Class: Fastly::ConfigStoreItemApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ConfigStoreItemApi

Returns a new instance of ConfigStoreItemApi.



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

def api_client
  @api_client
end

Instance Method Details

#bulk_update_config_store_item(opts = {}) ⇒ InlineResponse200

Update multiple entries in a config store Add multiple key-value pairs to an individual config store, specified by ID.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :config_store_id (String)

    An alphanumeric string identifying the config store. (required)

  • :bulk_update_config_store_list_request (BulkUpdateConfigStoreListRequest)

Returns:



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

def bulk_update_config_store_item(opts = {})
  data, _status_code, _headers = bulk_update_config_store_item_with_http_info(opts)
  data
end

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

Update multiple entries in a config store Add multiple key-value pairs to an individual config store, specified by ID.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :config_store_id (String)

    An alphanumeric string identifying the config store. (required)

  • :bulk_update_config_store_list_request (BulkUpdateConfigStoreListRequest)

Returns:

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

    InlineResponse200 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/config_store_item_api.rb', line 35

def bulk_update_config_store_item_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConfigStoreItemApi.bulk_update_config_store_item ...'
  end
  # unbox the parameters from the hash
  config_store_id = opts[:'config_store_id']
  # verify the required parameter 'config_store_id' is set
  if @api_client.config.client_side_validation && config_store_id.nil?
    fail ArgumentError, "Missing the required parameter 'config_store_id' when calling ConfigStoreItemApi.bulk_update_config_store_item"
  end
  # resource path
  local_var_path = '/resources/stores/config/{config_store_id}/items'.sub('{' + 'config_store_id' + '}', CGI.escape(config_store_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(opts[:'bulk_update_config_store_list_request'])

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

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

  new_options = opts.merge(
    :operation => :"ConfigStoreItemApi.bulk_update_config_store_item",
    :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(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ConfigStoreItemApi#bulk_update_config_store_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_config_store_item(opts = {}) ⇒ ConfigStoreItemResponse

Create an entry in a config store Add a single key-value pair to an individual config store, specified by ID.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :config_store_id (String)

    An alphanumeric string identifying the config store. (required)

  • :item_key (String)

    Item key, maximum 256 characters.

  • :item_value (String)

    Item value, maximum 8000 characters.

Returns:



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

def create_config_store_item(opts = {})
  data, _status_code, _headers = create_config_store_item_with_http_info(opts)
  data
end

#create_config_store_item_with_http_info(opts = {}) ⇒ Array<(ConfigStoreItemResponse, Integer, Hash)>

Create an entry in a config store Add a single key-value pair to an individual config store, specified by ID.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :config_store_id (String)

    An alphanumeric string identifying the config store. (required)

  • :item_key (String)

    Item key, maximum 256 characters.

  • :item_value (String)

    Item value, maximum 8000 characters.

Returns:

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

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

def create_config_store_item_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConfigStoreItemApi.create_config_store_item ...'
  end
  # unbox the parameters from the hash
  config_store_id = opts[:'config_store_id']
  # verify the required parameter 'config_store_id' is set
  if @api_client.config.client_side_validation && config_store_id.nil?
    fail ArgumentError, "Missing the required parameter 'config_store_id' when calling ConfigStoreItemApi.create_config_store_item"
  end
  # resource path
  local_var_path = '/resources/stores/config/{config_store_id}/item'.sub('{' + 'config_store_id' + '}', CGI.escape(config_store_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['item_key'] = opts[:'item_key'] if !opts[:'item_key'].nil?
  form_params['item_value'] = opts[:'item_value'] if !opts[:'item_value'].nil?

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

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

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

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

#delete_config_store_item(opts = {}) ⇒ InlineResponse200

Delete an item from a config store Delete an entry in a config store given a config store ID, and item key.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :config_store_id (String)

    An alphanumeric string identifying the config store. (required)

  • :config_store_item_key (String)

    Item key, maximum 256 characters. (required)

Returns:



169
170
171
172
# File 'lib/fastly/api/config_store_item_api.rb', line 169

def delete_config_store_item(opts = {})
  data, _status_code, _headers = delete_config_store_item_with_http_info(opts)
  data
end

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

Delete an item from a config store Delete an entry in a config store given a config store ID, and item key.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :config_store_id (String)

    An alphanumeric string identifying the config store. (required)

  • :config_store_item_key (String)

    Item key, maximum 256 characters. (required)

Returns:

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

    InlineResponse200 data, response status code and response headers



179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
# File 'lib/fastly/api/config_store_item_api.rb', line 179

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

#get_config_store_item(opts = {}) ⇒ ConfigStoreItemResponse

Get an item from a config store Retrieve a config store entry given a config store ID and item key.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :config_store_id (String)

    An alphanumeric string identifying the config store. (required)

  • :config_store_item_key (String)

    Item key, maximum 256 characters. (required)

Returns:



239
240
241
242
# File 'lib/fastly/api/config_store_item_api.rb', line 239

def get_config_store_item(opts = {})
  data, _status_code, _headers = get_config_store_item_with_http_info(opts)
  data
end

#get_config_store_item_with_http_info(opts = {}) ⇒ Array<(ConfigStoreItemResponse, Integer, Hash)>

Get an item from a config store Retrieve a config store entry given a config store ID and item key.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :config_store_id (String)

    An alphanumeric string identifying the config store. (required)

  • :config_store_item_key (String)

    Item key, maximum 256 characters. (required)

Returns:

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

    ConfigStoreItemResponse data, response status code and response headers



249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
# File 'lib/fastly/api/config_store_item_api.rb', line 249

def get_config_store_item_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConfigStoreItemApi.get_config_store_item ...'
  end
  # unbox the parameters from the hash
  config_store_id = opts[:'config_store_id']
  config_store_item_key = opts[:'config_store_item_key']
  # verify the required parameter 'config_store_id' is set
  if @api_client.config.client_side_validation && config_store_id.nil?
    fail ArgumentError, "Missing the required parameter 'config_store_id' when calling ConfigStoreItemApi.get_config_store_item"
  end
  # verify the required parameter 'config_store_item_key' is set
  if @api_client.config.client_side_validation && config_store_item_key.nil?
    fail ArgumentError, "Missing the required parameter 'config_store_item_key' when calling ConfigStoreItemApi.get_config_store_item"
  end
  # resource path
  local_var_path = '/resources/stores/config/{config_store_id}/item/{config_store_item_key}'.sub('{' + 'config_store_id' + '}', CGI.escape(config_store_id.to_s)).sub('{' + 'config_store_item_key' + '}', CGI.escape(config_store_item_key.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] || 'ConfigStoreItemResponse'

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

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

#list_config_store_items(opts = {}) ⇒ Array<ConfigStoreItemResponse>

List items in a config store List the key-value pairs associated with a given config store ID.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :config_store_id (String)

    An alphanumeric string identifying the config store. (required)

Returns:



308
309
310
311
# File 'lib/fastly/api/config_store_item_api.rb', line 308

def list_config_store_items(opts = {})
  data, _status_code, _headers = list_config_store_items_with_http_info(opts)
  data
end

#list_config_store_items_with_http_info(opts = {}) ⇒ Array<(Array<ConfigStoreItemResponse>, Integer, Hash)>

List items in a config store List the key-value pairs associated with a given config store ID.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :config_store_id (String)

    An alphanumeric string identifying the config store. (required)

Returns:

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

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



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

def list_config_store_items_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConfigStoreItemApi.list_config_store_items ...'
  end
  # unbox the parameters from the hash
  config_store_id = opts[:'config_store_id']
  # verify the required parameter 'config_store_id' is set
  if @api_client.config.client_side_validation && config_store_id.nil?
    fail ArgumentError, "Missing the required parameter 'config_store_id' when calling ConfigStoreItemApi.list_config_store_items"
  end
  # resource path
  local_var_path = '/resources/stores/config/{config_store_id}/items'.sub('{' + 'config_store_id' + '}', CGI.escape(config_store_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<ConfigStoreItemResponse>'

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

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

#update_config_store_item(opts = {}) ⇒ ConfigStoreItemResponse

Update an entry in a config store Update an entry in a config store given a config store ID, item key, and item value.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :config_store_id (String)

    An alphanumeric string identifying the config store. (required)

  • :config_store_item_key (String)

    Item key, maximum 256 characters. (required)

  • :item_key (String)

    Item key, maximum 256 characters.

  • :item_value (String)

    Item value, maximum 8000 characters.

Returns:



374
375
376
377
# File 'lib/fastly/api/config_store_item_api.rb', line 374

def update_config_store_item(opts = {})
  data, _status_code, _headers = update_config_store_item_with_http_info(opts)
  data
end

#update_config_store_item_with_http_info(opts = {}) ⇒ Array<(ConfigStoreItemResponse, Integer, Hash)>

Update an entry in a config store Update an entry in a config store given a config store ID, item key, and item value.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :config_store_id (String)

    An alphanumeric string identifying the config store. (required)

  • :config_store_item_key (String)

    Item key, maximum 256 characters. (required)

  • :item_key (String)

    Item key, maximum 256 characters.

  • :item_value (String)

    Item value, maximum 8000 characters.

Returns:

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

    ConfigStoreItemResponse data, response status code and response headers



386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
# File 'lib/fastly/api/config_store_item_api.rb', line 386

def update_config_store_item_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConfigStoreItemApi.update_config_store_item ...'
  end
  # unbox the parameters from the hash
  config_store_id = opts[:'config_store_id']
  config_store_item_key = opts[:'config_store_item_key']
  # verify the required parameter 'config_store_id' is set
  if @api_client.config.client_side_validation && config_store_id.nil?
    fail ArgumentError, "Missing the required parameter 'config_store_id' when calling ConfigStoreItemApi.update_config_store_item"
  end
  # verify the required parameter 'config_store_item_key' is set
  if @api_client.config.client_side_validation && config_store_item_key.nil?
    fail ArgumentError, "Missing the required parameter 'config_store_item_key' when calling ConfigStoreItemApi.update_config_store_item"
  end
  # resource path
  local_var_path = '/resources/stores/config/{config_store_id}/item/{config_store_item_key}'.sub('{' + 'config_store_id' + '}', CGI.escape(config_store_id.to_s)).sub('{' + 'config_store_item_key' + '}', CGI.escape(config_store_item_key.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['item_key'] = opts[:'item_key'] if !opts[:'item_key'].nil?
  form_params['item_value'] = opts[:'item_value'] if !opts[:'item_value'].nil?

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

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

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

  new_options = opts.merge(
    :operation => :"ConfigStoreItemApi.update_config_store_item",
    :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(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ConfigStoreItemApi#update_config_store_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#upsert_config_store_item(opts = {}) ⇒ ConfigStoreItemResponse

Insert or update an entry in a config store Insert or update an entry in a config store given a config store ID, item key, and item value.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :config_store_id (String)

    An alphanumeric string identifying the config store. (required)

  • :config_store_item_key (String)

    Item key, maximum 256 characters. (required)

  • :item_key (String)

    Item key, maximum 256 characters.

  • :item_value (String)

    Item value, maximum 8000 characters.

Returns:



455
456
457
458
# File 'lib/fastly/api/config_store_item_api.rb', line 455

def upsert_config_store_item(opts = {})
  data, _status_code, _headers = upsert_config_store_item_with_http_info(opts)
  data
end

#upsert_config_store_item_with_http_info(opts = {}) ⇒ Array<(ConfigStoreItemResponse, Integer, Hash)>

Insert or update an entry in a config store Insert or update an entry in a config store given a config store ID, item key, and item value.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :config_store_id (String)

    An alphanumeric string identifying the config store. (required)

  • :config_store_item_key (String)

    Item key, maximum 256 characters. (required)

  • :item_key (String)

    Item key, maximum 256 characters.

  • :item_value (String)

    Item value, maximum 8000 characters.

Returns:

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

    ConfigStoreItemResponse data, response status code and response headers



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
516
517
518
519
520
521
522
523
524
525
526
527
# File 'lib/fastly/api/config_store_item_api.rb', line 467

def upsert_config_store_item_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConfigStoreItemApi.upsert_config_store_item ...'
  end
  # unbox the parameters from the hash
  config_store_id = opts[:'config_store_id']
  config_store_item_key = opts[:'config_store_item_key']
  # verify the required parameter 'config_store_id' is set
  if @api_client.config.client_side_validation && config_store_id.nil?
    fail ArgumentError, "Missing the required parameter 'config_store_id' when calling ConfigStoreItemApi.upsert_config_store_item"
  end
  # verify the required parameter 'config_store_item_key' is set
  if @api_client.config.client_side_validation && config_store_item_key.nil?
    fail ArgumentError, "Missing the required parameter 'config_store_item_key' when calling ConfigStoreItemApi.upsert_config_store_item"
  end
  # resource path
  local_var_path = '/resources/stores/config/{config_store_id}/item/{config_store_item_key}'.sub('{' + 'config_store_id' + '}', CGI.escape(config_store_id.to_s)).sub('{' + 'config_store_item_key' + '}', CGI.escape(config_store_item_key.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['item_key'] = opts[:'item_key'] if !opts[:'item_key'].nil?
  form_params['item_value'] = opts[:'item_value'] if !opts[:'item_value'].nil?

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

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

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

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