## # This code was generated by # \ / _ _ _| _ _ # | (_)\/(_)(_|\/| |(/_ v1.0.0 # / / # # frozen_string_literal: true module Twilio module REST class Preview < Domain class TrustedComms < Version ## # 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 BrandedChannelList < ListResource ## # Initialize the BrandedChannelList # @param [Version] version Version that contains the resource # @return [BrandedChannelList] BrandedChannelList def initialize(version) super(version) # Path Solution @solution = {} 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 BrandedChannelPage < Page ## # Initialize the BrandedChannelPage # @param [Version] version Version that contains the resource # @param [Response] response Response from the API # @param [Hash] solution Path solution for the resource # @return [BrandedChannelPage] BrandedChannelPage def initialize(version, response, solution) super(version, response) # Path Solution @solution = solution end ## # Build an instance of BrandedChannelInstance # @param [Hash] payload Payload response from the API # @return [BrandedChannelInstance] BrandedChannelInstance def get_instance(payload) BrandedChannelInstance.new(@version, payload, ) 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 BrandedChannelContext < InstanceContext ## # Initialize the BrandedChannelContext # @param [Version] version Version that contains the resource # @param [String] sid The unique SID identifier of the Branded Channel. # @return [BrandedChannelContext] BrandedChannelContext def initialize(version, sid) super(version) # Path Solution @solution = {sid: sid, } @uri = "/BrandedChannels/#{@solution[:sid]}" # Dependents @channels = nil end ## # Fetch the BrandedChannelInstance # @return [BrandedChannelInstance] Fetched BrandedChannelInstance def fetch payload = @version.fetch('GET', @uri) BrandedChannelInstance.new(@version, payload, sid: @solution[:sid], ) end ## # Access the channels # @return [ChannelList] # @return [ChannelContext] def channels unless @channels @channels = ChannelList.new(@version, branded_channel_sid: @solution[:sid], ) end @channels 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 BrandedChannelInstance < InstanceResource ## # Initialize the BrandedChannelInstance # @param [Version] version Version that contains the resource # @param [Hash] payload payload that contains response from Twilio # @param [String] sid The unique SID identifier of the Branded Channel. # @return [BrandedChannelInstance] BrandedChannelInstance def initialize(version, payload, sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'business_sid' => payload['business_sid'], 'brand_sid' => payload['brand_sid'], 'sid' => payload['sid'], 'links' => payload['links'], 'url' => payload['url'], } # Context @instance_context = nil @params = {'sid' => 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 [BrandedChannelContext] BrandedChannelContext for this BrandedChannelInstance def context unless @instance_context @instance_context = BrandedChannelContext.new(@version, @params['sid'], ) end @instance_context end ## # @return [String] Account Sid. def account_sid @properties['account_sid'] end ## # @return [String] Business Sid. def business_sid @properties['business_sid'] end ## # @return [String] Brand Sid. def brand_sid @properties['brand_sid'] end ## # @return [String] Branded Channel Sid. def sid @properties['sid'] end ## # @return [String] Nested resource URLs. def links @properties['links'] end ## # @return [String] The URL of this resource. def url @properties['url'] end ## # Fetch the BrandedChannelInstance # @return [BrandedChannelInstance] Fetched BrandedChannelInstance def fetch context.fetch end ## # Access the channels # @return [channels] channels def channels context.channels 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