-
Notifications
You must be signed in to change notification settings - Fork 0
/
v2_ServiceTitan.vb
14280 lines (12527 loc) · 745 KB
/
v2_ServiceTitan.vb
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
Imports System.IO
Imports System.Net
Imports System.Text
Imports Newtonsoft.Json
Public Class ServiceTitan
Public Shared lastQuery As DateTime
Const minMsSinceLastQuery As Integer = 500
Public Shared useSandbox As Boolean = True
Const productionEnvironment As String = "api.servicetitan.io"
Const productionAuthEnvironment As String = "auth.servicetitan.io"
Const sandboxEnvironment As String = "api-integration.servicetitan.io"
Const sandboxAuthEnvironment As String = "auth-integration.servicetitan.io"
Public Class oAuth2
Public Class Credentials
''' <summary>
''' grant_type: Right now, should always be 'client_credentials'.
''' </summary>
Public grant_type As String = "client_credentials"
''' <summary>
''' client_id: Obtained from the Production Environment/Integration Environment. See https://developer.servicetitan.io/docs/get-going-manage-client-id-and-secret/
''' </summary>
Public client_id As String
''' <summary>
''' client_secret: Obtained from the Production Environment/Integration Environment. See https://developer.servicetitan.io/docs/get-going-manage-client-id-and-secret/
''' </summary>
Public client_secret As String
End Class
Public Class AccessToken
''' <summary>
''' Required to make calls to ServiceTitan Endpoints.
''' </summary>
Public access_token As String
''' <summary>
''' The access_token will expire in that many seconds from the original request. See the expires_at property for the exact expiration date and time.
''' </summary>
Public expires_in As Integer
Public token_type As String
Public scope As String
''' <summary>
''' The access_token will expire on this date and time (Local system time).
''' </summary>
Public expires_at As DateTime
End Class
Public Shared Function getAccessToken(ByVal credentials As Credentials) As AccessToken
Dim domain As String
If useSandbox = True Then
domain = "https://" & sandboxAuthEnvironment
Else
domain = "https://" & productionAuthEnvironment
End If
Dim requesturi As String = domain & "/connect/token"
Dim args As String = "grant_type=" & credentials.grant_type
args &= "&client_id=" & credentials.client_id
args &= "&client_secret=" & credentials.client_secret
Dim req As WebRequest = WebRequest.Create(requesturi)
req.Method = "POST"
req.Timeout = 999999
req.ContentType = "application/x-www-form-urlencoded"
Dim bytearray() As Byte = Encoding.UTF8.GetBytes(args)
req.ContentLength = bytearray.Length
Dim datastream As Stream = req.GetRequestStream
datastream.Write(bytearray, 0, bytearray.Length)
datastream.Close()
Dim response As WebResponse = req.GetResponse
Dim buffer As Stream = response.GetResponseStream
Dim streamread As StreamReader = New StreamReader(buffer, Text.Encoding.UTF8)
Dim output As String = streamread.ReadToEnd
streamread.Close()
buffer.Close()
response.Close()
Dim accesstoken As AccessToken = JsonConvert.DeserializeObject(Of AccessToken)(output, New JsonSerializerSettings With {.NullValueHandling = NullValueHandling.Ignore})
accesstoken.expires_at = Now.AddSeconds(accesstoken.expires_in)
Return accesstoken
End Function
End Class
Public Class Types
Public Class Accounting
''' <summary>
''' AdjustmentInvoiceCreateRequest: 'AdjustmentToId' is required.
''' </summary>
Public Class AdjustmentInvoiceCreateRequest
Public Property number As String
Public Property typeId As Integer
Public Property invoicedOn As String
Public Property subtotal As Integer
Public Property tax As Integer
Public Property summary As String
<JsonProperty("royaltyStatus")>
Public Property royaltyStatus_ As Royaltystatus
Public Property royaltyDate As DateTime
Public Property royaltySentOn As String
Public Property royaltyMemo As String
Public Property exportId As String
Public Property items As New InvoiceItemUpdateRequest
Public Property payments As List(Of PaymentSettlementUpdateRequest)
Public Property adjustmentToId As Integer
End Class
Public Class Royaltystatus
Public Property status As String
End Class
Public Class InvoiceItemUpdateRequest
Public Property skuId As Integer
Public Property skuName As String
Public Property technicianId As Integer
Public Property description As String
Public Property quantity As Integer
Public Property unitPrice As Integer
Public Property cost As Integer
Public Property isAddOn As Boolean
Public Property signature As String
Public Property technicianAcknowledgementSignature As String
Public Property installedOn As DateTime
Public Property inventoryWarehouseName As String
Public Property skipUpdatingMembershipPrices As Boolean
Public Property itemGroupName As String
Public Property itemGroupRootId As Integer
Public Property id As Integer
End Class
Public Class PaymentSettlementUpdateRequest
Public Property id As Integer
Public Property settlementStatus As Settlementstatus
Public Property settlementDate As DateTime
End Class
Public Class Settlementstatus
Public Property status As String
End Class
Public Class InvoiceResponse
Public Property id As Integer
Public Property syncStatus As String
Public Property summary As String
Public Property referenceNumber As String
Public Property invoiceDate As DateTime
Public Property dueDate As DateTime
Public Property subTotal As String
Public Property salesTax As String
Public Property salesTaxCode As SalesTaxResponse
Public Property total As String
Public Property balance As String
Public Property customer As NameFieldResponse
Public Property customerAddress As AddressResponse
Public Property locationAddress As AddressResponse
Public Property businessUnit As NameFieldResponse
Public Property termName As String
Public Property createdBy As String
Public Property batch As BatchResponse
Public Property modifiedOn As DateTime
Public Property adjustmentToId As Integer
Public Property job As JobResponse
Public Property projectId As Integer
Public Property royalty As RoyaltyResponse
Public Property employeeInfo As EmployeeInfoResponse
Public Property commissionEligibilityDate As String
Public Property items As List(Of InvoiceItemResponse)
Public Property customFields As List(Of CustomFieldResponse)
End Class
Public Class SalesTaxResponse
Public Property id As Integer
Public Property name As String
Public Property taxRate As Decimal
End Class
Public Class NameFieldResponse
Public Property id As Integer
Public Property name As String
End Class
Public Class AddressResponse
Public Property street As String
Public Property unit As String
Public Property city As String
Public Property state As String
Public Property zip As String
Public Property country As String
End Class
Public Class BatchResponse
Public Property id As Integer
Public Property number As String
Public Property name As String
End Class
Public Class JobResponse
Public Property id As Integer
Public Property number As String
Public Property type As String
End Class
Public Class RoyaltyResponse
Public Property status As String
<JsonProperty("date")>
Public Property _date As DateTime
Public Property sentOn As DateTime
Public Property memo As String
End Class
Public Class EmployeeInfoResponse
Public Property id As Integer
Public Property name As String
Public Property modifiedOn As DateTime
End Class
Public Class InvoiceResponse_P
Public Property page As Integer
Public Property pageSize As Integer
Public Property hasMore As Boolean
Public Property data As List(Of InvoiceResponse)
Public Property totalCount As Integer
End Class
Public Class InvoiceItemResponse
Public Property id As Integer
Public Property description As String
Public Property quantity As String
Public Property cost As String
Public Property totalCost As String
Public Property inventoryLocation As String
Public Property price As String
Public Property type As String
Public Property skuName As String
Public Property skuId As Integer
Public Property total As String
Public Property inventory As Boolean
Public Property taxable As Boolean
Public Property generalLedgerAccount As GLAccountResponse
Public Property costOfSaleAccount As GLAccountResponse
Public Property assetAccount As GLAccountResponse
Public Property membershipTypeId As Integer
Public Property itemGroup As ItemGroupResponse
Public Property displayName As String
Public Property soldHours As Decimal
Public Property modifiedOn As DateTime
Public Property serviceDate As String
Public Property order As Integer
End Class
Public Class GLAccountResponse
Public Property name As String
Public Property number As String
Public Property type As String
Public Property detailType As String
End Class
Public Class ItemGroupResponse
Public Property rootId As Integer
Public Property name As String
End Class
Public Class CustomFieldResponse
Public Property name As String
Public Property value As String
End Class
Public Class MarkInvoiceAsExportedUpdateRequest
Public Property invoiceId As Integer
Public Property externalId As String
Public Property externalMessage As String
End Class
Public Class MarkInvoiceAsExportedUpdateResponse
Public Property invoiceId As Integer
Public Property success As Boolean
Public Property errorMessage As String
End Class
Public Class InvoiceUpdateRequest
Public Property number As String
Public Property typeId As Integer
Public Property invoicedOn As DateTime
Public Property subtotal As Integer
Public Property tax As Integer
Public Property summary As String
Public Property royaltyStatus As Royaltystatus
Public Property royaltyDate As DateTime
Public Property royaltySentOn As DateTime
Public Property royaltyMemo As String
Public Property exportId As String
Public Property items As List(Of InvoiceItemUpdateRequest)
Public Property payments As List(Of PaymentSettlementUpdateRequest)
End Class
Public Class CustomFieldUpdateRequest
Public Property operations As List(Of CustomFieldOperationRequest)
End Class
Public Class CustomFieldOperationRequest
Public Property objectId As Integer
Public Property customFields As List(Of CustomFieldPairRequest)
End Class
Public Class CustomFieldPairRequest
Public Property name As String
Public Property value As String
End Class
Public Class PaymentCreateRequest
Public Property typeId As Integer
Public Property memo As String
Public Property paidOn As DateTime
Public Property authCode As String
Public Property checkNumber As String
Public Property exportId As String
Public Property transactionStatus As PaymentStatus
Public Property status As PaymentStatus
Public Property splits As List(Of PaymentSplitApiModel)
End Class
Public Class TransactionProcessingStatus
Public Property status As String
End Class
Public Class PaymentStatus
Public Property status As String
End Class
Public Class PaymentSplitApiModel
Public Property invoiceId As Integer
Public Property amount As Integer
End Class
Public Class PaymentResponse_P
Public Property page As Integer
Public Property pageSize As Integer
Public Property hasMore As Boolean
Public Property data As List(Of PaymentResponse)
Public Property totalCount As Integer
End Class
Public Class PaymentResponse
Public Property id As Integer
Public Property typeId As Integer
Public Property active As Boolean
Public Property memo As String
Public Property paidOn As DateTime
Public Property authCode As String
Public Property checkNumber As String
Public Property exportId As String
Public Property transactionStatus As TransactionProcessingStatus
Public Property status As PaymentStatus
Public Property splits As List(Of PaymentSplitApiModel)
End Class
Public Class DetailedPaymentResponse
Public Property id As Integer
Public Property syncStatus As String
Public Property referenceNumber As String
<JsonProperty("date")>
Public Property _date As Date
Public Property type As String
Public Property typeId As String
Public Property total As String
Public Property unappliedAmount As String
Public Property memo As String
Public Property customer As NamedFieldResponse
Public Property batch As NamedFieldResponse
Public Property createdBy As String
Public Property generalLedgerAccount As GLAccountResponse
Public Property appliedTo As List(Of PaymentAppliedResponse)
Public Property customFields As List(Of CustomFieldModel)
Public Property authCode As String
Public Property checkNumber As String
End Class
Public Class NamedFieldResponse
Public Property id As Integer
Public Property name As String
End Class
Public Class PaymentAppliedResponse
Public Property appliedTo As Integer
Public Property appliedAmount As String
Public Property appliedOn As DateTime
Public Property appliedBy As String
End Class
Public Class CustomFieldModel
Public Property name As String
Public Property value As String
End Class
Public Class PaymentStatusBatchRequest
Public Property status As PaymentStatus
Public Property paymentIds As List(Of Integer)
End Class
Public Class PaymentUpdateRequest
Public Property typeId As Integer
Public Property active As Boolean
Public Property memo As String
Public Property paidOn As String
Public Property authCode As String
Public Property checkNumber As String
Public Property exportId As String
Public Property transactionStatus As TransactionProcessingStatus
Public Property status As String
Public Property splits As List(Of PaymentSplitApiModel)
End Class
Public Class PaymentTermModel
Public Property id As Integer
Public Property name As String
Public Property dueDayType As String
Public Property dueDay As Integer
Public Property isCustomerDefault As Boolean
Public Property isVendorDefault As Boolean
Public Property active As Boolean
Public Property inUse As Boolean
Public Property paymentTermPenaltyModel As PaymentTermPenaltyModel
Public Property paymentTermDiscountModel As PaymentTermDiscountModel
End Class
Public Class PaymentTermPenaltyModel
Public Property id As Integer
Public Property penaltyApplyTo As PaymentTermApplyTo
Public Property penalty As Integer
Public Property penaltyType As PaymentTermValueType
Public Property maxPenaltyAmount As Integer
Public Property penaltyFrequency As PaymentTermPenaltyFrequency
Public Property serviceTaskId As Integer
End Class
Public Class PaymentTermValueType
Public Property value As String
End Class
Public Class PaymentTermPenaltyFrequency
Public Property value As String
End Class
Public Class PaymentTermDiscountModel
Public Property id As Integer
Public Property discountApplyTo As PaymentTermApplyTo
Public Property discount As Integer
Public Property discountType As PaymentTermValueType
Public Property account As String
Public Property applyBy As DiscountAppliedBy
Public Property applyByValue As Integer
End Class
Public Class PaymentTermApplyTo
Public Property value As String
End Class
Public Class DiscountAppliedBy
Public Property value As String
End Class
Public Class PaymentTypeResponse_P
Public Property page As Integer
Public Property pageSize As Integer
Public Property hasMore As Boolean
Public Property data As List(Of PaymentTypeResponse)
Public Property totalCount As Integer
End Class
Public Class PaymentTypeResponse
Public Property id As Integer
Public Property name As String
Public Property modifiedOn As DateTime
End Class
Public Class TaxZoneResponse_P
Public Property page As Integer
Public Property pageSize As Integer
Public Property hasMore As Boolean
Public Property data As List(Of TaxZoneResponse)
Public Property totalCount As Integer
End Class
Public Class TaxZoneResponse
Public Property id As Integer
Public Property name As String
Public Property color As Integer
Public Property isTaxRateSeparated As Boolean
Public Property isMultipleTaxZone As Boolean
Public Property rates As List(Of TaxRateResponse)
Public Property createdOn As DateTime
Public Property active As Boolean
End Class
Public Class TaxRateResponse
Public Property id As Integer
Public Property taxName As String
Public Property taxBaseType As List(Of String)
Public Property taxRate As Decimal
Public Property salesTaxItem As String
End Class
End Class
Public Class CRM
Public Class LeadResponse
Public Property id As Integer
Public Property status As LeadStatus
Public Property customerId As Integer
Public Property locationId As Integer
Public Property businessUnitId As Integer
Public Property jobTypeId As Integer
Public Property priority As Priority
Public Property campaignId As Integer
Public Property summary As String
Public Property callReasonId As Integer
Public Property latestFollowUpDate As String
Public Property createdOn As DateTime
Public Property createdById As Integer
Public Property modifiedOn As DateTime
End Class
Public Class LeadStatus
Public Property status As String
End Class
Public Class Priority
Public Property priority As String
End Class
Public Class LeadResponse_P
Public Property page As Integer
Public Property pageSize As Integer
Public Property hasMore As Boolean
Public Property data As List(Of LeadResponse)
Public Property totalCount As Integer
End Class
Public Class TagsResponse_P
Public Property page As Integer
Public Property pageSize As Integer
Public Property hasMore As Boolean
Public Property data As List(Of TagsResponse)
Public Property totalCount As Integer
End Class
Public Class TagsResponse
Public Property id As Integer
Public Property name As String
Public Property active As Boolean
End Class
End Class
Public Class Dispatch
Public Class AppointmentAssignmentResponse_P
Public Property page As Integer
Public Property pageSize As Integer
Public Property hasMore As Boolean
Public Property data As List(Of AppointmentAssignmentResponse)
Public Property totalCount As Integer
End Class
Public Class AppointmentAssignmentResponse
Public Property id As Integer
Public Property technicianId As Integer
Public Property technicianName As String
Public Property assignedById As Integer
Public Property assignedOn As DateTime
Public Property status As JobAppointmentAssignmentStatus
Public Property isPaused As Boolean
Public Property jobId As Integer
Public Property appointmentId As Integer
End Class
Public Class JobAppointmentAssignmentStatus
Public Property status As String
End Class
Public Class CapacityQueryFilter
Public Property startsOnOrAfter As DateTime
Public Property endsOnOrBefore As DateTime
Public Property businessUnitIds As List(Of Integer)
Public Property jobTypeId As Integer
Public Property skillBasedAvailability As Boolean
End Class
Public Class CapacityResponse
Public Property startsOnOrAfter As String
Public Property endsOnOrBefore As String
Public Property businessUnitIds As List(Of Integer)
Public Property jobTypeId As Integer
Public Property skillBasedAvailability As Boolean
End Class
Public Class TechnicianShiftResponse_P
Public Property page As Integer
Public Property pageSize As Integer
Public Property hasMore As Boolean
Public Property data As List(Of TechnicianShiftResponse)
Public Property totalCount As Integer
End Class
Public Class TechnicianShiftResponse
Public Property id As Integer
Public Property shiftType As Shifttype
Public Property title As String
Public Property note As String
Public Property active As Boolean
Public Property technicianId As Integer
Public Property start As String
<JsonProperty("end")>
Public Property _end As DateTime
End Class
Public Class Shifttype
Public Property type As String
End Class
End Class
Public Class EquipmentSystems
Public Class InstalledEquipmentCreateRequest
Public Property locationId As Integer
Public Property name As String
Public Property installedOn As DateTime
Public Property serialNumber As String
Public Property memo As String
Public Property manufacturer As String
Public Property model As String
Public Property cost As Integer
Public Property manufacturerWarrantyStart As DateTime
Public Property manufacturerWarrantyEnd As DateTime
Public Property serviceProviderWarrantyStart As DateTime
Public Property serviceProviderWarrantyEnd As DateTime
Public Property customFields As List(Of CustomFieldRequestModel)
End Class
Public Class CustomFieldRequestModel
Public Property id As Integer
Public Property typeId As Integer
Public Property value As String
End Class
Public Class InstalledEquipmentDetailedResponse
Public Property id As Integer
Public Property locationId As Integer
Public Property customerId As Integer
Public Property name As String
Public Property installedOn As DateTime
Public Property serialNumber As String
Public Property memo As String
Public Property manufacturer As String
Public Property model As String
Public Property cost As Integer
Public Property manufacturerWarrantyStart As DateTime
Public Property manufacturerWarrantyEnd As DateTime
Public Property serviceProviderWarrantyStart As DateTime
Public Property serviceProviderWarrantyEnd As DateTime
Public Property customFields As List(Of CustomFieldResponseModel)
End Class
Public Class CustomFieldResponseModel
Public Property id As Integer
Public Property typeId As Integer
Public Property name As String
Public Property value As String
End Class
Public Class InstalledEquipmentResponse_P
Public Property page As Integer
Public Property pageSize As Integer
Public Property hasMore As Boolean
Public Property data As List(Of InstalledEquipmentResponse)
Public Property totalCount As Integer
End Class
Public Class InstalledEquipmentResponse
Public Property id As Integer
Public Property locationId As Integer
Public Property customerId As Integer
Public Property name As String
Public Property installedOn As DateTime
Public Property serialNumber As String
Public Property memo As String
Public Property manufacturer As String
Public Property model As String
Public Property cost As Integer
Public Property manufacturerWarrantyStart As DateTime
Public Property manufacturerWarrantyEnd As DateTime
Public Property serviceProviderWarrantyStart As DateTime
Public Property serviceProviderWarrantyEnd As DateTime
End Class
Public Class InstalledEquipmentUpdateRequest
Public Property name As String
Public Property installedOn As DateTime
Public Property serialNumber As String
Public Property memo As String
Public Property manufacturer As String
Public Property model As String
Public Property cost As Integer
Public Property manufacturerWarrantyStart As DateTime
Public Property manufacturerWarrantyEnd As DateTime
Public Property serviceProviderWarrantyStart As DateTime
Public Property serviceProviderWarrantyEnd As DateTime
Public Property customFields As List(Of CustomFieldRequestModel)
End Class
End Class
Public Class Inventory
Public Class CreatePurchaseOrderResponse
Public id As Integer
End Class
Public Class CreatePurchaseOrderRequest
Public Property vendorId As Integer
Public Property typeId As Integer
Public Property businessUnitId As Integer
Public Property inventoryLocationId As Integer
Public Property jobId As Integer
Public Property technicianId As Integer
Public Property projectId As Integer
Public Property shipTo As CreateAddressRequest
Public Property vendorInvoiceNumber As String
Public Property impactsTechnicianPayroll As Boolean
Public Property memo As String
<JsonProperty("date")>
Public Property _date As DateTime
Public Property requiredOn As DateTime
Public Property tax As Integer
Public Property shipping As Integer
Public Property items As List(Of CreatePurchaseOrderItemRequest)
End Class
Public Class CreateAddressRequest
Public Property description As String
Public Property address As AddressRequest
End Class
Public Class AddressRequest
Public Property street As String
Public Property unit As String
Public Property city As String
Public Property state As String
Public Property zip As String
Public Property country As String
End Class
Public Class CreatePurchaseOrderItemRequest
Public Property skuId As Integer
Public Property description As String
Public Property vendorPartNumber As String
Public Property quantity As Integer
Public Property cost As Integer
End Class
Public Class PurchaseOrderResponse_P
Public Property page As Integer
Public Property pageSize As Integer
Public Property hasMore As Boolean
Public Property data As List(Of PurchaseOrderResponse)
Public Property totalCount As Integer
End Class
Public Class PurchaseOrderResponse
Public Property id As Integer
Public Property number As String
Public Property invoiceId As Integer
Public Property jobId As Integer
Public Property projectId As Integer
Public Property status As String
Public Property typeId As Integer
Public Property vendorId As Integer
Public Property technicianId As Integer
Public Property shipTo As AddressResponse
Public Property businessUnitId As Integer
Public Property inventoryLocationId As Integer
Public Property batchId As Integer
Public Property vendorDocumentNumber As String
<JsonProperty("date")>
Public Property _date As String
Public Property requiredOn As DateTime
Public Property sentOn As DateTime
Public Property receivedOn As DateTime
Public Property modifiedOn As DateTime
Public Property total As Integer
Public Property tax As Integer
Public Property shipping As Integer
Public Property summary As String
Public Property items As List(Of PurchaseOrderItemResponse)
Public Property customFields As List(Of CustomFieldApiModel)
End Class
Public Class AddressResponse
Public Property street As String
Public Property unit As String
Public Property city As String
Public Property state As String
Public Property zip As String
Public Property country As String
End Class
Public Class PurchaseOrderItemResponse
Public Property id As Integer
Public Property skuId As Integer
Public Property skuName As String
Public Property skuCode As String
Public Property skuType As String
Public Property description As String
Public Property vendorPartNumber As String
Public Property quantity As Integer
Public Property quantityReceived As Integer
Public Property cost As Integer
Public Property total As Integer
Public Property serialNumbers As List(Of SerialNumberResponse)
Public Property status As String
Public Property chargeable As Boolean
End Class
Public Class SerialNumberResponse
Public Property id As Integer
Public Property number As String
End Class
Public Class CustomFieldApiModel
Public Property typeId As Integer
Public Property name As String
Public Property value As String
End Class
Public Class UpdatePurchaseOrderRequest
Public Property vendorId As Integer
Public Property typeId As Integer
Public Property businessUnitId As Integer
Public Property inventoryLocationId As Integer
Public Property jobId As Integer
Public Property technicianId As Integer
Public Property projectId As Integer
Public Property shipTo As UpdateAddressRequest
Public Property vendorInvoiceNumber As String
Public Property impactsTechnicianPayroll As Boolean
Public Property memo As String
<JsonProperty("date")>
Public Property _date As DateTime
Public Property requiredOn As DateTime
Public Property tax As Integer
Public Property shipping As Integer
Public Property items As List(Of UpdatePurchaseOrderItemRequest)
Public Property removedItems As List(Of RemovePurchaseOrderItemRequest)
End Class
Public Class UpdateAddressRequest
Public Property description As String
Public Property address As AddressRequest
End Class
Public Class UpdatePurchaseOrderItemRequest
Public Property id As Integer
Public Property skuId As Integer
Public Property description As String
Public Property vendorPartNumber As String
Public Property quantity As Integer
Public Property cost As Integer
End Class
Public Class RemovePurchaseOrderItemRequest
Public Property id As Integer
Public Property doNotReplenish As Boolean
End Class
Public Class VendorResponse_P
Public Property page As Integer
Public Property pageSize As Integer
Public Property hasMore As Boolean
Public Property data As List(Of VendorResponse)
Public Property totalCount As Integer
End Class
Public Class VendorResponse
Public Property id As Integer
Public Property name As String
Public Property active As Boolean
Public Property isTruckReplenishment As Boolean
Public Property isMobileCreationRestricted As Boolean
Public Property memo As String
Public Property deliveryOption As String
Public Property defaultTaxRate As Integer
Public Property contactInfo As VendorContactInfoResponse
Public Property address As AddressResponse
End Class
Public Class VendorContactInfoResponse
Public Property firstName As String
Public Property lastName As String
Public Property phone As String
Public Property email As String
Public Property fax As String
End Class
End Class
Public Class JobBooking_ContactExperience
Public Class CallReasonResponse_P
Public Property page As Integer
Public Property pageSize As Integer
Public Property hasMore As Boolean
Public Property data As List(Of CallReasonResponse)
Public Property totalCount As Integer
End Class
Public Class CallReasonResponse
Public Property id As Integer
Public Property name As String
Public Property isLead As Boolean
Public Property active As Boolean
End Class
End Class
Public Class JobPlanning_Management
Public Class AppointmentAddRequest
Public Property jobId As Integer
Public Property start As DateTime
<JsonProperty("end")>
Public Property _end As DateTime
Public Property arrivalWindowStart As DateTime
Public Property arrivalWindowEnd As DateTime
Public Property technicianIds As List(Of Integer)
Public Property specialInstructions As String
End Class
Public Class AppointmentResponse
Public Property id As Integer
Public Property jobId As Integer
Public Property appointmentNumber As String
Public Property start As String
Public Property _end As String
Public Property arrivalWindowStart As DateTime
Public Property arrivalWindowEnd As DateTime
Public Property status As Status
Public Property specialInstructions As String
Public Property createdOn As DateTime
Public Property modifiedOn As DateTime
End Class
Public Class Status
Public Property status As String
End Class
Public Class UpdateAppointmentSpecialInstructionsRequest
Public Property specialInstructions As String
End Class
Public Class AppointmentResponse_P
Public Property page As Integer
Public Property pageSize As Integer
Public Property hasMore As Boolean
Public Property data As List(Of AppointmentResponse)
Public Property totalCount As Integer
End Class
Public Class HoldAppointmentRequest
Public Property reasonId As Integer
Public Property memo As String
End Class
Public Class AppointmentRescheduleRequest
Public Property start As DateTime
<JsonProperty("end")>
Public Property _end As DateTime
Public Property arrivalWindowStart As DateTime
Public Property arrivalWindowEnd As DateTime
End Class
Public Class JobCancelReasonResponse_P
Public Property page As Integer
Public Property pageSize As Integer
Public Property hasMore As Boolean
Public Property data As List(Of JobCancelReasonResponse)
Public Property totalCount As Integer
End Class
Public Class JobCancelReasonResponse
Public Property id As Integer
Public Property name As String
Public Property active As Boolean
End Class
Public Class JobHoldReasonResponse_P
Public Property page As Integer
Public Property pageSize As Integer
Public Property hasMore As Boolean
Public Property data As List(Of JobHoldReasonResponse)
Public Property totalCount As Integer