Class: UltracartClient::GiftCertificateApi

Inherits:
Object
  • Object
show all
Defined in:
lib/ultracart_api/api/gift_certificate_api.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ GiftCertificateApi

Returns a new instance of GiftCertificateApi.



19
20
21
# File 'lib/ultracart_api/api/gift_certificate_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/ultracart_api/api/gift_certificate_api.rb', line 17

def api_client
  @api_client
end

Class Method Details

.new_using_api_key(simple_key, verify_ssl = true, debugging = false) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/ultracart_api/api/gift_certificate_api.rb', line 23

def self.new_using_api_key(simple_key, verify_ssl = true, debugging = false)
  api_config = Configuration.new
  api_config.api_key_prefix['x-ultracart-simple-key'] = simple_key
  api_config.api_version = '2017-03-01'
  api_config.verify_ssl = verify_ssl

  api_client = ApiClient.new(api_config)
  api_client.config.debugging = debugging

  UltracartClient::GiftCertificateApi.new(api_client)
end

Instance Method Details

#add_gift_certificate_ledger_entry(gift_certificate_oid, gift_certificate_ledger_entry, opts = {}) ⇒ GiftCertificateResponse

Add a gift certificate ledger entry Adds a ledger entry for this gift certificate.

Parameters:

  • gift_certificate_oid
  • gift_certificate_ledger_entry

    Gift certificate ledger entry

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

    the optional parameters

Returns:



41
42
43
44
# File 'lib/ultracart_api/api/gift_certificate_api.rb', line 41

def add_gift_certificate_ledger_entry(gift_certificate_oid, gift_certificate_ledger_entry, opts = {})
  data, _status_code, _headers = add_gift_certificate_ledger_entry_with_http_info(gift_certificate_oid, gift_certificate_ledger_entry, opts)
  data
end

#add_gift_certificate_ledger_entry_with_http_info(gift_certificate_oid, gift_certificate_ledger_entry, opts = {}) ⇒ Array<(GiftCertificateResponse, Fixnum, Hash)>

Add a gift certificate ledger entry Adds a ledger entry for this gift certificate.

Parameters:

  • gift_certificate_oid
  • gift_certificate_ledger_entry

    Gift certificate ledger entry

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

    the optional parameters

Returns:

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

    GiftCertificateResponse data, response status code and response headers



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
# File 'lib/ultracart_api/api/gift_certificate_api.rb', line 52

def add_gift_certificate_ledger_entry_with_http_info(gift_certificate_oid, gift_certificate_ledger_entry, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: GiftCertificateApi.add_gift_certificate_ledger_entry ...'
  end
  # verify the required parameter 'gift_certificate_oid' is set
  if @api_client.config.client_side_validation && gift_certificate_oid.nil?
    fail ArgumentError, "Missing the required parameter 'gift_certificate_oid' when calling GiftCertificateApi.add_gift_certificate_ledger_entry"
  end
  # verify the required parameter 'gift_certificate_ledger_entry' is set
  if @api_client.config.client_side_validation && gift_certificate_ledger_entry.nil?
    fail ArgumentError, "Missing the required parameter 'gift_certificate_ledger_entry' when calling GiftCertificateApi.add_gift_certificate_ledger_entry"
  end
  # resource path
  local_var_path = '/gift_certificate/gift_certificates/{gift_certificate_oid}/ledger_entry'.sub('{' + 'gift_certificate_oid' + '}', gift_certificate_oid.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # 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(gift_certificate_ledger_entry)
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  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 => 'GiftCertificateResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: GiftCertificateApi#add_gift_certificate_ledger_entry\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_gift_certificate(gift_certificate_create_request, opts = {}) ⇒ GiftCertificateResponse

Create a gift certificate Creates a gift certificate for this merchant account.

Parameters:

  • gift_certificate_create_request

    Gift certificate create request

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

    the optional parameters

Returns:



101
102
103
104
# File 'lib/ultracart_api/api/gift_certificate_api.rb', line 101

def create_gift_certificate(gift_certificate_create_request, opts = {})
  data, _status_code, _headers = create_gift_certificate_with_http_info(gift_certificate_create_request, opts)
  data
end

#create_gift_certificate_with_http_info(gift_certificate_create_request, opts = {}) ⇒ Array<(GiftCertificateResponse, Fixnum, Hash)>

Create a gift certificate Creates a gift certificate for this merchant account.

Parameters:

  • gift_certificate_create_request

    Gift certificate create request

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

    the optional parameters

Returns:

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

    GiftCertificateResponse data, response status code and response headers



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
# File 'lib/ultracart_api/api/gift_certificate_api.rb', line 111

def create_gift_certificate_with_http_info(gift_certificate_create_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: GiftCertificateApi.create_gift_certificate ...'
  end
  # verify the required parameter 'gift_certificate_create_request' is set
  if @api_client.config.client_side_validation && gift_certificate_create_request.nil?
    fail ArgumentError, "Missing the required parameter 'gift_certificate_create_request' when calling GiftCertificateApi.create_gift_certificate"
  end
  # resource path
  local_var_path = '/gift_certificate/gift_certificates'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # 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(gift_certificate_create_request)
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  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 => 'GiftCertificateResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: GiftCertificateApi#create_gift_certificate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_gift_certificate(gift_certificate_oid, opts = {}) ⇒ nil

Delete a gift certificate Deletes a gift certificate for this merchant account.

Parameters:

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

    the optional parameters

Returns:

  • (nil)


156
157
158
159
# File 'lib/ultracart_api/api/gift_certificate_api.rb', line 156

def delete_gift_certificate(gift_certificate_oid, opts = {})
  delete_gift_certificate_with_http_info(gift_certificate_oid, opts)
  nil
end

#delete_gift_certificate_with_http_info(gift_certificate_oid, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete a gift certificate Deletes a gift certificate for this merchant account.

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



166
167
168
169
170
171
172
173
174
175
176
177
178
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
# File 'lib/ultracart_api/api/gift_certificate_api.rb', line 166

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

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # 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 = nil
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: GiftCertificateApi#delete_gift_certificate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_gift_certificate_by_code(code, opts = {}) ⇒ GiftCertificateResponse

Retrieve gift certificate by code Retrieves a gift certificate from the account based on the code (the value the customer enters at checkout time).

Parameters:

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

    the optional parameters

Returns:



210
211
212
213
# File 'lib/ultracart_api/api/gift_certificate_api.rb', line 210

def get_gift_certificate_by_code(code, opts = {})
  data, _status_code, _headers = get_gift_certificate_by_code_with_http_info(code, opts)
  data
end

#get_gift_certificate_by_code_with_http_info(code, opts = {}) ⇒ Array<(GiftCertificateResponse, Fixnum, Hash)>

Retrieve gift certificate by code Retrieves a gift certificate from the account based on the code (the value the customer enters at checkout time).

Parameters:

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

    the optional parameters

Returns:

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

    GiftCertificateResponse data, response status code and response headers



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/ultracart_api/api/gift_certificate_api.rb', line 220

def get_gift_certificate_by_code_with_http_info(code, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: GiftCertificateApi.get_gift_certificate_by_code ...'
  end
  # verify the required parameter 'code' is set
  if @api_client.config.client_side_validation && code.nil?
    fail ArgumentError, "Missing the required parameter 'code' when calling GiftCertificateApi.get_gift_certificate_by_code"
  end
  # resource path
  local_var_path = '/gift_certificate/gift_certificates/by_code/{code}'.sub('{' + 'code' + '}', code.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # 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 = nil
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  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 => 'GiftCertificateResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: GiftCertificateApi#get_gift_certificate_by_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_gift_certificate_by_oid(gift_certificate_oid, opts = {}) ⇒ GiftCertificateResponse

Retrieve gift certificate by oid Retrieves a gift certificate from the account based on the internal primary key.

Parameters:

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

    the optional parameters

Returns:



265
266
267
268
# File 'lib/ultracart_api/api/gift_certificate_api.rb', line 265

def get_gift_certificate_by_oid(gift_certificate_oid, opts = {})
  data, _status_code, _headers = get_gift_certificate_by_oid_with_http_info(gift_certificate_oid, opts)
  data
end

#get_gift_certificate_by_oid_with_http_info(gift_certificate_oid, opts = {}) ⇒ Array<(GiftCertificateResponse, Fixnum, Hash)>

Retrieve gift certificate by oid Retrieves a gift certificate from the account based on the internal primary key.

Parameters:

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

    the optional parameters

Returns:

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

    GiftCertificateResponse data, response status code and response headers



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
308
309
310
311
312
313
314
# File 'lib/ultracart_api/api/gift_certificate_api.rb', line 275

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

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # 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 = nil
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  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 => 'GiftCertificateResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: GiftCertificateApi#get_gift_certificate_by_oid\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_gift_certificates_by_email(email, opts = {}) ⇒ GiftCertificatesResponse

Retrieve gift certificate by email Retrieves all gift certificates from the account based on customer email.

Parameters:

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

    the optional parameters

Returns:



320
321
322
323
# File 'lib/ultracart_api/api/gift_certificate_api.rb', line 320

def get_gift_certificates_by_email(email, opts = {})
  data, _status_code, _headers = get_gift_certificates_by_email_with_http_info(email, opts)
  data
end

#get_gift_certificates_by_email_with_http_info(email, opts = {}) ⇒ Array<(GiftCertificatesResponse, Fixnum, Hash)>

Retrieve gift certificate by email Retrieves all gift certificates from the account based on customer email.

Parameters:

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

    the optional parameters

Returns:

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

    GiftCertificatesResponse data, response status code and response headers



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

def get_gift_certificates_by_email_with_http_info(email, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: GiftCertificateApi.get_gift_certificates_by_email ...'
  end
  # verify the required parameter 'email' is set
  if @api_client.config.client_side_validation && email.nil?
    fail ArgumentError, "Missing the required parameter 'email' when calling GiftCertificateApi.get_gift_certificates_by_email"
  end
  # resource path
  local_var_path = '/gift_certificate/gift_certificates/by_email/{email}'.sub('{' + 'email' + '}', email.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # 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 = nil
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  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 => 'GiftCertificatesResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: GiftCertificateApi#get_gift_certificates_by_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_gift_certificates_by_query(gift_certificate_query, opts = {}) ⇒ GiftCertificatesResponse

Retrieve gift certificates by query Retrieves gift certificates from the account. If no parameters are specified, all gift certificates will be returned. You will need to make multiple API calls in order to retrieve the entire result set since this API performs result set pagination.

Parameters:

  • gift_certificate_query

    Gift certificates query

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

    the optional parameters

Options Hash (opts):

  • :_limit (Integer)

    The maximum number of records to return on this one API call. (Max 200) (default to 100)

  • :_offset (Integer)

    Pagination of the record set. Offset is a zero based index. (default to 0)

  • :_since (String)

    Fetch customers that have been created/modified since this date/time.

  • :_sort (String)

    The sort order of the customers. See Sorting documentation for examples of using multiple values and sorting by ascending and descending.

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

Returns:



380
381
382
383
# File 'lib/ultracart_api/api/gift_certificate_api.rb', line 380

def get_gift_certificates_by_query(gift_certificate_query, opts = {})
  data, _status_code, _headers = get_gift_certificates_by_query_with_http_info(gift_certificate_query, opts)
  data
end

#get_gift_certificates_by_query_with_http_info(gift_certificate_query, opts = {}) ⇒ Array<(GiftCertificatesResponse, Fixnum, Hash)>

Retrieve gift certificates by query Retrieves gift certificates from the account. If no parameters are specified, all gift certificates will be returned. You will need to make multiple API calls in order to retrieve the entire result set since this API performs result set pagination.

Parameters:

  • gift_certificate_query

    Gift certificates query

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

    the optional parameters

Options Hash (opts):

  • :_limit (Integer)

    The maximum number of records to return on this one API call. (Max 200)

  • :_offset (Integer)

    Pagination of the record set. Offset is a zero based index.

  • :_since (String)

    Fetch customers that have been created/modified since this date/time.

  • :_sort (String)

    The sort order of the customers. See Sorting documentation for examples of using multiple values and sorting by ascending and descending.

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

Returns:

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

    GiftCertificatesResponse data, response status code and response headers



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
# File 'lib/ultracart_api/api/gift_certificate_api.rb', line 395

def get_gift_certificates_by_query_with_http_info(gift_certificate_query, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: GiftCertificateApi.get_gift_certificates_by_query ...'
  end
  # verify the required parameter 'gift_certificate_query' is set
  if @api_client.config.client_side_validation && gift_certificate_query.nil?
    fail ArgumentError, "Missing the required parameter 'gift_certificate_query' when calling GiftCertificateApi.get_gift_certificates_by_query"
  end
  # resource path
  local_var_path = '/gift_certificate/gift_certificates/query'

  # query parameters
  query_params = {}
  query_params[:'_limit'] = opts[:'_limit'] if !opts[:'_limit'].nil?
  query_params[:'_offset'] = opts[:'_offset'] if !opts[:'_offset'].nil?
  query_params[:'_since'] = opts[:'_since'] if !opts[:'_since'].nil?
  query_params[:'_sort'] = opts[:'_sort'] if !opts[:'_sort'].nil?
  query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil?

  # header parameters
  header_params = {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # 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(gift_certificate_query)
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  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 => 'GiftCertificatesResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: GiftCertificateApi#get_gift_certificates_by_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_gift_certificate(gift_certificate_oid, gift_certificate, opts = {}) ⇒ GiftCertificateResponse

Update a gift certificate Update a gift certificate for this merchant account.

Parameters:

  • gift_certificate_oid
  • gift_certificate

    Gift certificate

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

    the optional parameters

Returns:



446
447
448
449
# File 'lib/ultracart_api/api/gift_certificate_api.rb', line 446

def update_gift_certificate(gift_certificate_oid, gift_certificate, opts = {})
  data, _status_code, _headers = update_gift_certificate_with_http_info(gift_certificate_oid, gift_certificate, opts)
  data
end

#update_gift_certificate_with_http_info(gift_certificate_oid, gift_certificate, opts = {}) ⇒ Array<(GiftCertificateResponse, Fixnum, Hash)>

Update a gift certificate Update a gift certificate for this merchant account.

Parameters:

  • gift_certificate_oid
  • gift_certificate

    Gift certificate

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

    the optional parameters

Returns:

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

    GiftCertificateResponse data, response status code and response headers



457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
# File 'lib/ultracart_api/api/gift_certificate_api.rb', line 457

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

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # 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(gift_certificate)
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  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 => 'GiftCertificateResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: GiftCertificateApi#update_gift_certificate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end