require "uri" module PureCloud class ArchitectApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Get a pageable list of flows, filtered by query parameters # Multiple IDs can be specified, in which case all matching flows will be returned, and no other parameters will be evaluated. # @param [Hash] opts the optional parameters # @option opts [String] :type Type # @option opts [Integer] :page_number Page number # @option opts [Integer] :page_size Page size # @option opts [String] :sort_by Sort by # @option opts [String] :sort_order Sort order # @option opts [Array] :id ID # @option opts [String] :name Name # @option opts [String] :description Description # @option opts [String] :name_or_description Name or description # @option opts [String] :publish_version_id Publish version ID # @option opts [String] :editable_by Editable by # @option opts [String] :locked_by Locked by # @option opts [BOOLEAN] :deleted Include deleted # @return [FlowEntityListing] def get(opts = {}) data, status_code, headers = get_with_http_info(opts) return data end # Get a pageable list of flows, filtered by query parameters # Multiple IDs can be specified, in which case all matching flows will be returned, and no other parameters will be evaluated. # @param [Hash] opts the optional parameters # @option opts [String] :type Type # @option opts [Integer] :page_number Page number # @option opts [Integer] :page_size Page size # @option opts [String] :sort_by Sort by # @option opts [String] :sort_order Sort order # @option opts [Array] :id ID # @option opts [String] :name Name # @option opts [String] :description Description # @option opts [String] :name_or_description Name or description # @option opts [String] :publish_version_id Publish version ID # @option opts [String] :editable_by Editable by # @option opts [String] :locked_by Locked by # @option opts [BOOLEAN] :deleted Include deleted # @return [Array<(FlowEntityListing, Fixnum, Hash)>] FlowEntityListing data, response status code and response headers def get_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ArchitectApi#get ..." end # resource path path = "/api/v1/flows".sub('{format}','json') # query parameters query_params = {} query_params[:'type'] = opts[:'type'] if opts[:'type'] query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number'] query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size'] query_params[:'sortBy'] = opts[:'sort_by'] if opts[:'sort_by'] query_params[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order'] query_params[:'id'] = @api_client.build_collection_param(opts[:'id'], :multi) if opts[:'id'] query_params[:'name'] = opts[:'name'] if opts[:'name'] query_params[:'description'] = opts[:'description'] if opts[:'description'] query_params[:'nameOrDescription'] = opts[:'name_or_description'] if opts[:'name_or_description'] query_params[:'publishVersionId'] = opts[:'publish_version_id'] if opts[:'publish_version_id'] query_params[:'editableBy'] = opts[:'editable_by'] if opts[:'editable_by'] query_params[:'lockedBy'] = opts[:'locked_by'] if opts[:'locked_by'] query_params[:'deleted'] = opts[:'deleted'] if opts[:'deleted'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:GET, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'FlowEntityListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: ArchitectApi#get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create flow # # @param [Hash] opts the optional parameters # @option opts [Flow] :body # @return [Flow] def create(opts = {}) data, status_code, headers = create_with_http_info(opts) return data end # Create flow # # @param [Hash] opts the optional parameters # @option opts [Flow] :body # @return [Array<(Flow, Fixnum, Hash)>] Flow data, response status code and response headers def create_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ArchitectApi#create ..." end # resource path path = "/api/v1/flows".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:POST, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Flow') if @api_client.config.debugging @api_client.config.logger.debug "API called: ArchitectApi#create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Batch-delete a list of flows # Multiple IDs can be specified, in which case all specified flows will be deleted. # @param id List of Flow IDs # @param [Hash] opts the optional parameters # @option opts [BOOLEAN] :ignore_dependencies Ignore Dependencies # @return [nil] def delete(id, opts = {}) delete_with_http_info(id, opts) return nil end # Batch-delete a list of flows # Multiple IDs can be specified, in which case all specified flows will be deleted. # @param id List of Flow IDs # @param [Hash] opts the optional parameters # @option opts [BOOLEAN] :ignore_dependencies Ignore Dependencies # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def delete_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ArchitectApi#delete ..." end # verify the required parameter 'id' is set fail "Missing the required parameter 'id' when calling delete" if id.nil? # resource path path = "/api/v1/flows".sub('{format}','json') # query parameters query_params = {} query_params[:'id'] = @api_client.build_collection_param(id, :multi) query_params[:'ignoreDependencies'] = opts[:'ignore_dependencies'] if opts[:'ignore_dependencies'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:DELETE, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: ArchitectApi#delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end