chengkun
2025-06-05 4080b5997b38ca84b3b203c7101dcadb97b76925
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
<?php
/**
* This class is autogenerated by the Spapi class generator
* Date of generation: 2022-05-26
* Specification: https://github.com/amzn/selling-partner-api-models/blob/main/models/services-api-model/services.json
* Source MD5 signature: 18ecff1fb65dc8db2a7d5db3cb67499a
*
*
* Selling Partner API for Services
* With the Services API, you can build applications that help service providers get and modify their service orders.
*/
namespace DoubleBreak\Spapi\Api;
use DoubleBreak\Spapi\Client;
 
class Services extends Client {
 
  /**
  * Operation getServiceJobByServiceJobId
  *
  * @param string $serviceJobId A service job identifier.
  *
  */
  public function getServiceJobByServiceJobId($serviceJobId)
  {
    return $this->send("/service/v1/serviceJobs/{$serviceJobId}", [
      'method' => 'GET',
    ]);
  }
 
  public function getServiceJobByServiceJobIdAsync($serviceJobId)
  {
    return $this->sendAsync("/service/v1/serviceJobs/{$serviceJobId}", [
      'method' => 'GET',
    ]);
  }
 
  /**
  * Operation cancelServiceJobByServiceJobId
  *
  * @param string $serviceJobId An Amazon defined service job identifier.
  *
  * @param array $queryParams
  *    - *cancellationReasonCode* string - A cancel reason code that specifies the reason for cancelling a service job.
  *
  */
  public function cancelServiceJobByServiceJobId($serviceJobId, $queryParams = [])
  {
    return $this->send("/service/v1/serviceJobs/{$serviceJobId}/cancellations", [
      'method' => 'PUT',
      'query' => $queryParams,
    ]);
  }
 
  public function cancelServiceJobByServiceJobIdAsync($serviceJobId, $queryParams = [])
  {
    return $this->sendAsync("/service/v1/serviceJobs/{$serviceJobId}/cancellations", [
      'method' => 'PUT',
      'query' => $queryParams,
    ]);
  }
 
  /**
  * Operation completeServiceJobByServiceJobId
  *
  * @param string $serviceJobId An Amazon defined service job identifier.
  *
  */
  public function completeServiceJobByServiceJobId($serviceJobId)
  {
    return $this->send("/service/v1/serviceJobs/{$serviceJobId}/completions", [
      'method' => 'PUT',
    ]);
  }
 
  public function completeServiceJobByServiceJobIdAsync($serviceJobId)
  {
    return $this->sendAsync("/service/v1/serviceJobs/{$serviceJobId}/completions", [
      'method' => 'PUT',
    ]);
  }
 
  /**
  * Operation getServiceJobs
  *
  * @param array $queryParams
  *    - *serviceOrderIds* array - List of service order ids for the query you want to perform.Max values supported 20. 
  *    - *serviceJobStatus* array - A list of one or more job status by which to filter the list of jobs.
  *    - *pageToken* string - String returned in the response of your previous request.
  *    - *pageSize* integer - A non-negative integer that indicates the maximum number of jobs to return in the list, Value must be 1 - 20. Default 20. 
  *    - *sortField* string - Sort fields on which you want to sort the output.
  *    - *sortOrder* string - Sort order for the query you want to perform.
  *    - *createdAfter* string - A date used for selecting jobs created after (or at) a specified time must be in ISO 8601 format. Required if LastUpdatedAfter is not specified.Specifying both CreatedAfter and LastUpdatedAfter returns an error. 
  *    - *createdBefore* string - A date used for selecting jobs created before (or at) a specified time must be in ISO 8601 format. 
  *    - *lastUpdatedAfter* string - A date used for selecting jobs updated after (or at) a specified time must be in ISO 8601 format. Required if createdAfter is not specified.Specifying both CreatedAfter and LastUpdatedAfter returns an error. 
  *    - *lastUpdatedBefore* string - A date used for selecting jobs updated before (or at) a specified time must be in ISO 8601 format. 
  *    - *scheduleStartDate* string - A date used for filtering jobs schedule after (or at) a specified time must be in ISO 8601 format. schedule end date should not be earlier than schedule start date. 
  *    - *scheduleEndDate* string - A date used for filtering jobs schedule before (or at) a specified time must be in ISO 8601 format. schedule end date should not be earlier than schedule start date. 
  *    - *marketplaceIds* array - Used to select jobs that were placed in the specified marketplaces. 
  *
  */
  public function getServiceJobs($queryParams = [])
  {
    return $this->send("/service/v1/serviceJobs", [
      'method' => 'GET',
      'query' => $queryParams,
    ]);
  }
 
  public function getServiceJobsAsync($queryParams = [])
  {
    return $this->sendAsync("/service/v1/serviceJobs", [
      'method' => 'GET',
      'query' => $queryParams,
    ]);
  }
 
  /**
  * Operation addAppointmentForServiceJobByServiceJobId
  *
  * @param string $serviceJobId An Amazon defined service job identifier.
  *
  */
  public function addAppointmentForServiceJobByServiceJobId($serviceJobId, $body = [])
  {
    return $this->send("/service/v1/serviceJobs/{$serviceJobId}/appointments", [
      'method' => 'POST',
      'json' => $body
    ]);
  }
 
  public function addAppointmentForServiceJobByServiceJobIdAsync($serviceJobId, $body = [])
  {
    return $this->sendAsync("/service/v1/serviceJobs/{$serviceJobId}/appointments", [
      'method' => 'POST',
      'json' => $body
    ]);
  }
 
  /**
  * Operation rescheduleAppointmentForServiceJobByServiceJobId
  *
  * @param string $serviceJobId An Amazon defined service job identifier.
  * @param string $appointmentId An existing appointment identifier for the Service Job.
  *
  */
  public function rescheduleAppointmentForServiceJobByServiceJobId($serviceJobId, $appointmentId, $body = [])
  {
    return $this->send("/service/v1/serviceJobs/{$serviceJobId}/appointments/{$appointmentId}", [
      'method' => 'POST',
      'json' => $body
    ]);
  }
 
  public function rescheduleAppointmentForServiceJobByServiceJobIdAsync($serviceJobId, $appointmentId, $body = [])
  {
    return $this->sendAsync("/service/v1/serviceJobs/{$serviceJobId}/appointments/{$appointmentId}", [
      'method' => 'POST',
      'json' => $body
    ]);
  }
}