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 that contains the resource

  • payload that contains response from Twilio

  • The SID of the Account that created this NewApiKey resource.

  • The SID of the Call resource to fetch.



216
217
218
219
220
221
222
223
224
225
226
227
228
229
# File 'lib/twilio-ruby/rest/iam/v1/new_api_key.rb', line 216

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_createdTime

Returns The date and time in GMT that the API Key was created specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.

Returns:



246
247
248
# File 'lib/twilio-ruby/rest/iam/v1/new_api_key.rb', line 246

def date_created
    @properties['date_created']
end

#date_updatedTime

Returns The date and time in GMT that the new API Key was last updated specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.

Returns:



252
253
254
# File 'lib/twilio-ruby/rest/iam/v1/new_api_key.rb', line 252

def date_updated
    @properties['date_updated']
end

#friendly_nameString

Returns The string that you assigned to describe the resource.

Returns:

  • The string that you assigned to describe the resource.



240
241
242
# File 'lib/twilio-ruby/rest/iam/v1/new_api_key.rb', line 240

def friendly_name
    @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



276
277
278
# File 'lib/twilio-ruby/rest/iam/v1/new_api_key.rb', line 276

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

#policyHash

Returns Collection of allow assertions.

Returns:

  • Collection of allow assertions.



264
265
266
# File 'lib/twilio-ruby/rest/iam/v1/new_api_key.rb', line 264

def policy
    @properties['policy']
end

#secretString

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:

  • 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.**



258
259
260
# File 'lib/twilio-ruby/rest/iam/v1/new_api_key.rb', line 258

def secret
    @properties['secret']
end

#sidString

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:

  • 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.



234
235
236
# File 'lib/twilio-ruby/rest/iam/v1/new_api_key.rb', line 234

def sid
    @properties['sid']
end

#to_sObject

Provide a user friendly representation



270
271
272
# File 'lib/twilio-ruby/rest/iam/v1/new_api_key.rb', line 270

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