From 3ecb85952533bbb6ae1554289a9c244f61ee85e1 Mon Sep 17 00:00:00 2001 From: Kobe Brooks Date: Mon, 9 Oct 2023 12:05:41 -0400 Subject: [PATCH] chore: Removing Test Related To Deprecated Endpoint - OAuth --- lib/twilio-ruby/rest/oauth/v1.rb | 64 ----- lib/twilio-ruby/rest/oauth/v1/device_code.rb | 171 ------------ lib/twilio-ruby/rest/oauth/v1/oauth.rb | 185 ------------- .../rest/oauth/v1/openid_discovery.rb | 262 ------------------ lib/twilio-ruby/rest/oauth/v1/token.rb | 179 ------------ lib/twilio-ruby/rest/oauth/v1/user_info.rb | 213 -------------- 6 files changed, 1074 deletions(-) delete mode 100644 lib/twilio-ruby/rest/oauth/v1.rb delete mode 100644 lib/twilio-ruby/rest/oauth/v1/device_code.rb delete mode 100644 lib/twilio-ruby/rest/oauth/v1/oauth.rb delete mode 100644 lib/twilio-ruby/rest/oauth/v1/openid_discovery.rb delete mode 100644 lib/twilio-ruby/rest/oauth/v1/token.rb delete mode 100644 lib/twilio-ruby/rest/oauth/v1/user_info.rb diff --git a/lib/twilio-ruby/rest/oauth/v1.rb b/lib/twilio-ruby/rest/oauth/v1.rb deleted file mode 100644 index cd1b86b33..000000000 --- a/lib/twilio-ruby/rest/oauth/v1.rb +++ /dev/null @@ -1,64 +0,0 @@ -## -# This code was generated by -# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ -# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ -# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ -# -# Twilio - Oauth -# This is the public Twilio REST API. -# -# NOTE: This class is auto generated by OpenAPI Generator. -# https://openapi-generator.tech -# Do not edit the class manually. -# - -module Twilio - module REST - class Oauth - class V1 < Version - ## - # Initialize the V1 version of Oauth - def initialize(domain) - super - @version = 'v1' - @device_code = nil - @oauth = nil - @openid_discovery = nil - @token = nil - @user_info = nil - end - - ## - # @return [Twilio::REST::Oauth::V1::DeviceCodeList] - def device_code - @device_code ||= DeviceCodeList.new self - end - ## - # @return [Twilio::REST::Oauth::V1::oauthContext] - def oauth - @oauth ||= OauthContext.new self - end - ## - # @return [Twilio::REST::Oauth::V1::openidDiscoveryContext] - def openid_discovery - @openid_discovery ||= OpenidDiscoveryContext.new self - end - ## - # @return [Twilio::REST::Oauth::V1::TokenList] - def token - @token ||= TokenList.new self - end - ## - # @return [Twilio::REST::Oauth::V1::userInfoContext] - def user_info - @user_info ||= UserInfoContext.new self - end - ## - # Provide a user friendly representation - def to_s - ''; - end - end - end - end -end diff --git a/lib/twilio-ruby/rest/oauth/v1/device_code.rb b/lib/twilio-ruby/rest/oauth/v1/device_code.rb deleted file mode 100644 index 55e453081..000000000 --- a/lib/twilio-ruby/rest/oauth/v1/device_code.rb +++ /dev/null @@ -1,171 +0,0 @@ -## -# This code was generated by -# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ -# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ -# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ -# -# Twilio - Oauth -# This is the public Twilio REST API. -# -# NOTE: This class is auto generated by OpenAPI Generator. -# https://openapi-generator.tech -# Do not edit the class manually. -# - - -module Twilio - module REST - class Oauth < OauthBase - class V1 < Version - class DeviceCodeList < ListResource - ## - # Initialize the DeviceCodeList - # @param [Version] version Version that contains the resource - # @return [DeviceCodeList] DeviceCodeList - def initialize(version) - super(version) - # Path Solution - @solution = { } - @uri = "/device/code" - - end - ## - # Create the DeviceCodeInstance - # @param [String] client_sid A 34 character string that uniquely identifies this OAuth App. - # @param [Array[String]] scopes An Array of scopes for authorization request - # @param [Array[String]] audiences An array of intended audiences for token requests - # @return [DeviceCodeInstance] Created DeviceCodeInstance - def create( - client_sid: nil, - scopes: nil, - audiences: :unset - ) - - data = Twilio::Values.of({ - 'ClientSid' => client_sid, - 'Scopes' => Twilio.serialize_list(scopes) { |e| e }, - 'Audiences' => Twilio.serialize_list(audiences) { |e| e }, - }) - - payload = @version.create('POST', @uri, data: data) - DeviceCodeInstance.new( - @version, - payload, - ) - end - - - - - # Provide a user friendly representation - def to_s - '#' - end - end - - class DeviceCodePage < Page - ## - # Initialize the DeviceCodePage - # @param [Version] version Version that contains the resource - # @param [Response] response Response from the API - # @param [Hash] solution Path solution for the resource - # @return [DeviceCodePage] DeviceCodePage - def initialize(version, response, solution) - super(version, response) - - # Path Solution - @solution = solution - end - - ## - # Build an instance of DeviceCodeInstance - # @param [Hash] payload Payload response from the API - # @return [DeviceCodeInstance] DeviceCodeInstance - def get_instance(payload) - DeviceCodeInstance.new(@version, payload) - end - - ## - # Provide a user friendly representation - def to_s - '' - end - end - class DeviceCodeInstance < InstanceResource - ## - # Initialize the DeviceCodeInstance - # @param [Version] version Version that contains the resource - # @param [Hash] payload payload that contains response from Twilio - # @param [String] account_sid The SID of the - # {Account}[https://www.twilio.com/docs/iam/api/account] that created this DeviceCode - # resource. - # @param [String] sid The SID of the Call resource to fetch. - # @return [DeviceCodeInstance] DeviceCodeInstance - def initialize(version, payload ) - super(version) - - # Marshaled Properties - @properties = { - 'device_code' => payload['device_code'], - 'user_code' => payload['user_code'], - 'verification_uri' => payload['verification_uri'], - 'verification_uri_complete' => payload['verification_uri_complete'], - 'expires_in' => payload['expires_in'], - 'interval' => payload['interval'] == nil ? payload['interval'] : payload['interval'].to_i, - } - end - - - ## - # @return [String] The device verification code. - def device_code - @properties['device_code'] - end - - ## - # @return [String] The verification code which end user uses to verify authorization request. - def user_code - @properties['user_code'] - end - - ## - # @return [String] The URI that the end user visits to verify authorization request. - def verification_uri - @properties['verification_uri'] - end - - ## - # @return [String] The URI with user_code that the end-user alternatively visits to verify authorization request. - def verification_uri_complete - @properties['verification_uri_complete'] - end - - ## - # @return [String] The expiration time of the device_code and user_code in seconds. - def expires_in - @properties['expires_in'] - end - - ## - # @return [String] The minimum amount of time in seconds that the client should wait between polling requests to the token endpoint. - def interval - @properties['interval'] - end - - ## - # Provide a user friendly representation - def to_s - "" - end - - ## - # Provide a detailed, user friendly representation - def inspect - "" - end - end - - end - end - end -end diff --git a/lib/twilio-ruby/rest/oauth/v1/oauth.rb b/lib/twilio-ruby/rest/oauth/v1/oauth.rb deleted file mode 100644 index 684666c44..000000000 --- a/lib/twilio-ruby/rest/oauth/v1/oauth.rb +++ /dev/null @@ -1,185 +0,0 @@ -## -# This code was generated by -# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ -# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ -# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ -# -# Twilio - Oauth -# This is the public Twilio REST API. -# -# NOTE: This class is auto generated by OpenAPI Generator. -# https://openapi-generator.tech -# Do not edit the class manually. -# - - -module Twilio - module REST - class Oauth < OauthBase - class V1 < Version - class OauthList < ListResource - ## - # Initialize the OauthList - # @param [Version] version Version that contains the resource - # @return [OauthList] OauthList - def initialize(version) - super(version) - # Path Solution - @solution = { } - - - end - - - - # Provide a user friendly representation - def to_s - '#' - end - end - - - class OauthContext < InstanceContext - ## - # Initialize the OauthContext - # @param [Version] version Version that contains the resource - # @return [OauthContext] OauthContext - def initialize(version) - super(version) - - # Path Solution - @solution = { } - @uri = "/certs" - - - end - ## - # Fetch the OauthInstance - # @return [OauthInstance] Fetched OauthInstance - def fetch - - payload = @version.fetch('GET', @uri) - OauthInstance.new( - @version, - payload, - ) - end - - - ## - # Provide a user friendly representation - def to_s - context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') - "#" - end - - ## - # Provide a detailed, user friendly representation - def inspect - context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') - "#" - end - end - - class OauthPage < Page - ## - # Initialize the OauthPage - # @param [Version] version Version that contains the resource - # @param [Response] response Response from the API - # @param [Hash] solution Path solution for the resource - # @return [OauthPage] OauthPage - def initialize(version, response, solution) - super(version, response) - - # Path Solution - @solution = solution - end - - ## - # Build an instance of OauthInstance - # @param [Hash] payload Payload response from the API - # @return [OauthInstance] OauthInstance - def get_instance(payload) - OauthInstance.new(@version, payload) - end - - ## - # Provide a user friendly representation - def to_s - '' - end - end - class OauthInstance < InstanceResource - ## - # Initialize the OauthInstance - # @param [Version] version Version that contains the resource - # @param [Hash] payload payload that contains response from Twilio - # @param [String] account_sid The SID of the - # {Account}[https://www.twilio.com/docs/iam/api/account] that created this Oauth - # resource. - # @param [String] sid The SID of the Call resource to fetch. - # @return [OauthInstance] OauthInstance - def initialize(version, payload ) - super(version) - - # Marshaled Properties - @properties = { - 'keys' => payload['keys'], - 'url' => payload['url'], - } - - # Context - @instance_context = nil - @params = { } - end - - ## - # Generate an instance context for the instance, the context is capable of - # performing various actions. All instance actions are proxied to the context - # @return [OauthContext] CallContext for this CallInstance - def context - unless @instance_context - @instance_context = OauthContext.new(@version ) - end - @instance_context - end - - ## - # @return [Hash] A collection of certificates where are signed Twilio-issued tokens. - def keys - @properties['keys'] - end - - ## - # @return [String] - def url - @properties['url'] - end - - ## - # Fetch the OauthInstance - # @return [OauthInstance] Fetched OauthInstance - def fetch - - context.fetch - end - - ## - # Provide a user friendly representation - def to_s - values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") - "" - end - - ## - # Provide a detailed, user friendly representation - def inspect - values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") - "" - end - end - - end - end - end -end diff --git a/lib/twilio-ruby/rest/oauth/v1/openid_discovery.rb b/lib/twilio-ruby/rest/oauth/v1/openid_discovery.rb deleted file mode 100644 index ad774d663..000000000 --- a/lib/twilio-ruby/rest/oauth/v1/openid_discovery.rb +++ /dev/null @@ -1,262 +0,0 @@ -## -# This code was generated by -# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ -# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ -# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ -# -# Twilio - Oauth -# This is the public Twilio REST API. -# -# NOTE: This class is auto generated by OpenAPI Generator. -# https://openapi-generator.tech -# Do not edit the class manually. -# - - -module Twilio - module REST - class Oauth < OauthBase - class V1 < Version - class OpenidDiscoveryList < ListResource - ## - # Initialize the OpenidDiscoveryList - # @param [Version] version Version that contains the resource - # @return [OpenidDiscoveryList] OpenidDiscoveryList - def initialize(version) - super(version) - # Path Solution - @solution = { } - - - end - - - - # Provide a user friendly representation - def to_s - '#' - end - end - - - class OpenidDiscoveryContext < InstanceContext - ## - # Initialize the OpenidDiscoveryContext - # @param [Version] version Version that contains the resource - # @return [OpenidDiscoveryContext] OpenidDiscoveryContext - def initialize(version) - super(version) - - # Path Solution - @solution = { } - @uri = "/.well-known/openid-configuration" - - - end - ## - # Fetch the OpenidDiscoveryInstance - # @return [OpenidDiscoveryInstance] Fetched OpenidDiscoveryInstance - def fetch - - payload = @version.fetch('GET', @uri) - OpenidDiscoveryInstance.new( - @version, - payload, - ) - end - - - ## - # Provide a user friendly representation - def to_s - context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') - "#" - end - - ## - # Provide a detailed, user friendly representation - def inspect - context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') - "#" - end - end - - class OpenidDiscoveryPage < Page - ## - # Initialize the OpenidDiscoveryPage - # @param [Version] version Version that contains the resource - # @param [Response] response Response from the API - # @param [Hash] solution Path solution for the resource - # @return [OpenidDiscoveryPage] OpenidDiscoveryPage - def initialize(version, response, solution) - super(version, response) - - # Path Solution - @solution = solution - end - - ## - # Build an instance of OpenidDiscoveryInstance - # @param [Hash] payload Payload response from the API - # @return [OpenidDiscoveryInstance] OpenidDiscoveryInstance - def get_instance(payload) - OpenidDiscoveryInstance.new(@version, payload) - end - - ## - # Provide a user friendly representation - def to_s - '' - end - end - class OpenidDiscoveryInstance < InstanceResource - ## - # Initialize the OpenidDiscoveryInstance - # @param [Version] version Version that contains the resource - # @param [Hash] payload payload that contains response from Twilio - # @param [String] account_sid The SID of the - # {Account}[https://www.twilio.com/docs/iam/api/account] that created this OpenidDiscovery - # resource. - # @param [String] sid The SID of the Call resource to fetch. - # @return [OpenidDiscoveryInstance] OpenidDiscoveryInstance - def initialize(version, payload ) - super(version) - - # Marshaled Properties - @properties = { - 'issuer' => payload['issuer'], - 'authorization_endpoint' => payload['authorization_endpoint'], - 'device_authorization_endpoint' => payload['device_authorization_endpoint'], - 'token_endpoint' => payload['token_endpoint'], - 'userinfo_endpoint' => payload['userinfo_endpoint'], - 'revocation_endpoint' => payload['revocation_endpoint'], - 'jwk_uri' => payload['jwk_uri'], - 'response_type_supported' => payload['response_type_supported'], - 'subject_type_supported' => payload['subject_type_supported'], - 'id_token_signing_alg_values_supported' => payload['id_token_signing_alg_values_supported'], - 'scopes_supported' => payload['scopes_supported'], - 'claims_supported' => payload['claims_supported'], - 'url' => payload['url'], - } - - # Context - @instance_context = nil - @params = { } - end - - ## - # Generate an instance context for the instance, the context is capable of - # performing various actions. All instance actions are proxied to the context - # @return [OpenidDiscoveryContext] CallContext for this CallInstance - def context - unless @instance_context - @instance_context = OpenidDiscoveryContext.new(@version ) - end - @instance_context - end - - ## - # @return [String] The URL of the party that will create the token and sign it with its private key. - def issuer - @properties['issuer'] - end - - ## - # @return [String] The endpoint that validates all authorization requests. - def authorization_endpoint - @properties['authorization_endpoint'] - end - - ## - # @return [String] The endpoint that validates all device code related authorization requests. - def device_authorization_endpoint - @properties['device_authorization_endpoint'] - end - - ## - # @return [String] The URL of the token endpoint. After a client has received an authorization code, that code is presented to the token endpoint and exchanged for an identity token, an access token, and a refresh token. - def token_endpoint - @properties['token_endpoint'] - end - - ## - # @return [String] The URL of the user info endpoint, which returns user profile information to a client. Keep in mind that the user info endpoint returns only the information that has been requested. - def userinfo_endpoint - @properties['userinfo_endpoint'] - end - - ## - # @return [String] The endpoint used to revoke access or refresh tokens issued by the authorization server. - def revocation_endpoint - @properties['revocation_endpoint'] - end - - ## - # @return [String] The URL of your JSON Web Key Set. This set is a collection of JSON Web Keys, a standard method for representing cryptographic keys in a JSON structure. - def jwk_uri - @properties['jwk_uri'] - end - - ## - # @return [Array] A collection of response type supported by authorization server. - def response_type_supported - @properties['response_type_supported'] - end - - ## - # @return [Array] A collection of subject by authorization server. - def subject_type_supported - @properties['subject_type_supported'] - end - - ## - # @return [Array] A collection of JWS signing algorithms supported by authorization server to sign identity token. - def id_token_signing_alg_values_supported - @properties['id_token_signing_alg_values_supported'] - end - - ## - # @return [Array] A collection of scopes supported by authorization server for identity token - def scopes_supported - @properties['scopes_supported'] - end - - ## - # @return [Array] A collection of claims supported by authorization server for identity token - def claims_supported - @properties['claims_supported'] - end - - ## - # @return [String] - def url - @properties['url'] - end - - ## - # Fetch the OpenidDiscoveryInstance - # @return [OpenidDiscoveryInstance] Fetched OpenidDiscoveryInstance - def fetch - - context.fetch - end - - ## - # Provide a user friendly representation - def to_s - values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") - "" - end - - ## - # Provide a detailed, user friendly representation - def inspect - values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") - "" - end - end - - end - end - end -end diff --git a/lib/twilio-ruby/rest/oauth/v1/token.rb b/lib/twilio-ruby/rest/oauth/v1/token.rb deleted file mode 100644 index f1e6e7744..000000000 --- a/lib/twilio-ruby/rest/oauth/v1/token.rb +++ /dev/null @@ -1,179 +0,0 @@ -## -# This code was generated by -# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ -# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ -# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ -# -# Twilio - Oauth -# This is the public Twilio REST API. -# -# NOTE: This class is auto generated by OpenAPI Generator. -# https://openapi-generator.tech -# Do not edit the class manually. -# - - -module Twilio - module REST - class Oauth < OauthBase - class V1 < Version - class TokenList < ListResource - ## - # Initialize the TokenList - # @param [Version] version Version that contains the resource - # @return [TokenList] TokenList - def initialize(version) - super(version) - # Path Solution - @solution = { } - @uri = "/token" - - end - ## - # Create the TokenInstance - # @param [String] grant_type Grant type is a credential representing resource owner's authorization which can be used by client to obtain access token. - # @param [String] client_sid A 34 character string that uniquely identifies this OAuth App. - # @param [String] client_secret The credential for confidential OAuth App. - # @param [String] code JWT token related to the authorization code grant type. - # @param [String] code_verifier A code which is generation cryptographically. - # @param [String] device_code JWT token related to the device code grant type. - # @param [String] refresh_token JWT token related to the refresh token grant type. - # @param [String] device_id The Id of the device associated with the token (refresh token). - # @return [TokenInstance] Created TokenInstance - def create( - grant_type: nil, - client_sid: nil, - client_secret: :unset, - code: :unset, - code_verifier: :unset, - device_code: :unset, - refresh_token: :unset, - device_id: :unset - ) - - data = Twilio::Values.of({ - 'GrantType' => grant_type, - 'ClientSid' => client_sid, - 'ClientSecret' => client_secret, - 'Code' => code, - 'CodeVerifier' => code_verifier, - 'DeviceCode' => device_code, - 'RefreshToken' => refresh_token, - 'DeviceId' => device_id, - }) - - payload = @version.create('POST', @uri, data: data) - TokenInstance.new( - @version, - payload, - ) - end - - - - - # Provide a user friendly representation - def to_s - '#' - end - end - - class TokenPage < Page - ## - # Initialize the TokenPage - # @param [Version] version Version that contains the resource - # @param [Response] response Response from the API - # @param [Hash] solution Path solution for the resource - # @return [TokenPage] TokenPage - def initialize(version, response, solution) - super(version, response) - - # Path Solution - @solution = solution - end - - ## - # Build an instance of TokenInstance - # @param [Hash] payload Payload response from the API - # @return [TokenInstance] TokenInstance - def get_instance(payload) - TokenInstance.new(@version, payload) - end - - ## - # Provide a user friendly representation - def to_s - '' - end - end - class TokenInstance < InstanceResource - ## - # Initialize the TokenInstance - # @param [Version] version Version that contains the resource - # @param [Hash] payload payload that contains response from Twilio - # @param [String] account_sid The SID of the - # {Account}[https://www.twilio.com/docs/iam/api/account] that created this Token - # resource. - # @param [String] sid The SID of the Call resource to fetch. - # @return [TokenInstance] TokenInstance - def initialize(version, payload ) - super(version) - - # Marshaled Properties - @properties = { - 'access_token' => payload['access_token'], - 'refresh_token' => payload['refresh_token'], - 'id_token' => payload['id_token'], - 'refresh_token_expires_at' => Twilio.deserialize_iso8601_datetime(payload['refresh_token_expires_at']), - 'access_token_expires_at' => Twilio.deserialize_iso8601_datetime(payload['access_token_expires_at']), - } - end - - - ## - # @return [String] Token which carries the necessary information to access a Twilio resource directly. - def access_token - @properties['access_token'] - end - - ## - # @return [String] Token which carries the information necessary to get a new access token. - def refresh_token - @properties['refresh_token'] - end - - ## - # @return [String] - def id_token - @properties['id_token'] - end - - ## - # @return [Time] The date and time in GMT when the refresh token expires in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - def refresh_token_expires_at - @properties['refresh_token_expires_at'] - end - - ## - # @return [Time] The date and time in GMT when the refresh token expires in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - def access_token_expires_at - @properties['access_token_expires_at'] - end - - ## - # Provide a user friendly representation - def to_s - "" - end - - ## - # Provide a detailed, user friendly representation - def inspect - "" - end - end - - end - end - end -end diff --git a/lib/twilio-ruby/rest/oauth/v1/user_info.rb b/lib/twilio-ruby/rest/oauth/v1/user_info.rb deleted file mode 100644 index 984782fd1..000000000 --- a/lib/twilio-ruby/rest/oauth/v1/user_info.rb +++ /dev/null @@ -1,213 +0,0 @@ -## -# This code was generated by -# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ -# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ -# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ -# -# Twilio - Oauth -# This is the public Twilio REST API. -# -# NOTE: This class is auto generated by OpenAPI Generator. -# https://openapi-generator.tech -# Do not edit the class manually. -# - - -module Twilio - module REST - class Oauth < OauthBase - class V1 < Version - class UserInfoList < ListResource - ## - # Initialize the UserInfoList - # @param [Version] version Version that contains the resource - # @return [UserInfoList] UserInfoList - def initialize(version) - super(version) - # Path Solution - @solution = { } - - - end - - - - # Provide a user friendly representation - def to_s - '#' - end - end - - - class UserInfoContext < InstanceContext - ## - # Initialize the UserInfoContext - # @param [Version] version Version that contains the resource - # @return [UserInfoContext] UserInfoContext - def initialize(version) - super(version) - - # Path Solution - @solution = { } - @uri = "/userinfo" - - - end - ## - # Fetch the UserInfoInstance - # @return [UserInfoInstance] Fetched UserInfoInstance - def fetch - - payload = @version.fetch('GET', @uri) - UserInfoInstance.new( - @version, - payload, - ) - end - - - ## - # Provide a user friendly representation - def to_s - context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') - "#" - end - - ## - # Provide a detailed, user friendly representation - def inspect - context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') - "#" - end - end - - class UserInfoPage < Page - ## - # Initialize the UserInfoPage - # @param [Version] version Version that contains the resource - # @param [Response] response Response from the API - # @param [Hash] solution Path solution for the resource - # @return [UserInfoPage] UserInfoPage - def initialize(version, response, solution) - super(version, response) - - # Path Solution - @solution = solution - end - - ## - # Build an instance of UserInfoInstance - # @param [Hash] payload Payload response from the API - # @return [UserInfoInstance] UserInfoInstance - def get_instance(payload) - UserInfoInstance.new(@version, payload) - end - - ## - # Provide a user friendly representation - def to_s - '' - end - end - class UserInfoInstance < InstanceResource - ## - # Initialize the UserInfoInstance - # @param [Version] version Version that contains the resource - # @param [Hash] payload payload that contains response from Twilio - # @param [String] account_sid The SID of the - # {Account}[https://www.twilio.com/docs/iam/api/account] that created this UserInfo - # resource. - # @param [String] sid The SID of the Call resource to fetch. - # @return [UserInfoInstance] UserInfoInstance - def initialize(version, payload ) - super(version) - - # Marshaled Properties - @properties = { - 'user_sid' => payload['user_sid'], - 'first_name' => payload['first_name'], - 'last_name' => payload['last_name'], - 'friendly_name' => payload['friendly_name'], - 'email' => payload['email'], - 'url' => payload['url'], - } - - # Context - @instance_context = nil - @params = { } - end - - ## - # Generate an instance context for the instance, the context is capable of - # performing various actions. All instance actions are proxied to the context - # @return [UserInfoContext] CallContext for this CallInstance - def context - unless @instance_context - @instance_context = UserInfoContext.new(@version ) - end - @instance_context - end - - ## - # @return [String] The URL of the party that will create the token and sign it with its private key. - def user_sid - @properties['user_sid'] - end - - ## - # @return [String] The first name of the end-user. - def first_name - @properties['first_name'] - end - - ## - # @return [String] The last name of the end-user. - def last_name - @properties['last_name'] - end - - ## - # @return [String] The friendly name of the end-user. - def friendly_name - @properties['friendly_name'] - end - - ## - # @return [String] The end-user's preferred email address. - def email - @properties['email'] - end - - ## - # @return [String] - def url - @properties['url'] - end - - ## - # Fetch the UserInfoInstance - # @return [UserInfoInstance] Fetched UserInfoInstance - def fetch - - context.fetch - end - - ## - # Provide a user friendly representation - def to_s - values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") - "" - end - - ## - # Provide a detailed, user friendly representation - def inspect - values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") - "" - end - end - - end - end - end -end