Class: SubskribeSandboxClient::CustomFieldApi

Inherits:
Object
  • Object
show all
Defined in:
lib/subskribe_sandbox/api/custom_field_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ CustomFieldApi

Returns a new instance of CustomFieldApi.



19
20
21
# File 'lib/subskribe_sandbox/api/custom_field_api.rb', line 19

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/subskribe_sandbox/api/custom_field_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_custom_field_definition(body, opts = {}) ⇒ String

Create a custom field definition Creates a new custom field definition for your tenant. On success the id of the custom field definition is returned.

Parameters:

  • body

    custom field definition values

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

    the optional parameters

Returns:

  • (String)


27
28
29
30
# File 'lib/subskribe_sandbox/api/custom_field_api.rb', line 27

def create_custom_field_definition(body, opts = {})
  data, _status_code, _headers = create_custom_field_definition_with_http_info(body, opts)
  data
end

#create_custom_field_definition_with_http_info(body, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Create a custom field definition Creates a new custom field definition for your tenant. On success the id of the custom field definition is returned.

Parameters:

  • body

    custom field definition values

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

    the optional parameters

Returns:

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

    String data, response status code and response headers



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
# File 'lib/subskribe_sandbox/api/custom_field_api.rb', line 37

def create_custom_field_definition_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomFieldApi.create_custom_field_definition ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CustomFieldApi.create_custom_field_definition"
  end
  # resource path
  local_var_path = '/customFieldDefinition'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomFieldApi#create_custom_field_definition\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_custom_field_definition(id, opts = {}) ⇒ CustomFieldDefinitionJson

Delete a custom field definition Deletes an existing custom field definition for your tenant. On success the deleted custom field definition object is returned.

Parameters:

  • id

    object type custom fields are attached to

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

    the optional parameters

Returns:



81
82
83
84
# File 'lib/subskribe_sandbox/api/custom_field_api.rb', line 81

def delete_custom_field_definition(id, opts = {})
  data, _status_code, _headers = delete_custom_field_definition_with_http_info(id, opts)
  data
end

#delete_custom_field_definition_with_http_info(id, opts = {}) ⇒ Array<(CustomFieldDefinitionJson, Fixnum, Hash)>

Delete a custom field definition Deletes an existing custom field definition for your tenant. On success the deleted custom field definition object is returned.

Parameters:

  • id

    object type custom fields are attached to

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

    the optional parameters

Returns:

  • (Array<(CustomFieldDefinitionJson, Fixnum, Hash)>)

    CustomFieldDefinitionJson data, response status code and response headers



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/subskribe_sandbox/api/custom_field_api.rb', line 91

def delete_custom_field_definition_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomFieldApi.delete_custom_field_definition ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling CustomFieldApi.delete_custom_field_definition"
  end
  # resource path
  local_var_path = '/customFieldDefinition/{id}'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CustomFieldDefinitionJson')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomFieldApi#delete_custom_field_definition\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_custom_field_definitions(parent_object_type, opts = {}) ⇒ Array<CustomFieldDefinitionJson>

Get custom field definitions Returns all custom field definitions for a specific parent object type

Parameters:

  • parent_object_type

    object type custom fields are attached to

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

    the optional parameters

Returns:



133
134
135
136
# File 'lib/subskribe_sandbox/api/custom_field_api.rb', line 133

def get_custom_field_definitions(parent_object_type, opts = {})
  data, _status_code, _headers = get_custom_field_definitions_with_http_info(parent_object_type, opts)
  data
end

#get_custom_field_definitions_with_http_info(parent_object_type, opts = {}) ⇒ Array<(Array<CustomFieldDefinitionJson>, Fixnum, Hash)>

Get custom field definitions Returns all custom field definitions for a specific parent object type

Parameters:

  • parent_object_type

    object type custom fields are attached to

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

    the optional parameters

Returns:

  • (Array<(Array<CustomFieldDefinitionJson>, Fixnum, Hash)>)

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



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/subskribe_sandbox/api/custom_field_api.rb', line 143

def get_custom_field_definitions_with_http_info(parent_object_type, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomFieldApi.get_custom_field_definitions ...'
  end
  # verify the required parameter 'parent_object_type' is set
  if @api_client.config.client_side_validation && parent_object_type.nil?
    fail ArgumentError, "Missing the required parameter 'parent_object_type' when calling CustomFieldApi.get_custom_field_definitions"
  end
  # resource path
  local_var_path = '/customFieldDefinition/{parentObjectType}'.sub('{' + 'parentObjectType' + '}', parent_object_type.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<CustomFieldDefinitionJson>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomFieldApi#get_custom_field_definitions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_custom_fields(parent_object_type, parent_object_id, opts = {}) ⇒ nil

Get custom fields by type and parent object id Returns all custom fields for a specific parent object type and id

Parameters:

  • parent_object_type

    object type custom fields are attached to

  • parent_object_id

    Id of the parent object

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

    the optional parameters

Returns:

  • (nil)


186
187
188
189
# File 'lib/subskribe_sandbox/api/custom_field_api.rb', line 186

def get_custom_fields(parent_object_type, parent_object_id, opts = {})
  get_custom_fields_with_http_info(parent_object_type, parent_object_id, opts)
  nil
end

#get_custom_fields_with_http_info(parent_object_type, parent_object_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Get custom fields by type and parent object id Returns all custom fields for a specific parent object type and id

Parameters:

  • parent_object_type

    object type custom fields are attached to

  • parent_object_id

    Id of the parent object

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

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
# File 'lib/subskribe_sandbox/api/custom_field_api.rb', line 197

def get_custom_fields_with_http_info(parent_object_type, parent_object_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomFieldApi.get_custom_fields ...'
  end
  # verify the required parameter 'parent_object_type' is set
  if @api_client.config.client_side_validation && parent_object_type.nil?
    fail ArgumentError, "Missing the required parameter 'parent_object_type' when calling CustomFieldApi.get_custom_fields"
  end
  # verify the required parameter 'parent_object_id' is set
  if @api_client.config.client_side_validation && parent_object_id.nil?
    fail ArgumentError, "Missing the required parameter 'parent_object_id' when calling CustomFieldApi.get_custom_fields"
  end
  # resource path
  local_var_path = '/customField/{parentObjectType}/{parentObjectId}'.sub('{' + 'parentObjectType' + '}', parent_object_type.to_s).sub('{' + 'parentObjectId' + '}', parent_object_id.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomFieldApi#get_custom_fields\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_custom_field(parent_object_type, parent_object_id, custom_field_name, body, opts = {}) ⇒ nil

Update an existing set of custom fields Updates an existing set of custom fields for a given parent object type and id. On success the update custom fields are returned.

Parameters:

  • parent_object_type

    object type custom fields are attached to

  • parent_object_id

    Id of the parent object

  • custom_field_name

    Name of the custom field to be updated

  • body

    custom field value

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

    the optional parameters

Returns:

  • (nil)


245
246
247
248
# File 'lib/subskribe_sandbox/api/custom_field_api.rb', line 245

def update_custom_field(parent_object_type, parent_object_id, custom_field_name, body, opts = {})
  update_custom_field_with_http_info(parent_object_type, parent_object_id, custom_field_name, body, opts)
  nil
end

#update_custom_field_definition(id, body, opts = {}) ⇒ CustomFieldDefinitionJson

Update an existing custom field definition Updates an existing custom field definition for your tenant. On success the update custom field definition is returned.

Parameters:

  • id
  • body

    custom field definition values

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

    the optional parameters

Returns:



314
315
316
317
# File 'lib/subskribe_sandbox/api/custom_field_api.rb', line 314

def update_custom_field_definition(id, body, opts = {})
  data, _status_code, _headers = update_custom_field_definition_with_http_info(id, body, opts)
  data
end

#update_custom_field_definition_with_http_info(id, body, opts = {}) ⇒ Array<(CustomFieldDefinitionJson, Fixnum, Hash)>

Update an existing custom field definition Updates an existing custom field definition for your tenant. On success the update custom field definition is returned.

Parameters:

  • id
  • body

    custom field definition values

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

    the optional parameters

Returns:

  • (Array<(CustomFieldDefinitionJson, Fixnum, Hash)>)

    CustomFieldDefinitionJson data, response status code and response headers



325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
# File 'lib/subskribe_sandbox/api/custom_field_api.rb', line 325

def update_custom_field_definition_with_http_info(id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomFieldApi.update_custom_field_definition ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling CustomFieldApi.update_custom_field_definition"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CustomFieldApi.update_custom_field_definition"
  end
  # resource path
  local_var_path = '/customFieldDefinition/{id}'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CustomFieldDefinitionJson')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomFieldApi#update_custom_field_definition\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_custom_field_with_http_info(parent_object_type, parent_object_id, custom_field_name, body, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Update an existing set of custom fields Updates an existing set of custom fields for a given parent object type and id. On success the update custom fields are returned.

Parameters:

  • parent_object_type

    object type custom fields are attached to

  • parent_object_id

    Id of the parent object

  • custom_field_name

    Name of the custom field to be updated

  • body

    custom field value

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

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



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
303
304
305
306
307
# File 'lib/subskribe_sandbox/api/custom_field_api.rb', line 258

def update_custom_field_with_http_info(parent_object_type, parent_object_id, custom_field_name, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomFieldApi.update_custom_field ...'
  end
  # verify the required parameter 'parent_object_type' is set
  if @api_client.config.client_side_validation && parent_object_type.nil?
    fail ArgumentError, "Missing the required parameter 'parent_object_type' when calling CustomFieldApi.update_custom_field"
  end
  # verify the required parameter 'parent_object_id' is set
  if @api_client.config.client_side_validation && parent_object_id.nil?
    fail ArgumentError, "Missing the required parameter 'parent_object_id' when calling CustomFieldApi.update_custom_field"
  end
  # verify the required parameter 'custom_field_name' is set
  if @api_client.config.client_side_validation && custom_field_name.nil?
    fail ArgumentError, "Missing the required parameter 'custom_field_name' when calling CustomFieldApi.update_custom_field"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CustomFieldApi.update_custom_field"
  end
  # resource path
  local_var_path = '/customField/{parentObjectType}/{parentObjectId}/{customFieldName}'.sub('{' + 'parentObjectType' + '}', parent_object_type.to_s).sub('{' + 'parentObjectId' + '}', parent_object_id.to_s).sub('{' + 'customFieldName' + '}', custom_field_name.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomFieldApi#update_custom_field\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_custom_fields(parent_object_type, parent_object_id, body, opts = {}) ⇒ nil

Update an existing set of custom fields Updates an existing set of custom fields for a given parent object type and id. On success the update custom fields are returned.

Parameters:

  • parent_object_type

    object type custom fields are attached to

  • parent_object_id

    Id of the parent object

  • body

    custom field values

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

    the optional parameters

Returns:

  • (nil)


375
376
377
378
# File 'lib/subskribe_sandbox/api/custom_field_api.rb', line 375

def update_custom_fields(parent_object_type, parent_object_id, body, opts = {})
  update_custom_fields_with_http_info(parent_object_type, parent_object_id, body, opts)
  nil
end

#update_custom_fields_with_http_info(parent_object_type, parent_object_id, body, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Update an existing set of custom fields Updates an existing set of custom fields for a given parent object type and id. On success the update custom fields are returned.

Parameters:

  • parent_object_type

    object type custom fields are attached to

  • parent_object_id

    Id of the parent object

  • body

    custom field values

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

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
# File 'lib/subskribe_sandbox/api/custom_field_api.rb', line 387

def update_custom_fields_with_http_info(parent_object_type, parent_object_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomFieldApi.update_custom_fields ...'
  end
  # verify the required parameter 'parent_object_type' is set
  if @api_client.config.client_side_validation && parent_object_type.nil?
    fail ArgumentError, "Missing the required parameter 'parent_object_type' when calling CustomFieldApi.update_custom_fields"
  end
  # verify the required parameter 'parent_object_id' is set
  if @api_client.config.client_side_validation && parent_object_id.nil?
    fail ArgumentError, "Missing the required parameter 'parent_object_id' when calling CustomFieldApi.update_custom_fields"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CustomFieldApi.update_custom_fields"
  end
  # resource path
  local_var_path = '/customField/{parentObjectType}/{parentObjectId}'.sub('{' + 'parentObjectType' + '}', parent_object_type.to_s).sub('{' + 'parentObjectId' + '}', parent_object_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomFieldApi#update_custom_fields\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end