Class: Twilio::REST::Preview::TrustedComms::BusinessContext::BrandInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/preview/trusted_comms/business/brand.rb

Overview

PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected].

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, business_sid: nil, sid: nil) ⇒ BrandInstance

Initialize the BrandInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • business_sid (String) (defaults to: nil)

    The unique SID identifier of the Business.

  • sid (String) (defaults to: nil)

    The unique SID identifier of the Brand.



143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/twilio-ruby/rest/preview/trusted_comms/business/brand.rb', line 143

def initialize(version, payload, business_sid: nil, sid: nil)
  super(version)

  # Marshaled Properties
  @properties = {
      'account_sid' => payload['account_sid'],
      'business_sid' => payload['business_sid'],
      'sid' => payload['sid'],
      'links' => payload['links'],
      'url' => payload['url'],
  }

  # Context
  @instance_context = nil
  @params = {'business_sid' => business_sid, 'sid' => sid || @properties['sid'], }
end

Instance Method Details

#account_sidString

Returns Account Sid.

Returns:

  • (String)

    Account Sid.



173
174
175
# File 'lib/twilio-ruby/rest/preview/trusted_comms/business/brand.rb', line 173

def 
  @properties['account_sid']
end

#branded_channelsbranded_channels

Access the branded_channels

Returns:



211
212
213
# File 'lib/twilio-ruby/rest/preview/trusted_comms/business/brand.rb', line 211

def branded_channels
  context.branded_channels
end

#business_sidString

Returns Business Sid.

Returns:

  • (String)

    Business Sid.



179
180
181
# File 'lib/twilio-ruby/rest/preview/trusted_comms/business/brand.rb', line 179

def business_sid
  @properties['business_sid']
end

#contextBrandContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:



164
165
166
167
168
169
# File 'lib/twilio-ruby/rest/preview/trusted_comms/business/brand.rb', line 164

def context
  unless @instance_context
    @instance_context = BrandContext.new(@version, @params['business_sid'], @params['sid'], )
  end
  @instance_context
end

#fetchBrandInstance

Fetch the BrandInstance

Returns:



204
205
206
# File 'lib/twilio-ruby/rest/preview/trusted_comms/business/brand.rb', line 204

def fetch
  context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



224
225
226
227
# File 'lib/twilio-ruby/rest/preview/trusted_comms/business/brand.rb', line 224

def inspect
  values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Preview.TrustedComms.BrandInstance #{values}>"
end

Returns Nested resource URLs.

Returns:

  • (String)

    Nested resource URLs.



191
192
193
# File 'lib/twilio-ruby/rest/preview/trusted_comms/business/brand.rb', line 191

def links
  @properties['links']
end

#sidString

Returns Brand Sid.

Returns:

  • (String)

    Brand Sid.



185
186
187
# File 'lib/twilio-ruby/rest/preview/trusted_comms/business/brand.rb', line 185

def sid
  @properties['sid']
end

#to_sObject

Provide a user friendly representation



217
218
219
220
# File 'lib/twilio-ruby/rest/preview/trusted_comms/business/brand.rb', line 217

def to_s
  values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Preview.TrustedComms.BrandInstance #{values}>"
end

#urlString

Returns The URL of this resource.

Returns:

  • (String)

    The URL of this resource.



197
198
199
# File 'lib/twilio-ruby/rest/preview/trusted_comms/business/brand.rb', line 197

def url
  @properties['url']
end