forked from VapiAI/server-sdk-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCall.java
More file actions
1316 lines (1085 loc) · 45.2 KB
/
Copy pathCall.java
File metadata and controls
1316 lines (1085 loc) · 45.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
* This file was auto-generated by Fern from our API Definition.
*/
package com.vapi.api.types;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.Nulls;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.vapi.api.core.ObjectMappers;
import java.time.OffsetDateTime;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import org.jetbrains.annotations.NotNull;
@JsonInclude(JsonInclude.Include.NON_ABSENT)
@JsonDeserialize(builder = Call.Builder.class)
public final class Call {
private final Optional<CallType> type;
private final Optional<List<CallCostsItem>> costs;
private final Optional<List<CallMessagesItem>> messages;
private final Optional<CallPhoneCallProvider> phoneCallProvider;
private final Optional<CallPhoneCallTransport> phoneCallTransport;
private final Optional<CallStatus> status;
private final Optional<CallEndedReason> endedReason;
private final Optional<CallDestination> destination;
private final String id;
private final String orgId;
private final OffsetDateTime createdAt;
private final OffsetDateTime updatedAt;
private final Optional<OffsetDateTime> startedAt;
private final Optional<OffsetDateTime> endedAt;
private final Optional<Double> cost;
private final Optional<CostBreakdown> costBreakdown;
private final Optional<ArtifactPlan> artifactPlan;
private final Optional<Analysis> analysis;
private final Optional<Monitor> monitor;
private final Optional<Artifact> artifact;
private final Optional<Transport> transport;
private final Optional<String> phoneCallProviderId;
private final Optional<String> assistantId;
private final Optional<CreateAssistantDto> assistant;
private final Optional<AssistantOverrides> assistantOverrides;
private final Optional<String> squadId;
private final Optional<CreateSquadDto> squad;
private final Optional<String> phoneNumberId;
private final Optional<ImportTwilioPhoneNumberDto> phoneNumber;
private final Optional<String> customerId;
private final Optional<CreateCustomerDto> customer;
private final Optional<String> name;
private final Map<String, Object> additionalProperties;
private Call(
Optional<CallType> type,
Optional<List<CallCostsItem>> costs,
Optional<List<CallMessagesItem>> messages,
Optional<CallPhoneCallProvider> phoneCallProvider,
Optional<CallPhoneCallTransport> phoneCallTransport,
Optional<CallStatus> status,
Optional<CallEndedReason> endedReason,
Optional<CallDestination> destination,
String id,
String orgId,
OffsetDateTime createdAt,
OffsetDateTime updatedAt,
Optional<OffsetDateTime> startedAt,
Optional<OffsetDateTime> endedAt,
Optional<Double> cost,
Optional<CostBreakdown> costBreakdown,
Optional<ArtifactPlan> artifactPlan,
Optional<Analysis> analysis,
Optional<Monitor> monitor,
Optional<Artifact> artifact,
Optional<Transport> transport,
Optional<String> phoneCallProviderId,
Optional<String> assistantId,
Optional<CreateAssistantDto> assistant,
Optional<AssistantOverrides> assistantOverrides,
Optional<String> squadId,
Optional<CreateSquadDto> squad,
Optional<String> phoneNumberId,
Optional<ImportTwilioPhoneNumberDto> phoneNumber,
Optional<String> customerId,
Optional<CreateCustomerDto> customer,
Optional<String> name,
Map<String, Object> additionalProperties) {
this.type = type;
this.costs = costs;
this.messages = messages;
this.phoneCallProvider = phoneCallProvider;
this.phoneCallTransport = phoneCallTransport;
this.status = status;
this.endedReason = endedReason;
this.destination = destination;
this.id = id;
this.orgId = orgId;
this.createdAt = createdAt;
this.updatedAt = updatedAt;
this.startedAt = startedAt;
this.endedAt = endedAt;
this.cost = cost;
this.costBreakdown = costBreakdown;
this.artifactPlan = artifactPlan;
this.analysis = analysis;
this.monitor = monitor;
this.artifact = artifact;
this.transport = transport;
this.phoneCallProviderId = phoneCallProviderId;
this.assistantId = assistantId;
this.assistant = assistant;
this.assistantOverrides = assistantOverrides;
this.squadId = squadId;
this.squad = squad;
this.phoneNumberId = phoneNumberId;
this.phoneNumber = phoneNumber;
this.customerId = customerId;
this.customer = customer;
this.name = name;
this.additionalProperties = additionalProperties;
}
/**
* @return This is the type of call.
*/
@JsonProperty("type")
public Optional<CallType> getType() {
return type;
}
/**
* @return These are the costs of individual components of the call in USD.
*/
@JsonProperty("costs")
public Optional<List<CallCostsItem>> getCosts() {
return costs;
}
@JsonProperty("messages")
public Optional<List<CallMessagesItem>> getMessages() {
return messages;
}
/**
* @return This is the provider of the call.
* <p>Only relevant for <code>outboundPhoneCall</code> and <code>inboundPhoneCall</code> type.</p>
*/
@JsonProperty("phoneCallProvider")
public Optional<CallPhoneCallProvider> getPhoneCallProvider() {
return phoneCallProvider;
}
/**
* @return This is the transport of the phone call.
* <p>Only relevant for <code>outboundPhoneCall</code> and <code>inboundPhoneCall</code> type.</p>
*/
@JsonProperty("phoneCallTransport")
public Optional<CallPhoneCallTransport> getPhoneCallTransport() {
return phoneCallTransport;
}
/**
* @return This is the status of the call.
*/
@JsonProperty("status")
public Optional<CallStatus> getStatus() {
return status;
}
/**
* @return This is the explanation for how the call ended.
*/
@JsonProperty("endedReason")
public Optional<CallEndedReason> getEndedReason() {
return endedReason;
}
/**
* @return This is the destination where the call ended up being transferred to. If the call was not transferred, this will be empty.
*/
@JsonProperty("destination")
public Optional<CallDestination> getDestination() {
return destination;
}
/**
* @return This is the unique identifier for the call.
*/
@JsonProperty("id")
public String getId() {
return id;
}
/**
* @return This is the unique identifier for the org that this call belongs to.
*/
@JsonProperty("orgId")
public String getOrgId() {
return orgId;
}
/**
* @return This is the ISO 8601 date-time string of when the call was created.
*/
@JsonProperty("createdAt")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
/**
* @return This is the ISO 8601 date-time string of when the call was last updated.
*/
@JsonProperty("updatedAt")
public OffsetDateTime getUpdatedAt() {
return updatedAt;
}
/**
* @return This is the ISO 8601 date-time string of when the call was started.
*/
@JsonProperty("startedAt")
public Optional<OffsetDateTime> getStartedAt() {
return startedAt;
}
/**
* @return This is the ISO 8601 date-time string of when the call was ended.
*/
@JsonProperty("endedAt")
public Optional<OffsetDateTime> getEndedAt() {
return endedAt;
}
/**
* @return This is the cost of the call in USD.
*/
@JsonProperty("cost")
public Optional<Double> getCost() {
return cost;
}
/**
* @return This is the cost of the call in USD.
*/
@JsonProperty("costBreakdown")
public Optional<CostBreakdown> getCostBreakdown() {
return costBreakdown;
}
/**
* @return This is a copy of assistant artifact plan. This isn't actually stored on the call but rather just returned in POST /call/web to enable artifact creation client side.
*/
@JsonProperty("artifactPlan")
public Optional<ArtifactPlan> getArtifactPlan() {
return artifactPlan;
}
/**
* @return This is the analysis of the call. Configure in <code>assistant.analysisPlan</code>.
*/
@JsonProperty("analysis")
public Optional<Analysis> getAnalysis() {
return analysis;
}
/**
* @return This is to real-time monitor the call. Configure in <code>assistant.monitorPlan</code>.
*/
@JsonProperty("monitor")
public Optional<Monitor> getMonitor() {
return monitor;
}
/**
* @return These are the artifacts created from the call. Configure in <code>assistant.artifactPlan</code>.
*/
@JsonProperty("artifact")
public Optional<Artifact> getArtifact() {
return artifact;
}
/**
* @return This is the transport used for the call.
*/
@JsonProperty("transport")
public Optional<Transport> getTransport() {
return transport;
}
/**
* @return The ID of the call as provided by the phone number service. callSid in Twilio. conversationUuid in Vonage.
* <p>Only relevant for <code>outboundPhoneCall</code> and <code>inboundPhoneCall</code> type.</p>
*/
@JsonProperty("phoneCallProviderId")
public Optional<String> getPhoneCallProviderId() {
return phoneCallProviderId;
}
/**
* @return This is the assistant that will be used for the call. To use a transient assistant, use <code>assistant</code> instead.
*/
@JsonProperty("assistantId")
public Optional<String> getAssistantId() {
return assistantId;
}
/**
* @return This is the assistant that will be used for the call. To use an existing assistant, use <code>assistantId</code> instead.
*/
@JsonProperty("assistant")
public Optional<CreateAssistantDto> getAssistant() {
return assistant;
}
/**
* @return These are the overrides for the <code>assistant</code> or <code>assistantId</code>'s settings and template variables.
*/
@JsonProperty("assistantOverrides")
public Optional<AssistantOverrides> getAssistantOverrides() {
return assistantOverrides;
}
/**
* @return This is the squad that will be used for the call. To use a transient squad, use <code>squad</code> instead.
*/
@JsonProperty("squadId")
public Optional<String> getSquadId() {
return squadId;
}
/**
* @return This is a squad that will be used for the call. To use an existing squad, use <code>squadId</code> instead.
*/
@JsonProperty("squad")
public Optional<CreateSquadDto> getSquad() {
return squad;
}
/**
* @return This is the phone number that will be used for the call. To use a transient number, use <code>phoneNumber</code> instead.
* <p>Only relevant for <code>outboundPhoneCall</code> and <code>inboundPhoneCall</code> type.</p>
*/
@JsonProperty("phoneNumberId")
public Optional<String> getPhoneNumberId() {
return phoneNumberId;
}
/**
* @return This is the phone number that will be used for the call. To use an existing number, use <code>phoneNumberId</code> instead.
* <p>Only relevant for <code>outboundPhoneCall</code> and <code>inboundPhoneCall</code> type.</p>
*/
@JsonProperty("phoneNumber")
public Optional<ImportTwilioPhoneNumberDto> getPhoneNumber() {
return phoneNumber;
}
/**
* @return This is the customer that will be called. To call a transient customer , use <code>customer</code> instead.
* <p>Only relevant for <code>outboundPhoneCall</code> and <code>inboundPhoneCall</code> type.</p>
*/
@JsonProperty("customerId")
public Optional<String> getCustomerId() {
return customerId;
}
/**
* @return This is the customer that will be called. To call an existing customer, use <code>customerId</code> instead.
* <p>Only relevant for <code>outboundPhoneCall</code> and <code>inboundPhoneCall</code> type.</p>
*/
@JsonProperty("customer")
public Optional<CreateCustomerDto> getCustomer() {
return customer;
}
/**
* @return This is the name of the call. This is just for your own reference.
*/
@JsonProperty("name")
public Optional<String> getName() {
return name;
}
@java.lang.Override
public boolean equals(Object other) {
if (this == other) return true;
return other instanceof Call && equalTo((Call) other);
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
private boolean equalTo(Call other) {
return type.equals(other.type)
&& costs.equals(other.costs)
&& messages.equals(other.messages)
&& phoneCallProvider.equals(other.phoneCallProvider)
&& phoneCallTransport.equals(other.phoneCallTransport)
&& status.equals(other.status)
&& endedReason.equals(other.endedReason)
&& destination.equals(other.destination)
&& id.equals(other.id)
&& orgId.equals(other.orgId)
&& createdAt.equals(other.createdAt)
&& updatedAt.equals(other.updatedAt)
&& startedAt.equals(other.startedAt)
&& endedAt.equals(other.endedAt)
&& cost.equals(other.cost)
&& costBreakdown.equals(other.costBreakdown)
&& artifactPlan.equals(other.artifactPlan)
&& analysis.equals(other.analysis)
&& monitor.equals(other.monitor)
&& artifact.equals(other.artifact)
&& transport.equals(other.transport)
&& phoneCallProviderId.equals(other.phoneCallProviderId)
&& assistantId.equals(other.assistantId)
&& assistant.equals(other.assistant)
&& assistantOverrides.equals(other.assistantOverrides)
&& squadId.equals(other.squadId)
&& squad.equals(other.squad)
&& phoneNumberId.equals(other.phoneNumberId)
&& phoneNumber.equals(other.phoneNumber)
&& customerId.equals(other.customerId)
&& customer.equals(other.customer)
&& name.equals(other.name);
}
@java.lang.Override
public int hashCode() {
return Objects.hash(
this.type,
this.costs,
this.messages,
this.phoneCallProvider,
this.phoneCallTransport,
this.status,
this.endedReason,
this.destination,
this.id,
this.orgId,
this.createdAt,
this.updatedAt,
this.startedAt,
this.endedAt,
this.cost,
this.costBreakdown,
this.artifactPlan,
this.analysis,
this.monitor,
this.artifact,
this.transport,
this.phoneCallProviderId,
this.assistantId,
this.assistant,
this.assistantOverrides,
this.squadId,
this.squad,
this.phoneNumberId,
this.phoneNumber,
this.customerId,
this.customer,
this.name);
}
@java.lang.Override
public String toString() {
return ObjectMappers.stringify(this);
}
public static IdStage builder() {
return new Builder();
}
public interface IdStage {
OrgIdStage id(@NotNull String id);
Builder from(Call other);
}
public interface OrgIdStage {
CreatedAtStage orgId(@NotNull String orgId);
}
public interface CreatedAtStage {
UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt);
}
public interface UpdatedAtStage {
_FinalStage updatedAt(@NotNull OffsetDateTime updatedAt);
}
public interface _FinalStage {
Call build();
_FinalStage type(Optional<CallType> type);
_FinalStage type(CallType type);
_FinalStage costs(Optional<List<CallCostsItem>> costs);
_FinalStage costs(List<CallCostsItem> costs);
_FinalStage messages(Optional<List<CallMessagesItem>> messages);
_FinalStage messages(List<CallMessagesItem> messages);
_FinalStage phoneCallProvider(Optional<CallPhoneCallProvider> phoneCallProvider);
_FinalStage phoneCallProvider(CallPhoneCallProvider phoneCallProvider);
_FinalStage phoneCallTransport(Optional<CallPhoneCallTransport> phoneCallTransport);
_FinalStage phoneCallTransport(CallPhoneCallTransport phoneCallTransport);
_FinalStage status(Optional<CallStatus> status);
_FinalStage status(CallStatus status);
_FinalStage endedReason(Optional<CallEndedReason> endedReason);
_FinalStage endedReason(CallEndedReason endedReason);
_FinalStage destination(Optional<CallDestination> destination);
_FinalStage destination(CallDestination destination);
_FinalStage startedAt(Optional<OffsetDateTime> startedAt);
_FinalStage startedAt(OffsetDateTime startedAt);
_FinalStage endedAt(Optional<OffsetDateTime> endedAt);
_FinalStage endedAt(OffsetDateTime endedAt);
_FinalStage cost(Optional<Double> cost);
_FinalStage cost(Double cost);
_FinalStage costBreakdown(Optional<CostBreakdown> costBreakdown);
_FinalStage costBreakdown(CostBreakdown costBreakdown);
_FinalStage artifactPlan(Optional<ArtifactPlan> artifactPlan);
_FinalStage artifactPlan(ArtifactPlan artifactPlan);
_FinalStage analysis(Optional<Analysis> analysis);
_FinalStage analysis(Analysis analysis);
_FinalStage monitor(Optional<Monitor> monitor);
_FinalStage monitor(Monitor monitor);
_FinalStage artifact(Optional<Artifact> artifact);
_FinalStage artifact(Artifact artifact);
_FinalStage transport(Optional<Transport> transport);
_FinalStage transport(Transport transport);
_FinalStage phoneCallProviderId(Optional<String> phoneCallProviderId);
_FinalStage phoneCallProviderId(String phoneCallProviderId);
_FinalStage assistantId(Optional<String> assistantId);
_FinalStage assistantId(String assistantId);
_FinalStage assistant(Optional<CreateAssistantDto> assistant);
_FinalStage assistant(CreateAssistantDto assistant);
_FinalStage assistantOverrides(Optional<AssistantOverrides> assistantOverrides);
_FinalStage assistantOverrides(AssistantOverrides assistantOverrides);
_FinalStage squadId(Optional<String> squadId);
_FinalStage squadId(String squadId);
_FinalStage squad(Optional<CreateSquadDto> squad);
_FinalStage squad(CreateSquadDto squad);
_FinalStage phoneNumberId(Optional<String> phoneNumberId);
_FinalStage phoneNumberId(String phoneNumberId);
_FinalStage phoneNumber(Optional<ImportTwilioPhoneNumberDto> phoneNumber);
_FinalStage phoneNumber(ImportTwilioPhoneNumberDto phoneNumber);
_FinalStage customerId(Optional<String> customerId);
_FinalStage customerId(String customerId);
_FinalStage customer(Optional<CreateCustomerDto> customer);
_FinalStage customer(CreateCustomerDto customer);
_FinalStage name(Optional<String> name);
_FinalStage name(String name);
}
@JsonIgnoreProperties(ignoreUnknown = true)
public static final class Builder implements IdStage, OrgIdStage, CreatedAtStage, UpdatedAtStage, _FinalStage {
private String id;
private String orgId;
private OffsetDateTime createdAt;
private OffsetDateTime updatedAt;
private Optional<String> name = Optional.empty();
private Optional<CreateCustomerDto> customer = Optional.empty();
private Optional<String> customerId = Optional.empty();
private Optional<ImportTwilioPhoneNumberDto> phoneNumber = Optional.empty();
private Optional<String> phoneNumberId = Optional.empty();
private Optional<CreateSquadDto> squad = Optional.empty();
private Optional<String> squadId = Optional.empty();
private Optional<AssistantOverrides> assistantOverrides = Optional.empty();
private Optional<CreateAssistantDto> assistant = Optional.empty();
private Optional<String> assistantId = Optional.empty();
private Optional<String> phoneCallProviderId = Optional.empty();
private Optional<Transport> transport = Optional.empty();
private Optional<Artifact> artifact = Optional.empty();
private Optional<Monitor> monitor = Optional.empty();
private Optional<Analysis> analysis = Optional.empty();
private Optional<ArtifactPlan> artifactPlan = Optional.empty();
private Optional<CostBreakdown> costBreakdown = Optional.empty();
private Optional<Double> cost = Optional.empty();
private Optional<OffsetDateTime> endedAt = Optional.empty();
private Optional<OffsetDateTime> startedAt = Optional.empty();
private Optional<CallDestination> destination = Optional.empty();
private Optional<CallEndedReason> endedReason = Optional.empty();
private Optional<CallStatus> status = Optional.empty();
private Optional<CallPhoneCallTransport> phoneCallTransport = Optional.empty();
private Optional<CallPhoneCallProvider> phoneCallProvider = Optional.empty();
private Optional<List<CallMessagesItem>> messages = Optional.empty();
private Optional<List<CallCostsItem>> costs = Optional.empty();
private Optional<CallType> type = Optional.empty();
@JsonAnySetter
private Map<String, Object> additionalProperties = new HashMap<>();
private Builder() {}
@java.lang.Override
public Builder from(Call other) {
type(other.getType());
costs(other.getCosts());
messages(other.getMessages());
phoneCallProvider(other.getPhoneCallProvider());
phoneCallTransport(other.getPhoneCallTransport());
status(other.getStatus());
endedReason(other.getEndedReason());
destination(other.getDestination());
id(other.getId());
orgId(other.getOrgId());
createdAt(other.getCreatedAt());
updatedAt(other.getUpdatedAt());
startedAt(other.getStartedAt());
endedAt(other.getEndedAt());
cost(other.getCost());
costBreakdown(other.getCostBreakdown());
artifactPlan(other.getArtifactPlan());
analysis(other.getAnalysis());
monitor(other.getMonitor());
artifact(other.getArtifact());
transport(other.getTransport());
phoneCallProviderId(other.getPhoneCallProviderId());
assistantId(other.getAssistantId());
assistant(other.getAssistant());
assistantOverrides(other.getAssistantOverrides());
squadId(other.getSquadId());
squad(other.getSquad());
phoneNumberId(other.getPhoneNumberId());
phoneNumber(other.getPhoneNumber());
customerId(other.getCustomerId());
customer(other.getCustomer());
name(other.getName());
return this;
}
/**
* <p>This is the unique identifier for the call.</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
@JsonSetter("id")
public OrgIdStage id(@NotNull String id) {
this.id = Objects.requireNonNull(id, "id must not be null");
return this;
}
/**
* <p>This is the unique identifier for the org that this call belongs to.</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
@JsonSetter("orgId")
public CreatedAtStage orgId(@NotNull String orgId) {
this.orgId = Objects.requireNonNull(orgId, "orgId must not be null");
return this;
}
/**
* <p>This is the ISO 8601 date-time string of when the call was created.</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
@JsonSetter("createdAt")
public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) {
this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null");
return this;
}
/**
* <p>This is the ISO 8601 date-time string of when the call was last updated.</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
@JsonSetter("updatedAt")
public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) {
this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null");
return this;
}
/**
* <p>This is the name of the call. This is just for your own reference.</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
public _FinalStage name(String name) {
this.name = Optional.ofNullable(name);
return this;
}
@java.lang.Override
@JsonSetter(value = "name", nulls = Nulls.SKIP)
public _FinalStage name(Optional<String> name) {
this.name = name;
return this;
}
/**
* <p>This is the customer that will be called. To call an existing customer, use <code>customerId</code> instead.</p>
* <p>Only relevant for <code>outboundPhoneCall</code> and <code>inboundPhoneCall</code> type.</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
public _FinalStage customer(CreateCustomerDto customer) {
this.customer = Optional.ofNullable(customer);
return this;
}
@java.lang.Override
@JsonSetter(value = "customer", nulls = Nulls.SKIP)
public _FinalStage customer(Optional<CreateCustomerDto> customer) {
this.customer = customer;
return this;
}
/**
* <p>This is the customer that will be called. To call a transient customer , use <code>customer</code> instead.</p>
* <p>Only relevant for <code>outboundPhoneCall</code> and <code>inboundPhoneCall</code> type.</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
public _FinalStage customerId(String customerId) {
this.customerId = Optional.ofNullable(customerId);
return this;
}
@java.lang.Override
@JsonSetter(value = "customerId", nulls = Nulls.SKIP)
public _FinalStage customerId(Optional<String> customerId) {
this.customerId = customerId;
return this;
}
/**
* <p>This is the phone number that will be used for the call. To use an existing number, use <code>phoneNumberId</code> instead.</p>
* <p>Only relevant for <code>outboundPhoneCall</code> and <code>inboundPhoneCall</code> type.</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
public _FinalStage phoneNumber(ImportTwilioPhoneNumberDto phoneNumber) {
this.phoneNumber = Optional.ofNullable(phoneNumber);
return this;
}
@java.lang.Override
@JsonSetter(value = "phoneNumber", nulls = Nulls.SKIP)
public _FinalStage phoneNumber(Optional<ImportTwilioPhoneNumberDto> phoneNumber) {
this.phoneNumber = phoneNumber;
return this;
}
/**
* <p>This is the phone number that will be used for the call. To use a transient number, use <code>phoneNumber</code> instead.</p>
* <p>Only relevant for <code>outboundPhoneCall</code> and <code>inboundPhoneCall</code> type.</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
public _FinalStage phoneNumberId(String phoneNumberId) {
this.phoneNumberId = Optional.ofNullable(phoneNumberId);
return this;
}
@java.lang.Override
@JsonSetter(value = "phoneNumberId", nulls = Nulls.SKIP)
public _FinalStage phoneNumberId(Optional<String> phoneNumberId) {
this.phoneNumberId = phoneNumberId;
return this;
}
/**
* <p>This is a squad that will be used for the call. To use an existing squad, use <code>squadId</code> instead.</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
public _FinalStage squad(CreateSquadDto squad) {
this.squad = Optional.ofNullable(squad);
return this;
}
@java.lang.Override
@JsonSetter(value = "squad", nulls = Nulls.SKIP)
public _FinalStage squad(Optional<CreateSquadDto> squad) {
this.squad = squad;
return this;
}
/**
* <p>This is the squad that will be used for the call. To use a transient squad, use <code>squad</code> instead.</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
public _FinalStage squadId(String squadId) {
this.squadId = Optional.ofNullable(squadId);
return this;
}
@java.lang.Override
@JsonSetter(value = "squadId", nulls = Nulls.SKIP)
public _FinalStage squadId(Optional<String> squadId) {
this.squadId = squadId;
return this;
}
/**
* <p>These are the overrides for the <code>assistant</code> or <code>assistantId</code>'s settings and template variables.</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
public _FinalStage assistantOverrides(AssistantOverrides assistantOverrides) {
this.assistantOverrides = Optional.ofNullable(assistantOverrides);
return this;
}
@java.lang.Override
@JsonSetter(value = "assistantOverrides", nulls = Nulls.SKIP)
public _FinalStage assistantOverrides(Optional<AssistantOverrides> assistantOverrides) {
this.assistantOverrides = assistantOverrides;
return this;
}
/**
* <p>This is the assistant that will be used for the call. To use an existing assistant, use <code>assistantId</code> instead.</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
public _FinalStage assistant(CreateAssistantDto assistant) {
this.assistant = Optional.ofNullable(assistant);
return this;
}
@java.lang.Override
@JsonSetter(value = "assistant", nulls = Nulls.SKIP)
public _FinalStage assistant(Optional<CreateAssistantDto> assistant) {
this.assistant = assistant;
return this;
}
/**
* <p>This is the assistant that will be used for the call. To use a transient assistant, use <code>assistant</code> instead.</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
public _FinalStage assistantId(String assistantId) {
this.assistantId = Optional.ofNullable(assistantId);
return this;
}
@java.lang.Override
@JsonSetter(value = "assistantId", nulls = Nulls.SKIP)
public _FinalStage assistantId(Optional<String> assistantId) {
this.assistantId = assistantId;
return this;
}
/**
* <p>The ID of the call as provided by the phone number service. callSid in Twilio. conversationUuid in Vonage.</p>
* <p>Only relevant for <code>outboundPhoneCall</code> and <code>inboundPhoneCall</code> type.</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
public _FinalStage phoneCallProviderId(String phoneCallProviderId) {
this.phoneCallProviderId = Optional.ofNullable(phoneCallProviderId);
return this;
}
@java.lang.Override
@JsonSetter(value = "phoneCallProviderId", nulls = Nulls.SKIP)
public _FinalStage phoneCallProviderId(Optional<String> phoneCallProviderId) {
this.phoneCallProviderId = phoneCallProviderId;
return this;
}
/**
* <p>This is the transport used for the call.</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
public _FinalStage transport(Transport transport) {
this.transport = Optional.ofNullable(transport);
return this;
}