## # This code was generated by # \ / _ _ _| _ _ # | (_)\/(_)(_|\/| |(/_ v1.0.0 # / / # # frozen_string_literal: true 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) # Path Solution @solution = {sid: sid} end ## # Provide a user friendly representation def to_s '#' 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) # 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 ## # Provide a user friendly representation def to_s '' 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 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) # Path Solution @solution = {sid: sid, } @uri = "/Content/#{@solution[:sid]}/ApprovalRequests" 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(',') "#" end ## # Provide a detailed, user friendly representation def inspect context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#" 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 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) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'account_sid' => payload['account_sid'], 'whatsapp' => payload['whatsapp'], 'url' => payload['url'], } # Context @instance_context = nil @params = {'sid' => 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] ApprovalFetchContext for this ApprovalFetchInstance def context unless @instance_context @instance_context = ApprovalFetchContext.new(@version, @params['sid'], ) end @instance_context end ## # @return [String] The unique string that identifies the Content resource def sid @properties['sid'] end ## # @return [String] The SID of the Account that created the Content resource def account_sid @properties['account_sid'] end ## # @return [Hash] Contains the whatsapp approval information for the Content resource 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 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 end