Class: Twilio::REST::Accounts::V1::MessagingGeopermissionsInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/accounts/v1/messaging_geopermissions.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload) ⇒ MessagingGeopermissionsInstance

Initialize the MessagingGeopermissionsInstance

Parameters:

  • version (Version) —

    Version that contains the resource

  • payload (Hash) —

    payload that contains response from Twilio

  • account_sid (String) —

    The SID of the Account that created this MessagingGeopermissions resource.

  • sid (String) —

    The SID of the Call resource to fetch.



193
194
195
196
197
198
199
200
201
# File 'lib/twilio-ruby/rest/accounts/v1/messaging_geopermissions.rb', line 193

def initialize(version, payload )
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'permissions' => payload['permissions'],
    }
end

Instance Method Details

#inspect ⇒ Object

Provide a detailed, user friendly representation



218
219
220
# File 'lib/twilio-ruby/rest/accounts/v1/messaging_geopermissions.rb', line 218

def inspect
    "<Twilio.Accounts.V1.MessagingGeopermissionsInstance>"
end

#permissions ⇒ Hash

Returns A list of objects where each object represents the result of processing a messaging Geo Permission. Each object contains the following fields: country_code, the country code of the country for which the permission was updated; type, the type of the permission i.e. country; enabled, true if the permission is enabled else false; error_code, an integer where 0 indicates success and any non-zero value represents an error; and error_messages, an array of strings describing specific validation errors encountered. If the request is successful, the error_messages array will be empty.

Returns:

  • (Hash) —

    A list of objects where each object represents the result of processing a messaging Geo Permission. Each object contains the following fields: country_code, the country code of the country for which the permission was updated; type, the type of the permission i.e. country; enabled, true if the permission is enabled else false; error_code, an integer where 0 indicates success and any non-zero value represents an error; and error_messages, an array of strings describing specific validation errors encountered. If the request is successful, the error_messages array will be empty.



206
207
208
# File 'lib/twilio-ruby/rest/accounts/v1/messaging_geopermissions.rb', line 206

def permissions
    @properties['permissions']
end

#to_s ⇒ Object

Provide a user friendly representation



212
213
214
# File 'lib/twilio-ruby/rest/accounts/v1/messaging_geopermissions.rb', line 212

def to_s
    "<Twilio.Accounts.V1.MessagingGeopermissionsInstance>"
end