Class: Fastly::VclApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ VclApi

Returns a new instance of VclApi.



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

def api_client
  @api_client
end

Instance Method Details

#create_custom_vcl(opts = {}) ⇒ VclResponse

Create a custom VCL file Upload a VCL 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)

  • :content (String)

    The VCL code to be included.

  • :main (Boolean)

    Set to `true` when this is the main VCL, otherwise `false`.

  • :name (String)

    The name of this VCL.

Returns:



28
29
30
31
# File 'lib/fastly/api/vcl_api.rb', line 28

def create_custom_vcl(opts = {})
  data, _status_code, _headers = create_custom_vcl_with_http_info(opts)
  data
end

#create_custom_vcl_with_http_info(opts = {}) ⇒ Array<(VclResponse, Integer, Hash)>

Create a custom VCL file Upload a VCL 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)

  • :content (String)

    The VCL code to be included.

  • :main (Boolean)

    Set to &#x60;true&#x60; when this is the main VCL, otherwise &#x60;false&#x60;.

  • :name (String)

    The name of this VCL.

Returns:

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

    VclResponse data, response status code and response headers



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

def create_custom_vcl_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VclApi.create_custom_vcl ...'
  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 VclApi.create_custom_vcl"
  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 VclApi.create_custom_vcl"
  end
  # resource path
  local_var_path = '/service/{service_id}/version/{version_id}/vcl'.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['content'] = opts[:'content'] if !opts[:'content'].nil?
  form_params['main'] = opts[:'main'] if !opts[:'main'].nil?
  form_params['name'] = opts[:'name'] if !opts[:'name'].nil?

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

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

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

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

#delete_custom_vcl(opts = {}) ⇒ InlineResponse200

Delete a custom VCL file Delete the uploaded VCL 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)

  • :vcl_name (String)

    The name of this VCL. (required)

Returns:



110
111
112
113
# File 'lib/fastly/api/vcl_api.rb', line 110

def delete_custom_vcl(opts = {})
  data, _status_code, _headers = delete_custom_vcl_with_http_info(opts)
  data
end

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

Delete a custom VCL file Delete the uploaded VCL 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)

  • :vcl_name (String)

    The name of this VCL. (required)

Returns:

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

    InlineResponse200 data, response status code and response headers



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

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

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

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

#get_custom_vcl(opts = {}) ⇒ VclResponse

Get a custom VCL file Get the uploaded VCL 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)

  • :vcl_name (String)

    The name of this VCL. (required)

  • :no_content (String)

    Omit VCL content. (default to ‘0’)

Returns:



188
189
190
191
# File 'lib/fastly/api/vcl_api.rb', line 188

def get_custom_vcl(opts = {})
  data, _status_code, _headers = get_custom_vcl_with_http_info(opts)
  data
end

#get_custom_vcl_boilerplate(opts = {}) ⇒ String

Get boilerplate VCL Return boilerplate VCL with the service’s TTL from the [settings](www.fastly.com/documentation/reference/api/vcl-services/settings/).

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:

  • (String)


266
267
268
269
# File 'lib/fastly/api/vcl_api.rb', line 266

def get_custom_vcl_boilerplate(opts = {})
  data, _status_code, _headers = get_custom_vcl_boilerplate_with_http_info(opts)
  data
end

#get_custom_vcl_boilerplate_with_http_info(opts = {}) ⇒ Array<(String, Integer, Hash)>

Get boilerplate VCL Return boilerplate VCL with the service&#39;s TTL from the [settings](www.fastly.com/documentation/reference/api/vcl-services/settings/).

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<(String, Integer, Hash)>)

    String data, response status code and response headers



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

def get_custom_vcl_boilerplate_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VclApi.get_custom_vcl_boilerplate ...'
  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 VclApi.get_custom_vcl_boilerplate"
  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 VclApi.get_custom_vcl_boilerplate"
  end
  # resource path
  local_var_path = '/service/{service_id}/version/{version_id}/boilerplate'.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(['text/plain'])

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

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

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

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

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

#get_custom_vcl_generated(opts = {}) ⇒ VclResponse

Get the generated VCL for a service Display the generated VCL 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:



336
337
338
339
# File 'lib/fastly/api/vcl_api.rb', line 336

def get_custom_vcl_generated(opts = {})
  data, _status_code, _headers = get_custom_vcl_generated_with_http_info(opts)
  data
end

#get_custom_vcl_generated_highlighted(opts = {}) ⇒ VclSyntaxHighlightingResponse

Get the generated VCL with syntax highlighting Display the content of generated VCL with HTML syntax highlighting. Include line numbers by sending ‘lineno=true` as a request parameter.

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:



406
407
408
409
# File 'lib/fastly/api/vcl_api.rb', line 406

def get_custom_vcl_generated_highlighted(opts = {})
  data, _status_code, _headers = get_custom_vcl_generated_highlighted_with_http_info(opts)
  data
end

#get_custom_vcl_generated_highlighted_with_http_info(opts = {}) ⇒ Array<(VclSyntaxHighlightingResponse, Integer, Hash)>

Get the generated VCL with syntax highlighting Display the content of generated VCL with HTML syntax highlighting. Include line numbers by sending &#x60;lineno&#x3D;true&#x60; as a request parameter.

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:



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

def get_custom_vcl_generated_highlighted_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VclApi.get_custom_vcl_generated_highlighted ...'
  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 VclApi.get_custom_vcl_generated_highlighted"
  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 VclApi.get_custom_vcl_generated_highlighted"
  end
  # resource path
  local_var_path = '/service/{service_id}/version/{version_id}/generated_vcl/content'.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] || 'VclSyntaxHighlightingResponse'

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

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

#get_custom_vcl_generated_with_http_info(opts = {}) ⇒ Array<(VclResponse, Integer, Hash)>

Get the generated VCL for a service Display the generated VCL 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<(VclResponse, Integer, Hash)>)

    VclResponse data, response status code and response headers



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

def get_custom_vcl_generated_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VclApi.get_custom_vcl_generated ...'
  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 VclApi.get_custom_vcl_generated"
  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 VclApi.get_custom_vcl_generated"
  end
  # resource path
  local_var_path = '/service/{service_id}/version/{version_id}/generated_vcl'.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] || 'VclResponse'

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

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

#get_custom_vcl_highlighted(opts = {}) ⇒ VclSyntaxHighlightingResponse

Get a custom VCL file with syntax highlighting Get the uploaded VCL for a particular service and version with HTML syntax highlighting. Include line numbers by sending ‘lineno=true` as a request parameter.

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)

  • :vcl_name (String)

    The name of this VCL. (required)

Returns:



477
478
479
480
# File 'lib/fastly/api/vcl_api.rb', line 477

def get_custom_vcl_highlighted(opts = {})
  data, _status_code, _headers = get_custom_vcl_highlighted_with_http_info(opts)
  data
end

#get_custom_vcl_highlighted_with_http_info(opts = {}) ⇒ Array<(VclSyntaxHighlightingResponse, Integer, Hash)>

Get a custom VCL file with syntax highlighting Get the uploaded VCL for a particular service and version with HTML syntax highlighting. Include line numbers by sending &#x60;lineno&#x3D;true&#x60; as a request parameter.

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)

  • :vcl_name (String)

    The name of this VCL. (required)

Returns:



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

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

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

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

#get_custom_vcl_raw(opts = {}) ⇒ String

Download a custom VCL file Download the specified VCL.

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)

  • :vcl_name (String)

    The name of this VCL. (required)

Returns:

  • (String)


554
555
556
557
# File 'lib/fastly/api/vcl_api.rb', line 554

def get_custom_vcl_raw(opts = {})
  data, _status_code, _headers = get_custom_vcl_raw_with_http_info(opts)
  data
end

#get_custom_vcl_raw_with_http_info(opts = {}) ⇒ Array<(String, Integer, Hash)>

Download a custom VCL file Download the specified VCL.

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)

  • :vcl_name (String)

    The name of this VCL. (required)

Returns:

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

    String data, response status code and response headers



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

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

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

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

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

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

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

#get_custom_vcl_with_http_info(opts = {}) ⇒ Array<(VclResponse, Integer, Hash)>

Get a custom VCL file Get the uploaded VCL 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)

  • :vcl_name (String)

    The name of this VCL. (required)

  • :no_content (String)

    Omit VCL content. (default to ‘0’)

Returns:

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

    VclResponse data, response status code and response headers



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

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

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'no_content'] = opts[:'no_content'] if !opts[:'no_content'].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] || 'VclResponse'

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

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

#lint_vcl_default(opts = {}) ⇒ ValidatorResult

Lint (validate) VCL using a default set of flags. This endpoint validates the submitted VCL against a default set of enabled flags. Consider using the ‘/service/service_id/lint` operation to validate VCL in the context of a specific service.

Parameters:

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

    a customizable set of options

Options Hash (opts):

Returns:



629
630
631
632
# File 'lib/fastly/api/vcl_api.rb', line 629

def lint_vcl_default(opts = {})
  data, _status_code, _headers = lint_vcl_default_with_http_info(opts)
  data
end

#lint_vcl_default_with_http_info(opts = {}) ⇒ Array<(ValidatorResult, Integer, Hash)>

Lint (validate) VCL using a default set of flags. This endpoint validates the submitted VCL against a default set of enabled flags. Consider using the &#x60;/service/service_id/lint&#x60; operation to validate VCL in the context of a specific service.

Parameters:

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

    a customizable set of options

Options Hash (opts):

Returns:

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

    ValidatorResult data, response status code and response headers



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

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

  # 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/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(inline_object1)

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

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

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

#lint_vcl_for_service(opts = {}) ⇒ ValidatorResult

Lint (validate) VCL using flags set for the service. Services may have flags set by a Fastly employee or by the purchase of products as addons to the service, which modify the way VCL is interpreted by that service. This endpoint validates the submitted VCL in the context of the specified service.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

  • :inline_object (InlineObject) — default: required

Returns:



698
699
700
701
# File 'lib/fastly/api/vcl_api.rb', line 698

def lint_vcl_for_service(opts = {})
  data, _status_code, _headers = lint_vcl_for_service_with_http_info(opts)
  data
end

#lint_vcl_for_service_with_http_info(opts = {}) ⇒ Array<(ValidatorResult, Integer, Hash)>

Lint (validate) VCL using flags set for the service. Services may have flags set by a Fastly employee or by the purchase of products as addons to the service, which modify the way VCL is interpreted by that service. This endpoint validates the submitted VCL in the context of the specified service.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

  • :inline_object (InlineObject) — default: required

Returns:

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

    ValidatorResult data, response status code and response headers



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

def lint_vcl_for_service_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VclApi.lint_vcl_for_service ...'
  end
  # unbox the parameters from the hash
  service_id = opts[:'service_id']
  inline_object = opts[:'inline_object']
  # 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 VclApi.lint_vcl_for_service"
  end
  # verify the required parameter 'inline_object' is set
  if @api_client.config.client_side_validation && inline_object.nil?
    fail ArgumentError, "Missing the required parameter 'inline_object' when calling VclApi.lint_vcl_for_service"
  end
  # resource path
  local_var_path = '/service/{service_id}/lint'.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/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(inline_object)

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

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

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

#list_custom_vcl(opts = {}) ⇒ Array<VclResponse>

List custom VCL files List the uploaded VCLs 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:



773
774
775
776
# File 'lib/fastly/api/vcl_api.rb', line 773

def list_custom_vcl(opts = {})
  data, _status_code, _headers = list_custom_vcl_with_http_info(opts)
  data
end

#list_custom_vcl_with_http_info(opts = {}) ⇒ Array<(Array<VclResponse>, Integer, Hash)>

List custom VCL files List the uploaded VCLs 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<(Array<VclResponse>, Integer, Hash)>)

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



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

def list_custom_vcl_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VclApi.list_custom_vcl ...'
  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 VclApi.list_custom_vcl"
  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 VclApi.list_custom_vcl"
  end
  # resource path
  local_var_path = '/service/{service_id}/version/{version_id}/vcl'.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] || 'Array<VclResponse>'

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

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

#set_custom_vcl_main(opts = {}) ⇒ VclResponse

Set a custom VCL file as main Set the specified VCL as the main.

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)

  • :vcl_name (String)

    The name of this VCL. (required)

Returns:



844
845
846
847
# File 'lib/fastly/api/vcl_api.rb', line 844

def set_custom_vcl_main(opts = {})
  data, _status_code, _headers = set_custom_vcl_main_with_http_info(opts)
  data
end

#set_custom_vcl_main_with_http_info(opts = {}) ⇒ Array<(VclResponse, Integer, Hash)>

Set a custom VCL file as main Set the specified VCL as the main.

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)

  • :vcl_name (String)

    The name of this VCL. (required)

Returns:

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

    VclResponse data, response status code and response headers



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

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

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

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

#update_custom_vcl(opts = {}) ⇒ VclResponse

Update a custom VCL file Update the uploaded VCL 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)

  • :vcl_name (String)

    The name of this VCL. (required)

  • :content (String)

    The VCL code to be included.

  • :main (Boolean)

    Set to &#x60;true&#x60; when this is the main VCL, otherwise &#x60;false&#x60;.

  • :name (String)

    The name of this VCL.

Returns:



924
925
926
927
# File 'lib/fastly/api/vcl_api.rb', line 924

def update_custom_vcl(opts = {})
  data, _status_code, _headers = update_custom_vcl_with_http_info(opts)
  data
end

#update_custom_vcl_with_http_info(opts = {}) ⇒ Array<(VclResponse, Integer, Hash)>

Update a custom VCL file Update the uploaded VCL 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)

  • :vcl_name (String)

    The name of this VCL. (required)

  • :content (String)

    The VCL code to be included.

  • :main (Boolean)

    Set to &#x60;true&#x60; when this is the main VCL, otherwise &#x60;false&#x60;.

  • :name (String)

    The name of this VCL.

Returns:

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

    VclResponse data, response status code and response headers



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
1001
1002
1003
1004
# File 'lib/fastly/api/vcl_api.rb', line 938

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

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

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

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

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