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,
lib/twilio-ruby/rest/messaging/v1/brand_registration/brand_registration_otp.rb

Defined Under Namespace

Classes: BrandRegistrationOtpInstance, BrandRegistrationOtpList, BrandRegistrationOtpPage, 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 update.



173
174
175
176
177
178
179
180
181
182
183
# File 'lib/twilio-ruby/rest/messaging/v1/brand_registration.rb', line 173

def initialize(version, sid)
    super(version)

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

    # Dependents
    @brand_registration_otps = nil
    @brand_vettings = nil
end

Instance Method Details

#brand_registration_otpsBrandRegistrationOtpList, BrandRegistrationOtpContext

Access the brand_registration_otps

Returns:



226
227
228
229
230
231
232
# File 'lib/twilio-ruby/rest/messaging/v1/brand_registration.rb', line 226

def brand_registration_otps
  unless @brand_registration_otps
    @brand_registration_otps = BrandRegistrationOtpList.new(
            @version, brand_registration_sid: @solution[:sid], )
  end
  @brand_registration_otps
end

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

Access the brand_vettings

Returns:

Raises:

  • (ArgumentError)


237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
# File 'lib/twilio-ruby/rest/messaging/v1/brand_registration.rb', line 237

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:



187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# File 'lib/twilio-ruby/rest/messaging/v1/brand_registration.rb', line 187

def fetch

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.fetch('GET', @uri, headers: headers)
    BrandRegistrationInstance.new(
        @version,
        payload,
        sid: @solution[:sid],
    )
end

#inspectObject

Provide a detailed, user friendly representation



262
263
264
265
# File 'lib/twilio-ruby/rest/messaging/v1/brand_registration.rb', line 262

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

#to_sObject

Provide a user friendly representation



255
256
257
258
# File 'lib/twilio-ruby/rest/messaging/v1/brand_registration.rb', line 255

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

#updateBrandRegistrationInstance

Update the BrandRegistrationInstance

Returns:



206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
# File 'lib/twilio-ruby/rest/messaging/v1/brand_registration.rb', line 206

def update

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.update('POST', @uri, headers: headers)
    BrandRegistrationInstance.new(
        @version,
        payload,
        sid: @solution[:sid],
    )
end