Class: Zippendo::BrandsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/zippendo/api/brands_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ BrandsApi

Returns a new instance of BrandsApi.



19
20
21
# File 'lib/zippendo/api/brands_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/zippendo/api/brands_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#archive_org_brand(org_id, brand_id, opts = {}) ⇒ ListOrgBrands200ResponseDataInner

Archive brand Archives a brand: it leaves the brand switcher and default listings, but its orders, shipments and settings are retained and remain visible in the organization-wide view.

Parameters:

  • org_id (String)

    Organization ID

  • brand_id (String)

    Brand ID

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

    the optional parameters

Returns:



28
29
30
31
# File 'lib/zippendo/api/brands_api.rb', line 28

def archive_org_brand(org_id, brand_id, opts = {})
  data, _status_code, _headers = archive_org_brand_with_http_info(org_id, brand_id, opts)
  data
end

#archive_org_brand_with_http_info(org_id, brand_id, opts = {}) ⇒ Array<(ListOrgBrands200ResponseDataInner, Integer, Hash)>

Archive brand Archives a brand: it leaves the brand switcher and default listings, but its orders, shipments and settings are retained and remain visible in the organization-wide view.

Parameters:

  • org_id (String)

    Organization ID

  • brand_id (String)

    Brand ID

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

    the optional parameters

Returns:



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
89
# File 'lib/zippendo/api/brands_api.rb', line 39

def archive_org_brand_with_http_info(org_id, brand_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BrandsApi.archive_org_brand ...'
  end
  # verify the required parameter 'org_id' is set
  if @api_client.config.client_side_validation && org_id.nil?
    fail ArgumentError, "Missing the required parameter 'org_id' when calling BrandsApi.archive_org_brand"
  end
  # verify the required parameter 'brand_id' is set
  if @api_client.config.client_side_validation && brand_id.nil?
    fail ArgumentError, "Missing the required parameter 'brand_id' when calling BrandsApi.archive_org_brand"
  end
  # resource path
  local_var_path = '/orgs/{orgId}/brands/{brandId}/archive'.sub('{orgId}', CGI.escape(org_id.to_s)).sub('{brandId}', CGI.escape(brand_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']) unless header_params['Accept']

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

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

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

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

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

#check_brand_slug(org_id, slug, opts = {}) ⇒ CheckBrandSlug200Response

Check brand slug availability Reports whether a brand slug is free within this organization. Brand slugs are unique per organization, so the same slug may exist in another organization. Archived brands still hold their slug.

Parameters:

  • org_id (String)

    Organization ID

  • slug (String)

    Brand slug to check

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

    the optional parameters

Returns:



97
98
99
100
# File 'lib/zippendo/api/brands_api.rb', line 97

def check_brand_slug(org_id, slug, opts = {})
  data, _status_code, _headers = check_brand_slug_with_http_info(org_id, slug, opts)
  data
end

#check_brand_slug_with_http_info(org_id, slug, opts = {}) ⇒ Array<(CheckBrandSlug200Response, Integer, Hash)>

Check brand slug availability Reports whether a brand slug is free within this organization. Brand slugs are unique per organization, so the same slug may exist in another organization. Archived brands still hold their slug.

Parameters:

  • org_id (String)

    Organization ID

  • slug (String)

    Brand slug to check

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

    the optional parameters

Returns:

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

    CheckBrandSlug200Response data, response status code and response headers



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
163
164
165
166
167
168
169
170
171
# File 'lib/zippendo/api/brands_api.rb', line 108

def check_brand_slug_with_http_info(org_id, slug, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BrandsApi.check_brand_slug ...'
  end
  # verify the required parameter 'org_id' is set
  if @api_client.config.client_side_validation && org_id.nil?
    fail ArgumentError, "Missing the required parameter 'org_id' when calling BrandsApi.check_brand_slug"
  end
  # verify the required parameter 'slug' is set
  if @api_client.config.client_side_validation && slug.nil?
    fail ArgumentError, "Missing the required parameter 'slug' when calling BrandsApi.check_brand_slug"
  end
  if @api_client.config.client_side_validation && slug.to_s.length > 60
    fail ArgumentError, 'invalid value for "slug" when calling BrandsApi.check_brand_slug, the character length must be smaller than or equal to 60.'
  end

  if @api_client.config.client_side_validation && slug.to_s.length < 2
    fail ArgumentError, 'invalid value for "slug" when calling BrandsApi.check_brand_slug, the character length must be greater than or equal to 2.'
  end

  pattern = Regexp.new(/^[a-z0-9]+(?:-[a-z0-9]+)*$/)
  if @api_client.config.client_side_validation && slug !~ pattern
    fail ArgumentError, "invalid value for 'slug' when calling BrandsApi.check_brand_slug, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/orgs/{orgId}/brands/check-slug/{slug}'.sub('{orgId}', CGI.escape(org_id.to_s)).sub('{slug}', CGI.escape(slug.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']) unless header_params['Accept']

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

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

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

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

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

#create_org_brand(org_id, create_org_brand_request, opts = {}) ⇒ ListOrgBrands200ResponseDataInner

Create brand Creates a brand (sub-account) in the organization. The slug is derived from the name when omitted. Requires a plan that includes brands.

Parameters:

  • org_id (String)

    Organization ID

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

    the optional parameters

Returns:



179
180
181
182
# File 'lib/zippendo/api/brands_api.rb', line 179

def create_org_brand(org_id, create_org_brand_request, opts = {})
  data, _status_code, _headers = create_org_brand_with_http_info(org_id, create_org_brand_request, opts)
  data
end

#create_org_brand_with_http_info(org_id, create_org_brand_request, opts = {}) ⇒ Array<(ListOrgBrands200ResponseDataInner, Integer, Hash)>

Create brand Creates a brand (sub-account) in the organization. The slug is derived from the name when omitted. Requires a plan that includes brands.

Parameters:

  • org_id (String)

    Organization ID

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

    the optional parameters

Returns:



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
233
234
235
236
237
238
239
240
241
242
243
244
245
# File 'lib/zippendo/api/brands_api.rb', line 190

def create_org_brand_with_http_info(org_id, create_org_brand_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BrandsApi.create_org_brand ...'
  end
  # verify the required parameter 'org_id' is set
  if @api_client.config.client_side_validation && org_id.nil?
    fail ArgumentError, "Missing the required parameter 'org_id' when calling BrandsApi.create_org_brand"
  end
  # verify the required parameter 'create_org_brand_request' is set
  if @api_client.config.client_side_validation && create_org_brand_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_org_brand_request' when calling BrandsApi.create_org_brand"
  end
  # resource path
  local_var_path = '/orgs/{orgId}/brands'.sub('{orgId}', CGI.escape(org_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']) unless header_params['Accept']
  # 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(create_org_brand_request)

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

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

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

#delete_brand_logo(org_id, brand_id, opts = {}) ⇒ ListOrgBrands200ResponseDataInner

Delete brand logo Removes a brand's logo. Its documents fall back to the organization's logo. Requires the brands and customBranding entitlements.

Parameters:

  • org_id (String)

    Organization ID

  • brand_id (String)

    Brand ID

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

    the optional parameters

Returns:



253
254
255
256
# File 'lib/zippendo/api/brands_api.rb', line 253

def (org_id, brand_id, opts = {})
  data, _status_code, _headers = delete_brand_logo_with_http_info(org_id, brand_id, opts)
  data
end

#delete_brand_logo_with_http_info(org_id, brand_id, opts = {}) ⇒ Array<(ListOrgBrands200ResponseDataInner, Integer, Hash)>

Delete brand logo Removes a brand's logo. Its documents fall back to the organization's logo. Requires the brands and customBranding entitlements.

Parameters:

  • org_id (String)

    Organization ID

  • brand_id (String)

    Brand ID

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

    the optional parameters

Returns:



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

def delete_brand_logo_with_http_info(org_id, brand_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BrandsApi.delete_brand_logo ...'
  end
  # verify the required parameter 'org_id' is set
  if @api_client.config.client_side_validation && org_id.nil?
    fail ArgumentError, "Missing the required parameter 'org_id' when calling BrandsApi.delete_brand_logo"
  end
  # verify the required parameter 'brand_id' is set
  if @api_client.config.client_side_validation && brand_id.nil?
    fail ArgumentError, "Missing the required parameter 'brand_id' when calling BrandsApi.delete_brand_logo"
  end
  # resource path
  local_var_path = '/orgs/{orgId}/brands/{brandId}/logo'.sub('{orgId}', CGI.escape(org_id.to_s)).sub('{brandId}', CGI.escape(brand_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']) unless header_params['Accept']

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

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

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

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

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

#get_brand_logo(org_id, brand_id, opts = {}) ⇒ File

Get brand logo Streams the brand's logo bytes. This is the URL returned as the brand's logoUrl.

Parameters:

  • org_id (String)

    Organization ID

  • brand_id (String)

    Brand ID

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

    the optional parameters

Returns:

  • (File)


322
323
324
325
# File 'lib/zippendo/api/brands_api.rb', line 322

def (org_id, brand_id, opts = {})
  data, _status_code, _headers = get_brand_logo_with_http_info(org_id, brand_id, opts)
  data
end

#get_brand_logo_with_http_info(org_id, brand_id, opts = {}) ⇒ Array<(File, Integer, Hash)>

Get brand logo Streams the brand's logo bytes. This is the URL returned as the brand's `logoUrl`.

Parameters:

  • org_id (String)

    Organization ID

  • brand_id (String)

    Brand ID

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

    the optional parameters

Returns:

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

    File data, response status code and response headers



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
370
371
372
373
374
375
376
377
378
379
380
381
382
383
# File 'lib/zippendo/api/brands_api.rb', line 333

def get_brand_logo_with_http_info(org_id, brand_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BrandsApi.get_brand_logo ...'
  end
  # verify the required parameter 'org_id' is set
  if @api_client.config.client_side_validation && org_id.nil?
    fail ArgumentError, "Missing the required parameter 'org_id' when calling BrandsApi.get_brand_logo"
  end
  # verify the required parameter 'brand_id' is set
  if @api_client.config.client_side_validation && brand_id.nil?
    fail ArgumentError, "Missing the required parameter 'brand_id' when calling BrandsApi.get_brand_logo"
  end
  # resource path
  local_var_path = '/orgs/{orgId}/brands/{brandId}/logo'.sub('{orgId}', CGI.escape(org_id.to_s)).sub('{brandId}', CGI.escape(brand_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(['image/png', 'image/jpeg', 'image/webp']) unless header_params['Accept']

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

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

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

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

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

#get_org_brand(org_id, brand_id, opts = {}) ⇒ ListOrgBrands200ResponseDataInner

Get brand Returns a single brand (sub-account) by id.

Parameters:

  • org_id (String)

    Organization ID

  • brand_id (String)

    Brand ID

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

    the optional parameters

Returns:



391
392
393
394
# File 'lib/zippendo/api/brands_api.rb', line 391

def get_org_brand(org_id, brand_id, opts = {})
  data, _status_code, _headers = get_org_brand_with_http_info(org_id, brand_id, opts)
  data
end

#get_org_brand_with_http_info(org_id, brand_id, opts = {}) ⇒ Array<(ListOrgBrands200ResponseDataInner, Integer, Hash)>

Get brand Returns a single brand (sub-account) by id.

Parameters:

  • org_id (String)

    Organization ID

  • brand_id (String)

    Brand ID

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

    the optional parameters

Returns:



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
447
448
449
450
451
452
# File 'lib/zippendo/api/brands_api.rb', line 402

def get_org_brand_with_http_info(org_id, brand_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BrandsApi.get_org_brand ...'
  end
  # verify the required parameter 'org_id' is set
  if @api_client.config.client_side_validation && org_id.nil?
    fail ArgumentError, "Missing the required parameter 'org_id' when calling BrandsApi.get_org_brand"
  end
  # verify the required parameter 'brand_id' is set
  if @api_client.config.client_side_validation && brand_id.nil?
    fail ArgumentError, "Missing the required parameter 'brand_id' when calling BrandsApi.get_org_brand"
  end
  # resource path
  local_var_path = '/orgs/{orgId}/brands/{brandId}'.sub('{orgId}', CGI.escape(org_id.to_s)).sub('{brandId}', CGI.escape(brand_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']) unless header_params['Accept']

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

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

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

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

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

#list_org_brands(org_id, opts = {}) ⇒ ListOrgBrands200Response

List brands Returns the organization's brands (sub-accounts). Archived brands are excluded unless includeArchived is set.

Parameters:

  • org_id (String)

    Organization ID

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

    the optional parameters

Options Hash (opts):

  • :include_archived (String)

    Include archived brands in the response

Returns:



460
461
462
463
# File 'lib/zippendo/api/brands_api.rb', line 460

def list_org_brands(org_id, opts = {})
  data, _status_code, _headers = list_org_brands_with_http_info(org_id, opts)
  data
end

#list_org_brands_with_http_info(org_id, opts = {}) ⇒ Array<(ListOrgBrands200Response, Integer, Hash)>

List brands Returns the organization's brands (sub-accounts). Archived brands are excluded unless `includeArchived` is set.

Parameters:

  • org_id (String)

    Organization ID

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

    the optional parameters

Options Hash (opts):

  • :include_archived (String)

    Include archived brands in the response

Returns:

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

    ListOrgBrands200Response data, response status code and response headers



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
# File 'lib/zippendo/api/brands_api.rb', line 471

def list_org_brands_with_http_info(org_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BrandsApi.list_org_brands ...'
  end
  # verify the required parameter 'org_id' is set
  if @api_client.config.client_side_validation && org_id.nil?
    fail ArgumentError, "Missing the required parameter 'org_id' when calling BrandsApi.list_org_brands"
  end
  # resource path
  local_var_path = '/orgs/{orgId}/brands'.sub('{orgId}', CGI.escape(org_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'includeArchived'] = opts[:'include_archived'] if !opts[:'include_archived'].nil?

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

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

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

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

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

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

#unarchive_org_brand(org_id, brand_id, opts = {}) ⇒ ListOrgBrands200ResponseDataInner

Unarchive brand Restores an archived brand so it appears in the brand switcher again.

Parameters:

  • org_id (String)

    Organization ID

  • brand_id (String)

    Brand ID

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

    the optional parameters

Returns:



526
527
528
529
# File 'lib/zippendo/api/brands_api.rb', line 526

def unarchive_org_brand(org_id, brand_id, opts = {})
  data, _status_code, _headers = unarchive_org_brand_with_http_info(org_id, brand_id, opts)
  data
end

#unarchive_org_brand_with_http_info(org_id, brand_id, opts = {}) ⇒ Array<(ListOrgBrands200ResponseDataInner, Integer, Hash)>

Unarchive brand Restores an archived brand so it appears in the brand switcher again.

Parameters:

  • org_id (String)

    Organization ID

  • brand_id (String)

    Brand ID

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

    the optional parameters

Returns:



537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
# File 'lib/zippendo/api/brands_api.rb', line 537

def unarchive_org_brand_with_http_info(org_id, brand_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BrandsApi.unarchive_org_brand ...'
  end
  # verify the required parameter 'org_id' is set
  if @api_client.config.client_side_validation && org_id.nil?
    fail ArgumentError, "Missing the required parameter 'org_id' when calling BrandsApi.unarchive_org_brand"
  end
  # verify the required parameter 'brand_id' is set
  if @api_client.config.client_side_validation && brand_id.nil?
    fail ArgumentError, "Missing the required parameter 'brand_id' when calling BrandsApi.unarchive_org_brand"
  end
  # resource path
  local_var_path = '/orgs/{orgId}/brands/{brandId}/unarchive'.sub('{orgId}', CGI.escape(org_id.to_s)).sub('{brandId}', CGI.escape(brand_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']) unless header_params['Accept']

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

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

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

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

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

#update_org_brand(org_id, brand_id, update_org_brand_request, opts = {}) ⇒ ListOrgBrands200ResponseDataInner

Update brand Updates a brand's name, slug, identity overrides (company name, VAT, customs, address) and document colours. Null clears an override so the organization's value applies again.

Parameters:

  • org_id (String)

    Organization ID

  • brand_id (String)

    Brand ID

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

    the optional parameters

Returns:



596
597
598
599
# File 'lib/zippendo/api/brands_api.rb', line 596

def update_org_brand(org_id, brand_id, update_org_brand_request, opts = {})
  data, _status_code, _headers = update_org_brand_with_http_info(org_id, brand_id, update_org_brand_request, opts)
  data
end

#update_org_brand_with_http_info(org_id, brand_id, update_org_brand_request, opts = {}) ⇒ Array<(ListOrgBrands200ResponseDataInner, Integer, Hash)>

Update brand Updates a brand's name, slug, identity overrides (company name, VAT, customs, address) and document colours. Null clears an override so the organization's value applies again.

Parameters:

  • org_id (String)

    Organization ID

  • brand_id (String)

    Brand ID

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

    the optional parameters

Returns:



608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
# File 'lib/zippendo/api/brands_api.rb', line 608

def update_org_brand_with_http_info(org_id, brand_id, update_org_brand_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BrandsApi.update_org_brand ...'
  end
  # verify the required parameter 'org_id' is set
  if @api_client.config.client_side_validation && org_id.nil?
    fail ArgumentError, "Missing the required parameter 'org_id' when calling BrandsApi.update_org_brand"
  end
  # verify the required parameter 'brand_id' is set
  if @api_client.config.client_side_validation && brand_id.nil?
    fail ArgumentError, "Missing the required parameter 'brand_id' when calling BrandsApi.update_org_brand"
  end
  # verify the required parameter 'update_org_brand_request' is set
  if @api_client.config.client_side_validation && update_org_brand_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_org_brand_request' when calling BrandsApi.update_org_brand"
  end
  # resource path
  local_var_path = '/orgs/{orgId}/brands/{brandId}'.sub('{orgId}', CGI.escape(org_id.to_s)).sub('{brandId}', CGI.escape(brand_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']) unless header_params['Accept']
  # 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(update_org_brand_request)

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

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

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

#upload_brand_logo(org_id, brand_id, file, opts = {}) ⇒ ListOrgBrands200ResponseDataInner

Upload brand logo Uploads a brand's logo as multipart/form-data. Accepts PNG, JPG or WEBP up to 5MB and 4096×4096px; the image is re-encoded and stored. Documents for this brand's shipments use it instead of the organization's logo. Requires the brands and customBranding entitlements.

Parameters:

  • org_id (String)

    Organization ID

  • brand_id (String)

    Brand ID

  • file (File)

    Image file (PNG, JPG, or WEBP)

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

    the optional parameters

Returns:



676
677
678
679
# File 'lib/zippendo/api/brands_api.rb', line 676

def (org_id, brand_id, file, opts = {})
  data, _status_code, _headers = upload_brand_logo_with_http_info(org_id, brand_id, file, opts)
  data
end

#upload_brand_logo_with_http_info(org_id, brand_id, file, opts = {}) ⇒ Array<(ListOrgBrands200ResponseDataInner, Integer, Hash)>

Upload brand logo Uploads a brand's logo as multipart/form-data. Accepts PNG, JPG or WEBP up to 5MB and 4096×4096px; the image is re-encoded and stored. Documents for this brand's shipments use it instead of the organization's logo. Requires the brands and customBranding entitlements.

Parameters:

  • org_id (String)

    Organization ID

  • brand_id (String)

    Brand ID

  • file (File)

    Image file (PNG, JPG, or WEBP)

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

    the optional parameters

Returns:



688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
# File 'lib/zippendo/api/brands_api.rb', line 688

def upload_brand_logo_with_http_info(org_id, brand_id, file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BrandsApi.upload_brand_logo ...'
  end
  # verify the required parameter 'org_id' is set
  if @api_client.config.client_side_validation && org_id.nil?
    fail ArgumentError, "Missing the required parameter 'org_id' when calling BrandsApi.upload_brand_logo"
  end
  # verify the required parameter 'brand_id' is set
  if @api_client.config.client_side_validation && brand_id.nil?
    fail ArgumentError, "Missing the required parameter 'brand_id' when calling BrandsApi.upload_brand_logo"
  end
  # verify the required parameter 'file' is set
  if @api_client.config.client_side_validation && file.nil?
    fail ArgumentError, "Missing the required parameter 'file' when calling BrandsApi.upload_brand_logo"
  end
  # resource path
  local_var_path = '/orgs/{orgId}/brands/{brandId}/logo'.sub('{orgId}', CGI.escape(org_id.to_s)).sub('{brandId}', CGI.escape(brand_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']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['multipart/form-data'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

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

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

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

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