## # This code was generated by # \ / _ _ _| _ _ # | (_)\/(_)(_|\/| |(/_ v1.0.0 # / / # # frozen_string_literal: true module Twilio module REST class Studio < Domain class V2 < Version class FlowContext < InstanceContext ## # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. class FlowTestUserList < ListResource ## # Initialize the FlowTestUserList # @param [Version] version Version that contains the resource # @param [String] sid The sid # @return [FlowTestUserList] FlowTestUserList 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 beta products that are subject to change. Use them with caution. class FlowTestUserPage < Page ## # Initialize the FlowTestUserPage # @param [Version] version Version that contains the resource # @param [Response] response Response from the API # @param [Hash] solution Path solution for the resource # @return [FlowTestUserPage] FlowTestUserPage def initialize(version, response, solution) super(version, response) # Path Solution @solution = solution end ## # Build an instance of FlowTestUserInstance # @param [Hash] payload Payload response from the API # @return [FlowTestUserInstance] FlowTestUserInstance def get_instance(payload) FlowTestUserInstance.new(@version, payload, sid: @solution[:sid], ) end ## # Provide a user friendly representation def to_s '' end end ## # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. class FlowTestUserContext < InstanceContext ## # Initialize the FlowTestUserContext # @param [Version] version Version that contains the resource # @param [String] sid The sid # @return [FlowTestUserContext] FlowTestUserContext def initialize(version, sid) super(version) # Path Solution @solution = {sid: sid, } @uri = "/Flows/#{@solution[:sid]}/TestUsers" end ## # Fetch the FlowTestUserInstance # @return [FlowTestUserInstance] Fetched FlowTestUserInstance def fetch payload = @version.fetch('GET', @uri) FlowTestUserInstance.new(@version, payload, sid: @solution[:sid], ) end ## # Update the FlowTestUserInstance # @param [String] test_users The test_users # @return [FlowTestUserInstance] Updated FlowTestUserInstance def update(test_users: nil) data = Twilio::Values.of({'TestUsers' => Twilio.serialize_list(test_users) { |e| e }, }) payload = @version.update('POST', @uri, data: data) FlowTestUserInstance.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 beta products that are subject to change. Use them with caution. class FlowTestUserInstance < InstanceResource ## # Initialize the FlowTestUserInstance # @param [Version] version Version that contains the resource # @param [Hash] payload payload that contains response from Twilio # @param [String] sid The sid # @return [FlowTestUserInstance] FlowTestUserInstance def initialize(version, payload, sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'test_users' => payload['test_users'], '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 [FlowTestUserContext] FlowTestUserContext for this FlowTestUserInstance def context unless @instance_context @instance_context = FlowTestUserContext.new(@version, @params['sid'], ) end @instance_context end ## # @return [String] The sid def sid @properties['sid'] end ## # @return [String] The test_users def test_users @properties['test_users'] end ## # @return [String] The url def url @properties['url'] end ## # Fetch the FlowTestUserInstance # @return [FlowTestUserInstance] Fetched FlowTestUserInstance def fetch context.fetch end ## # Update the FlowTestUserInstance # @param [String] test_users The test_users # @return [FlowTestUserInstance] Updated FlowTestUserInstance def update(test_users: nil) context.update(test_users: test_users, ) 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