lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb in twilio-ruby-5.77.0 vs lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb in twilio-ruby-6.0.0.pre.rc.1

- old
+ new

@@ -1,195 +1,208 @@ ## -# This code was generated by -# \ / _ _ _| _ _ -# | (_)\/(_)(_|\/| |(/_ v1.0.0 -# / / +# This code was generated by +# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ +# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ +# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ # -# frozen_string_literal: true +# Twilio - Content +# 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 Content < Domain - class V1 < Version - class ContentContext < InstanceContext - ## - # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. - class ApprovalFetchList < ListResource - ## - # Initialize the ApprovalFetchList - # @param [Version] version Version that contains the resource - # @param [String] sid The unique string that that we created to identify the - # Content resource. - # @return [ApprovalFetchList] ApprovalFetchList - def initialize(version, sid: nil) - super(version) + module REST + class Content < ContentBase + class V1 < Version + class ContentContext < InstanceContext - # Path Solution - @solution = {sid: sid} - end + class ApprovalFetchList < ListResource + ## + # Initialize the ApprovalFetchList + # @param [Version] version Version that contains the resource + # @return [ApprovalFetchList] ApprovalFetchList + def initialize(version, sid: nil) + super(version) + # Path Solution + @solution = { sid: sid } + + + end + - ## - # Provide a user friendly representation - def to_s - '#<Twilio.Content.V1.ApprovalFetchList>' - end - end - ## - # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. - class ApprovalFetchPage < Page - ## - # Initialize the ApprovalFetchPage - # @param [Version] version Version that contains the resource - # @param [Response] response Response from the API - # @param [Hash] solution Path solution for the resource - # @return [ApprovalFetchPage] ApprovalFetchPage - def initialize(version, response, solution) - super(version, response) + # Provide a user friendly representation + def to_s + '#<Twilio.Content.V1.ApprovalFetchList>' + end + end - # Path Solution - @solution = solution - end - ## - # Build an instance of ApprovalFetchInstance - # @param [Hash] payload Payload response from the API - # @return [ApprovalFetchInstance] ApprovalFetchInstance - def get_instance(payload) - ApprovalFetchInstance.new(@version, payload, sid: @solution[:sid], ) - end + ## + #PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. + class ApprovalFetchContext < InstanceContext + ## + # Initialize the ApprovalFetchContext + # @param [Version] version Version that contains the resource + # @param [String] sid The Twilio-provided string that uniquely identifies the Content resource whose approval information to fetch. + # @return [ApprovalFetchContext] ApprovalFetchContext + def initialize(version, sid) + super(version) - ## - # Provide a user friendly representation - def to_s - '<Twilio.Content.V1.ApprovalFetchPage>' - end - end + # Path Solution + @solution = { sid: sid, } + @uri = "/Content/#{@solution[:sid]}/ApprovalRequests" - ## - # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. - class ApprovalFetchContext < InstanceContext - ## - # Initialize the ApprovalFetchContext - # @param [Version] version Version that contains the resource - # @param [String] sid The Twilio-provided string that uniquely identifies the - # Content resource whose approval information to fetch. - # @return [ApprovalFetchContext] ApprovalFetchContext - def initialize(version, sid) - super(version) + + end + ## + # Fetch the ApprovalFetchInstance + # @return [ApprovalFetchInstance] Fetched ApprovalFetchInstance + def fetch - # Path Solution - @solution = {sid: sid, } - @uri = "/Content/#{@solution[:sid]}/ApprovalRequests" - end + payload = @version.fetch('GET', @uri) + ApprovalFetchInstance.new( + @version, + payload, + sid: @solution[:sid], + ) + end - ## - # Fetch the ApprovalFetchInstance - # @return [ApprovalFetchInstance] Fetched ApprovalFetchInstance - def fetch - payload = @version.fetch('GET', @uri) - ApprovalFetchInstance.new(@version, payload, sid: @solution[:sid], ) - end + ## + # Provide a user friendly representation + def to_s + context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') + "#<Twilio.Content.V1.ApprovalFetchContext #{context}>" + end - ## - # Provide a user friendly representation - def to_s - context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') - "#<Twilio.Content.V1.ApprovalFetchContext #{context}>" - end + ## + # Provide a detailed, user friendly representation + def inspect + context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') + "#<Twilio.Content.V1.ApprovalFetchContext #{context}>" + end + end - ## - # Provide a detailed, user friendly representation - def inspect - context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') - "#<Twilio.Content.V1.ApprovalFetchContext #{context}>" - end - end + class ApprovalFetchPage < Page + ## + # Initialize the ApprovalFetchPage + # @param [Version] version Version that contains the resource + # @param [Response] response Response from the API + # @param [Hash] solution Path solution for the resource + # @return [ApprovalFetchPage] ApprovalFetchPage + def initialize(version, response, solution) + super(version, response) - ## - # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. - class ApprovalFetchInstance < InstanceResource - ## - # Initialize the ApprovalFetchInstance - # @param [Version] version Version that contains the resource - # @param [Hash] payload payload that contains response from Twilio - # @param [String] sid The unique string that that we created to identify the - # Content resource. - # @return [ApprovalFetchInstance] ApprovalFetchInstance - def initialize(version, payload, sid: nil) - super(version) + # Path Solution + @solution = solution + end - # Marshaled Properties - @properties = { - 'sid' => payload['sid'], - 'account_sid' => payload['account_sid'], - 'whatsapp' => payload['whatsapp'], - 'url' => payload['url'], - } + ## + # Build an instance of ApprovalFetchInstance + # @param [Hash] payload Payload response from the API + # @return [ApprovalFetchInstance] ApprovalFetchInstance + def get_instance(payload) + ApprovalFetchInstance.new(@version, payload, sid: @solution[:sid]) + end - # Context - @instance_context = nil - @params = {'sid' => sid, } - end + ## + # Provide a user friendly representation + def to_s + '<Twilio.Content.V1.ApprovalFetchPage>' + end + end + class ApprovalFetchInstance < InstanceResource + ## + # Initialize the ApprovalFetchInstance + # @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 ApprovalFetch + # resource. + # @param [String] sid The SID of the Call resource to fetch. + # @return [ApprovalFetchInstance] ApprovalFetchInstance + def initialize(version, payload , sid: nil) + super(version) + + # Marshaled Properties + @properties = { + 'sid' => payload['sid'], + 'account_sid' => payload['account_sid'], + 'whatsapp' => payload['whatsapp'], + 'url' => payload['url'], + } - ## - # Generate an instance context for the instance, the context is capable of - # performing various actions. All instance actions are proxied to the context - # @return [ApprovalFetchContext] ApprovalFetchContext for this ApprovalFetchInstance - def context - unless @instance_context - @instance_context = ApprovalFetchContext.new(@version, @params['sid'], ) - end - @instance_context - end + # Context + @instance_context = nil + @params = { 'sid' => sid || @properties['sid'] , } + end - ## - # @return [String] The unique string that identifies the Content resource - def sid - @properties['sid'] - 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 [ApprovalFetchContext] CallContext for this CallInstance + def context + unless @instance_context + @instance_context = ApprovalFetchContext.new(@version , @params['sid']) + end + @instance_context + end + + ## + # @return [String] The unique string that that we created to identify the Content resource. + def sid + @properties['sid'] + end + + ## + # @return [String] The SID of the [Account](https://www.twilio.com/docs/usage/api/account) that created Content resource. + def account_sid + @properties['account_sid'] + end + + ## + # @return [Hash] Contains the whatsapp approval information for the Content resource, with fields such as approval status, rejection reason, and category, amongst others. + def whatsapp + @properties['whatsapp'] + end + + ## + # @return [String] The URL of the resource, relative to `https://content.twilio.com`. + def url + @properties['url'] + end + + ## + # Fetch the ApprovalFetchInstance + # @return [ApprovalFetchInstance] Fetched ApprovalFetchInstance + def fetch - ## - # @return [String] The SID of the Account that created the Content resource - def account_sid - @properties['account_sid'] - end + context.fetch + end - ## - # @return [Hash] Contains the whatsapp approval information for the Content resource - def whatsapp - @properties['whatsapp'] - end + ## + # Provide a user friendly representation + def to_s + values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") + "<Twilio.Content.V1.ApprovalFetchInstance #{values}>" + end - ## - # @return [String] The URL of the resource, relative to `https://content.twilio.com` - def url - @properties['url'] - end + ## + # Provide a detailed, user friendly representation + def inspect + values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") + "<Twilio.Content.V1.ApprovalFetchInstance #{values}>" + end + end - ## - # Fetch the ApprovalFetchInstance - # @return [ApprovalFetchInstance] Fetched ApprovalFetchInstance - def fetch - context.fetch + end end - - ## - # Provide a user friendly representation - def to_s - values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") - "<Twilio.Content.V1.ApprovalFetchInstance #{values}>" - end - - ## - # Provide a detailed, user friendly representation - def inspect - values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") - "<Twilio.Content.V1.ApprovalFetchInstance #{values}>" - end - end end - end end - end -end \ No newline at end of file +end + +