"""Generated client library for developerknowledge version v1alpha."""
# NOTE: This file is autogenerated and should not be edited by hand.

from apitools.base.py import base_api
from googlecloudsdk.generated_clients.apis.developerknowledge.v1alpha import developerknowledge_v1alpha_messages as messages


class DeveloperknowledgeV1alpha(base_api.BaseApiClient):
  """Generated client library for service developerknowledge version v1alpha."""

  MESSAGES_MODULE = messages
  BASE_URL = 'https://developerknowledge.googleapis.com/'
  MTLS_BASE_URL = 'https://developerknowledge.mtls.googleapis.com/'

  _PACKAGE = 'developerknowledge'
  _SCOPES = ['https://www.googleapis.com/auth/cloud-platform']
  _VERSION = 'v1alpha'
  _CLIENT_ID = 'CLIENT_ID'
  _CLIENT_SECRET = 'CLIENT_SECRET'
  _USER_AGENT = 'google-cloud-sdk'
  _CLIENT_CLASS_NAME = 'DeveloperknowledgeV1alpha'
  _URL_VERSION = 'v1alpha'
  _API_KEY = None

  def __init__(self, url='', credentials=None,
               get_credentials=True, http=None, model=None,
               log_request=False, log_response=False,
               credentials_args=None, default_global_params=None,
               additional_http_headers=None, response_encoding=None):
    """Create a new developerknowledge handle."""
    url = url or self.BASE_URL
    super(DeveloperknowledgeV1alpha, self).__init__(
        url, credentials=credentials,
        get_credentials=get_credentials, http=http, model=model,
        log_request=log_request, log_response=log_response,
        credentials_args=credentials_args,
        default_global_params=default_global_params,
        additional_http_headers=additional_http_headers,
        response_encoding=response_encoding)
    self.apiReferences = self.ApiReferencesService(self)
    self.documents = self.DocumentsService(self)
    self.v1alpha = self.V1alphaService(self)

  class ApiReferencesService(base_api.BaseApiService):
    """Service class for the apiReferences resource."""

    _NAME = 'apiReferences'

    def __init__(self, client):
      super(DeveloperknowledgeV1alpha.ApiReferencesService, self).__init__(client)
      self._upload_configs = {
          }

    def Get(self, request, global_params=None):
      r"""Retrieves the reference data for an API symbol, such as a class or method.

      Args:
        request: (DeveloperknowledgeApiReferencesGetRequest) input message
        global_params: (StandardQueryParameters, default: None) global arguments
      Returns:
        (ApiReference) The response message.
      """
      config = self.GetMethodConfig('Get')
      return self._RunMethod(
          config, request, global_params=global_params)

    Get.method_config = lambda: base_api.ApiMethodInfo(
        flat_path='v1alpha/apiReferences/{apiReferencesId}',
        http_method='GET',
        method_id='developerknowledge.apiReferences.get',
        ordered_params=['name'],
        path_params=['name'],
        query_params=[],
        relative_path='v1alpha/{+name}',
        request_field='',
        request_type_name='DeveloperknowledgeApiReferencesGetRequest',
        response_type_name='ApiReference',
        supports_download=False,
    )

  class DocumentsService(base_api.BaseApiService):
    """Service class for the documents resource."""

    _NAME = 'documents'

    def __init__(self, client):
      super(DeveloperknowledgeV1alpha.DocumentsService, self).__init__(client)
      self._upload_configs = {
          }

    def BatchGet(self, request, global_params=None):
      r"""Retrieves multiple documents, each with its full Markdown content.

      Args:
        request: (DeveloperknowledgeDocumentsBatchGetRequest) input message
        global_params: (StandardQueryParameters, default: None) global arguments
      Returns:
        (BatchGetDocumentsResponse) The response message.
      """
      config = self.GetMethodConfig('BatchGet')
      return self._RunMethod(
          config, request, global_params=global_params)

    BatchGet.method_config = lambda: base_api.ApiMethodInfo(
        http_method='GET',
        method_id='developerknowledge.documents.batchGet',
        ordered_params=[],
        path_params=[],
        query_params=['names', 'view'],
        relative_path='v1alpha/documents:batchGet',
        request_field='',
        request_type_name='DeveloperknowledgeDocumentsBatchGetRequest',
        response_type_name='BatchGetDocumentsResponse',
        supports_download=False,
    )

    def Get(self, request, global_params=None):
      r"""Retrieves a single document with its full Markdown content.

      Args:
        request: (DeveloperknowledgeDocumentsGetRequest) input message
        global_params: (StandardQueryParameters, default: None) global arguments
      Returns:
        (Document) The response message.
      """
      config = self.GetMethodConfig('Get')
      return self._RunMethod(
          config, request, global_params=global_params)

    Get.method_config = lambda: base_api.ApiMethodInfo(
        flat_path='v1alpha/documents/{documentsId}',
        http_method='GET',
        method_id='developerknowledge.documents.get',
        ordered_params=['name'],
        path_params=['name'],
        query_params=['view'],
        relative_path='v1alpha/{+name}',
        request_field='',
        request_type_name='DeveloperknowledgeDocumentsGetRequest',
        response_type_name='Document',
        supports_download=False,
    )

    def SearchDocumentChunks(self, request, global_params=None):
      r"""Searches for developer knowledge across Google's developer documentation. Returns DocumentChunks based on the user's query. There may be many chunks from the same Document. To retrieve full documents, use DeveloperKnowledge.GetDocument or DeveloperKnowledge.BatchGetDocuments with the DocumentChunk.parent returned in the SearchDocumentChunksResponse.results.

      Args:
        request: (DeveloperknowledgeDocumentsSearchDocumentChunksRequest) input message
        global_params: (StandardQueryParameters, default: None) global arguments
      Returns:
        (SearchDocumentChunksResponse) The response message.
      """
      config = self.GetMethodConfig('SearchDocumentChunks')
      return self._RunMethod(
          config, request, global_params=global_params)

    SearchDocumentChunks.method_config = lambda: base_api.ApiMethodInfo(
        http_method='GET',
        method_id='developerknowledge.documents.searchDocumentChunks',
        ordered_params=[],
        path_params=[],
        query_params=['filter', 'pageSize', 'pageToken', 'query'],
        relative_path='v1alpha/documents:searchDocumentChunks',
        request_field='',
        request_type_name='DeveloperknowledgeDocumentsSearchDocumentChunksRequest',
        response_type_name='SearchDocumentChunksResponse',
        supports_download=False,
    )

  class V1alphaService(base_api.BaseApiService):
    """Service class for the v1alpha resource."""

    _NAME = 'v1alpha'

    def __init__(self, client):
      super(DeveloperknowledgeV1alpha.V1alphaService, self).__init__(client)
      self._upload_configs = {
          }

    def AnswerQuery(self, request, global_params=None):
      r"""Answers a query using grounded generation.

      Args:
        request: (AnswerQueryRequest) input message
        global_params: (StandardQueryParameters, default: None) global arguments
      Returns:
        (AnswerQueryResponse) The response message.
      """
      config = self.GetMethodConfig('AnswerQuery')
      return self._RunMethod(
          config, request, global_params=global_params)

    AnswerQuery.method_config = lambda: base_api.ApiMethodInfo(
        http_method='POST',
        method_id='developerknowledge.answerQuery',
        ordered_params=[],
        path_params=[],
        query_params=[],
        relative_path='v1alpha:answerQuery',
        request_field='<request>',
        request_type_name='AnswerQueryRequest',
        response_type_name='AnswerQueryResponse',
        supports_download=False,
    )

    def Lookup(self, request, global_params=None):
      r"""Retrieves multiple developer knowledge resources by name, such as documents or reference data for API symbols.

      Args:
        request: (DeveloperknowledgeLookupRequest) input message
        global_params: (StandardQueryParameters, default: None) global arguments
      Returns:
        (LookupResponse) The response message.
      """
      config = self.GetMethodConfig('Lookup')
      return self._RunMethod(
          config, request, global_params=global_params)

    Lookup.method_config = lambda: base_api.ApiMethodInfo(
        http_method='GET',
        method_id='developerknowledge.lookup',
        ordered_params=[],
        path_params=[],
        query_params=['documentReadOptions_view', 'names'],
        relative_path='v1alpha:lookup',
        request_field='',
        request_type_name='DeveloperknowledgeLookupRequest',
        response_type_name='LookupResponse',
        supports_download=False,
    )

    def Search(self, request, global_params=None):
      r"""Searches for developer knowledge across Google's developer documentation and other sources. For documentation, returns DocumentChunks based on the user's query. There may be many chunks from the same Document. To retrieve full documents, use DeveloperKnowledge.GetDocument or DeveloperKnowledge.BatchGetDocuments with the DocumentChunk.parent returned in the SearchResponse.results.

      Args:
        request: (DeveloperknowledgeSearchRequest) input message
        global_params: (StandardQueryParameters, default: None) global arguments
      Returns:
        (SearchResponse) The response message.
      """
      config = self.GetMethodConfig('Search')
      return self._RunMethod(
          config, request, global_params=global_params)

    Search.method_config = lambda: base_api.ApiMethodInfo(
        http_method='GET',
        method_id='developerknowledge.search',
        ordered_params=[],
        path_params=[],
        query_params=['filter', 'pageSize', 'pageToken', 'query'],
        relative_path='v1alpha:search',
        request_field='',
        request_type_name='DeveloperknowledgeSearchRequest',
        response_type_name='SearchResponse',
        supports_download=False,
    )
