Class: Twilio::REST::Iam::V1::NewApiKeyInstance

Inherits:
Twilio::REST::InstanceResource show all
Defined in:
lib/twilio-ruby/rest/iam/v1/new_api_key.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload) ⇒ NewApiKeyInstance

Initialize the NewApiKeyInstance

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 NewApiKey resource.

  • sid (String) —

    The SID of the Call resource to fetch.



157
158
159
160
161
162
163
164
165
166
167
168
169
170
# File 'lib/twilio-ruby/rest/iam/v1/new_api_key.rb', line 157

def initialize(version, payload )
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'sid' => payload['sid'],
        'friendly_name' => payload['friendly_name'],
        'date_created' => Twilio.deserialize_rfc2822(payload['date_created']),
        'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
        'secret' => payload['secret'],
        'policy' => payload['policy'],
    }
end

Instance Method Details

#date_created ⇒ Time

Returns The date and time in GMT that the API Key was created specified in RFC 2822 format.

Returns:

  • (Time) —

    The date and time in GMT that the API Key was created specified in RFC 2822 format.



187
188
189
# File 'lib/twilio-ruby/rest/iam/v1/new_api_key.rb', line 187

def date_created
    @properties['date_created']
end

#date_updated ⇒ Time

Returns The date and time in GMT that the new API Key was last updated specified in RFC 2822 format.

Returns:

  • (Time) —

    The date and time in GMT that the new API Key was last updated specified in RFC 2822 format.



193
194
195
# File 'lib/twilio-ruby/rest/iam/v1/new_api_key.rb', line 193

def date_updated
    @properties['date_updated']
end

#friendly_name ⇒ String

Returns The string that you assigned to describe the resource.

Returns:

  • (String) —

    The string that you assigned to describe the resource.



181
182
183
# File 'lib/twilio-ruby/rest/iam/v1/new_api_key.rb', line 181

def friendly_name
    @properties['friendly_name']
end

#inspect ⇒ Object

Provide a detailed, user friendly representation



217
218
219
# File 'lib/twilio-ruby/rest/iam/v1/new_api_key.rb', line 217

def inspect
    "<Twilio.Iam.V1.NewApiKeyInstance>"
end

#policy ⇒ Hash

Returns Collection of allow assertions.

Returns:

  • (Hash) —

    Collection of allow assertions.



205
206
207
# File 'lib/twilio-ruby/rest/iam/v1/new_api_key.rb', line 205

def policy
    @properties['policy']
end

#secret ⇒ String

Returns The secret your application uses to sign Access Tokens and to authenticate to the REST API (you will use this as the basic-auth password). Note that for security reasons, this field is ONLY returned when the API Key is first created..

Returns:

  • (String) —

    The secret your application uses to sign Access Tokens and to authenticate to the REST API (you will use this as the basic-auth password). Note that for security reasons, this field is ONLY returned when the API Key is first created.



199
200
201
# File 'lib/twilio-ruby/rest/iam/v1/new_api_key.rb', line 199

def secret
    @properties['secret']
end

#sid ⇒ String

Returns The unique string that that we created to identify the NewKey resource. You will use this as the basic-auth user when authenticating to the API.

Returns:

  • (String) —

    The unique string that that we created to identify the NewKey resource. You will use this as the basic-auth user when authenticating to the API.



175
176
177
# File 'lib/twilio-ruby/rest/iam/v1/new_api_key.rb', line 175

def sid
    @properties['sid']
end

#to_s ⇒ Object

Provide a user friendly representation



211
212
213
# File 'lib/twilio-ruby/rest/iam/v1/new_api_key.rb', line 211

def to_s
    "<Twilio.Iam.V1.NewApiKeyInstance>"
end