fastly 4.0.1.pre.alpha.0 → 4.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,553 @@
1
+ =begin
2
+ #Fastly API
3
+
4
+ #Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://developer.fastly.com/reference/api/)
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: oss@fastly.com
8
+
9
+ =end
10
+
11
+ require 'cgi'
12
+
13
+ module Fastly
14
+ class ObjectStoreApi
15
+ attr_accessor :api_client
16
+
17
+ def initialize(api_client = ApiClient.default)
18
+ @api_client = api_client
19
+ end
20
+ # Create an object store.
21
+ # Create a new object store.
22
+ # @option opts [Store] :store
23
+ # @return [StoreResponse]
24
+ def create_store(opts = {})
25
+ data, _status_code, _headers = create_store_with_http_info(opts)
26
+ data
27
+ end
28
+
29
+ # Create an object store.
30
+ # Create a new object store.
31
+ # @option opts [Store] :store
32
+ # @return [Array<(StoreResponse, Integer, Hash)>] StoreResponse data, response status code and response headers
33
+ def create_store_with_http_info(opts = {})
34
+ if @api_client.config.debugging
35
+ @api_client.config.logger.debug 'Calling API: ObjectStoreApi.create_store ...'
36
+ end
37
+ # unbox the parameters from the hash
38
+ # resource path
39
+ local_var_path = '/resources/stores/object'
40
+
41
+ # query parameters
42
+ query_params = opts[:query_params] || {}
43
+
44
+ # header parameters
45
+ header_params = opts[:header_params] || {}
46
+ # HTTP header 'Accept' (if needed)
47
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
48
+ # HTTP header 'Content-Type'
49
+ content_type = @api_client.select_header_content_type(['application/json'])
50
+ if !content_type.nil?
51
+ header_params['Content-Type'] = content_type
52
+ end
53
+
54
+ # form parameters
55
+ form_params = opts[:form_params] || {}
56
+
57
+ # http body (model)
58
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'store'])
59
+
60
+ # return_type
61
+ return_type = opts[:debug_return_type] || 'StoreResponse'
62
+
63
+ # auth_names
64
+ auth_names = opts[:debug_auth_names] || ['token']
65
+
66
+ new_options = opts.merge(
67
+ :operation => :"ObjectStoreApi.create_store",
68
+ :header_params => header_params,
69
+ :query_params => query_params,
70
+ :form_params => form_params,
71
+ :body => post_body,
72
+ :auth_names => auth_names,
73
+ :return_type => return_type
74
+ )
75
+
76
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
77
+ if @api_client.config.debugging
78
+ @api_client.config.logger.debug "API called: ObjectStoreApi#create_store\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
79
+ end
80
+ return data, status_code, headers
81
+ end
82
+
83
+ # Delete object store key.
84
+ # Delete a key from a customer store.
85
+ # @option opts [String] :store_id (required)
86
+ # @option opts [String] :key_name (required)
87
+ # @return [nil]
88
+ def delete_key_from_store(opts = {})
89
+ delete_key_from_store_with_http_info(opts)
90
+ nil
91
+ end
92
+
93
+ # Delete object store key.
94
+ # Delete a key from a customer store.
95
+ # @option opts [String] :store_id (required)
96
+ # @option opts [String] :key_name (required)
97
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
98
+ def delete_key_from_store_with_http_info(opts = {})
99
+ if @api_client.config.debugging
100
+ @api_client.config.logger.debug 'Calling API: ObjectStoreApi.delete_key_from_store ...'
101
+ end
102
+ # unbox the parameters from the hash
103
+ store_id = opts[:'store_id']
104
+ key_name = opts[:'key_name']
105
+ # verify the required parameter 'store_id' is set
106
+ if @api_client.config.client_side_validation && store_id.nil?
107
+ fail ArgumentError, "Missing the required parameter 'store_id' when calling ObjectStoreApi.delete_key_from_store"
108
+ end
109
+ # verify the required parameter 'key_name' is set
110
+ if @api_client.config.client_side_validation && key_name.nil?
111
+ fail ArgumentError, "Missing the required parameter 'key_name' when calling ObjectStoreApi.delete_key_from_store"
112
+ end
113
+ # resource path
114
+ local_var_path = '/resources/stores/object/{store_id}/keys/{key_name}'.sub('{' + 'store_id' + '}', CGI.escape(store_id.to_s)).sub('{' + 'key_name' + '}', CGI.escape(key_name.to_s))
115
+
116
+ # query parameters
117
+ query_params = opts[:query_params] || {}
118
+
119
+ # header parameters
120
+ header_params = opts[:header_params] || {}
121
+
122
+ # form parameters
123
+ form_params = opts[:form_params] || {}
124
+
125
+ # http body (model)
126
+ post_body = opts[:debug_body]
127
+
128
+ # return_type
129
+ return_type = opts[:debug_return_type]
130
+
131
+ # auth_names
132
+ auth_names = opts[:debug_auth_names] || ['token']
133
+
134
+ new_options = opts.merge(
135
+ :operation => :"ObjectStoreApi.delete_key_from_store",
136
+ :header_params => header_params,
137
+ :query_params => query_params,
138
+ :form_params => form_params,
139
+ :body => post_body,
140
+ :auth_names => auth_names,
141
+ :return_type => return_type
142
+ )
143
+
144
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
145
+ if @api_client.config.debugging
146
+ @api_client.config.logger.debug "API called: ObjectStoreApi#delete_key_from_store\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
147
+ end
148
+ return data, status_code, headers
149
+ end
150
+
151
+ # Delete an object store.
152
+ # An object store must be empty before it can be deleted. Deleting an object store that still contains keys will result in a 409 Conflict.
153
+ # @option opts [String] :store_id (required)
154
+ # @return [nil]
155
+ def delete_store(opts = {})
156
+ delete_store_with_http_info(opts)
157
+ nil
158
+ end
159
+
160
+ # Delete an object store.
161
+ # An object store must be empty before it can be deleted. Deleting an object store that still contains keys will result in a 409 Conflict.
162
+ # @option opts [String] :store_id (required)
163
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
164
+ def delete_store_with_http_info(opts = {})
165
+ if @api_client.config.debugging
166
+ @api_client.config.logger.debug 'Calling API: ObjectStoreApi.delete_store ...'
167
+ end
168
+ # unbox the parameters from the hash
169
+ store_id = opts[:'store_id']
170
+ # verify the required parameter 'store_id' is set
171
+ if @api_client.config.client_side_validation && store_id.nil?
172
+ fail ArgumentError, "Missing the required parameter 'store_id' when calling ObjectStoreApi.delete_store"
173
+ end
174
+ # resource path
175
+ local_var_path = '/resources/stores/object/{store_id}'.sub('{' + 'store_id' + '}', CGI.escape(store_id.to_s))
176
+
177
+ # query parameters
178
+ query_params = opts[:query_params] || {}
179
+
180
+ # header parameters
181
+ header_params = opts[:header_params] || {}
182
+
183
+ # form parameters
184
+ form_params = opts[:form_params] || {}
185
+
186
+ # http body (model)
187
+ post_body = opts[:debug_body]
188
+
189
+ # return_type
190
+ return_type = opts[:debug_return_type]
191
+
192
+ # auth_names
193
+ auth_names = opts[:debug_auth_names] || ['token']
194
+
195
+ new_options = opts.merge(
196
+ :operation => :"ObjectStoreApi.delete_store",
197
+ :header_params => header_params,
198
+ :query_params => query_params,
199
+ :form_params => form_params,
200
+ :body => post_body,
201
+ :auth_names => auth_names,
202
+ :return_type => return_type
203
+ )
204
+
205
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
206
+ if @api_client.config.debugging
207
+ @api_client.config.logger.debug "API called: ObjectStoreApi#delete_store\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
208
+ end
209
+ return data, status_code, headers
210
+ end
211
+
212
+ # List object store keys.
213
+ # List all keys within an object store.
214
+ # @option opts [String] :store_id (required)
215
+ # @option opts [String] :cursor
216
+ # @option opts [Integer] :limit (default to 100)
217
+ # @return [KeyResponse]
218
+ def get_keys(opts = {})
219
+ data, _status_code, _headers = get_keys_with_http_info(opts)
220
+ data
221
+ end
222
+
223
+ # List object store keys.
224
+ # List all keys within an object store.
225
+ # @option opts [String] :store_id (required)
226
+ # @option opts [String] :cursor
227
+ # @option opts [Integer] :limit (default to 100)
228
+ # @return [Array<(KeyResponse, Integer, Hash)>] KeyResponse data, response status code and response headers
229
+ def get_keys_with_http_info(opts = {})
230
+ if @api_client.config.debugging
231
+ @api_client.config.logger.debug 'Calling API: ObjectStoreApi.get_keys ...'
232
+ end
233
+ # unbox the parameters from the hash
234
+ store_id = opts[:'store_id']
235
+ # verify the required parameter 'store_id' is set
236
+ if @api_client.config.client_side_validation && store_id.nil?
237
+ fail ArgumentError, "Missing the required parameter 'store_id' when calling ObjectStoreApi.get_keys"
238
+ end
239
+ # resource path
240
+ local_var_path = '/resources/stores/object/{store_id}/keys'.sub('{' + 'store_id' + '}', CGI.escape(store_id.to_s))
241
+
242
+ # query parameters
243
+ query_params = opts[:query_params] || {}
244
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
245
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
246
+
247
+ # header parameters
248
+ header_params = opts[:header_params] || {}
249
+ # HTTP header 'Accept' (if needed)
250
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
251
+
252
+ # form parameters
253
+ form_params = opts[:form_params] || {}
254
+
255
+ # http body (model)
256
+ post_body = opts[:debug_body]
257
+
258
+ # return_type
259
+ return_type = opts[:debug_return_type] || 'KeyResponse'
260
+
261
+ # auth_names
262
+ auth_names = opts[:debug_auth_names] || ['token']
263
+
264
+ new_options = opts.merge(
265
+ :operation => :"ObjectStoreApi.get_keys",
266
+ :header_params => header_params,
267
+ :query_params => query_params,
268
+ :form_params => form_params,
269
+ :body => post_body,
270
+ :auth_names => auth_names,
271
+ :return_type => return_type
272
+ )
273
+
274
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
275
+ if @api_client.config.debugging
276
+ @api_client.config.logger.debug "API called: ObjectStoreApi#get_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
277
+ end
278
+ return data, status_code, headers
279
+ end
280
+
281
+ # Describe an object store.
282
+ # Get an object store by ID.
283
+ # @option opts [String] :store_id (required)
284
+ # @return [StoreResponse]
285
+ def get_store(opts = {})
286
+ data, _status_code, _headers = get_store_with_http_info(opts)
287
+ data
288
+ end
289
+
290
+ # Describe an object store.
291
+ # Get an object store by ID.
292
+ # @option opts [String] :store_id (required)
293
+ # @return [Array<(StoreResponse, Integer, Hash)>] StoreResponse data, response status code and response headers
294
+ def get_store_with_http_info(opts = {})
295
+ if @api_client.config.debugging
296
+ @api_client.config.logger.debug 'Calling API: ObjectStoreApi.get_store ...'
297
+ end
298
+ # unbox the parameters from the hash
299
+ store_id = opts[:'store_id']
300
+ # verify the required parameter 'store_id' is set
301
+ if @api_client.config.client_side_validation && store_id.nil?
302
+ fail ArgumentError, "Missing the required parameter 'store_id' when calling ObjectStoreApi.get_store"
303
+ end
304
+ # resource path
305
+ local_var_path = '/resources/stores/object/{store_id}'.sub('{' + 'store_id' + '}', CGI.escape(store_id.to_s))
306
+
307
+ # query parameters
308
+ query_params = opts[:query_params] || {}
309
+
310
+ # header parameters
311
+ header_params = opts[:header_params] || {}
312
+ # HTTP header 'Accept' (if needed)
313
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
314
+
315
+ # form parameters
316
+ form_params = opts[:form_params] || {}
317
+
318
+ # http body (model)
319
+ post_body = opts[:debug_body]
320
+
321
+ # return_type
322
+ return_type = opts[:debug_return_type] || 'StoreResponse'
323
+
324
+ # auth_names
325
+ auth_names = opts[:debug_auth_names] || ['token']
326
+
327
+ new_options = opts.merge(
328
+ :operation => :"ObjectStoreApi.get_store",
329
+ :header_params => header_params,
330
+ :query_params => query_params,
331
+ :form_params => form_params,
332
+ :body => post_body,
333
+ :auth_names => auth_names,
334
+ :return_type => return_type
335
+ )
336
+
337
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
338
+ if @api_client.config.debugging
339
+ @api_client.config.logger.debug "API called: ObjectStoreApi#get_store\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
340
+ end
341
+ return data, status_code, headers
342
+ end
343
+
344
+ # List object stores.
345
+ # Get all stores for a given customer.
346
+ # @option opts [String] :cursor
347
+ # @option opts [Integer] :limit (default to 100)
348
+ # @return [GetStoresResponse]
349
+ def get_stores(opts = {})
350
+ data, _status_code, _headers = get_stores_with_http_info(opts)
351
+ data
352
+ end
353
+
354
+ # List object stores.
355
+ # Get all stores for a given customer.
356
+ # @option opts [String] :cursor
357
+ # @option opts [Integer] :limit (default to 100)
358
+ # @return [Array<(GetStoresResponse, Integer, Hash)>] GetStoresResponse data, response status code and response headers
359
+ def get_stores_with_http_info(opts = {})
360
+ if @api_client.config.debugging
361
+ @api_client.config.logger.debug 'Calling API: ObjectStoreApi.get_stores ...'
362
+ end
363
+ # unbox the parameters from the hash
364
+ # resource path
365
+ local_var_path = '/resources/stores/object'
366
+
367
+ # query parameters
368
+ query_params = opts[:query_params] || {}
369
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
370
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
371
+
372
+ # header parameters
373
+ header_params = opts[:header_params] || {}
374
+ # HTTP header 'Accept' (if needed)
375
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
376
+
377
+ # form parameters
378
+ form_params = opts[:form_params] || {}
379
+
380
+ # http body (model)
381
+ post_body = opts[:debug_body]
382
+
383
+ # return_type
384
+ return_type = opts[:debug_return_type] || 'GetStoresResponse'
385
+
386
+ # auth_names
387
+ auth_names = opts[:debug_auth_names] || ['token']
388
+
389
+ new_options = opts.merge(
390
+ :operation => :"ObjectStoreApi.get_stores",
391
+ :header_params => header_params,
392
+ :query_params => query_params,
393
+ :form_params => form_params,
394
+ :body => post_body,
395
+ :auth_names => auth_names,
396
+ :return_type => return_type
397
+ )
398
+
399
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
400
+ if @api_client.config.debugging
401
+ @api_client.config.logger.debug "API called: ObjectStoreApi#get_stores\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
402
+ end
403
+ return data, status_code, headers
404
+ end
405
+
406
+ # Get object store key value.
407
+ # Get the value associated with a key.
408
+ # @option opts [String] :store_id (required)
409
+ # @option opts [String] :key_name (required)
410
+ # @return [File]
411
+ def get_value_for_key(opts = {})
412
+ data, _status_code, _headers = get_value_for_key_with_http_info(opts)
413
+ data
414
+ end
415
+
416
+ # Get object store key value.
417
+ # Get the value associated with a key.
418
+ # @option opts [String] :store_id (required)
419
+ # @option opts [String] :key_name (required)
420
+ # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
421
+ def get_value_for_key_with_http_info(opts = {})
422
+ if @api_client.config.debugging
423
+ @api_client.config.logger.debug 'Calling API: ObjectStoreApi.get_value_for_key ...'
424
+ end
425
+ # unbox the parameters from the hash
426
+ store_id = opts[:'store_id']
427
+ key_name = opts[:'key_name']
428
+ # verify the required parameter 'store_id' is set
429
+ if @api_client.config.client_side_validation && store_id.nil?
430
+ fail ArgumentError, "Missing the required parameter 'store_id' when calling ObjectStoreApi.get_value_for_key"
431
+ end
432
+ # verify the required parameter 'key_name' is set
433
+ if @api_client.config.client_side_validation && key_name.nil?
434
+ fail ArgumentError, "Missing the required parameter 'key_name' when calling ObjectStoreApi.get_value_for_key"
435
+ end
436
+ # resource path
437
+ local_var_path = '/resources/stores/object/{store_id}/keys/{key_name}'.sub('{' + 'store_id' + '}', CGI.escape(store_id.to_s)).sub('{' + 'key_name' + '}', CGI.escape(key_name.to_s))
438
+
439
+ # query parameters
440
+ query_params = opts[:query_params] || {}
441
+
442
+ # header parameters
443
+ header_params = opts[:header_params] || {}
444
+ # HTTP header 'Accept' (if needed)
445
+ header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
446
+
447
+ # form parameters
448
+ form_params = opts[:form_params] || {}
449
+
450
+ # http body (model)
451
+ post_body = opts[:debug_body]
452
+
453
+ # return_type
454
+ return_type = opts[:debug_return_type] || 'File'
455
+
456
+ # auth_names
457
+ auth_names = opts[:debug_auth_names] || ['token']
458
+
459
+ new_options = opts.merge(
460
+ :operation => :"ObjectStoreApi.get_value_for_key",
461
+ :header_params => header_params,
462
+ :query_params => query_params,
463
+ :form_params => form_params,
464
+ :body => post_body,
465
+ :auth_names => auth_names,
466
+ :return_type => return_type
467
+ )
468
+
469
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
470
+ if @api_client.config.debugging
471
+ @api_client.config.logger.debug "API called: ObjectStoreApi#get_value_for_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
472
+ end
473
+ return data, status_code, headers
474
+ end
475
+
476
+ # Insert object store key-value.
477
+ # Insert a new key-value pair into an object store.
478
+ # @option opts [String] :store_id (required)
479
+ # @option opts [String] :key_name (required)
480
+ # @option opts [File] :body
481
+ # @return [File]
482
+ def set_value_for_key(opts = {})
483
+ data, _status_code, _headers = set_value_for_key_with_http_info(opts)
484
+ data
485
+ end
486
+
487
+ # Insert object store key-value.
488
+ # Insert a new key-value pair into an object store.
489
+ # @option opts [String] :store_id (required)
490
+ # @option opts [String] :key_name (required)
491
+ # @option opts [File] :body
492
+ # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
493
+ def set_value_for_key_with_http_info(opts = {})
494
+ if @api_client.config.debugging
495
+ @api_client.config.logger.debug 'Calling API: ObjectStoreApi.set_value_for_key ...'
496
+ end
497
+ # unbox the parameters from the hash
498
+ store_id = opts[:'store_id']
499
+ key_name = opts[:'key_name']
500
+ # verify the required parameter 'store_id' is set
501
+ if @api_client.config.client_side_validation && store_id.nil?
502
+ fail ArgumentError, "Missing the required parameter 'store_id' when calling ObjectStoreApi.set_value_for_key"
503
+ end
504
+ # verify the required parameter 'key_name' is set
505
+ if @api_client.config.client_side_validation && key_name.nil?
506
+ fail ArgumentError, "Missing the required parameter 'key_name' when calling ObjectStoreApi.set_value_for_key"
507
+ end
508
+ # resource path
509
+ local_var_path = '/resources/stores/object/{store_id}/keys/{key_name}'.sub('{' + 'store_id' + '}', CGI.escape(store_id.to_s)).sub('{' + 'key_name' + '}', CGI.escape(key_name.to_s))
510
+
511
+ # query parameters
512
+ query_params = opts[:query_params] || {}
513
+
514
+ # header parameters
515
+ header_params = opts[:header_params] || {}
516
+ # HTTP header 'Accept' (if needed)
517
+ header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
518
+ # HTTP header 'Content-Type'
519
+ content_type = @api_client.select_header_content_type(['application/octet-stream'])
520
+ if !content_type.nil?
521
+ header_params['Content-Type'] = content_type
522
+ end
523
+
524
+ # form parameters
525
+ form_params = opts[:form_params] || {}
526
+
527
+ # http body (model)
528
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
529
+
530
+ # return_type
531
+ return_type = opts[:debug_return_type] || 'File'
532
+
533
+ # auth_names
534
+ auth_names = opts[:debug_auth_names] || ['token']
535
+
536
+ new_options = opts.merge(
537
+ :operation => :"ObjectStoreApi.set_value_for_key",
538
+ :header_params => header_params,
539
+ :query_params => query_params,
540
+ :form_params => form_params,
541
+ :body => post_body,
542
+ :auth_names => auth_names,
543
+ :return_type => return_type
544
+ )
545
+
546
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
547
+ if @api_client.config.debugging
548
+ @api_client.config.logger.debug "API called: ObjectStoreApi#set_value_for_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
549
+ end
550
+ return data, status_code, headers
551
+ end
552
+ end
553
+ end
@@ -86,5 +86,92 @@ module Fastly
86
86
  end
87
87
  return data, status_code, headers
88
88
  end
89
+
90
+ # Update service settings
91
+ # Update the settings for a particular service and version. NOTE: If you override TTLs with custom VCL, any general.default_ttl value will not be honored and the expected behavior may change.
92
+ # @option opts [String] :service_id Alphanumeric string identifying the service. (required)
93
+ # @option opts [Integer] :version_id Integer identifying a service version. (required)
94
+ # @option opts [String] :general_default_host The default host name for the version.
95
+ # @option opts [Integer] :general_default_ttl The default time-to-live (TTL) for the version.
96
+ # @option opts [Boolean] :general_stale_if_error Enables serving a stale object if there is an error. (default to false)
97
+ # @option opts [Integer] :general_stale_if_error_ttl The default time-to-live (TTL) for serving the stale object for the version. (default to 43200)
98
+ # @return [SettingsResponse]
99
+ def update_service_settings(opts = {})
100
+ data, _status_code, _headers = update_service_settings_with_http_info(opts)
101
+ data
102
+ end
103
+
104
+ # Update service settings
105
+ # Update the settings for a particular service and version. NOTE: If you override TTLs with custom VCL, any general.default_ttl value will not be honored and the expected behavior may change.
106
+ # @option opts [String] :service_id Alphanumeric string identifying the service. (required)
107
+ # @option opts [Integer] :version_id Integer identifying a service version. (required)
108
+ # @option opts [String] :general_default_host The default host name for the version.
109
+ # @option opts [Integer] :general_default_ttl The default time-to-live (TTL) for the version.
110
+ # @option opts [Boolean] :general_stale_if_error Enables serving a stale object if there is an error. (default to false)
111
+ # @option opts [Integer] :general_stale_if_error_ttl The default time-to-live (TTL) for serving the stale object for the version. (default to 43200)
112
+ # @return [Array<(SettingsResponse, Integer, Hash)>] SettingsResponse data, response status code and response headers
113
+ def update_service_settings_with_http_info(opts = {})
114
+ if @api_client.config.debugging
115
+ @api_client.config.logger.debug 'Calling API: SettingsApi.update_service_settings ...'
116
+ end
117
+ # unbox the parameters from the hash
118
+ service_id = opts[:'service_id']
119
+ version_id = opts[:'version_id']
120
+ # verify the required parameter 'service_id' is set
121
+ if @api_client.config.client_side_validation && service_id.nil?
122
+ fail ArgumentError, "Missing the required parameter 'service_id' when calling SettingsApi.update_service_settings"
123
+ end
124
+ # verify the required parameter 'version_id' is set
125
+ if @api_client.config.client_side_validation && version_id.nil?
126
+ fail ArgumentError, "Missing the required parameter 'version_id' when calling SettingsApi.update_service_settings"
127
+ end
128
+ # resource path
129
+ local_var_path = '/service/{service_id}/version/{version_id}/settings'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'version_id' + '}', CGI.escape(version_id.to_s))
130
+
131
+ # query parameters
132
+ query_params = opts[:query_params] || {}
133
+
134
+ # header parameters
135
+ header_params = opts[:header_params] || {}
136
+ # HTTP header 'Accept' (if needed)
137
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
138
+ # HTTP header 'Content-Type'
139
+ content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
140
+ if !content_type.nil?
141
+ header_params['Content-Type'] = content_type
142
+ end
143
+
144
+ # form parameters
145
+ form_params = opts[:form_params] || {}
146
+ form_params['general.default_host'] = opts[:'general_default_host'] if !opts[:'general_default_host'].nil?
147
+ form_params['general.default_ttl'] = opts[:'general_default_ttl'] if !opts[:'general_default_ttl'].nil?
148
+ form_params['general.stale_if_error'] = opts[:'general_stale_if_error'] if !opts[:'general_stale_if_error'].nil?
149
+ form_params['general.stale_if_error_ttl'] = opts[:'general_stale_if_error_ttl'] if !opts[:'general_stale_if_error_ttl'].nil?
150
+
151
+ # http body (model)
152
+ post_body = opts[:debug_body]
153
+
154
+ # return_type
155
+ return_type = opts[:debug_return_type] || 'SettingsResponse'
156
+
157
+ # auth_names
158
+ auth_names = opts[:debug_auth_names] || ['token']
159
+
160
+ new_options = opts.merge(
161
+ :operation => :"SettingsApi.update_service_settings",
162
+ :header_params => header_params,
163
+ :query_params => query_params,
164
+ :form_params => form_params,
165
+ :body => post_body,
166
+ :auth_names => auth_names,
167
+ :return_type => return_type
168
+ )
169
+
170
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
171
+ if @api_client.config.debugging
172
+ @api_client.config.logger.debug "API called: SettingsApi#update_service_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
173
+ end
174
+ return data, status_code, headers
175
+ end
89
176
  end
90
177
  end
@@ -348,7 +348,7 @@ module Fastly
348
348
  end
349
349
 
350
350
  # Update a user
351
- # Update a user. Only users with the role of `superuser` can make changes to other users on the account. Non-superusers may use this endpoint to make changes to their own account. Modifications to `login` email require a valid password in the request body. Two-factor attributes are not editable via this endpoint.
351
+ # Update a user. Only users with the role of `superuser` can make changes to other users on the account. Non-superusers may use this endpoint to make changes to their own account. Two-factor attributes are not editable via this endpoint.
352
352
  # @option opts [String] :user_id Alphanumeric string identifying the user. (required)
353
353
  # @option opts [String] :login
354
354
  # @option opts [String] :name The real life name of the user.
@@ -365,7 +365,7 @@ module Fastly
365
365
  end
366
366
 
367
367
  # Update a user
368
- # Update a user. Only users with the role of &#x60;superuser&#x60; can make changes to other users on the account. Non-superusers may use this endpoint to make changes to their own account. Modifications to &#x60;login&#x60; email require a valid password in the request body. Two-factor attributes are not editable via this endpoint.
368
+ # Update a user. Only users with the role of &#x60;superuser&#x60; can make changes to other users on the account. Non-superusers may use this endpoint to make changes to their own account. Two-factor attributes are not editable via this endpoint.
369
369
  # @option opts [String] :user_id Alphanumeric string identifying the user. (required)
370
370
  # @option opts [String] :login
371
371
  # @option opts [String] :name The real life name of the user.