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.



129
130
131
132
133
134
135
136
# File 'lib/twilio-ruby/rest/accounts/v1/messaging_geopermissions.rb', line 129

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

Instance Method Details

#inspectObject

Provide a detailed, user friendly representation



153
154
155
# File 'lib/twilio-ruby/rest/accounts/v1/messaging_geopermissions.rb', line 153

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

#permissionsHash

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.



141
142
143
# File 'lib/twilio-ruby/rest/accounts/v1/messaging_geopermissions.rb', line 141

def permissions
    @properties['permissions']
end

#to_sObject

Provide a user friendly representation



147
148
149
# File 'lib/twilio-ruby/rest/accounts/v1/messaging_geopermissions.rb', line 147

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