=begin #DocuSign Rooms API - v2 #An API for an integrator to access the features of DocuSign Rooms OpenAPI spec version: v2 Contact: devcenter@docusign.com Generated by: https://github.com/swagger-api/swagger-codegen.git =end require "uri" module DocuSign_Rooms class GetRegionsOptions # Number of regions to include in the response, (Default 100). attr_accessor :count # Position in the overall list of regions to begin results. attr_accessor :start_position # When true, the response only includes regions that the calling user can manage. attr_accessor :managed_only def self.default @@default ||= GetRegionsOptions.new end end class RegionsApi attr_accessor :api_client def initialize(api_client = RegionsApi.default) @api_client = api_client end # Creates a new region for a company # Creates a new region for a company # @param account_id (Required) The globally unique identifier (GUID) for the account. # @param body The information required to create a new region for the caller's company (optional parameter) # @return [Region] def create_region(account_id, body) data, _status_code, _headers = create_region_with_http_info(account_id, body) return data end # Creates a new region for a company # Creates a new region for a company # @param account_id (Required) The globally unique identifier (GUID) for the account. # @param body The information required to create a new region for the caller's company (optional parameter) # @return [Array<(Region, Fixnum, Hash)>] Region data, response status code and response headers def create_region_with_http_info(account_id, body) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: RegionsApi.create_region ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling RegionsApi.create_region" if account_id.nil? # resource path local_var_path = "/v2/accounts/{accountId}/regions".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json', 'application/xml', 'text/xml']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json-patch+json', 'application/json', 'text/json', 'application/*+json', 'application/xml', 'text/xml', 'application/*+xml']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Region') if @api_client.config.debugging @api_client.config.logger.debug "API called: RegionsApi#create_region\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete a region. # Delete a region. # @param region_id Id of the desired region # @param account_id (Required) The globally unique identifier (GUID) for the account. # @return [nil] def delete_region(region_id, account_id) delete_region_with_http_info(region_id, account_id) return nil end # Delete a region. # Delete a region. # @param region_id Id of the desired region # @param account_id (Required) The globally unique identifier (GUID) for the account. # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def delete_region_with_http_info(region_id, account_id) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: RegionsApi.delete_region ..." end # verify the required parameter 'region_id' is set fail ArgumentError, "Missing the required parameter 'region_id' when calling RegionsApi.delete_region" if region_id.nil? # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling RegionsApi.delete_region" if account_id.nil? # resource path local_var_path = "/v2/accounts/{accountId}/regions/{regionId}".sub('{format}','json').sub('{' + 'regionId' + '}', region_id.to_s).sub('{' + 'accountId' + '}', account_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json', 'application/xml', 'text/xml']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = [] data, status_code, headers = @api_client.call_api(:DELETE, local_var_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: RegionsApi#delete_region\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get information about the region with the given regionId # Get information about the region with the given regionId # @param region_id Id of the desired region # @param account_id (Required) The globally unique identifier (GUID) for the account. # @return [Region] def get_region(region_id, account_id) data, _status_code, _headers = get_region_with_http_info(region_id, account_id) return data end # Get information about the region with the given regionId # Get information about the region with the given regionId # @param region_id Id of the desired region # @param account_id (Required) The globally unique identifier (GUID) for the account. # @return [Array<(Region, Fixnum, Hash)>] Region data, response status code and response headers def get_region_with_http_info(region_id, account_id) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: RegionsApi.get_region ..." end # verify the required parameter 'region_id' is set fail ArgumentError, "Missing the required parameter 'region_id' when calling RegionsApi.get_region" if region_id.nil? # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling RegionsApi.get_region" if account_id.nil? # resource path local_var_path = "/v2/accounts/{accountId}/regions/{regionId}".sub('{format}','json').sub('{' + 'regionId' + '}', region_id.to_s).sub('{' + 'accountId' + '}', account_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json', 'application/xml', 'text/xml']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Region') if @api_client.config.debugging @api_client.config.logger.debug "API called: RegionsApi#get_region\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get region reference counts. # This method returns a list of each type of object and the number of objects of that type referencing the specified region. # @param region_id Id of the desired region # @param account_id (Required) The globally unique identifier (GUID) for the account. # @return [RegionReferenceCountList] def get_region_reference_counts(region_id, account_id) data, _status_code, _headers = get_region_reference_counts_with_http_info(region_id, account_id) return data end # Get region reference counts. # This method returns a list of each type of object and the number of objects of that type referencing the specified region. # @param region_id Id of the desired region # @param account_id (Required) The globally unique identifier (GUID) for the account. # @return [Array<(RegionReferenceCountList, Fixnum, Hash)>] RegionReferenceCountList data, response status code and response headers def get_region_reference_counts_with_http_info(region_id, account_id) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: RegionsApi.get_region_reference_counts ..." end # verify the required parameter 'region_id' is set fail ArgumentError, "Missing the required parameter 'region_id' when calling RegionsApi.get_region_reference_counts" if region_id.nil? # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling RegionsApi.get_region_reference_counts" if account_id.nil? # resource path local_var_path = "/v2/accounts/{accountId}/regions/{regionId}/reference_counts".sub('{format}','json').sub('{' + 'regionId' + '}', region_id.to_s).sub('{' + 'accountId' + '}', account_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json', 'application/xml', 'text/xml']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'RegionReferenceCountList') if @api_client.config.debugging @api_client.config.logger.debug "API called: RegionsApi#get_region_reference_counts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get account regions. # Returns a list of regions that are associated with a Rooms account. # @param account_id (Required) The globally unique identifier (GUID) for the account. # @param DocuSign_Rooms::GetRegionsOptions Options for modifying the behavior of the function. # @return [RegionSummaryList] def get_regions(account_id, options = DocuSign_Rooms::GetRegionsOptions.default) data, _status_code, _headers = get_regions_with_http_info(account_id, options) return data end # Get account regions. # Returns a list of regions that are associated with a Rooms account. # @param account_id (Required) The globally unique identifier (GUID) for the account. # @param DocuSign_Rooms::GetRegionsOptions Options for modifying the behavior of the function. # @return [Array<(RegionSummaryList, Fixnum, Hash)>] RegionSummaryList data, response status code and response headers def get_regions_with_http_info(account_id, options = DocuSign_Rooms::GetRegionsOptions.default) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: RegionsApi.get_regions ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling RegionsApi.get_regions" if account_id.nil? # resource path local_var_path = "/v2/accounts/{accountId}/regions".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s) # query parameters query_params = {} query_params[:'count'] = options.count if !options.count.nil? query_params[:'startPosition'] = options.start_position if !options.start_position.nil? query_params[:'managedOnly'] = options.managed_only if !options.managed_only.nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json', 'application/xml', 'text/xml']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'RegionSummaryList') if @api_client.config.debugging @api_client.config.logger.debug "API called: RegionsApi#get_regions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end