=begin #Treezor #Treezor API. more info [here](https://www.treezor.com). OpenAPI spec version: 0.1.1 Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.4.19 =end require 'uri' module TreezorClient class MerchantIdRestrictionGroupsApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # cancel a merchant id restriction group # Cancel a merchant id restriction group from the system. # @param id Merchant ID restriction Group internal id. # @param [Hash] opts the optional parameters # @option opts [Array] :fields List of the object's properties you want to pick up. # @return [InlineResponse20016] def delete_merchant_id_restriction_groups(id, opts = {}) data, _status_code, _headers = delete_merchant_id_restriction_groups_with_http_info(id, opts) data end # cancel a merchant id restriction group # Cancel a merchant id restriction group from the system. # @param id Merchant ID restriction Group internal id. # @param [Hash] opts the optional parameters # @option opts [Array] :fields List of the object's properties you want to pick up. # @return [Array<(InlineResponse20016, Fixnum, Hash)>] InlineResponse20016 data, response status code and response headers def delete_merchant_id_restriction_groups_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MerchantIdRestrictionGroupsApi.delete_merchant_id_restriction_groups ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling MerchantIdRestrictionGroupsApi.delete_merchant_id_restriction_groups" end # resource path local_var_path = '/merchantIdRestrictionGroups/{id}'.sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api_key'] 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, :return_type => 'InlineResponse20016') if @api_client.config.debugging @api_client.config.logger.debug "API called: MerchantIdRestrictionGroupsApi#delete_merchant_id_restriction_groups\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # search merchant id restriction groups # Get merchant ID restriction groups that match search criteria. # @param [Hash] opts the optional parameters # @option opts [String] :access_signature Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](https://agent.treezor.com/security-authentication). # @option opts [String] :access_tag Access tag is used for idem potency query. More info [here](https://agent.treezor.com/basics). # @option opts [Integer] :access_user_id Access user's id is used for user's action restriction. More info [here](https://agent.treezor.com/basics). # @option opts [String] :access_user_ip Access user's ip is used for user's action restriction. More info [here](https://agent.treezor.com/basics). # @option opts [Array] :fields List of the object's properties you want to pick up. # @option opts [String] :filter You can filter the API response by using filter(s). Filterable fields are : - id - name - isWhitelist - status - startDate - createdDate Filters should be separated by a \";\". Example for 3 filters : FILTER1;FILTER2;FILTER3. A single filter has the following syntax : \"fieldName criterion expression\". Where : - fieldName : the name of a filterable field of this object. - expression : the values to be included or excluded (see the table below for more information) - criterion : a filter criterion. Here are the possible values for criterion : | Criteria | Description | Type | Expression Example | |----------|------------------------|------------------------------------------|--------------------| | > | greater than | alphanumeric string | 100 | | >= | greater or equal than | alphanumeric string | 100 | | < | less than | alphanumeric string | 100 | | <= | less or equal than | alphanumeric string | 100 | | != | not equal to | alphanumeric string | 100 | | like | like | alphanumeric string | 100 | | in | in | alphanumeric strings separated by commas | 100,30,25 | | == | equals | alphanumeric string | 100 | # @option opts [Integer] :page_number Pagination page number. More info [here](https://agent.treezor.com/lists). # @option opts [Integer] :page_count The number of items per page. More info [here](https://agent.treezor.com/lists). # @option opts [String] :sort_by The transaction element you want to sort the list with. Default value : _createdDate_. More info [here](https://agent.treezor.com/lists). # @option opts [String] :sort_order The order you want to sort the list. * **DESC** for a descending sort * **ASC** for a ascending sort. Default value : DESC. More info [here](https://agent.treezor.com/lists). # @return [InlineResponse20016] def get_merchant_id_restriction_group(opts = {}) data, _status_code, _headers = get_merchant_id_restriction_group_with_http_info(opts) data end # search merchant id restriction groups # Get merchant ID restriction groups that match search criteria. # @param [Hash] opts the optional parameters # @option opts [String] :access_signature Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](https://agent.treezor.com/security-authentication). # @option opts [String] :access_tag Access tag is used for idem potency query. More info [here](https://agent.treezor.com/basics). # @option opts [Integer] :access_user_id Access user's id is used for user's action restriction. More info [here](https://agent.treezor.com/basics). # @option opts [String] :access_user_ip Access user's ip is used for user's action restriction. More info [here](https://agent.treezor.com/basics). # @option opts [Array] :fields List of the object's properties you want to pick up. # @option opts [String] :filter You can filter the API response by using filter(s). Filterable fields are : - id - name - isWhitelist - status - startDate - createdDate Filters should be separated by a \";\". Example for 3 filters : FILTER1;FILTER2;FILTER3. A single filter has the following syntax : \"fieldName criterion expression\". Where : - fieldName : the name of a filterable field of this object. - expression : the values to be included or excluded (see the table below for more information) - criterion : a filter criterion. Here are the possible values for criterion : | Criteria | Description | Type | Expression Example | |----------|------------------------|------------------------------------------|--------------------| | > | greater than | alphanumeric string | 100 | | >= | greater or equal than | alphanumeric string | 100 | | < | less than | alphanumeric string | 100 | | <= | less or equal than | alphanumeric string | 100 | | != | not equal to | alphanumeric string | 100 | | like | like | alphanumeric string | 100 | | in | in | alphanumeric strings separated by commas | 100,30,25 | | == | equals | alphanumeric string | 100 | # @option opts [Integer] :page_number Pagination page number. More info [here](https://agent.treezor.com/lists). # @option opts [Integer] :page_count The number of items per page. More info [here](https://agent.treezor.com/lists). # @option opts [String] :sort_by The transaction element you want to sort the list with. Default value : _createdDate_. More info [here](https://agent.treezor.com/lists). # @option opts [String] :sort_order The order you want to sort the list. * **DESC** for a descending sort * **ASC** for a ascending sort. Default value : DESC. More info [here](https://agent.treezor.com/lists). # @return [Array<(InlineResponse20016, Fixnum, Hash)>] InlineResponse20016 data, response status code and response headers def get_merchant_id_restriction_group_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MerchantIdRestrictionGroupsApi.get_merchant_id_restriction_group ...' end # resource path local_var_path = '/merchantIdRestrictionGroups' # query parameters query_params = {} query_params[:'accessSignature'] = opts[:'access_signature'] if !opts[:'access_signature'].nil? query_params[:'accessTag'] = opts[:'access_tag'] if !opts[:'access_tag'].nil? query_params[:'accessUserId'] = opts[:'access_user_id'] if !opts[:'access_user_id'].nil? query_params[:'accessUserIp'] = opts[:'access_user_ip'] if !opts[:'access_user_ip'].nil? query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? query_params[:'pageNumber'] = opts[:'page_number'] if !opts[:'page_number'].nil? query_params[:'pageCount'] = opts[:'page_count'] if !opts[:'page_count'].nil? query_params[:'sortBy'] = opts[:'sort_by'] if !opts[:'sort_by'].nil? query_params[:'sortOrder'] = opts[:'sort_order'] if !opts[:'sort_order'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api_key'] 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 => 'InlineResponse20016') if @api_client.config.debugging @api_client.config.logger.debug "API called: MerchantIdRestrictionGroupsApi#get_merchant_id_restriction_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # get a merchant ID restriction group # Get a merchant ID restriction group from the system. # @param id Merchant ID restriction Group internal id. # @param [Hash] opts the optional parameters # @option opts [Array] :fields List of the object's properties you want to pick up. # @return [InlineResponse20016] def get_merchant_id_restriction_groups_id(id, opts = {}) data, _status_code, _headers = get_merchant_id_restriction_groups_id_with_http_info(id, opts) data end # get a merchant ID restriction group # Get a merchant ID restriction group from the system. # @param id Merchant ID restriction Group internal id. # @param [Hash] opts the optional parameters # @option opts [Array] :fields List of the object's properties you want to pick up. # @return [Array<(InlineResponse20016, Fixnum, Hash)>] InlineResponse20016 data, response status code and response headers def get_merchant_id_restriction_groups_id_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MerchantIdRestrictionGroupsApi.get_merchant_id_restriction_groups_id ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling MerchantIdRestrictionGroupsApi.get_merchant_id_restriction_groups_id" end # resource path local_var_path = '/merchantIdRestrictionGroups/{id}'.sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api_key'] 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 => 'InlineResponse20016') if @api_client.config.debugging @api_client.config.logger.debug "API called: MerchantIdRestrictionGroupsApi#get_merchant_id_restriction_groups_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # edit the merchant ID list for a restriction group # Edit the merchant ID list for a restriction group in the system. # @param id Merchant ID restriction group's id. # @param [Hash] opts the optional parameters # @option opts [String] :access_signature Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](https://agent.treezor.com/security-authentication). # @option opts [String] :access_tag Access tag is used for idem potency query. More info [here](https://agent.treezor.com/basics). # @option opts [Integer] :access_user_id Access user's id is used for user's action restriction. More info [here](https://agent.treezor.com/basics). # @option opts [String] :access_user_ip Access user's ip is used for user's action restriction. More info [here](https://agent.treezor.com/basics). # @option opts [Body11] :body # @return [InlineResponse20016] def merchant_id_restriction_groups_id_delta_update_put(id, opts = {}) data, _status_code, _headers = merchant_id_restriction_groups_id_delta_update_put_with_http_info(id, opts) data end # edit the merchant ID list for a restriction group # Edit the merchant ID list for a restriction group in the system. # @param id Merchant ID restriction group's id. # @param [Hash] opts the optional parameters # @option opts [String] :access_signature Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](https://agent.treezor.com/security-authentication). # @option opts [String] :access_tag Access tag is used for idem potency query. More info [here](https://agent.treezor.com/basics). # @option opts [Integer] :access_user_id Access user's id is used for user's action restriction. More info [here](https://agent.treezor.com/basics). # @option opts [String] :access_user_ip Access user's ip is used for user's action restriction. More info [here](https://agent.treezor.com/basics). # @option opts [Body11] :body # @return [Array<(InlineResponse20016, Fixnum, Hash)>] InlineResponse20016 data, response status code and response headers def merchant_id_restriction_groups_id_delta_update_put_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MerchantIdRestrictionGroupsApi.merchant_id_restriction_groups_id_delta_update_put ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling MerchantIdRestrictionGroupsApi.merchant_id_restriction_groups_id_delta_update_put" end # resource path local_var_path = '/merchantIdRestrictionGroups/{id}/DeltaUpdate/'.sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} query_params[:'accessSignature'] = opts[:'access_signature'] if !opts[:'access_signature'].nil? query_params[:'accessTag'] = opts[:'access_tag'] if !opts[:'access_tag'].nil? query_params[:'accessUserId'] = opts[:'access_user_id'] if !opts[:'access_user_id'].nil? query_params[:'accessUserIp'] = opts[:'access_user_ip'] if !opts[:'access_user_ip'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['api_key'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'InlineResponse20016') if @api_client.config.debugging @api_client.config.logger.debug "API called: MerchantIdRestrictionGroupsApi#merchant_id_restriction_groups_id_delta_update_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # create a merchantIdRestrictionGroup # Create a new merchant ID restriction group in the system. # @param [Hash] opts the optional parameters # @option opts [String] :access_signature Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](https://agent.treezor.com/security-authentication). # @option opts [String] :access_tag Access tag is used for idem potency query. More info [here](https://agent.treezor.com/basics). # @option opts [Integer] :access_user_id Access user's id is used for user's action restriction. More info [here](https://agent.treezor.com/basics). # @option opts [String] :access_user_ip Access user's ip is used for user's action restriction. More info [here](https://agent.treezor.com/basics). # @option opts [Body9] :body # @return [InlineResponse20016] def post_merchant_id_restriction_group(opts = {}) data, _status_code, _headers = post_merchant_id_restriction_group_with_http_info(opts) data end # create a merchantIdRestrictionGroup # Create a new merchant ID restriction group in the system. # @param [Hash] opts the optional parameters # @option opts [String] :access_signature Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](https://agent.treezor.com/security-authentication). # @option opts [String] :access_tag Access tag is used for idem potency query. More info [here](https://agent.treezor.com/basics). # @option opts [Integer] :access_user_id Access user's id is used for user's action restriction. More info [here](https://agent.treezor.com/basics). # @option opts [String] :access_user_ip Access user's ip is used for user's action restriction. More info [here](https://agent.treezor.com/basics). # @option opts [Body9] :body # @return [Array<(InlineResponse20016, Fixnum, Hash)>] InlineResponse20016 data, response status code and response headers def post_merchant_id_restriction_group_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MerchantIdRestrictionGroupsApi.post_merchant_id_restriction_group ...' end # resource path local_var_path = '/merchantIdRestrictionGroups' # query parameters query_params = {} query_params[:'accessSignature'] = opts[:'access_signature'] if !opts[:'access_signature'].nil? query_params[:'accessTag'] = opts[:'access_tag'] if !opts[:'access_tag'].nil? query_params[:'accessUserId'] = opts[:'access_user_id'] if !opts[:'access_user_id'].nil? query_params[:'accessUserIp'] = opts[:'access_user_ip'] if !opts[:'access_user_ip'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['api_key'] 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 => 'InlineResponse20016') if @api_client.config.debugging @api_client.config.logger.debug "API called: MerchantIdRestrictionGroupsApi#post_merchant_id_restriction_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # edit a merchant id restriction group # Edit a merchant id restriction group in the system. # @param id Merchant ID restriction group's id. # @param [Hash] opts the optional parameters # @option opts [String] :access_signature Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](https://agent.treezor.com/security-authentication). # @option opts [String] :access_tag Access tag is used for idem potency query. More info [here](https://agent.treezor.com/basics). # @option opts [Integer] :access_user_id Access user's id is used for user's action restriction. More info [here](https://agent.treezor.com/basics). # @option opts [String] :access_user_ip Access user's ip is used for user's action restriction. More info [here](https://agent.treezor.com/basics). # @option opts [Body10] :body # @return [InlineResponse20016] def put_merchant_id_restriction_groups(id, opts = {}) data, _status_code, _headers = put_merchant_id_restriction_groups_with_http_info(id, opts) data end # edit a merchant id restriction group # Edit a merchant id restriction group in the system. # @param id Merchant ID restriction group's id. # @param [Hash] opts the optional parameters # @option opts [String] :access_signature Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](https://agent.treezor.com/security-authentication). # @option opts [String] :access_tag Access tag is used for idem potency query. More info [here](https://agent.treezor.com/basics). # @option opts [Integer] :access_user_id Access user's id is used for user's action restriction. More info [here](https://agent.treezor.com/basics). # @option opts [String] :access_user_ip Access user's ip is used for user's action restriction. More info [here](https://agent.treezor.com/basics). # @option opts [Body10] :body # @return [Array<(InlineResponse20016, Fixnum, Hash)>] InlineResponse20016 data, response status code and response headers def put_merchant_id_restriction_groups_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MerchantIdRestrictionGroupsApi.put_merchant_id_restriction_groups ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling MerchantIdRestrictionGroupsApi.put_merchant_id_restriction_groups" end # resource path local_var_path = '/merchantIdRestrictionGroups/{id}'.sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} query_params[:'accessSignature'] = opts[:'access_signature'] if !opts[:'access_signature'].nil? query_params[:'accessTag'] = opts[:'access_tag'] if !opts[:'access_tag'].nil? query_params[:'accessUserId'] = opts[:'access_user_id'] if !opts[:'access_user_id'].nil? query_params[:'accessUserIp'] = opts[:'access_user_ip'] if !opts[:'access_user_ip'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['api_key'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'InlineResponse20016') if @api_client.config.debugging @api_client.config.logger.debug "API called: MerchantIdRestrictionGroupsApi#put_merchant_id_restriction_groups\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end