Class: Readiness::Zendesk::Brands
- Inherits:
-
Client
- Object
- Client
- Readiness::Zendesk::Brands
show all
- Defined in:
- lib/support_readiness/zendesk/brands.rb
Overview
TODO:
Check Host Mapping Validity
TODO:
Check Host Mapping Validity for an Existing Brand
Defines the class Brands within the module Readiness::Zendesk.
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Client
auth_error, bad_request_error, convert_actions, convert_conditions, convert_standard_names_to_ids, convert_ticket_form_agent_conditions, convert_ticket_form_brands, convert_ticket_form_end_user_conditions, convert_ticket_form_names_to_ids, convert_view_names_to_ids, convert_view_restrictions, covert_ticket_form_field_ids, create_package!, erb_renderer, handle_request_error, not_found_error, not_processible_error, put_into_archive, recursively_deflate_directory, timestamp_filename, to_clean_json, to_clean_json_with_key, to_hash, to_nearly_clean_json, to_nearly_clean_json_with_key, to_param_string, write_entries
Constructor Details
#initialize(object = {}) ⇒ Brands
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
# File 'lib/support_readiness/zendesk/brands.rb', line 31
def initialize(object = {})
@active = object['active']
@brand_url = object['brand_url']
@created_at = object['created_at']
@default = object['default']
@has_help_center = object['has_help_center']
@help_center_state = object['help_center_state']
@host_mapping = object['host_mapping']
@id = object['id']
@logo = object['logo']
@name = object['name']
@signature_template = object['signature_template']
@subdomain = object['subdomain']
@ticket_form_ids = object['ticket_form_ids']
@updated_at = object['updated_at']
end
|
Instance Attribute Details
#active ⇒ Object
20
21
22
|
# File 'lib/support_readiness/zendesk/brands.rb', line 20
def active
@active
end
|
#brand_url ⇒ Object
20
21
22
|
# File 'lib/support_readiness/zendesk/brands.rb', line 20
def brand_url
@brand_url
end
|
#created_at ⇒ Object
20
21
22
|
# File 'lib/support_readiness/zendesk/brands.rb', line 20
def created_at
@created_at
end
|
#default ⇒ Object
20
21
22
|
# File 'lib/support_readiness/zendesk/brands.rb', line 20
def default
@default
end
|
#has_help_center ⇒ Object
20
21
22
|
# File 'lib/support_readiness/zendesk/brands.rb', line 20
def has_help_center
@has_help_center
end
|
#help_center_state ⇒ Object
20
21
22
|
# File 'lib/support_readiness/zendesk/brands.rb', line 20
def help_center_state
@help_center_state
end
|
#host_mapping ⇒ Object
20
21
22
|
# File 'lib/support_readiness/zendesk/brands.rb', line 20
def host_mapping
@host_mapping
end
|
#id ⇒ Object
20
21
22
|
# File 'lib/support_readiness/zendesk/brands.rb', line 20
def id
@id
end
|
#logo ⇒ Object
20
21
22
|
# File 'lib/support_readiness/zendesk/brands.rb', line 20
def logo
@logo
end
|
#name ⇒ Object
20
21
22
|
# File 'lib/support_readiness/zendesk/brands.rb', line 20
def name
@name
end
|
#signature_template ⇒ Object
20
21
22
|
# File 'lib/support_readiness/zendesk/brands.rb', line 20
def signature_template
@signature_template
end
|
#subdomain ⇒ Object
20
21
22
|
# File 'lib/support_readiness/zendesk/brands.rb', line 20
def subdomain
@subdomain
end
|
20
21
22
|
# File 'lib/support_readiness/zendesk/brands.rb', line 20
def ticket_form_ids
@ticket_form_ids
end
|
#updated_at ⇒ Object
20
21
22
|
# File 'lib/support_readiness/zendesk/brands.rb', line 20
def updated_at
@updated_at
end
|
Class Method Details
.find_by_name(client, name, cache = nil) ⇒ Object
Locates a brand within Zendesk by name. Can utilize a cacheh for quicker results
92
93
94
95
96
97
98
99
|
# File 'lib/support_readiness/zendesk/brands.rb', line 92
def self.find_by_name(client, name, cache = nil)
brands = if cache.nil?
Brands.list(client)
else
cache
end
brands.detect { |f| f.name == name }
end
|
.list(client) ⇒ Array
66
67
68
69
70
71
|
# File 'lib/support_readiness/zendesk/brands.rb', line 66
def self.list(client)
response = client.connection.get 'brands'
handle_request_error(0, 'Zendesk', response.status) unless response.status == 200
body = Oj.load(response.body)
body['brands'].map { |b| Brands.new(b) }
end
|