## # 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 SecondaryAuthTokenList < ListResource ## # Initialize the SecondaryAuthTokenList # @param [Version] version Version that contains the resource # @return [SecondaryAuthTokenList] SecondaryAuthTokenList def initialize(version) super(version) # Path Solution @solution = { } end # Provide a user friendly representation def to_s '#' end end class SecondaryAuthTokenContext < InstanceContext ## # Initialize the SecondaryAuthTokenContext # @param [Version] version Version that contains the resource # @return [SecondaryAuthTokenContext] SecondaryAuthTokenContext def initialize(version) super(version) # Path Solution @solution = { } @uri = "/AuthTokens/Secondary" end ## # Create the SecondaryAuthTokenInstance # @return [SecondaryAuthTokenInstance] Created SecondaryAuthTokenInstance def create headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.create('POST', @uri, headers: headers) SecondaryAuthTokenInstance.new( @version, payload, ) end ## # Delete the SecondaryAuthTokenInstance # @return [Boolean] True if delete succeeds, false otherwise def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) 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 SecondaryAuthTokenPage < Page ## # Initialize the SecondaryAuthTokenPage # @param [Version] version Version that contains the resource # @param [Response] response Response from the API # @param [Hash] solution Path solution for the resource # @return [SecondaryAuthTokenPage] SecondaryAuthTokenPage def initialize(version, response, solution) super(version, response) # Path Solution @solution = solution end ## # Build an instance of SecondaryAuthTokenInstance # @param [Hash] payload Payload response from the API # @return [SecondaryAuthTokenInstance] SecondaryAuthTokenInstance def get_instance(payload) SecondaryAuthTokenInstance.new(@version, payload) end ## # Provide a user friendly representation def to_s '' end end class SecondaryAuthTokenInstance < InstanceResource ## # Initialize the SecondaryAuthTokenInstance # @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 SecondaryAuthToken # resource. # @param [String] sid The SID of the Call resource to fetch. # @return [SecondaryAuthTokenInstance] SecondaryAuthTokenInstance def initialize(version, payload ) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'secondary_auth_token' => payload['secondary_auth_token'], '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 [SecondaryAuthTokenContext] CallContext for this CallInstance def context unless @instance_context @instance_context = SecondaryAuthTokenContext.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 [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 UTC 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 generated secondary Auth Token that can be used to authenticate future API requests. def secondary_auth_token @properties['secondary_auth_token'] end ## # @return [String] The URI for this resource, relative to `https://accounts.twilio.com` def url @properties['url'] end ## # Create the SecondaryAuthTokenInstance # @return [SecondaryAuthTokenInstance] Created SecondaryAuthTokenInstance def create context.create end ## # Delete the SecondaryAuthTokenInstance # @return [Boolean] True if delete succeeds, false otherwise def delete context.delete 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