Class: Twilio::REST::Messaging::V1::ServiceContext::UsAppToPersonUsecaseList

Inherits:
ListResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person_usecase.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, messaging_service_sid: nil) ⇒ UsAppToPersonUsecaseList

Initialize the UsAppToPersonUsecaseList

Parameters:

  • version (Version)

    Version that contains the resource



28
29
30
31
32
33
34
35
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person_usecase.rb', line 28

def initialize(version, messaging_service_sid: nil)
    super(version)
    
    # Path Solution
    @solution = { messaging_service_sid: messaging_service_sid }
    @uri = "/Services/#{@solution[:messaging_service_sid]}/Compliance/Usa2p/Usecases"
    
end

Instance Method Details

#fetch(brand_registration_sid: :unset) ⇒ UsAppToPersonUsecaseInstance

Fetch the UsAppToPersonUsecaseInstance

Parameters:

  • brand_registration_sid (String) (defaults to: :unset)

    The unique string to identify the A2P brand.

Returns:



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person_usecase.rb', line 40

def fetch(
    brand_registration_sid: :unset
)

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

#fetch_with_metadata(brand_registration_sid: :unset) ⇒ UsAppToPersonUsecaseInstance

Fetch the UsAppToPersonUsecaseInstanceMetadata

Parameters:

  • brand_registration_sid (String) (defaults to: :unset)

    The unique string to identify the A2P brand.

Returns:



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
90
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person_usecase.rb', line 65

def (
  brand_registration_sid: :unset
)

    params = Twilio::Values.of({
        'BrandRegistrationSid' => brand_registration_sid,
    })
    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    response = @version.('GET', @uri, params: params, headers: headers)
    us_app_to_person_usecase_instance = UsAppToPersonUsecaseInstance.new(
        @version,
        response.body,
        messaging_service_sid: @solution[:messaging_service_sid],
    )
    .new(
        @version,
        us_app_to_person_usecase_instance,
        response.headers,
        response.status_code
    )
end

#to_sObject

Provide a user friendly representation



96
97
98
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person_usecase.rb', line 96

def to_s
    '#<Twilio.Messaging.V1.UsAppToPersonUsecaseList>'
end