## # 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