Class: Twilio::REST::Messaging::V1::BrandRegistrationContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/messaging/v1/brand_registration.rb,
lib/twilio-ruby/rest/messaging/v1/brand_registration/brand_vetting.rb

Overview

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

Defined Under Namespace

Classes: BrandVettingContext, BrandVettingInstance, BrandVettingList, BrandVettingPage

Instance Method Summary collapse

Constructor Details

#initialize(version, sid) ⇒ BrandRegistrationContext

Initialize the BrandRegistrationContext

Parameters:

  • version (Version)

    Version that contains the resource

  • sid (String)

    The SID of the Brand Registration resource to fetch.


181
182
183
184
185
186
187
188
189
190
# File 'lib/twilio-ruby/rest/messaging/v1/brand_registration.rb', line 181

def initialize(version, sid)
  super(version)

  # Path Solution
  @solution = {sid: sid, }
  @uri = "/a2p/BrandRegistrations/#{@solution[:sid]}"

  # Dependents
  @brand_vettings = nil
end

Instance Method Details

#brand_vettings(brand_vetting_sid = :unset) ⇒ BrandVettingList, BrandVettingContext

Access the brand_vettings

Returns:

Raises:

  • (ArgumentError)

214
215
216
217
218
219
220
221
222
223
224
225
226
# File 'lib/twilio-ruby/rest/messaging/v1/brand_registration.rb', line 214

def brand_vettings(brand_vetting_sid=:unset)
  raise ArgumentError, 'brand_vetting_sid cannot be nil' if brand_vetting_sid.nil?

  if brand_vetting_sid != :unset
    return BrandVettingContext.new(@version, @solution[:sid], brand_vetting_sid, )
  end

  unless @brand_vettings
    @brand_vettings = BrandVettingList.new(@version, brand_sid: @solution[:sid], )
  end

  @brand_vettings
end

#fetchBrandRegistrationInstance

Fetch the BrandRegistrationInstance

Returns:


195
196
197
198
199
# File 'lib/twilio-ruby/rest/messaging/v1/brand_registration.rb', line 195

def fetch
  payload = @version.fetch('GET', @uri)

  BrandRegistrationInstance.new(@version, payload, sid: @solution[:sid], )
end

#inspectObject

Provide a detailed, user friendly representation


237
238
239
240
# File 'lib/twilio-ruby/rest/messaging/v1/brand_registration.rb', line 237

def inspect
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Messaging.V1.BrandRegistrationContext #{context}>"
end

#to_sObject

Provide a user friendly representation


230
231
232
233
# File 'lib/twilio-ruby/rest/messaging/v1/brand_registration.rb', line 230

def to_s
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Messaging.V1.BrandRegistrationContext #{context}>"
end

#updateBrandRegistrationInstance

Update the BrandRegistrationInstance

Returns:


204
205
206
207
208
# File 'lib/twilio-ruby/rest/messaging/v1/brand_registration.rb', line 204

def update
  payload = @version.update('POST', @uri)

  BrandRegistrationInstance.new(@version, payload, sid: @solution[:sid], )
end