001package com.plivo.api.models.call.actions; 002 003import com.plivo.api.PlivoClient; 004import com.plivo.api.exceptions.PlivoRestException; 005import com.plivo.api.models.base.VoiceCreator; 006 007import java.io.IOException; 008 009public class CallRecordCreator extends VoiceCreator<CallRecordCreateResponse> { 010 011 private final String id; 012 private Integer timeLimit; 013 private String fileFormat; 014 private String transcriptionType; 015 private String transcriptionUrl; 016 private String transcriptionMethod; 017 private String callbackUrl; 018 private String callbackMethod; 019 020 public CallRecordCreator(String id) { 021 this.id = id; 022 } 023 024 @Override 025 protected retrofit2.Call<CallRecordCreateResponse> obtainCall() { 026 return client().getVoiceApiService().callRecordCreate(client().getAuthId(), id, this); 027 } 028 029 @Override 030 protected retrofit2.Call<CallRecordCreateResponse> obtainFallback1Call() { 031 return client().getVoiceFallback1Service().callRecordCreate(client().getAuthId(), id, this); 032 } 033 034 @Override 035 protected retrofit2.Call<CallRecordCreateResponse> obtainFallback2Call() { 036 return client().getVoiceFallback2Service().callRecordCreate(client().getAuthId(), id, this); 037 } 038 039 public CallRecordCreateResponse record() throws IOException, PlivoRestException { 040 return create(); 041 } 042 043 @Override 044 public CallRecordCreator client(final PlivoClient plivoClient) { 045 this.plivoClient = plivoClient; 046 return this; 047 } 048 049 public CallRecordCreator timeLimit(final Integer timeLimit) { 050 this.timeLimit = timeLimit; 051 return this; 052 } 053 public CallRecordCreator fileFormat(final String fileFormat) { 054 this.fileFormat = fileFormat; 055 return this; 056 } 057 public CallRecordCreator transcriptionType(final String transcriptionType) { 058 this.transcriptionType = transcriptionType; 059 return this; 060 } 061 public CallRecordCreator transcriptionUrl(final String transcriptionUrl) { 062 this.transcriptionUrl = transcriptionUrl; 063 return this; 064 } 065 public CallRecordCreator transcriptionMethod(final String transcriptionMethod) { 066 this.transcriptionMethod = transcriptionMethod; 067 return this; 068 } 069 070 public CallRecordCreator callbackUrl(final String callbackUrl) { 071 this.callbackUrl = callbackUrl; 072 return this; 073 } 074 075 public CallRecordCreator callbackMethod(final String callbackMethod) { 076 this.callbackMethod = callbackMethod; 077 return this; 078 } 079 080 public Integer timeLimit() { 081 return this.timeLimit; 082 } 083 084 public String fileFormat() { 085 return this.fileFormat; 086 } 087 088 public String transcriptionType() { 089 return this.transcriptionType; 090 } 091 092 public String transcriptionUrl() { 093 return this.transcriptionUrl; 094 } 095 096 public String transcriptionMethod() { 097 return this.transcriptionMethod; 098 } 099 100 public String callbackUrl() { 101 return this.callbackUrl; 102 } 103 104 public String callbackMethod() { 105 return this.callbackMethod; 106 } 107}