Class: Fastly::ServiceApi

Inherits:
Object
  • Object
show all
Defined in:
lib/fastly/api/service_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ServiceApi

Returns a new instance of ServiceApi.



17
18
19
# File 'lib/fastly/api/service_api.rb', line 17

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



15
16
17
# File 'lib/fastly/api/service_api.rb', line 15

def api_client
  @api_client
end

Instance Method Details

#create_service(opts = {}) ⇒ ServiceResponse

Create a service Create a service.

Parameters:

  • opts (Hash) (defaults to: {})

    a customizable set of options

Options Hash (opts):

  • :comment (String)

    A freeform descriptive note.

  • :name (String)

    The name of the service.

  • :customer_id (String)

    Alphanumeric string identifying the customer.

  • :type (String)

    The type of this service.

Returns:



27
28
29
30
# File 'lib/fastly/api/service_api.rb', line 27

def create_service(opts = {})
  data, _status_code, _headers = create_service_with_http_info(opts)
  data
end

#create_service_with_http_info(opts = {}) ⇒ Array<(ServiceResponse, Integer, Hash)>

Create a service Create a service.

Parameters:

  • opts (Hash) (defaults to: {})

    a customizable set of options

Options Hash (opts):

  • :comment (String)

    A freeform descriptive note.

  • :name (String)

    The name of the service.

  • :customer_id (String)

    Alphanumeric string identifying the customer.

  • :type (String)

    The type of this service.

Returns:

  • (Array<(ServiceResponse, Integer, Hash)>)

    ServiceResponse data, response status code and response headers



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
# File 'lib/fastly/api/service_api.rb', line 39

def create_service_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ServiceApi.create_service ...'
  end
  # unbox the parameters from the hash
  allowable_values = ["vcl", "wasm"]
  if @api_client.config.client_side_validation && opts[:'type'] && !allowable_values.include?(opts[:'type'])
    fail ArgumentError, "invalid value for \"type\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/service'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}
  form_params['comment'] = opts[:'comment'] if !opts[:'comment'].nil?
  form_params['name'] = opts[:'name'] if !opts[:'name'].nil?
  form_params['customer_id'] = opts[:'customer_id'] if !opts[:'customer_id'].nil?
  form_params['type'] = opts[:'type'] if !opts[:'type'].nil?

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ServiceResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"ServiceApi.create_service",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ServiceApi#create_service\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_service(opts = {}) ⇒ InlineResponse200

Delete a service Delete a service.

Parameters:

  • opts (Hash) (defaults to: {})

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

Returns:



101
102
103
104
# File 'lib/fastly/api/service_api.rb', line 101

def delete_service(opts = {})
  data, _status_code, _headers = delete_service_with_http_info(opts)
  data
end

#delete_service_with_http_info(opts = {}) ⇒ Array<(InlineResponse200, Integer, Hash)>

Delete a service Delete a service.

Parameters:

  • opts (Hash) (defaults to: {})

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

Returns:

  • (Array<(InlineResponse200, Integer, Hash)>)

    InlineResponse200 data, response status code and response headers



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
# File 'lib/fastly/api/service_api.rb', line 110

def delete_service_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ServiceApi.delete_service ...'
  end
  # unbox the parameters from the hash
  service_id = opts[:'service_id']
  # verify the required parameter 'service_id' is set
  if @api_client.config.client_side_validation && service_id.nil?
    fail ArgumentError, "Missing the required parameter 'service_id' when calling ServiceApi.delete_service"
  end
  # resource path
  local_var_path = '/service/{service_id}'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'InlineResponse200'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"ServiceApi.delete_service",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ServiceApi#delete_service\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_service(opts = {}) ⇒ ServiceResponse

Get a service Get a specific service by id.

Parameters:

  • opts (Hash) (defaults to: {})

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

Returns:



164
165
166
167
# File 'lib/fastly/api/service_api.rb', line 164

def get_service(opts = {})
  data, _status_code, _headers = get_service_with_http_info(opts)
  data
end

#get_service_detail(opts = {}) ⇒ ServiceDetail

Get service details List detailed information on a specified service.

Parameters:

  • opts (Hash) (defaults to: {})

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

  • :version (Integer)

    Number identifying a version of the service.

Returns:



228
229
230
231
# File 'lib/fastly/api/service_api.rb', line 228

def get_service_detail(opts = {})
  data, _status_code, _headers = get_service_detail_with_http_info(opts)
  data
end

#get_service_detail_with_http_info(opts = {}) ⇒ Array<(ServiceDetail, Integer, Hash)>

Get service details List detailed information on a specified service.

Parameters:

  • opts (Hash) (defaults to: {})

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

  • :version (Integer)

    Number identifying a version of the service.

Returns:

  • (Array<(ServiceDetail, Integer, Hash)>)

    ServiceDetail data, response status code and response headers



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
# File 'lib/fastly/api/service_api.rb', line 238

def get_service_detail_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ServiceApi.get_service_detail ...'
  end
  # unbox the parameters from the hash
  service_id = opts[:'service_id']
  # verify the required parameter 'service_id' is set
  if @api_client.config.client_side_validation && service_id.nil?
    fail ArgumentError, "Missing the required parameter 'service_id' when calling ServiceApi.get_service_detail"
  end
  if @api_client.config.client_side_validation && !opts[:'version'].nil? && opts[:'version'] < 1
    fail ArgumentError, 'invalid value for "opts[:"version"]" when calling ServiceApi.get_service_detail, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/service/{service_id}/details'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'version'] = opts[:'version'] if !opts[:'version'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ServiceDetail'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"ServiceApi.get_service_detail",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ServiceApi#get_service_detail\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_service_with_http_info(opts = {}) ⇒ Array<(ServiceResponse, Integer, Hash)>

Get a service Get a specific service by id.

Parameters:

  • opts (Hash) (defaults to: {})

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

Returns:

  • (Array<(ServiceResponse, Integer, Hash)>)

    ServiceResponse data, response status code and response headers



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
# File 'lib/fastly/api/service_api.rb', line 173

def get_service_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ServiceApi.get_service ...'
  end
  # unbox the parameters from the hash
  service_id = opts[:'service_id']
  # verify the required parameter 'service_id' is set
  if @api_client.config.client_side_validation && service_id.nil?
    fail ArgumentError, "Missing the required parameter 'service_id' when calling ServiceApi.get_service"
  end
  # resource path
  local_var_path = '/service/{service_id}'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ServiceResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"ServiceApi.get_service",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ServiceApi#get_service\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_service_domains(opts = {}) ⇒ Array<DomainResponse>

List the domains within a service List the domains within a service.

Parameters:

  • opts (Hash) (defaults to: {})

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

Returns:



297
298
299
300
# File 'lib/fastly/api/service_api.rb', line 297

def list_service_domains(opts = {})
  data, _status_code, _headers = list_service_domains_with_http_info(opts)
  data
end

#list_service_domains_with_http_info(opts = {}) ⇒ Array<(Array<DomainResponse>, Integer, Hash)>

List the domains within a service List the domains within a service.

Parameters:

  • opts (Hash) (defaults to: {})

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

Returns:

  • (Array<(Array<DomainResponse>, Integer, Hash)>)

    Array<DomainResponse> data, response status code and response headers



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
# File 'lib/fastly/api/service_api.rb', line 306

def list_service_domains_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ServiceApi.list_service_domains ...'
  end
  # unbox the parameters from the hash
  service_id = opts[:'service_id']
  # verify the required parameter 'service_id' is set
  if @api_client.config.client_side_validation && service_id.nil?
    fail ArgumentError, "Missing the required parameter 'service_id' when calling ServiceApi.list_service_domains"
  end
  # resource path
  local_var_path = '/service/{service_id}/domain'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<DomainResponse>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"ServiceApi.list_service_domains",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ServiceApi#list_service_domains\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_services(opts = {}) ⇒ Array<ServiceListResponse>

List services List services.

Parameters:

  • opts (Hash) (defaults to: {})

    a customizable set of options

Options Hash (opts):

  • :page (Integer)

    Current page.

  • :per_page (Integer)

    Number of records per page. (default to 20)

  • :sort (String)

    Field on which to sort. (default to ‘created’)

  • :direction (String)

    Direction in which to sort results. (default to ‘ascend’)

Returns:



363
364
365
366
# File 'lib/fastly/api/service_api.rb', line 363

def list_services(opts = {})
  data, _status_code, _headers = list_services_with_http_info(opts)
  data
end

#list_services_with_http_info(opts = {}) ⇒ Array<(Array<ServiceListResponse>, Integer, Hash)>

List services List services.

Parameters:

  • opts (Hash) (defaults to: {})

    a customizable set of options

Options Hash (opts):

  • :page (Integer)

    Current page.

  • :per_page (Integer)

    Number of records per page. (default to 20)

  • :sort (String)

    Field on which to sort. (default to ‘created’)

  • :direction (String)

    Direction in which to sort results. (default to ‘ascend’)

Returns:

  • (Array<(Array<ServiceListResponse>, Integer, Hash)>)

    Array<ServiceListResponse> data, response status code and response headers



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
# File 'lib/fastly/api/service_api.rb', line 375

def list_services_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ServiceApi.list_services ...'
  end
  # unbox the parameters from the hash
  if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] > 100
    fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling ServiceApi.list_services, must be smaller than or equal to 100.'
  end

  if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] < 1
    fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling ServiceApi.list_services, must be greater than or equal to 1.'
  end

  allowable_values = ["ascend", "descend"]
  if @api_client.config.client_side_validation && opts[:'direction'] && !allowable_values.include?(opts[:'direction'])
    fail ArgumentError, "invalid value for \"direction\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/service'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'direction'] = opts[:'direction'] if !opts[:'direction'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<ServiceListResponse>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"ServiceApi.list_services",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ServiceApi#list_services\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#search_service(opts = {}) ⇒ ServiceResponse

Search for a service by name Get a specific service by name.

Parameters:

  • opts (Hash) (defaults to: {})

    a customizable set of options

Options Hash (opts):

  • :name (String)

    The name of the service. (required)

Returns:



440
441
442
443
# File 'lib/fastly/api/service_api.rb', line 440

def search_service(opts = {})
  data, _status_code, _headers = search_service_with_http_info(opts)
  data
end

#search_service_with_http_info(opts = {}) ⇒ Array<(ServiceResponse, Integer, Hash)>

Search for a service by name Get a specific service by name.

Parameters:

  • opts (Hash) (defaults to: {})

    a customizable set of options

Options Hash (opts):

  • :name (String)

    The name of the service. (required)

Returns:

  • (Array<(ServiceResponse, Integer, Hash)>)

    ServiceResponse data, response status code and response headers



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
# File 'lib/fastly/api/service_api.rb', line 449

def search_service_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ServiceApi.search_service ...'
  end
  # unbox the parameters from the hash
  name = opts[:'name']
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling ServiceApi.search_service"
  end
  # resource path
  local_var_path = '/service/search'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'name'] = name

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ServiceResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"ServiceApi.search_service",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ServiceApi#search_service\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_service(opts = {}) ⇒ ServiceResponse

Update a service Update a service.

Parameters:

  • opts (Hash) (defaults to: {})

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

  • :comment (String)

    A freeform descriptive note.

  • :name (String)

    The name of the service.

  • :customer_id (String)

    Alphanumeric string identifying the customer.

Returns:



507
508
509
510
# File 'lib/fastly/api/service_api.rb', line 507

def update_service(opts = {})
  data, _status_code, _headers = update_service_with_http_info(opts)
  data
end

#update_service_with_http_info(opts = {}) ⇒ Array<(ServiceResponse, Integer, Hash)>

Update a service Update a service.

Parameters:

  • opts (Hash) (defaults to: {})

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

  • :comment (String)

    A freeform descriptive note.

  • :name (String)

    The name of the service.

  • :customer_id (String)

    Alphanumeric string identifying the customer.

Returns:

  • (Array<(ServiceResponse, Integer, Hash)>)

    ServiceResponse data, response status code and response headers



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
# File 'lib/fastly/api/service_api.rb', line 519

def update_service_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ServiceApi.update_service ...'
  end
  # unbox the parameters from the hash
  service_id = opts[:'service_id']
  # verify the required parameter 'service_id' is set
  if @api_client.config.client_side_validation && service_id.nil?
    fail ArgumentError, "Missing the required parameter 'service_id' when calling ServiceApi.update_service"
  end
  # resource path
  local_var_path = '/service/{service_id}'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}
  form_params['comment'] = opts[:'comment'] if !opts[:'comment'].nil?
  form_params['name'] = opts[:'name'] if !opts[:'name'].nil?
  form_params['customer_id'] = opts[:'customer_id'] if !opts[:'customer_id'].nil?

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ServiceResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"ServiceApi.update_service",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ServiceApi#update_service\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end