text: # coding: utf-8
  
  """
      data.world API
  
      # data.world in a nutshell  data.world is a productive, secure platform for modern data teamwork.  We bring together your data practitioners, subject matter experts, and other stakeholders by removing costly barriers to data discovery, comprehension, integration, and sharing.   Everything your team needs to quickly understand and use data stays with it.   Social features and integrations encourage collaborators to ask and answer questions, share discoveries, and coordinate closely while still using their preferred tools.  Our focus on interoperability helps you enhance your own data with data from any source, including our vast and growing library of free public datasets.   Sophisticated permissions, auditing features, and more make it easy to manage who views your data and what they do with it.  # Conventions  ## Authentication  All data.world API calls require an API token.   OAuth2 is the preferred and most secure method for authenticating users of your data.world applications. Visit our [oauth documentation](https://apidocs.data.world/toolkit/oauth) for additional information. Alternatively, you can obtain a token for _personal use or testing_ by navigating to your profile settings, under the Advanced tab ([https://data.world/settings/advanced](https://data.world/settings/advanced)).  Authentication must be provided in API requests via the `Authorization` header. For example, for a user whose API token is `my_api_token`, the request header should be `Authorization: Bearer my_api_token` (note the `Bearer` prefix).  ## Content type   By default, `application/json` is the content type used in request and response bodies. Exceptions are noted in respective endpoint documentation.  ## HTTPS only   Our APIs can only be accessed via HTTPS.  # Interested in building data.world apps?  Check out our [developer portal](https://apidocs.data.world) for tips on how to get started, tutorials, and to interact with the API endpoints right within your browser.
  
      OpenAPI spec version: 0.21.0
      Contact: help@data.world
      Generated by: https://github.com/swagger-api/swagger-codegen.git
  """
  
  
  from __future__ import absolute_import
  
  import sys
  import os
  import re
  
  # python 2 and python 3 compatibility library
  from six import iteritems
  
  from ..configuration import Configuration
  from ..api_client import ApiClient
  
  
  class MetadataglossaryApi(object):
      """
      NOTE: This class is auto generated by the swagger code generator program.
      Do not edit the class manually.
      Ref: https://github.com/swagger-api/swagger-codegen
      """
  
      def __init__(self, api_client=None):
          config = Configuration()
          if api_client:
              self.api_client = api_client
          else:
              if not config.api_client:
                  config.api_client = ApiClient()
              self.api_client = config.api_client
  
      def create_catalog_glossary(self, owner, body, **kwargs):
          """
          Create a new business glossary resource
          Create a new business glossary resource
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please define a `callback` function
          to be invoked when receiving the response.
          >>> def callback_function(response):
          >>>     pprint(response)
          >>>
          >>> thread = api.create_catalog_glossary(owner, body, callback=callback_function)
  
          :param callback function: The callback function
              for asynchronous request. (optional)
          :param str owner: User name and unique identifier of the user or organization a resource belongs to. For example, in the URL: [https://data.world/jonloyens/an-intro-to-dataworld-dataset](https://data.world/jonloyens/an-intro-to-dataworld-dataset), jonloyens is the unique identifier of the owner. (required)
          :param CatalogGlossaryRequest body: (required)
          :return: CreateResponse
                   If the method is called asynchronously,
                   returns the request thread.
          """
          kwargs['_return_http_data_only'] = True
          if kwargs.get('callback'):
              return self.create_catalog_glossary_with_http_info(owner, body, **kwargs)
          else:
              (data) = self.create_catalog_glossary_with_http_info(owner, body, **kwargs)
              return data
  
      def create_catalog_glossary_with_http_info(self, owner, body, **kwargs):
          """
          Create a new business glossary resource
          Create a new business glossary resource
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please define a `callback` function
          to be invoked when receiving the response.
          >>> def callback_function(response):
          >>>     pprint(response)
          >>>
          >>> thread = api.create_catalog_glossary_with_http_info(owner, body, callback=callback_function)
  
          :param callback function: The callback function
              for asynchronous request. (optional)
          :param str owner: User name and unique identifier of the user or organization a resource belongs to. For example, in the URL: [https://data.world/jonloyens/an-intro-to-dataworld-dataset](https://data.world/jonloyens/an-intro-to-dataworld-dataset), jonloyens is the unique identifier of the owner. (required)
          :param CatalogGlossaryRequest body: (required)
          :return: CreateResponse
                   If the method is called asynchronously,
                   returns the request thread.
          """
  
          all_params = ['owner', 'body']
          all_params.append('callback')
          all_params.append('_return_http_data_only')
          all_params.append('_preload_content')
          all_params.append('_request_timeout')
  
          params = locals()
          for key, val in iteritems(params['kwargs']):
              if key not in all_params:
                  raise TypeError(
                      "Got an unexpected keyword argument '%s'"
                      " to method create_catalog_glossary" % key
                  )
              params[key] = val
          del params['kwargs']
          # verify the required parameter 'owner' is set
          if ('owner' not in params) or (params['owner'] is None):
              raise ValueError("Missing the required parameter `owner` when calling `create_catalog_glossary`")
          # verify the required parameter 'body' is set
          if ('body' not in params) or (params['body'] is None):
              raise ValueError("Missing the required parameter `body` when calling `create_catalog_glossary`")
  
          if 'owner' in params and not re.search('[a-z0-9](?:-(?!-)|[a-z0-9])+[a-z0-9]', params['owner']):
              raise ValueError("Invalid value for parameter `owner` when calling `create_catalog_glossary`, must conform to the pattern `/[a-z0-9](?:-(?!-)|[a-z0-9])+[a-z0-9]/`")
  
          collection_formats = {}
  
          path_params = {}
          if 'owner' in params:
              path_params['owner'] = params['owner']
  
          query_params = []
  
          header_params = {}
  
          form_params = []
          local_var_files = {}
  
          body_params = None
          if 'body' in params:
              body_params = params['body']
          # HTTP header `Accept`
          header_params['Accept'] = self.api_client.\
              select_header_accept(['application/json'])
  
          # HTTP header `Content-Type`
          header_params['Content-Type'] = self.api_client.\
              select_header_content_type(['application/json'])
  
          # Authentication setting
          auth_settings = ['oauth']
  
          return self.api_client.call_api('/metadata/glossary/{owner}', 'POST',
                                          path_params,
                                          query_params,
                                          header_params,
                                          body=body_params,
                                          post_params=form_params,
                                          files=local_var_files,
                                          response_type='CreateResponse',
                                          auth_settings=auth_settings,
                                          callback=params.get('callback'),
                                          _return_http_data_only=params.get('_return_http_data_only'),
                                          _preload_content=params.get('_preload_content', True),
                                          _request_timeout=params.get('_request_timeout'),
                                          collection_formats=collection_formats)
  
      def delete_catalog_glossary(self, owner, id, **kwargs):
          """
          Delete a business glossary resource
          Delete a business glossary resource
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please define a `callback` function
          to be invoked when receiving the response.
          >>> def callback_function(response):
          >>>     pprint(response)
          >>>
          >>> thread = api.delete_catalog_glossary(owner, id, callback=callback_function)
  
          :param callback function: The callback function
              for asynchronous request. (optional)
          :param str owner: User name and unique identifier of the user or organization a resource belongs to. For example, in the URL: [https://data.world/jonloyens/an-intro-to-dataworld-dataset](https://data.world/jonloyens/an-intro-to-dataworld-dataset), jonloyens is the unique identifier of the owner. (required)
          :param str id: Unique identifier for the resource as displayed in the resource URL on data.world (required)
          :return: SuccessMessage
                   If the method is called asynchronously,
                   returns the request thread.
          """
          kwargs['_return_http_data_only'] = True
          if kwargs.get('callback'):
              return self.delete_catalog_glossary_with_http_info(owner, id, **kwargs)
          else:
              (data) = self.delete_catalog_glossary_with_http_info(owner, id, **kwargs)
              return data
  
      def delete_catalog_glossary_with_http_info(self, owner, id, **kwargs):
          """
          Delete a business glossary resource
          Delete a business glossary resource
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please define a `callback` function
          to be invoked when receiving the response.
          >>> def callback_function(response):
          >>>     pprint(response)
          >>>
          >>> thread = api.delete_catalog_glossary_with_http_info(owner, id, callback=callback_function)
  
          :param callback function: The callback function
              for asynchronous request. (optional)
          :param str owner: User name and unique identifier of the user or organization a resource belongs to. For example, in the URL: [https://data.world/jonloyens/an-intro-to-dataworld-dataset](https://data.world/jonloyens/an-intro-to-dataworld-dataset), jonloyens is the unique identifier of the owner. (required)
          :param str id: Unique identifier for the resource as displayed in the resource URL on data.world (required)
          :return: SuccessMessage
                   If the method is called asynchronously,
                   returns the request thread.
          """
  
          all_params = ['owner', 'id']
          all_params.append('callback')
          all_params.append('_return_http_data_only')
          all_params.append('_preload_content')
          all_params.append('_request_timeout')
  
          params = locals()
          for key, val in iteritems(params['kwargs']):
              if key not in all_params:
                  raise TypeError(
                      "Got an unexpected keyword argument '%s'"
                      " to method delete_catalog_glossary" % key
                  )
              params[key] = val
          del params['kwargs']
          # verify the required parameter 'owner' is set
          if ('owner' not in params) or (params['owner'] is None):
              raise ValueError("Missing the required parameter `owner` when calling `delete_catalog_glossary`")
          # verify the required parameter 'id' is set
          if ('id' not in params) or (params['id'] is None):
              raise ValueError("Missing the required parameter `id` when calling `delete_catalog_glossary`")
  
          if 'owner' in params and not re.search('[a-z0-9](?:-(?!-)|[a-z0-9])+[a-z0-9]', params['owner']):
              raise ValueError("Invalid value for parameter `owner` when calling `delete_catalog_glossary`, must conform to the pattern `/[a-z0-9](?:-(?!-)|[a-z0-9])+[a-z0-9]/`")
  
          collection_formats = {}
  
          path_params = {}
          if 'owner' in params:
              path_params['owner'] = params['owner']
          if 'id' in params:
              path_params['id'] = params['id']
  
          query_params = []
  
          header_params = {}
  
          form_params = []
          local_var_files = {}
  
          body_params = None
          # HTTP header `Accept`
          header_params['Accept'] = self.api_client.\
              select_header_accept(['application/json'])
  
          # Authentication setting
          auth_settings = ['oauth']
  
          return self.api_client.call_api('/metadata/glossary/{owner}/{id}', 'DELETE',
                                          path_params,
                                          query_params,
                                          header_params,
                                          body=body_params,
                                          post_params=form_params,
                                          files=local_var_files,
                                          response_type='SuccessMessage',
                                          auth_settings=auth_settings,
                                          callback=params.get('callback'),
                                          _return_http_data_only=params.get('_return_http_data_only'),
                                          _preload_content=params.get('_preload_content', True),
                                          _request_timeout=params.get('_request_timeout'),
                                          collection_formats=collection_formats)
  
      def get_metadata_glossary(self, owner, id, **kwargs):
          """
          Get a business glossary resource by id
          Get a business glossary resource by id
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please define a `callback` function
          to be invoked when receiving the response.
          >>> def callback_function(response):
          >>>     pprint(response)
          >>>
          >>> thread = api.get_metadata_glossary(owner, id, callback=callback_function)
  
          :param callback function: The callback function
              for asynchronous request. (optional)
          :param str owner: User name and unique identifier of the user or organization a resource belongs to. For example, in the URL: [https://data.world/jonloyens/an-intro-to-dataworld-dataset](https://data.world/jonloyens/an-intro-to-dataworld-dataset), jonloyens is the unique identifier of the owner. (required)
          :param str id: Unique identifier for the resource as displayed in the resource URL on data.world (required)
          :return: MetadataResourceDto
                   If the method is called asynchronously,
                   returns the request thread.
          """
          kwargs['_return_http_data_only'] = True
          if kwargs.get('callback'):
              return self.get_metadata_glossary_with_http_info(owner, id, **kwargs)
          else:
              (data) = self.get_metadata_glossary_with_http_info(owner, id, **kwargs)
              return data
  
      def get_metadata_glossary_with_http_info(self, owner, id, **kwargs):
          """
          Get a business glossary resource by id
          Get a business glossary resource by id
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please define a `callback` function
          to be invoked when receiving the response.
          >>> def callback_function(response):
          >>>     pprint(response)
          >>>
          >>> thread = api.get_metadata_glossary_with_http_info(owner, id, callback=callback_function)
  
          :param callback function: The callback function
              for asynchronous request. (optional)
          :param str owner: User name and unique identifier of the user or organization a resource belongs to. For example, in the URL: [https://data.world/jonloyens/an-intro-to-dataworld-dataset](https://data.world/jonloyens/an-intro-to-dataworld-dataset), jonloyens is the unique identifier of the owner. (required)
          :param str id: Unique identifier for the resource as displayed in the resource URL on data.world (required)
          :return: MetadataResourceDto
                   If the method is called asynchronously,
                   returns the request thread.
          """
  
          all_params = ['owner', 'id']
          all_params.append('callback')
          all_params.append('_return_http_data_only')
          all_params.append('_preload_content')
          all_params.append('_request_timeout')
  
          params = locals()
          for key, val in iteritems(params['kwargs']):
              if key not in all_params:
                  raise TypeError(
                      "Got an unexpected keyword argument '%s'"
                      " to method get_metadata_glossary" % key
                  )
              params[key] = val
          del params['kwargs']
          # verify the required parameter 'owner' is set
          if ('owner' not in params) or (params['owner'] is None):
              raise ValueError("Missing the required parameter `owner` when calling `get_metadata_glossary`")
          # verify the required parameter 'id' is set
          if ('id' not in params) or (params['id'] is None):
              raise ValueError("Missing the required parameter `id` when calling `get_metadata_glossary`")
  
          if 'owner' in params and not re.search('[a-z0-9](?:-(?!-)|[a-z0-9])+[a-z0-9]', params['owner']):
              raise ValueError("Invalid value for parameter `owner` when calling `get_metadata_glossary`, must conform to the pattern `/[a-z0-9](?:-(?!-)|[a-z0-9])+[a-z0-9]/`")
  
          collection_formats = {}
  
          path_params = {}
          if 'owner' in params:
              path_params['owner'] = params['owner']
          if 'id' in params:
              path_params['id'] = params['id']
  
          query_params = []
  
          header_params = {}
  
          form_params = []
          local_var_files = {}
  
          body_params = None
          # HTTP header `Accept`
          header_params['Accept'] = self.api_client.\
              select_header_accept(['application/json'])
  
          # Authentication setting
          auth_settings = ['oauth']
  
          return self.api_client.call_api('/metadata/glossary/{owner}/{id}', 'GET',
                                          path_params,
                                          query_params,
                                          header_params,
                                          body=body_params,
                                          post_params=form_params,
                                          files=local_var_files,
                                          response_type='MetadataResourceDto',
                                          auth_settings=auth_settings,
                                          callback=params.get('callback'),
                                          _return_http_data_only=params.get('_return_http_data_only'),
                                          _preload_content=params.get('_preload_content', True),
                                          _request_timeout=params.get('_request_timeout'),
                                          collection_formats=collection_formats)
  
      def get_metadata_glossary_by_owner(self, owner, **kwargs):
          """
          List business glossary entries by owner
          List business glossary resources by owner
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please define a `callback` function
          to be invoked when receiving the response.
          >>> def callback_function(response):
          >>>     pprint(response)
          >>>
          >>> thread = api.get_metadata_glossary_by_owner(owner, callback=callback_function)
  
          :param callback function: The callback function
              for asynchronous request. (optional)
          :param str owner: User name and unique identifier of the user or organization a resource belongs to. For example, in the URL: [https://data.world/jonloyens/an-intro-to-dataworld-dataset](https://data.world/jonloyens/an-intro-to-dataworld-dataset), jonloyens is the unique identifier of the owner. (required)
          :param str typelabel:
          :param str typeiri:
          :param str size:
          :param str _from:
          :param str sort:
          :return: PaginatedMetadataResourceResults
                   If the method is called asynchronously,
                   returns the request thread.
          """
          kwargs['_return_http_data_only'] = True
          if kwargs.get('callback'):
              return self.get_metadata_glossary_by_owner_with_http_info(owner, **kwargs)
          else:
              (data) = self.get_metadata_glossary_by_owner_with_http_info(owner, **kwargs)
              return data
  
      def get_metadata_glossary_by_owner_with_http_info(self, owner, **kwargs):
          """
          List business glossary entries by owner
          List business glossary resources by owner
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please define a `callback` function
          to be invoked when receiving the response.
          >>> def callback_function(response):
          >>>     pprint(response)
          >>>
          >>> thread = api.get_metadata_glossary_by_owner_with_http_info(owner, callback=callback_function)
  
          :param callback function: The callback function
              for asynchronous request. (optional)
          :param str owner: User name and unique identifier of the user or organization a resource belongs to. For example, in the URL: [https://data.world/jonloyens/an-intro-to-dataworld-dataset](https://data.world/jonloyens/an-intro-to-dataworld-dataset), jonloyens is the unique identifier of the owner. (required)
          :param str typelabel:
          :param str typeiri:
          :param str size:
          :param str _from:
          :param str sort:
          :return: PaginatedMetadataResourceResults
                   If the method is called asynchronously,
                   returns the request thread.
          """
  
          all_params = ['owner', 'typelabel', 'typeiri', 'size', '_from', 'sort']
          all_params.append('callback')
          all_params.append('_return_http_data_only')
          all_params.append('_preload_content')
          all_params.append('_request_timeout')
  
          params = locals()
          for key, val in iteritems(params['kwargs']):
              if key not in all_params:
                  raise TypeError(
                      "Got an unexpected keyword argument '%s'"
                      " to method get_metadata_glossary_by_owner" % key
                  )
              params[key] = val
          del params['kwargs']
          # verify the required parameter 'owner' is set
          if ('owner' not in params) or (params['owner'] is None):
              raise ValueError("Missing the required parameter `owner` when calling `get_metadata_glossary_by_owner`")
  
          if 'owner' in params and not re.search('[a-z0-9](?:-(?!-)|[a-z0-9])+[a-z0-9]', params['owner']):
              raise ValueError("Invalid value for parameter `owner` when calling `get_metadata_glossary_by_owner`, must conform to the pattern `/[a-z0-9](?:-(?!-)|[a-z0-9])+[a-z0-9]/`")
  
          collection_formats = {}
  
          path_params = {}
          if 'owner' in params:
              path_params['owner'] = params['owner']
  
          query_params = []
          if 'typelabel' in params:
              query_params.append(('typelabel', params['typelabel']))
          if 'typeiri' in params:
              query_params.append(('typeiri', params['typeiri']))
          if 'size' in params:
              query_params.append(('size', params['size']))
          if '_from' in params:
              query_params.append(('from', params['_from']))
          if 'sort' in params:
              query_params.append(('sort', params['sort']))
  
          header_params = {}
  
          form_params = []
          local_var_files = {}
  
          body_params = None
          # HTTP header `Accept`
          header_params['Accept'] = self.api_client.\
              select_header_accept(['application/json'])
  
          # Authentication setting
          auth_settings = ['oauth']
  
          return self.api_client.call_api('/metadata/glossary/{owner}', 'GET',
                                          path_params,
                                          query_params,
                                          header_params,
                                          body=body_params,
                                          post_params=form_params,
                                          files=local_var_files,
                                          response_type='PaginatedMetadataResourceResults',
                                          auth_settings=auth_settings,
                                          callback=params.get('callback'),
                                          _return_http_data_only=params.get('_return_http_data_only'),
                                          _preload_content=params.get('_preload_content', True),
                                          _request_timeout=params.get('_request_timeout'),
                                          collection_formats=collection_formats)
  
      def patch_catalog_glossary(self, owner, id, body, **kwargs):
          """
          Update an existing business glossary resource
          Update an existing business glossary resource
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please define a `callback` function
          to be invoked when receiving the response.
          >>> def callback_function(response):
          >>>     pprint(response)
          >>>
          >>> thread = api.patch_catalog_glossary(owner, id, body, callback=callback_function)
  
          :param callback function: The callback function
              for asynchronous request. (optional)
          :param str owner: User name and unique identifier of the user or organization a resource belongs to. For example, in the URL: [https://data.world/jonloyens/an-intro-to-dataworld-dataset](https://data.world/jonloyens/an-intro-to-dataworld-dataset), jonloyens is the unique identifier of the owner. (required)
          :param str id: Unique identifier for the resource as displayed in the resource URL on data.world (required)
          :param CatalogGlossaryRequest body: (required)
          :return: SuccessMessage
                   If the method is called asynchronously,
                   returns the request thread.
          """
          kwargs['_return_http_data_only'] = True
          if kwargs.get('callback'):
              return self.patch_catalog_glossary_with_http_info(owner, id, body, **kwargs)
          else:
              (data) = self.patch_catalog_glossary_with_http_info(owner, id, body, **kwargs)
              return data
  
      def patch_catalog_glossary_with_http_info(self, owner, id, body, **kwargs):
          """
          Update an existing business glossary resource
          Update an existing business glossary resource
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please define a `callback` function
          to be invoked when receiving the response.
          >>> def callback_function(response):
          >>>     pprint(response)
          >>>
          >>> thread = api.patch_catalog_glossary_with_http_info(owner, id, body, callback=callback_function)
  
          :param callback function: The callback function
              for asynchronous request. (optional)
          :param str owner: User name and unique identifier of the user or organization a resource belongs to. For example, in the URL: [https://data.world/jonloyens/an-intro-to-dataworld-dataset](https://data.world/jonloyens/an-intro-to-dataworld-dataset), jonloyens is the unique identifier of the owner. (required)
          :param str id: Unique identifier for the resource as displayed in the resource URL on data.world (required)
          :param CatalogGlossaryRequest body: (required)
          :return: SuccessMessage
                   If the method is called asynchronously,
                   returns the request thread.
          """
  
          all_params = ['owner', 'id', 'body']
          all_params.append('callback')
          all_params.append('_return_http_data_only')
          all_params.append('_preload_content')
          all_params.append('_request_timeout')
  
          params = locals()
          for key, val in iteritems(params['kwargs']):
              if key not in all_params:
                  raise TypeError(
                      "Got an unexpected keyword argument '%s'"
                      " to method patch_catalog_glossary" % key
                  )
              params[key] = val
          del params['kwargs']
          # verify the required parameter 'owner' is set
          if ('owner' not in params) or (params['owner'] is None):
              raise ValueError("Missing the required parameter `owner` when calling `patch_catalog_glossary`")
          # verify the required parameter 'id' is set
          if ('id' not in params) or (params['id'] is None):
              raise ValueError("Missing the required parameter `id` when calling `patch_catalog_glossary`")
          # verify the required parameter 'body' is set
          if ('body' not in params) or (params['body'] is None):
              raise ValueError("Missing the required parameter `body` when calling `patch_catalog_glossary`")
  
          if 'owner' in params and not re.search('[a-z0-9](?:-(?!-)|[a-z0-9])+[a-z0-9]', params['owner']):
              raise ValueError("Invalid value for parameter `owner` when calling `patch_catalog_glossary`, must conform to the pattern `/[a-z0-9](?:-(?!-)|[a-z0-9])+[a-z0-9]/`")
  
          collection_formats = {}
  
          path_params = {}
          if 'owner' in params:
              path_params['owner'] = params['owner']
          if 'id' in params:
              path_params['id'] = params['id']
  
          query_params = []
  
          header_params = {}
  
          form_params = []
          local_var_files = {}
  
          body_params = None
          if 'body' in params:
              body_params = params['body']
          # HTTP header `Accept`
          header_params['Accept'] = self.api_client.\
              select_header_accept(['application/json'])
  
          # HTTP header `Content-Type`
          header_params['Content-Type'] = self.api_client.\
              select_header_content_type(['application/json'])
  
          # Authentication setting
          auth_settings = ['oauth']
  
          return self.api_client.call_api('/metadata/glossary/{owner}/{id}', 'PATCH',
                                          path_params,
                                          query_params,
                                          header_params,
                                          body=body_params,
                                          post_params=form_params,
                                          files=local_var_files,
                                          response_type='SuccessMessage',
                                          auth_settings=auth_settings,
                                          callback=params.get('callback'),
                                          _return_http_data_only=params.get('_return_http_data_only'),
                                          _preload_content=params.get('_preload_content', True),
                                          _request_timeout=params.get('_request_timeout'),
                                          collection_formats=collection_formats)
  
      def replace_catalog_glossary(self, owner, id, body, **kwargs):
          """
          Overwrite an existing business glossary resource
          Overwrite an existing business glossary resource
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please define a `callback` function
          to be invoked when receiving the response.
          >>> def callback_function(response):
          >>>     pprint(response)
          >>>
          >>> thread = api.replace_catalog_glossary(owner, id, body, callback=callback_function)
  
          :param callback function: The callback function
              for asynchronous request. (optional)
          :param str owner: User name and unique identifier of the user or organization a resource belongs to. For example, in the URL: [https://data.world/jonloyens/an-intro-to-dataworld-dataset](https://data.world/jonloyens/an-intro-to-dataworld-dataset), jonloyens is the unique identifier of the owner. (required)
          :param str id: Unique identifier for the resource as displayed in the resource URL on data.world (required)
          :param CatalogGlossaryRequest body: (required)
          :return: SuccessMessage
                   If the method is called asynchronously,
                   returns the request thread.
          """
          kwargs['_return_http_data_only'] = True
          if kwargs.get('callback'):
              return self.replace_catalog_glossary_with_http_info(owner, id, body, **kwargs)
          else:
              (data) = self.replace_catalog_glossary_with_http_info(owner, id, body, **kwargs)
              return data
  
      def replace_catalog_glossary_with_http_info(self, owner, id, body, **kwargs):
          """
          Overwrite an existing business glossary resource
          Overwrite an existing business glossary resource
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please define a `callback` function
          to be invoked when receiving the response.
          >>> def callback_function(response):
          >>>     pprint(response)
          >>>
          >>> thread = api.replace_catalog_glossary_with_http_info(owner, id, body, callback=callback_function)
  
          :param callback function: The callback function
              for asynchronous request. (optional)
          :param str owner: User name and unique identifier of the user or organization a resource belongs to. For example, in the URL: [https://data.world/jonloyens/an-intro-to-dataworld-dataset](https://data.world/jonloyens/an-intro-to-dataworld-dataset), jonloyens is the unique identifier of the owner. (required)
          :param str id: Unique identifier for the resource as displayed in the resource URL on data.world (required)
          :param CatalogGlossaryRequest body: (required)
          :return: SuccessMessage
                   If the method is called asynchronously,
                   returns the request thread.
          """
  
          all_params = ['owner', 'id', 'body']
          all_params.append('callback')
          all_params.append('_return_http_data_only')
          all_params.append('_preload_content')
          all_params.append('_request_timeout')
  
          params = locals()
          for key, val in iteritems(params['kwargs']):
              if key not in all_params:
                  raise TypeError(
                      "Got an unexpected keyword argument '%s'"
                      " to method replace_catalog_glossary" % key
                  )
              params[key] = val
          del params['kwargs']
          # verify the required parameter 'owner' is set
          if ('owner' not in params) or (params['owner'] is None):
              raise ValueError("Missing the required parameter `owner` when calling `replace_catalog_glossary`")
          # verify the required parameter 'id' is set
          if ('id' not in params) or (params['id'] is None):
              raise ValueError("Missing the required parameter `id` when calling `replace_catalog_glossary`")
          # verify the required parameter 'body' is set
          if ('body' not in params) or (params['body'] is None):
              raise ValueError("Missing the required parameter `body` when calling `replace_catalog_glossary`")
  
          if 'owner' in params and not re.search('[a-z0-9](?:-(?!-)|[a-z0-9])+[a-z0-9]', params['owner']):
              raise ValueError("Invalid value for parameter `owner` when calling `replace_catalog_glossary`, must conform to the pattern `/[a-z0-9](?:-(?!-)|[a-z0-9])+[a-z0-9]/`")
  
          collection_formats = {}
  
          path_params = {}
          if 'owner' in params:
              path_params['owner'] = params['owner']
          if 'id' in params:
              path_params['id'] = params['id']
  
          query_params = []
  
          header_params = {}
  
          form_params = []
          local_var_files = {}
  
          body_params = None
          if 'body' in params:
              body_params = params['body']
          # HTTP header `Accept`
          header_params['Accept'] = self.api_client.\
              select_header_accept(['application/json'])
  
          # HTTP header `Content-Type`
          header_params['Content-Type'] = self.api_client.\
              select_header_content_type(['application/json'])
  
          # Authentication setting
          auth_settings = ['oauth']
  
          return self.api_client.call_api('/metadata/glossary/{owner}/{id}', 'PUT',
                                          path_params,
                                          query_params,
                                          header_params,
                                          body=body_params,
                                          post_params=form_params,
                                          files=local_var_files,
                                          response_type='SuccessMessage',
                                          auth_settings=auth_settings,
                                          callback=params.get('callback'),
                                          _return_http_data_only=params.get('_return_http_data_only'),
                                          _preload_content=params.get('_preload_content', True),
                                          _request_timeout=params.get('_request_timeout'),
                                          collection_formats=collection_formats)
  