## # This code was generated by # ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ # # Twilio - Accounts # 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 Accounts < AccountsBase class V1 < Version class AuthTokenPromotionList < ListResource ## # Initialize the AuthTokenPromotionList # @param [Version] version Version that contains the resource # @return [AuthTokenPromotionList] AuthTokenPromotionList def initialize(version) super(version) # Path Solution @solution = { } end # Provide a user friendly representation def to_s '#' end end class AuthTokenPromotionContext < InstanceContext ## # Initialize the AuthTokenPromotionContext # @param [Version] version Version that contains the resource # @return [AuthTokenPromotionContext] AuthTokenPromotionContext def initialize(version) super(version) # Path Solution @solution = { } @uri = "/AuthTokens/Promote" end ## # Update the AuthTokenPromotionInstance # @return [AuthTokenPromotionInstance] Updated AuthTokenPromotionInstance def update payload = @version.update('POST', @uri) AuthTokenPromotionInstance.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 AuthTokenPromotionPage < Page ## # Initialize the AuthTokenPromotionPage # @param [Version] version Version that contains the resource # @param [Response] response Response from the API # @param [Hash] solution Path solution for the resource # @return [AuthTokenPromotionPage] AuthTokenPromotionPage def initialize(version, response, solution) super(version, response) # Path Solution @solution = solution end ## # Build an instance of AuthTokenPromotionInstance # @param [Hash] payload Payload response from the API # @return [AuthTokenPromotionInstance] AuthTokenPromotionInstance def get_instance(payload) AuthTokenPromotionInstance.new(@version, payload) end ## # Provide a user friendly representation def to_s '' end end class AuthTokenPromotionInstance < InstanceResource ## # Initialize the AuthTokenPromotionInstance # @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 AuthTokenPromotion # resource. # @param [String] sid The SID of the Call resource to fetch. # @return [AuthTokenPromotionInstance] AuthTokenPromotionInstance def initialize(version, payload ) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'auth_token' => payload['auth_token'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), '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 [AuthTokenPromotionContext] CallContext for this CallInstance def context unless @instance_context @instance_context = AuthTokenPromotionContext.new(@version ) end @instance_context end ## # @return [String] The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that the secondary Auth Token was created for. def account_sid @properties['account_sid'] end ## # @return [String] The promoted Auth Token that must be used to authenticate future API requests. def auth_token @properties['auth_token'] end ## # @return [Time] The date and time in UTC when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. def date_created @properties['date_created'] end ## # @return [Time] The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. def date_updated @properties['date_updated'] end ## # @return [String] The URI for this resource, relative to `https://accounts.twilio.com` def url @properties['url'] end ## # Update the AuthTokenPromotionInstance # @return [AuthTokenPromotionInstance] Updated AuthTokenPromotionInstance def update context.update 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