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)

    A 34 character string that uniquely identifies this resource.



91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/twilio-ruby/rest/api/v2010/account/new_key.rb', line 91

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_createdTime

Returns The RFC 2822 date and time in GMT that the resource was created.

Returns:

  • (Time)

    The RFC 2822 date and time in GMT that the resource was created



118
119
120
# File 'lib/twilio-ruby/rest/api/v2010/account/new_key.rb', line 118

def date_created
  @properties['date_created']
end

#date_updatedTime

Returns The RFC 2822 date and time in GMT that the resource was last updated.

Returns:

  • (Time)

    The RFC 2822 date and time in GMT that the resource was last updated



124
125
126
# File 'lib/twilio-ruby/rest/api/v2010/account/new_key.rb', line 124

def date_updated
  @properties['date_updated']
end

#friendly_nameString

Returns The string that you assigned to describe the resource.

Returns:

  • (String)

    The string that you assigned to describe the resource



112
113
114
# File 'lib/twilio-ruby/rest/api/v2010/account/new_key.rb', line 112

def friendly_name
  @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



142
143
144
# File 'lib/twilio-ruby/rest/api/v2010/account/new_key.rb', line 142

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

#secretString

Returns The secret your application uses to sign Access Tokens and to authenticate to the REST API.

Returns:

  • (String)

    The secret your application uses to sign Access Tokens and to authenticate to the REST API.



130
131
132
# File 'lib/twilio-ruby/rest/api/v2010/account/new_key.rb', line 130

def secret
  @properties['secret']
end

#sidString

Returns The unique string that identifies the resource.

Returns:

  • (String)

    The unique string that identifies the resource



106
107
108
# File 'lib/twilio-ruby/rest/api/v2010/account/new_key.rb', line 106

def sid
  @properties['sid']
end

#to_sObject

Provide a user friendly representation



136
137
138
# File 'lib/twilio-ruby/rest/api/v2010/account/new_key.rb', line 136

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