lib/twilio-ruby/rest/oauth/v1/oauth.rb in twilio-ruby-5.77.0 vs lib/twilio-ruby/rest/oauth/v1/oauth.rb in twilio-ruby-6.0.0.pre.rc.1
- old
+ new
@@ -1,162 +1,185 @@
##
-# This code was generated by
-# \ / _ _ _| _ _
-# | (_)\/(_)(_|\/| |(/_ v1.0.0
-# / /
+# This code was generated by
+# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
+# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
+# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
#
-# frozen_string_literal: true
+# 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 < Domain
- 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)
+ 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
+
- # Path Solution
- @solution = {}
- end
- ##
- # Provide a user friendly representation
- def to_s
- '#<Twilio.Oauth.V1.OauthList>'
- end
- end
+ # Provide a user friendly representation
+ def to_s
+ '#<Twilio.Oauth.V1.OauthList>'
+ 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
+ class OauthContext < InstanceContext
+ ##
+ # Initialize the OauthContext
+ # @param [Version] version Version that contains the resource
+ # @return [OauthContext] OauthContext
+ def initialize(version)
+ super(version)
- ##
- # 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
+ # Path Solution
+ @solution = { }
+ @uri = "/certs"
- ##
- # Provide a user friendly representation
- def to_s
- '<Twilio.Oauth.V1.OauthPage>'
- end
- end
+
+ end
+ ##
+ # Fetch the OauthInstance
+ # @return [OauthInstance] Fetched OauthInstance
+ def fetch
- class OauthContext < InstanceContext
- ##
- # Initialize the OauthContext
- # @param [Version] version Version that contains the resource
- # @return [OauthContext] OauthContext
- def initialize(version)
- super(version)
+ payload = @version.fetch('GET', @uri)
+ OauthInstance.new(
+ @version,
+ payload,
+ )
+ end
- # Path Solution
- @solution = {}
- @uri = "/certs"
- end
- ##
- # Fetch the OauthInstance
- # @return [OauthInstance] Fetched OauthInstance
- def fetch
- payload = @version.fetch('GET', @uri)
+ ##
+ # Provide a user friendly representation
+ def to_s
+ context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
+ "#<Twilio.Oauth.V1.OauthContext #{context}>"
+ end
- OauthInstance.new(@version, payload, )
- end
+ ##
+ # Provide a detailed, user friendly representation
+ def inspect
+ context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
+ "#<Twilio.Oauth.V1.OauthContext #{context}>"
+ end
+ end
- ##
- # Provide a user friendly representation
- def to_s
- context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
- "#<Twilio.Oauth.V1.OauthContext #{context}>"
- 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)
- ##
- # Provide a detailed, user friendly representation
- def inspect
- context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
- "#<Twilio.Oauth.V1.OauthContext #{context}>"
- end
- end
+ # Path Solution
+ @solution = solution
+ end
- class OauthInstance < InstanceResource
- ##
- # Initialize the OauthInstance
- # @param [Version] version Version that contains the resource
- # @param [Hash] payload payload that contains response from Twilio
- # @return [OauthInstance] OauthInstance
- def initialize(version, payload)
- super(version)
+ ##
+ # 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
- # Marshaled Properties
- @properties = {'keys' => payload['keys'], 'url' => payload['url'], }
+ ##
+ # Provide a user friendly representation
+ def to_s
+ '<Twilio.Oauth.V1.OauthPage>'
+ 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
+ # 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] OauthContext for this OauthInstance
- def context
- unless @instance_context
- @instance_context = OauthContext.new(@version, )
- end
- @instance_context
- 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
- ##
- # @return [Hash] A collection of certificates
- def keys
- @properties['keys']
- end
+ context.fetch
+ end
- ##
- # @return [String] The url
- def url
- @properties['url']
- end
+ ##
+ # Provide a user friendly representation
+ def to_s
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
+ "<Twilio.Oauth.V1.OauthInstance #{values}>"
+ end
- ##
- # Fetch the OauthInstance
- # @return [OauthInstance] Fetched OauthInstance
- def fetch
- context.fetch
- end
+ ##
+ # Provide a detailed, user friendly representation
+ def inspect
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
+ "<Twilio.Oauth.V1.OauthInstance #{values}>"
+ end
+ end
- ##
- # Provide a user friendly representation
- def to_s
- values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
- "<Twilio.Oauth.V1.OauthInstance #{values}>"
- end
-
- ##
- # Provide a detailed, user friendly representation
- def inspect
- values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
- "<Twilio.Oauth.V1.OauthInstance #{values}>"
- end
+ end
end
- end
end
- end
-end
\ No newline at end of file
+end