Source code for geonode.geoserver.acl.gsauth_client.api.rules_api

# coding: utf-8

"""
    GeoServer ACL

    GeoServer Access Control List API  # noqa: E501

    The version of the OpenAPI document: 1.0.0
    Generated by: https://openapi-generator.tech
"""


from __future__ import absolute_import

import re  # noqa: F401

# python 2 and python 3 compatibility library
import six

from geonode.geoserver.acl.gsauth_client.api_client import ApiClient
from geonode.geoserver.acl.gsauth_client.exceptions import (  # noqa: F401
    ApiTypeError,
    ApiValueError
)


[docs] class RulesApi(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ def __init__(self, api_client=None): if api_client is None: api_client = ApiClient()
[docs] self.api_client = api_client
[docs] def count_all_rules(self, **kwargs): # noqa: E501 """count_all_rules # noqa: E501 Returns the total number of rules # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.count_all_rules(async_req=True) >>> result = thread.get() :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: int """ kwargs['_return_http_data_only'] = True return self.count_all_rules_with_http_info(**kwargs) # noqa: E501
[docs] def count_all_rules_with_http_info(self, **kwargs): # noqa: E501 """count_all_rules # noqa: E501 Returns the total number of rules # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.count_all_rules_with_http_info(async_req=True) >>> result = thread.get() :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _return_http_data_only: response data without head status code and headers :type _return_http_data_only: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: tuple(int, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() all_params = [ ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout', '_request_auth', '_content_type', '_headers' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method count_all_rules" % key ) local_var_params[key] = val del local_var_params['kwargs'] collection_formats = {} path_params = {} query_params = [] header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['basicAuth'] # noqa: E501 response_types_map = { 200: "int", } return self.api_client.call_api( '/rules/query/count', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats, _request_auth=local_var_params.get('_request_auth'))
[docs] def count_rules(self, rule_filter, **kwargs): # noqa: E501 """count_rules # noqa: E501 Returns the number of rules that matches the search criteria # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.count_rules(rule_filter, async_req=True) >>> result = thread.get() :param rule_filter: (required) :type rule_filter: RuleFilter :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: int """ kwargs['_return_http_data_only'] = True return self.count_rules_with_http_info(rule_filter, **kwargs) # noqa: E501
[docs] def count_rules_with_http_info(self, rule_filter, **kwargs): # noqa: E501 """count_rules # noqa: E501 Returns the number of rules that matches the search criteria # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.count_rules_with_http_info(rule_filter, async_req=True) >>> result = thread.get() :param rule_filter: (required) :type rule_filter: RuleFilter :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _return_http_data_only: response data without head status code and headers :type _return_http_data_only: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: tuple(int, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() all_params = [ 'rule_filter' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout', '_request_auth', '_content_type', '_headers' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method count_rules" % key ) local_var_params[key] = val del local_var_params['kwargs'] collection_formats = {} path_params = {} query_params = [] header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} body_params = None if 'rule_filter' in local_var_params: body_params = local_var_params['rule_filter'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # HTTP header `Content-Type` content_types_list = local_var_params.get('_content_type', self.api_client.select_header_content_type( ['application/json', 'application/x-jackson-smile'], 'POST', body_params)) # noqa: E501 if content_types_list: header_params['Content-Type'] = content_types_list # Authentication setting auth_settings = ['basicAuth'] # noqa: E501 response_types_map = { 200: "int", } return self.api_client.call_api( '/rules/query/count', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats, _request_auth=local_var_params.get('_request_auth'))
[docs] def create_rule(self, rule, **kwargs): # noqa: E501 """create_rule # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.create_rule(rule, async_req=True) >>> result = thread.get() :param rule: (required) :type rule: Rule :param position: Displacement option related to how to interpret the Rule's priority :type position: InsertPosition :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: Rule """ kwargs['_return_http_data_only'] = True return self.create_rule_with_http_info(rule, **kwargs) # noqa: E501
[docs] def create_rule_with_http_info(self, rule, **kwargs): # noqa: E501 """create_rule # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.create_rule_with_http_info(rule, async_req=True) >>> result = thread.get() :param rule: (required) :type rule: Rule :param position: Displacement option related to how to interpret the Rule's priority :type position: InsertPosition :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _return_http_data_only: response data without head status code and headers :type _return_http_data_only: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: tuple(Rule, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() all_params = [ 'rule', 'position' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout', '_request_auth', '_content_type', '_headers' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method create_rule" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'rule' is set if self.api_client.client_side_validation and local_var_params.get('rule') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `rule` when calling `create_rule`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] if local_var_params.get('position') is not None: # noqa: E501 query_params.append(('position', local_var_params['position'])) # noqa: E501 header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} body_params = None if 'rule' in local_var_params: body_params = local_var_params['rule'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json', 'application/x-jackson-smile']) # noqa: E501 # HTTP header `Content-Type` content_types_list = local_var_params.get('_content_type', self.api_client.select_header_content_type( ['application/json', 'application/x-jackson-smile'], 'POST', body_params)) # noqa: E501 if content_types_list: header_params['Content-Type'] = content_types_list # Authentication setting auth_settings = ['basicAuth'] # noqa: E501 response_types_map = { 201: "Rule", 400: None, 409: None, } return self.api_client.call_api( '/rules', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats, _request_auth=local_var_params.get('_request_auth'))
[docs] def delete_rule_by_id(self, id, **kwargs): # noqa: E501 """delete_rule_by_id # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.delete_rule_by_id(id, async_req=True) >>> result = thread.get() :param id: The rule identifier (required) :type id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: None """ kwargs['_return_http_data_only'] = True return self.delete_rule_by_id_with_http_info(id, **kwargs) # noqa: E501
[docs] def delete_rule_by_id_with_http_info(self, id, **kwargs): # noqa: E501 """delete_rule_by_id # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.delete_rule_by_id_with_http_info(id, async_req=True) >>> result = thread.get() :param id: The rule identifier (required) :type id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _return_http_data_only: response data without head status code and headers :type _return_http_data_only: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: None """ local_var_params = locals() all_params = [ 'id' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout', '_request_auth', '_content_type', '_headers' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method delete_rule_by_id" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'id' is set if self.api_client.client_side_validation and local_var_params.get('id') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `id` when calling `delete_rule_by_id`") # noqa: E501 collection_formats = {} path_params = {} if 'id' in local_var_params: path_params['id'] = local_var_params['id'] # noqa: E501 query_params = [] header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} body_params = None # Authentication setting auth_settings = ['basicAuth'] # noqa: E501 response_types_map = {} return self.api_client.call_api( '/rules/id/{id}', 'DELETE', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats, _request_auth=local_var_params.get('_request_auth'))
[docs] def find_one_rule_by_priority(self, priority, **kwargs): # noqa: E501 """find_one_rule_by_priority # noqa: E501 Finds the Rule with the given priority # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.find_one_rule_by_priority(priority, async_req=True) >>> result = thread.get() :param priority: The rule priority to search for (required) :type priority: int :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: Rule """ kwargs['_return_http_data_only'] = True return self.find_one_rule_by_priority_with_http_info(priority, **kwargs) # noqa: E501
[docs] def find_one_rule_by_priority_with_http_info(self, priority, **kwargs): # noqa: E501 """find_one_rule_by_priority # noqa: E501 Finds the Rule with the given priority # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.find_one_rule_by_priority_with_http_info(priority, async_req=True) >>> result = thread.get() :param priority: The rule priority to search for (required) :type priority: int :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _return_http_data_only: response data without head status code and headers :type _return_http_data_only: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: tuple(Rule, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() all_params = [ 'priority' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout', '_request_auth', '_content_type', '_headers' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method find_one_rule_by_priority" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'priority' is set if self.api_client.client_side_validation and local_var_params.get('priority') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `priority` when calling `find_one_rule_by_priority`") # noqa: E501 collection_formats = {} path_params = {} if 'priority' in local_var_params: path_params['priority'] = local_var_params['priority'] # noqa: E501 query_params = [] header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json', 'application/x-jackson-smile']) # noqa: E501 # Authentication setting auth_settings = ['basicAuth'] # noqa: E501 response_types_map = { 200: "Rule", 404: None, 409: None, } return self.api_client.call_api( '/rules/query/one/priority/{priority}', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats, _request_auth=local_var_params.get('_request_auth'))
[docs] def get_layer_details_by_rule_id(self, id, **kwargs): # noqa: E501 """get_layer_details_by_rule_id # noqa: E501 Returns the LayerDetails for the Rule with the given identifier # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_layer_details_by_rule_id(id, async_req=True) >>> result = thread.get() :param id: The rule identifier (required) :type id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: LayerDetails """ kwargs['_return_http_data_only'] = True return self.get_layer_details_by_rule_id_with_http_info(id, **kwargs) # noqa: E501
[docs] def get_layer_details_by_rule_id_with_http_info(self, id, **kwargs): # noqa: E501 """get_layer_details_by_rule_id # noqa: E501 Returns the LayerDetails for the Rule with the given identifier # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_layer_details_by_rule_id_with_http_info(id, async_req=True) >>> result = thread.get() :param id: The rule identifier (required) :type id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _return_http_data_only: response data without head status code and headers :type _return_http_data_only: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: tuple(LayerDetails, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() all_params = [ 'id' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout', '_request_auth', '_content_type', '_headers' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method get_layer_details_by_rule_id" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'id' is set if self.api_client.client_side_validation and local_var_params.get('id') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `id` when calling `get_layer_details_by_rule_id`") # noqa: E501 collection_formats = {} path_params = {} if 'id' in local_var_params: path_params['id'] = local_var_params['id'] # noqa: E501 query_params = [] header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json', 'application/x-jackson-smile']) # noqa: E501 # Authentication setting auth_settings = ['basicAuth'] # noqa: E501 response_types_map = { 200: "LayerDetails", 204: None, 400: None, 404: None, } return self.api_client.call_api( '/rules/id/{id}/layer-details', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats, _request_auth=local_var_params.get('_request_auth'))
[docs] def get_rule_by_id(self, id, **kwargs): # noqa: E501 """get_rule_by_id # noqa: E501 Returns the Rule with the given identifier # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_rule_by_id(id, async_req=True) >>> result = thread.get() :param id: The rule identifier (required) :type id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: Rule """ kwargs['_return_http_data_only'] = True return self.get_rule_by_id_with_http_info(id, **kwargs) # noqa: E501
[docs] def get_rule_by_id_with_http_info(self, id, **kwargs): # noqa: E501 """get_rule_by_id # noqa: E501 Returns the Rule with the given identifier # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_rule_by_id_with_http_info(id, async_req=True) >>> result = thread.get() :param id: The rule identifier (required) :type id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _return_http_data_only: response data without head status code and headers :type _return_http_data_only: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: tuple(Rule, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() all_params = [ 'id' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout', '_request_auth', '_content_type', '_headers' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method get_rule_by_id" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'id' is set if self.api_client.client_side_validation and local_var_params.get('id') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `id` when calling `get_rule_by_id`") # noqa: E501 collection_formats = {} path_params = {} if 'id' in local_var_params: path_params['id'] = local_var_params['id'] # noqa: E501 query_params = [] header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json', 'application/x-jackson-smile']) # noqa: E501 # Authentication setting auth_settings = ['basicAuth'] # noqa: E501 response_types_map = { 200: "Rule", 404: None, } return self.api_client.call_api( '/rules/id/{id}', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats, _request_auth=local_var_params.get('_request_auth'))
[docs] def get_rules(self, **kwargs): # noqa: E501 """get_rules # noqa: E501 Returns an (optionally) paginated list of rules. See also the count operation. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_rules(async_req=True) >>> result = thread.get() :param limit: Maximum number of rules to return from the query. If there are more rules, the response will return an X-ACL-NEXTCURSOR header with a value that can be used for the nextCursor parameter on a subsequent request, until X-ACL-NEXTCURSOR is null :type limit: int :param next_cursor: The next cursor identifier when doing cursor paging, as returned by the X-ACL-NEXTCURSOR response header :type next_cursor: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: list[Rule] """ kwargs['_return_http_data_only'] = True return self.get_rules_with_http_info(**kwargs) # noqa: E501
[docs] def get_rules_with_http_info(self, **kwargs): # noqa: E501 """get_rules # noqa: E501 Returns an (optionally) paginated list of rules. See also the count operation. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_rules_with_http_info(async_req=True) >>> result = thread.get() :param limit: Maximum number of rules to return from the query. If there are more rules, the response will return an X-ACL-NEXTCURSOR header with a value that can be used for the nextCursor parameter on a subsequent request, until X-ACL-NEXTCURSOR is null :type limit: int :param next_cursor: The next cursor identifier when doing cursor paging, as returned by the X-ACL-NEXTCURSOR response header :type next_cursor: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _return_http_data_only: response data without head status code and headers :type _return_http_data_only: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: tuple(list[Rule], status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() all_params = [ 'limit', 'next_cursor' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout', '_request_auth', '_content_type', '_headers' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method get_rules" % key ) local_var_params[key] = val del local_var_params['kwargs'] collection_formats = {} path_params = {} query_params = [] if local_var_params.get('limit') is not None: # noqa: E501 query_params.append(('limit', local_var_params['limit'])) # noqa: E501 if local_var_params.get('next_cursor') is not None: # noqa: E501 query_params.append(('nextCursor', local_var_params['next_cursor'])) # noqa: E501 header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json', 'application/x-jackson-smile']) # noqa: E501 # Authentication setting auth_settings = ['basicAuth'] # noqa: E501 response_types_map = { 200: "list[Rule]", } return self.api_client.call_api( '/rules', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats, _request_auth=local_var_params.get('_request_auth'))
[docs] def query_rules(self, **kwargs): # noqa: E501 """query_rules # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.query_rules(async_req=True) >>> result = thread.get() :param limit: Maximum number of rules to return from the query. If there are more rules, the response will return an X-ACL-NEXTCURSOR header with a value that can be used for the nextCursor parameter on a subsequent request, until X-ACL-NEXTCURSOR is null :type limit: int :param next_cursor: The next cursor identifier when doing cursor paging, as returned by the X-ACL-NEXTCURSOR response header :type next_cursor: str :param rule_filter: :type rule_filter: RuleFilter :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: list[Rule] """ kwargs['_return_http_data_only'] = True return self.query_rules_with_http_info(**kwargs) # noqa: E501
[docs] def query_rules_with_http_info(self, **kwargs): # noqa: E501 """query_rules # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.query_rules_with_http_info(async_req=True) >>> result = thread.get() :param limit: Maximum number of rules to return from the query. If there are more rules, the response will return an X-ACL-NEXTCURSOR header with a value that can be used for the nextCursor parameter on a subsequent request, until X-ACL-NEXTCURSOR is null :type limit: int :param next_cursor: The next cursor identifier when doing cursor paging, as returned by the X-ACL-NEXTCURSOR response header :type next_cursor: str :param rule_filter: :type rule_filter: RuleFilter :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _return_http_data_only: response data without head status code and headers :type _return_http_data_only: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: tuple(list[Rule], status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() all_params = [ 'limit', 'next_cursor', 'rule_filter' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout', '_request_auth', '_content_type', '_headers' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method query_rules" % key ) local_var_params[key] = val del local_var_params['kwargs'] collection_formats = {} path_params = {} query_params = [] if local_var_params.get('limit') is not None: # noqa: E501 query_params.append(('limit', local_var_params['limit'])) # noqa: E501 if local_var_params.get('next_cursor') is not None: # noqa: E501 query_params.append(('nextCursor', local_var_params['next_cursor'])) # noqa: E501 header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} body_params = None if 'rule_filter' in local_var_params: body_params = local_var_params['rule_filter'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json', 'application/x-jackson-smile']) # noqa: E501 # HTTP header `Content-Type` content_types_list = local_var_params.get('_content_type', self.api_client.select_header_content_type( ['application/json', 'application/x-jackson-smile'], 'POST', body_params)) # noqa: E501 if content_types_list: header_params['Content-Type'] = content_types_list # Authentication setting auth_settings = ['basicAuth'] # noqa: E501 response_types_map = { 200: "list[Rule]", } return self.api_client.call_api( '/rules/query', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats, _request_auth=local_var_params.get('_request_auth'))
[docs] def rule_exists_by_id(self, id, **kwargs): # noqa: E501 """rule_exists_by_id # noqa: E501 Returns the Rule with the given identifier # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.rule_exists_by_id(id, async_req=True) >>> result = thread.get() :param id: The rule identifier (required) :type id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: bool """ kwargs['_return_http_data_only'] = True return self.rule_exists_by_id_with_http_info(id, **kwargs) # noqa: E501
[docs] def rule_exists_by_id_with_http_info(self, id, **kwargs): # noqa: E501 """rule_exists_by_id # noqa: E501 Returns the Rule with the given identifier # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.rule_exists_by_id_with_http_info(id, async_req=True) >>> result = thread.get() :param id: The rule identifier (required) :type id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _return_http_data_only: response data without head status code and headers :type _return_http_data_only: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: tuple(bool, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() all_params = [ 'id' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout', '_request_auth', '_content_type', '_headers' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method rule_exists_by_id" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'id' is set if self.api_client.client_side_validation and local_var_params.get('id') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `id` when calling `rule_exists_by_id`") # noqa: E501 collection_formats = {} path_params = {} if 'id' in local_var_params: path_params['id'] = local_var_params['id'] # noqa: E501 query_params = [] header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json', 'application/x-jackson-smile']) # noqa: E501 # Authentication setting auth_settings = ['basicAuth'] # noqa: E501 response_types_map = { 200: "bool", } return self.api_client.call_api( '/rules/id/{id}/exists', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats, _request_auth=local_var_params.get('_request_auth'))
[docs] def set_rule_allowed_styles(self, id, **kwargs): # noqa: E501 """set_rule_allowed_styles # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.set_rule_allowed_styles(id, async_req=True) >>> result = thread.get() :param id: The rule identifier (required) :type id: str :param request_body: :type request_body: list[str] :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: None """ kwargs['_return_http_data_only'] = True return self.set_rule_allowed_styles_with_http_info(id, **kwargs) # noqa: E501
[docs] def set_rule_allowed_styles_with_http_info(self, id, **kwargs): # noqa: E501 """set_rule_allowed_styles # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.set_rule_allowed_styles_with_http_info(id, async_req=True) >>> result = thread.get() :param id: The rule identifier (required) :type id: str :param request_body: :type request_body: list[str] :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _return_http_data_only: response data without head status code and headers :type _return_http_data_only: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: None """ local_var_params = locals() all_params = [ 'id', 'request_body' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout', '_request_auth', '_content_type', '_headers' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method set_rule_allowed_styles" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'id' is set if self.api_client.client_side_validation and local_var_params.get('id') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `id` when calling `set_rule_allowed_styles`") # noqa: E501 collection_formats = {} path_params = {} if 'id' in local_var_params: path_params['id'] = local_var_params['id'] # noqa: E501 query_params = [] header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} body_params = None if 'request_body' in local_var_params: body_params = local_var_params['request_body'] # HTTP header `Content-Type` content_types_list = local_var_params.get('_content_type', self.api_client.select_header_content_type( ['application/json', 'application/x-jackson-smile'], 'PUT', body_params)) # noqa: E501 if content_types_list: header_params['Content-Type'] = content_types_list # Authentication setting auth_settings = ['basicAuth'] # noqa: E501 response_types_map = {} return self.api_client.call_api( '/rules/id/{id}/styles', 'PUT', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats, _request_auth=local_var_params.get('_request_auth'))
[docs] def set_rule_layer_details(self, id, **kwargs): # noqa: E501 """set_rule_layer_details # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.set_rule_layer_details(id, async_req=True) >>> result = thread.get() :param id: The rule identifier (required) :type id: str :param layer_details: :type layer_details: LayerDetails :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: None """ kwargs['_return_http_data_only'] = True return self.set_rule_layer_details_with_http_info(id, **kwargs) # noqa: E501
[docs] def set_rule_layer_details_with_http_info(self, id, **kwargs): # noqa: E501 """set_rule_layer_details # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.set_rule_layer_details_with_http_info(id, async_req=True) >>> result = thread.get() :param id: The rule identifier (required) :type id: str :param layer_details: :type layer_details: LayerDetails :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _return_http_data_only: response data without head status code and headers :type _return_http_data_only: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: None """ local_var_params = locals() all_params = [ 'id', 'layer_details' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout', '_request_auth', '_content_type', '_headers' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method set_rule_layer_details" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'id' is set if self.api_client.client_side_validation and local_var_params.get('id') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `id` when calling `set_rule_layer_details`") # noqa: E501 collection_formats = {} path_params = {} if 'id' in local_var_params: path_params['id'] = local_var_params['id'] # noqa: E501 query_params = [] header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} body_params = None if 'layer_details' in local_var_params: body_params = local_var_params['layer_details'] # HTTP header `Content-Type` content_types_list = local_var_params.get('_content_type', self.api_client.select_header_content_type( ['application/json', 'application/x-jackson-smile'], 'PUT', body_params)) # noqa: E501 if content_types_list: header_params['Content-Type'] = content_types_list # Authentication setting auth_settings = ['basicAuth'] # noqa: E501 response_types_map = {} return self.api_client.call_api( '/rules/id/{id}/layer-details', 'PUT', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats, _request_auth=local_var_params.get('_request_auth'))
[docs] def set_rule_limits(self, id, **kwargs): # noqa: E501 """set_rule_limits # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.set_rule_limits(id, async_req=True) >>> result = thread.get() :param id: The rule identifier (required) :type id: str :param rule_limits: :type rule_limits: RuleLimits :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: None """ kwargs['_return_http_data_only'] = True return self.set_rule_limits_with_http_info(id, **kwargs) # noqa: E501
[docs] def set_rule_limits_with_http_info(self, id, **kwargs): # noqa: E501 """set_rule_limits # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.set_rule_limits_with_http_info(id, async_req=True) >>> result = thread.get() :param id: The rule identifier (required) :type id: str :param rule_limits: :type rule_limits: RuleLimits :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _return_http_data_only: response data without head status code and headers :type _return_http_data_only: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: None """ local_var_params = locals() all_params = [ 'id', 'rule_limits' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout', '_request_auth', '_content_type', '_headers' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method set_rule_limits" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'id' is set if self.api_client.client_side_validation and local_var_params.get('id') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `id` when calling `set_rule_limits`") # noqa: E501 collection_formats = {} path_params = {} if 'id' in local_var_params: path_params['id'] = local_var_params['id'] # noqa: E501 query_params = [] header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} body_params = None if 'rule_limits' in local_var_params: body_params = local_var_params['rule_limits'] # HTTP header `Content-Type` content_types_list = local_var_params.get('_content_type', self.api_client.select_header_content_type( ['application/json', 'application/x-jackson-smile'], 'PUT', body_params)) # noqa: E501 if content_types_list: header_params['Content-Type'] = content_types_list # Authentication setting auth_settings = ['basicAuth'] # noqa: E501 response_types_map = {} return self.api_client.call_api( '/rules/id/{id}/limits', 'PUT', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats, _request_auth=local_var_params.get('_request_auth'))
[docs] def shift_rules_by_priority(self, priority_start, offset, **kwargs): # noqa: E501 """shift_rules_by_priority # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.shift_rules_by_priority(priority_start, offset, async_req=True) >>> result = thread.get() :param priority_start: The minimum priority to start shifting at (inclusive) (required) :type priority_start: int :param offset: The priority offset to apply to all rules from priorityStart onwards (required) :type offset: int :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: int """ kwargs['_return_http_data_only'] = True return self.shift_rules_by_priority_with_http_info(priority_start, offset, **kwargs) # noqa: E501
[docs] def shift_rules_by_priority_with_http_info(self, priority_start, offset, **kwargs): # noqa: E501 """shift_rules_by_priority # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.shift_rules_by_priority_with_http_info(priority_start, offset, async_req=True) >>> result = thread.get() :param priority_start: The minimum priority to start shifting at (inclusive) (required) :type priority_start: int :param offset: The priority offset to apply to all rules from priorityStart onwards (required) :type offset: int :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _return_http_data_only: response data without head status code and headers :type _return_http_data_only: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: tuple(int, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() all_params = [ 'priority_start', 'offset' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout', '_request_auth', '_content_type', '_headers' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method shift_rules_by_priority" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'priority_start' is set if self.api_client.client_side_validation and local_var_params.get('priority_start') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `priority_start` when calling `shift_rules_by_priority`") # noqa: E501 # verify the required parameter 'offset' is set if self.api_client.client_side_validation and local_var_params.get('offset') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `offset` when calling `shift_rules_by_priority`") # noqa: E501 if self.api_client.client_side_validation and 'offset' in local_var_params and local_var_params['offset'] < 1: # noqa: E501 raise ApiValueError("Invalid value for parameter `offset` when calling `shift_rules_by_priority`, must be a value greater than or equal to `1`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] if local_var_params.get('priority_start') is not None: # noqa: E501 query_params.append(('priorityStart', local_var_params['priority_start'])) # noqa: E501 if local_var_params.get('offset') is not None: # noqa: E501 query_params.append(('offset', local_var_params['offset'])) # noqa: E501 header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json', 'application/x-jackson-smile']) # noqa: E501 # Authentication setting auth_settings = ['basicAuth'] # noqa: E501 response_types_map = { 200: "int", 404: None, } return self.api_client.call_api( '/rules/shift', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats, _request_auth=local_var_params.get('_request_auth'))
[docs] def swap_rules(self, id, id2, **kwargs): # noqa: E501 """swap_rules # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.swap_rules(id, id2, async_req=True) >>> result = thread.get() :param id: The rule identifier (required) :type id: str :param id2: The rule identifier to swap priorities with (required) :type id2: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: None """ kwargs['_return_http_data_only'] = True return self.swap_rules_with_http_info(id, id2, **kwargs) # noqa: E501
[docs] def swap_rules_with_http_info(self, id, id2, **kwargs): # noqa: E501 """swap_rules # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.swap_rules_with_http_info(id, id2, async_req=True) >>> result = thread.get() :param id: The rule identifier (required) :type id: str :param id2: The rule identifier to swap priorities with (required) :type id2: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _return_http_data_only: response data without head status code and headers :type _return_http_data_only: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: None """ local_var_params = locals() all_params = [ 'id', 'id2' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout', '_request_auth', '_content_type', '_headers' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method swap_rules" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'id' is set if self.api_client.client_side_validation and local_var_params.get('id') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `id` when calling `swap_rules`") # noqa: E501 # verify the required parameter 'id2' is set if self.api_client.client_side_validation and local_var_params.get('id2') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `id2` when calling `swap_rules`") # noqa: E501 collection_formats = {} path_params = {} if 'id' in local_var_params: path_params['id'] = local_var_params['id'] # noqa: E501 if 'id2' in local_var_params: path_params['id2'] = local_var_params['id2'] # noqa: E501 query_params = [] header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} body_params = None # Authentication setting auth_settings = ['basicAuth'] # noqa: E501 response_types_map = {} return self.api_client.call_api( '/rules/id/{id}/swapwith/{id2}', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats, _request_auth=local_var_params.get('_request_auth'))
[docs] def update_rule_by_id(self, id, rule, **kwargs): # noqa: E501 """update_rule_by_id # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.update_rule_by_id(id, rule, async_req=True) >>> result = thread.get() :param id: The rule identifier (required) :type id: str :param rule: (required) :type rule: Rule :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: Rule """ kwargs['_return_http_data_only'] = True return self.update_rule_by_id_with_http_info(id, rule, **kwargs) # noqa: E501
[docs] def update_rule_by_id_with_http_info(self, id, rule, **kwargs): # noqa: E501 """update_rule_by_id # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.update_rule_by_id_with_http_info(id, rule, async_req=True) >>> result = thread.get() :param id: The rule identifier (required) :type id: str :param rule: (required) :type rule: Rule :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _return_http_data_only: response data without head status code and headers :type _return_http_data_only: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: tuple(Rule, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() all_params = [ 'id', 'rule' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout', '_request_auth', '_content_type', '_headers' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method update_rule_by_id" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'id' is set if self.api_client.client_side_validation and local_var_params.get('id') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `id` when calling `update_rule_by_id`") # noqa: E501 # verify the required parameter 'rule' is set if self.api_client.client_side_validation and local_var_params.get('rule') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `rule` when calling `update_rule_by_id`") # noqa: E501 collection_formats = {} path_params = {} if 'id' in local_var_params: path_params['id'] = local_var_params['id'] # noqa: E501 query_params = [] header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} body_params = None if 'rule' in local_var_params: body_params = local_var_params['rule'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json', 'application/x-jackson-smile']) # noqa: E501 # HTTP header `Content-Type` content_types_list = local_var_params.get('_content_type', self.api_client.select_header_content_type( ['application/json', 'application/x-jackson-smile'], 'PATCH', body_params)) # noqa: E501 if content_types_list: header_params['Content-Type'] = content_types_list # Authentication setting auth_settings = ['basicAuth'] # noqa: E501 response_types_map = { 200: "Rule", 400: None, 404: None, 409: None, } return self.api_client.call_api( '/rules/id/{id}', 'PATCH', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_types_map=response_types_map, auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats, _request_auth=local_var_params.get('_request_auth'))