## # 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 BusinessList < ListResource ## # Initialize the BusinessList # @param [Version] version Version that contains the resource # @return [BusinessList] BusinessList 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 BusinessPage < Page ## # Initialize the BusinessPage # @param [Version] version Version that contains the resource # @param [Response] response Response from the API # @param [Hash] solution Path solution for the resource # @return [BusinessPage] BusinessPage def initialize(version, response, solution) super(version, response) # Path Solution @solution = solution end ## # Build an instance of BusinessInstance # @param [Hash] payload Payload response from the API # @return [BusinessInstance] BusinessInstance def get_instance(payload) BusinessInstance.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 BusinessContext < InstanceContext ## # Initialize the BusinessContext # @param [Version] version Version that contains the resource # @param [String] sid A 34 character string that uniquely identifies this # Business. # @return [BusinessContext] BusinessContext def initialize(version, sid) super(version) # Path Solution @solution = {sid: sid, } @uri = "/Businesses/#{@solution[:sid]}" # Dependents @insights = nil end ## # Fetch a BusinessInstance # @return [BusinessInstance] Fetched BusinessInstance def fetch params = Twilio::Values.of({}) payload = @version.fetch( 'GET', @uri, params, ) BusinessInstance.new(@version, payload, sid: @solution[:sid], ) end ## # Access the insights # @return [InsightsList] # @return [InsightsContext] def insights unless @insights @insights = InsightsList.new(@version, business_sid: @solution[:sid], ) end @insights 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 BusinessInstance < InstanceResource ## # Initialize the BusinessInstance # @param [Version] version Version that contains the resource # @param [Hash] payload payload that contains response from Twilio # @param [String] sid A 34 character string that uniquely identifies this # Business. # @return [BusinessInstance] BusinessInstance def initialize(version, payload, sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'sid' => payload['sid'], 'url' => payload['url'], 'links' => payload['links'], } # 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 [BusinessContext] BusinessContext for this BusinessInstance def context unless @instance_context @instance_context = BusinessContext.new(@version, @params['sid'], ) end @instance_context end ## # @return [String] Account Sid. def account_sid @properties['account_sid'] end ## # @return [String] A string that uniquely identifies this Business. def sid @properties['sid'] end ## # @return [String] The URL of this resource. def url @properties['url'] end ## # @return [String] Nested resource URLs. def links @properties['links'] end ## # Fetch a BusinessInstance # @return [BusinessInstance] Fetched BusinessInstance def fetch context.fetch end ## # Access the insights # @return [insights] insights def insights context.insights 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