Class: Twilio::JWT::AccessToken::VoiceGrant

Inherits:
Object
  • Object
show all
Includes:
Twilio::JWT::AccessTokenGrant
Defined in:
lib/twilio-ruby/jwt/access_token.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#endpoint_idObject

Returns the value of attribute endpoint_id.



147
148
149
# File 'lib/twilio-ruby/jwt/access_token.rb', line 147

def endpoint_id
  @endpoint_id
end

#outgoing_application_paramsObject

Returns the value of attribute outgoing_application_params.



147
148
149
# File 'lib/twilio-ruby/jwt/access_token.rb', line 147

def outgoing_application_params
  @outgoing_application_params
end

#outgoing_application_sidObject

Returns the value of attribute outgoing_application_sid.



147
148
149
# File 'lib/twilio-ruby/jwt/access_token.rb', line 147

def outgoing_application_sid
  @outgoing_application_sid
end

#push_credential_sidObject

Returns the value of attribute push_credential_sid.



147
148
149
# File 'lib/twilio-ruby/jwt/access_token.rb', line 147

def push_credential_sid
  @push_credential_sid
end

Instance Method Details

#_generate_payloadObject



156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# File 'lib/twilio-ruby/jwt/access_token.rb', line 156

def _generate_payload
  payload = {}

  if outgoing_application_sid
    outgoing = {}
    outgoing[:application_sid] = outgoing_application_sid
    if outgoing_application_params
      outgoing[:params] = outgoing_application_params
    end

    payload[:outgoing] = outgoing
  end

  if push_credential_sid
    payload[:push_credential_sid] = push_credential_sid
  end

  payload[:endpoint_id] = endpoint_id if endpoint_id

  payload
end

#_keyObject



152
153
154
# File 'lib/twilio-ruby/jwt/access_token.rb', line 152

def _key
  'voice'
end