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


154
155
156
# File 'lib/twilio-ruby/jwt/access_token.rb', line 154

def endpoint_id
  @endpoint_id
end

#incoming_allowObject

Returns the value of attribute incoming_allow


154
155
156
# File 'lib/twilio-ruby/jwt/access_token.rb', line 154

def incoming_allow
  @incoming_allow
end

#outgoing_application_paramsObject

Returns the value of attribute outgoing_application_params


154
155
156
# File 'lib/twilio-ruby/jwt/access_token.rb', line 154

def outgoing_application_params
  @outgoing_application_params
end

#outgoing_application_sidObject

Returns the value of attribute outgoing_application_sid


154
155
156
# File 'lib/twilio-ruby/jwt/access_token.rb', line 154

def outgoing_application_sid
  @outgoing_application_sid
end

#push_credential_sidObject

Returns the value of attribute push_credential_sid


154
155
156
# File 'lib/twilio-ruby/jwt/access_token.rb', line 154

def push_credential_sid
  @push_credential_sid
end

Instance Method Details

#_generate_payloadObject


164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# File 'lib/twilio-ruby/jwt/access_token.rb', line 164

def _generate_payload
  payload = {}
  payload[:incoming] = { allow: true } if incoming_allow == true

  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


160
161
162
# File 'lib/twilio-ruby/jwt/access_token.rb', line 160

def _key
  'voice'
end