## # This code was generated by # ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ # # Twilio - Studio # 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 Studio < StudioBase class V2 < Version class FlowContext < InstanceContext class FlowTestUserList < ListResource ## # Initialize the FlowTestUserList # @param [Version] version Version that contains the resource # @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 class FlowTestUserContext < InstanceContext ## # Initialize the FlowTestUserContext # @param [Version] version Version that contains the resource # @param [String] sid Unique identifier of the flow. # @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 [Array[String]] test_users List of test user identities that can test draft versions of the flow. # @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 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 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] account_sid The SID of the # {Account}[https://www.twilio.com/docs/iam/api/account] that created this FlowTestUser # resource. # @param [String] sid The SID of the Call resource to fetch. # @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 || @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 [FlowTestUserContext] CallContext for this CallInstance def context unless @instance_context @instance_context = FlowTestUserContext.new(@version , @params['sid']) end @instance_context end ## # @return [String] Unique identifier of the flow. def sid @properties['sid'] end ## # @return [Array] List of test user identities that can test draft versions of the flow. def test_users @properties['test_users'] end ## # @return [String] The URL of this resource. def url @properties['url'] end ## # Fetch the FlowTestUserInstance # @return [FlowTestUserInstance] Fetched FlowTestUserInstance def fetch context.fetch end ## # Update the FlowTestUserInstance # @param [Array[String]] test_users List of test user identities that can test draft versions of the flow. # @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