class DocuSign_Rooms::RegionsApi
Attributes
Public Class Methods
# File lib/docusign_rooms/api/regions_api.rb, line 35 def initialize(api_client = RegionsApi.default) @api_client = api_client end
Public Instance Methods
Creates a new region for a company
@param account_id @param body (optional parameter) @return [Region]
# File lib/docusign_rooms/api/regions_api.rb, line 44 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
@param account_id @param body (optional parameter) @return [Array<(Region
, Fixnum, Hash)>] Region
data, response status code and response headers
# File lib/docusign_rooms/api/regions_api.rb, line 54 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']) # 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 = @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.
@param region_id Id of the desired region @param account_id @return [nil]
# File lib/docusign_rooms/api/regions_api.rb, line 97 def delete_region(region_id, account_id) delete_region_with_http_info(region_id, account_id) return nil end
Delete a region.
@param region_id Id of the desired region @param account_id @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/docusign_rooms/api/regions_api.rb, line 107 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']) # 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
@param region_id Id of the desired region @param account_id @return [Region]
# File lib/docusign_rooms/api/regions_api.rb, line 149 def get_region(region_id, account_id) data, _status_code, _headers = get_region_with_http_info(region_id, account_id) return data end
Get region reference counts.
@param region_id Id of the desired region @param account_id @return [RegionReferenceCountList]
# File lib/docusign_rooms/api/regions_api.rb, line 202 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.
@param region_id Id of the desired region @param account_id @return [Array<(RegionReferenceCountList
, Fixnum, Hash)>] RegionReferenceCountList
data, response status code and response headers
# File lib/docusign_rooms/api/regions_api.rb, line 212 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']) # 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 information about the region with the given regionId
@param region_id Id of the desired region @param account_id @return [Array<(Region
, Fixnum, Hash)>] Region
data, response status code and response headers
# File lib/docusign_rooms/api/regions_api.rb, line 159 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']) # 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 account
@param account_id @param DocuSign_Rooms::GetRegionsOptions
Options for modifying the behavior of the function. @return [RegionSummaryList]
# File lib/docusign_rooms/api/regions_api.rb, line 255 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
@param account_id @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
# File lib/docusign_rooms/api/regions_api.rb, line 265 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']) # 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