Class: Twilio::REST::Accounts::V1::MessagingGeopermissionsList
- Inherits:
-
ListResource
- Object
- ListResource
- Twilio::REST::Accounts::V1::MessagingGeopermissionsList
- Defined in:
- lib/twilio-ruby/rest/accounts/v1/messaging_geopermissions.rb
Instance Method Summary collapse
-
#fetch(country_code: :unset) ⇒ MessagingGeopermissionsInstance
Fetch the MessagingGeopermissionsInstance.
-
#fetch_with_metadata(country_code: :unset) ⇒ MessagingGeopermissionsInstance
Fetch the MessagingGeopermissionsInstanceMetadata.
-
#initialize(version) ⇒ MessagingGeopermissionsList
constructor
Initialize the MessagingGeopermissionsList.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(permissions: nil) ⇒ MessagingGeopermissionsInstance
Update the MessagingGeopermissionsInstance.
-
#update_with_metadata(permissions: nil) ⇒ MessagingGeopermissionsInstance
Update the MessagingGeopermissionsInstanceMetadata.
Constructor Details
#initialize(version) ⇒ MessagingGeopermissionsList
Initialize the MessagingGeopermissionsList
26 27 28 29 30 31 32 33 |
# File 'lib/twilio-ruby/rest/accounts/v1/messaging_geopermissions.rb', line 26 def initialize(version) super(version) # Path Solution @solution = { } @uri = "/Messaging/GeoPermissions" end |
Instance Method Details
#fetch(country_code: :unset) ⇒ MessagingGeopermissionsInstance
Fetch the MessagingGeopermissionsInstance
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/twilio-ruby/rest/accounts/v1/messaging_geopermissions.rb', line 38 def fetch( country_code: :unset ) params = Twilio::Values.of({ 'CountryCode' => country_code, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, params: params, headers: headers) .new( @version, payload, ) end |
#fetch_with_metadata(country_code: :unset) ⇒ MessagingGeopermissionsInstance
Fetch the MessagingGeopermissionsInstanceMetadata
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/twilio-ruby/rest/accounts/v1/messaging_geopermissions.rb', line 62 def ( country_code: :unset ) params = Twilio::Values.of({ 'CountryCode' => country_code, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('GET', @uri, params: params, headers: headers) = .new( @version, response.body, ) .new( @version, , response.headers, response.status_code ) end |
#to_s ⇒ Object
Provide a user friendly representation
148 149 150 |
# File 'lib/twilio-ruby/rest/accounts/v1/messaging_geopermissions.rb', line 148 def to_s '#<Twilio.Accounts.V1.MessagingGeopermissionsList>' end |
#update(permissions: nil) ⇒ MessagingGeopermissionsInstance
Update the MessagingGeopermissionsInstance
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/twilio-ruby/rest/accounts/v1/messaging_geopermissions.rb', line 92 def update( permissions: nil ) data = Twilio::Values.of({ 'Permissions' => Twilio.serialize_list() { |e| Twilio.serialize_object(e) }, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('PATCH', @uri, data: data, headers: headers) .new( @version, payload, ) end |
#update_with_metadata(permissions: nil) ⇒ MessagingGeopermissionsInstance
Update the MessagingGeopermissionsInstanceMetadata
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 |
# File 'lib/twilio-ruby/rest/accounts/v1/messaging_geopermissions.rb', line 117 def ( permissions: nil ) data = Twilio::Values.of({ 'Permissions' => Twilio.serialize_list() { |e| Twilio.serialize_object(e) }, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('PATCH', @uri, data: data, headers: headers) = .new( @version, response.body, ) .new( @version, , response.headers, response.status_code ) end |