Class: Twilio::REST::Api::V2010::AccountContext::NewKeyInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/api/v2010/account/new_key.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, account_sid: nil) ⇒ NewKeyInstance

Initialize the NewKeyInstance

Parameters:

  • version (Version) —

    Version that contains the resource

  • payload (Hash) —

    payload that contains response from Twilio

  • account_sid (String) (defaults to: nil) —

    The SID of the Account that created this NewKey resource.

  • sid (String) —

    The SID of the Call resource to fetch.



143
144
145
146
147
148
149
150
151
152
153
154
155
# File 'lib/twilio-ruby/rest/api/v2010/account/new_key.rb', line 143

def initialize(version, payload , account_sid: nil)
    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'],
    }
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.



172
173
174
# File 'lib/twilio-ruby/rest/api/v2010/account/new_key.rb', line 172

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.



178
179
180
# File 'lib/twilio-ruby/rest/api/v2010/account/new_key.rb', line 178

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.



166
167
168
# File 'lib/twilio-ruby/rest/api/v2010/account/new_key.rb', line 166

def friendly_name
    @properties['friendly_name']
end

#inspect ⇒ Object

Provide a detailed, user friendly representation



196
197
198
# File 'lib/twilio-ruby/rest/api/v2010/account/new_key.rb', line 196

def inspect
    "<Twilio.Api.V2010.NewKeyInstance>"
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.



184
185
186
# File 'lib/twilio-ruby/rest/api/v2010/account/new_key.rb', line 184

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.



160
161
162
# File 'lib/twilio-ruby/rest/api/v2010/account/new_key.rb', line 160

def sid
    @properties['sid']
end

#to_s ⇒ Object

Provide a user friendly representation



190
191
192
# File 'lib/twilio-ruby/rest/api/v2010/account/new_key.rb', line 190

def to_s
    "<Twilio.Api.V2010.NewKeyInstance>"
end