Class: Fastly::VersionApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ VersionApi

Returns a new instance of VersionApi.



17
18
19
# File 'lib/fastly/api/version_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/version_api.rb', line 15

def api_client
  @api_client
end

Instance Method Details

#activate_service_version(opts = {}) ⇒ VersionResponse

Activate a service version Activate the current version.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

  • :version_id (Integer)

    Integer identifying a service version. (required)

Returns:



25
26
27
28
# File 'lib/fastly/api/version_api.rb', line 25

def activate_service_version(opts = {})
  data, _status_code, _headers = activate_service_version_with_http_info(opts)
  data
end

#activate_service_version_environment(opts = {}) ⇒ VersionResponse

Activate a service version on the specified environment Activate a version on a given environment, i.e. "staging"

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

  • :version_id (Integer)

    Integer identifying a service version. (required)

  • :environment_name (EnvironmentName) — default: required

Returns:



96
97
98
99
# File 'lib/fastly/api/version_api.rb', line 96

def activate_service_version_environment(opts = {})
  data, _status_code, _headers = activate_service_version_environment_with_http_info(opts)
  data
end

#activate_service_version_environment_with_http_info(opts = {}) ⇒ Array<(VersionResponse, Integer, Hash)>

Activate a service version on the specified environment Activate a version on a given environment, i.e. &quot;staging&quot;

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

  • :version_id (Integer)

    Integer identifying a service version. (required)

  • :environment_name (EnvironmentName) — default: required

Returns:

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

    VersionResponse data, response status code and response headers



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

def activate_service_version_environment_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VersionApi.activate_service_version_environment ...'
  end
  # unbox the parameters from the hash
  service_id = opts[:'service_id']
  version_id = opts[:'version_id']
  environment_name = opts[:'environment_name']
  # 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 VersionApi.activate_service_version_environment"
  end
  # verify the required parameter 'version_id' is set
  if @api_client.config.client_side_validation && version_id.nil?
    fail ArgumentError, "Missing the required parameter 'version_id' when calling VersionApi.activate_service_version_environment"
  end
  # verify the required parameter 'environment_name' is set
  if @api_client.config.client_side_validation && environment_name.nil?
    fail ArgumentError, "Missing the required parameter 'environment_name' when calling VersionApi.activate_service_version_environment"
  end
  # resource path
  local_var_path = '/service/{service_id}/version/{version_id}/activate/{environment_name}'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'version_id' + '}', CGI.escape(version_id.to_s)).sub('{' + 'environment_name' + '}', CGI.escape(environment_name.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] || 'VersionResponse'

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

  new_options = opts.merge(
    :operation => :"VersionApi.activate_service_version_environment",
    :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: VersionApi#activate_service_version_environment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#activate_service_version_with_http_info(opts = {}) ⇒ Array<(VersionResponse, Integer, Hash)>

Activate a service version Activate the current version.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

  • :version_id (Integer)

    Integer identifying a service version. (required)

Returns:

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

    VersionResponse data, response status code and response headers



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

def activate_service_version_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VersionApi.activate_service_version ...'
  end
  # unbox the parameters from the hash
  service_id = opts[:'service_id']
  version_id = opts[:'version_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 VersionApi.activate_service_version"
  end
  # verify the required parameter 'version_id' is set
  if @api_client.config.client_side_validation && version_id.nil?
    fail ArgumentError, "Missing the required parameter 'version_id' when calling VersionApi.activate_service_version"
  end
  # resource path
  local_var_path = '/service/{service_id}/version/{version_id}/activate'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'version_id' + '}', CGI.escape(version_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] || 'VersionResponse'

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

  new_options = opts.merge(
    :operation => :"VersionApi.activate_service_version",
    :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: VersionApi#activate_service_version\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#clone_service_version(opts = {}) ⇒ Version

Clone a service version Clone the current configuration into a new version.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

  • :version_id (Integer)

    Integer identifying a service version. (required)

Returns:



172
173
174
175
# File 'lib/fastly/api/version_api.rb', line 172

def clone_service_version(opts = {})
  data, _status_code, _headers = clone_service_version_with_http_info(opts)
  data
end

#clone_service_version_with_http_info(opts = {}) ⇒ Array<(Version, Integer, Hash)>

Clone a service version Clone the current configuration into a new version.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

  • :version_id (Integer)

    Integer identifying a service version. (required)

Returns:

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

    Version data, response status code and response headers



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

def clone_service_version_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VersionApi.clone_service_version ...'
  end
  # unbox the parameters from the hash
  service_id = opts[:'service_id']
  version_id = opts[:'version_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 VersionApi.clone_service_version"
  end
  # verify the required parameter 'version_id' is set
  if @api_client.config.client_side_validation && version_id.nil?
    fail ArgumentError, "Missing the required parameter 'version_id' when calling VersionApi.clone_service_version"
  end
  # resource path
  local_var_path = '/service/{service_id}/version/{version_id}/clone'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'version_id' + '}', CGI.escape(version_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] || 'Version'

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

  new_options = opts.merge(
    :operation => :"VersionApi.clone_service_version",
    :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: VersionApi#clone_service_version\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_service_version(opts = {}) ⇒ VersionCreateResponse

Create a service version Create a version for a particular service.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

Returns:



241
242
243
244
# File 'lib/fastly/api/version_api.rb', line 241

def create_service_version(opts = {})
  data, _status_code, _headers = create_service_version_with_http_info(opts)
  data
end

#create_service_version_with_http_info(opts = {}) ⇒ Array<(VersionCreateResponse, Integer, Hash)>

Create a service version Create a version for a particular 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<(VersionCreateResponse, Integer, Hash)>)

    VersionCreateResponse data, response status code and response headers



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

def create_service_version_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VersionApi.create_service_version ...'
  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 VersionApi.create_service_version"
  end
  # resource path
  local_var_path = '/service/{service_id}/version'.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] || 'VersionCreateResponse'

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

  new_options = opts.merge(
    :operation => :"VersionApi.create_service_version",
    :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: VersionApi#create_service_version\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#deactivate_service_version(opts = {}) ⇒ VersionResponse

Deactivate a service version Deactivate the current version.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

  • :version_id (Integer)

    Integer identifying a service version. (required)

Returns:



305
306
307
308
# File 'lib/fastly/api/version_api.rb', line 305

def deactivate_service_version(opts = {})
  data, _status_code, _headers = deactivate_service_version_with_http_info(opts)
  data
end

#deactivate_service_version_environment(opts = {}) ⇒ VersionResponse

Deactivate a service version on an environment Deactivate the current version on a given environment, i.e. "staging"

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

  • :version_id (Integer)

    Integer identifying a service version. (required)

  • :environment_name (EnvironmentName) — default: required

Returns:



376
377
378
379
# File 'lib/fastly/api/version_api.rb', line 376

def deactivate_service_version_environment(opts = {})
  data, _status_code, _headers = deactivate_service_version_environment_with_http_info(opts)
  data
end

#deactivate_service_version_environment_with_http_info(opts = {}) ⇒ Array<(VersionResponse, Integer, Hash)>

Deactivate a service version on an environment Deactivate the current version on a given environment, i.e. &quot;staging&quot;

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

  • :version_id (Integer)

    Integer identifying a service version. (required)

  • :environment_name (EnvironmentName) — default: required

Returns:

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

    VersionResponse data, response status code and response headers



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

def deactivate_service_version_environment_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VersionApi.deactivate_service_version_environment ...'
  end
  # unbox the parameters from the hash
  service_id = opts[:'service_id']
  version_id = opts[:'version_id']
  environment_name = opts[:'environment_name']
  # 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 VersionApi.deactivate_service_version_environment"
  end
  # verify the required parameter 'version_id' is set
  if @api_client.config.client_side_validation && version_id.nil?
    fail ArgumentError, "Missing the required parameter 'version_id' when calling VersionApi.deactivate_service_version_environment"
  end
  # verify the required parameter 'environment_name' is set
  if @api_client.config.client_side_validation && environment_name.nil?
    fail ArgumentError, "Missing the required parameter 'environment_name' when calling VersionApi.deactivate_service_version_environment"
  end
  # resource path
  local_var_path = '/service/{service_id}/version/{version_id}/deactivate/{environment_name}'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'version_id' + '}', CGI.escape(version_id.to_s)).sub('{' + 'environment_name' + '}', CGI.escape(environment_name.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] || 'VersionResponse'

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

  new_options = opts.merge(
    :operation => :"VersionApi.deactivate_service_version_environment",
    :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: VersionApi#deactivate_service_version_environment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#deactivate_service_version_with_http_info(opts = {}) ⇒ Array<(VersionResponse, Integer, Hash)>

Deactivate a service version Deactivate the current version.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

  • :version_id (Integer)

    Integer identifying a service version. (required)

Returns:

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

    VersionResponse data, response status code and response headers



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

def deactivate_service_version_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VersionApi.deactivate_service_version ...'
  end
  # unbox the parameters from the hash
  service_id = opts[:'service_id']
  version_id = opts[:'version_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 VersionApi.deactivate_service_version"
  end
  # verify the required parameter 'version_id' is set
  if @api_client.config.client_side_validation && version_id.nil?
    fail ArgumentError, "Missing the required parameter 'version_id' when calling VersionApi.deactivate_service_version"
  end
  # resource path
  local_var_path = '/service/{service_id}/version/{version_id}/deactivate'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'version_id' + '}', CGI.escape(version_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] || 'VersionResponse'

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

  new_options = opts.merge(
    :operation => :"VersionApi.deactivate_service_version",
    :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: VersionApi#deactivate_service_version\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_service_version(opts = {}) ⇒ VersionResponse

Get a version of a service Get the version for a particular service.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

  • :version_id (Integer)

    Integer identifying a service version. (required)

Returns:



452
453
454
455
# File 'lib/fastly/api/version_api.rb', line 452

def get_service_version(opts = {})
  data, _status_code, _headers = get_service_version_with_http_info(opts)
  data
end

#get_service_version_with_http_info(opts = {}) ⇒ Array<(VersionResponse, Integer, Hash)>

Get a version of a service Get the version for a particular service.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

  • :version_id (Integer)

    Integer identifying a service version. (required)

Returns:

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

    VersionResponse data, response status code and response headers



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

def get_service_version_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VersionApi.get_service_version ...'
  end
  # unbox the parameters from the hash
  service_id = opts[:'service_id']
  version_id = opts[:'version_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 VersionApi.get_service_version"
  end
  # verify the required parameter 'version_id' is set
  if @api_client.config.client_side_validation && version_id.nil?
    fail ArgumentError, "Missing the required parameter 'version_id' when calling VersionApi.get_service_version"
  end
  # resource path
  local_var_path = '/service/{service_id}/version/{version_id}'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'version_id' + '}', CGI.escape(version_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] || 'VersionResponse'

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

  new_options = opts.merge(
    :operation => :"VersionApi.get_service_version",
    :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: VersionApi#get_service_version\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_service_versions(opts = {}) ⇒ Array<VersionResponse>

List versions of a service List the versions for a particular service.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

Returns:



521
522
523
524
# File 'lib/fastly/api/version_api.rb', line 521

def list_service_versions(opts = {})
  data, _status_code, _headers = list_service_versions_with_http_info(opts)
  data
end

#list_service_versions_with_http_info(opts = {}) ⇒ Array<(Array<VersionResponse>, Integer, Hash)>

List versions of a service List the versions for a particular 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<VersionResponse>, Integer, Hash)>)

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



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

def list_service_versions_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VersionApi.list_service_versions ...'
  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 VersionApi.list_service_versions"
  end
  # resource path
  local_var_path = '/service/{service_id}/version'.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<VersionResponse>'

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

  new_options = opts.merge(
    :operation => :"VersionApi.list_service_versions",
    :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: VersionApi#list_service_versions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#lock_service_version(opts = {}) ⇒ Version

Lock a service version Locks the specified version.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

  • :version_id (Integer)

    Integer identifying a service version. (required)

Returns:



585
586
587
588
# File 'lib/fastly/api/version_api.rb', line 585

def lock_service_version(opts = {})
  data, _status_code, _headers = lock_service_version_with_http_info(opts)
  data
end

#lock_service_version_with_http_info(opts = {}) ⇒ Array<(Version, Integer, Hash)>

Lock a service version Locks the specified version.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

  • :version_id (Integer)

    Integer identifying a service version. (required)

Returns:

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

    Version data, response status code and response headers



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

def lock_service_version_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VersionApi.lock_service_version ...'
  end
  # unbox the parameters from the hash
  service_id = opts[:'service_id']
  version_id = opts[:'version_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 VersionApi.lock_service_version"
  end
  # verify the required parameter 'version_id' is set
  if @api_client.config.client_side_validation && version_id.nil?
    fail ArgumentError, "Missing the required parameter 'version_id' when calling VersionApi.lock_service_version"
  end
  # resource path
  local_var_path = '/service/{service_id}/version/{version_id}/lock'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'version_id' + '}', CGI.escape(version_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] || 'Version'

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

  new_options = opts.merge(
    :operation => :"VersionApi.lock_service_version",
    :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: VersionApi#lock_service_version\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_service_version(opts = {}) ⇒ VersionResponse

Update a service version Update a particular version for a particular service.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

  • :version_id (Integer)

    Integer identifying a service version. (required)

  • :active (Boolean)

    Whether this is the active version or not. (default to false)

  • :comment (String)

    A freeform descriptive note.

  • :deployed (Boolean)

    Unused at this time.

  • :locked (Boolean)

    Whether this version is locked or not. Objects can not be added or edited on locked versions. (default to false)

  • :number (Integer)

    The number of this version.

  • :staging (Boolean)

    Unused at this time. (default to false)

  • :testing (Boolean)

    Unused at this time. (default to false)

Returns:



662
663
664
665
# File 'lib/fastly/api/version_api.rb', line 662

def update_service_version(opts = {})
  data, _status_code, _headers = update_service_version_with_http_info(opts)
  data
end

#update_service_version_with_http_info(opts = {}) ⇒ Array<(VersionResponse, Integer, Hash)>

Update a service version Update a particular version for a particular service.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

  • :version_id (Integer)

    Integer identifying a service version. (required)

  • :active (Boolean)

    Whether this is the active version or not. (default to false)

  • :comment (String)

    A freeform descriptive note.

  • :deployed (Boolean)

    Unused at this time.

  • :locked (Boolean)

    Whether this version is locked or not. Objects can not be added or edited on locked versions. (default to false)

  • :number (Integer)

    The number of this version.

  • :staging (Boolean)

    Unused at this time. (default to false)

  • :testing (Boolean)

    Unused at this time. (default to false)

Returns:

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

    VersionResponse data, response status code and response headers



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

def update_service_version_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VersionApi.update_service_version ...'
  end
  # unbox the parameters from the hash
  service_id = opts[:'service_id']
  version_id = opts[:'version_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 VersionApi.update_service_version"
  end
  # verify the required parameter 'version_id' is set
  if @api_client.config.client_side_validation && version_id.nil?
    fail ArgumentError, "Missing the required parameter 'version_id' when calling VersionApi.update_service_version"
  end
  # resource path
  local_var_path = '/service/{service_id}/version/{version_id}'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'version_id' + '}', CGI.escape(version_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['active'] = opts[:'active'] if !opts[:'active'].nil?
  form_params['comment'] = opts[:'comment'] if !opts[:'comment'].nil?
  form_params['deployed'] = opts[:'deployed'] if !opts[:'deployed'].nil?
  form_params['locked'] = opts[:'locked'] if !opts[:'locked'].nil?
  form_params['number'] = opts[:'number'] if !opts[:'number'].nil?
  form_params['staging'] = opts[:'staging'] if !opts[:'staging'].nil?
  form_params['testing'] = opts[:'testing'] if !opts[:'testing'].nil?

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

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

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

  new_options = opts.merge(
    :operation => :"VersionApi.update_service_version",
    :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: VersionApi#update_service_version\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#validate_service_version(opts = {}) ⇒ InlineResponse200

Validate a service version Validate the version for a particular service and version.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

  • :version_id (Integer)

    Integer identifying a service version. (required)

Returns:



751
752
753
754
# File 'lib/fastly/api/version_api.rb', line 751

def validate_service_version(opts = {})
  data, _status_code, _headers = validate_service_version_with_http_info(opts)
  data
end

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

Validate a service version Validate the version for a particular service and version.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

  • :version_id (Integer)

    Integer identifying a service version. (required)

Returns:

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

    InlineResponse200 data, response status code and response headers



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

def validate_service_version_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VersionApi.validate_service_version ...'
  end
  # unbox the parameters from the hash
  service_id = opts[:'service_id']
  version_id = opts[:'version_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 VersionApi.validate_service_version"
  end
  # verify the required parameter 'version_id' is set
  if @api_client.config.client_side_validation && version_id.nil?
    fail ArgumentError, "Missing the required parameter 'version_id' when calling VersionApi.validate_service_version"
  end
  # resource path
  local_var_path = '/service/{service_id}/version/{version_id}/validate'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'version_id' + '}', CGI.escape(version_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 => :"VersionApi.validate_service_version",
    :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: VersionApi#validate_service_version\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end