o
    ̳i,                     @   s   d dl mZ d dlmZ d dlmZmZmZmZm	Z	m
Z
mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z' G dd de(Z)dS )    )HttpRedirect)KaggleHttpClient)#ApiCreateModelInstanceRequest$ApiCreateModelInstanceVersionRequestApiCreateModelRequestApiCreateModelResponseApiDeleteModelInstanceRequest$ApiDeleteModelInstanceVersionRequestApiDeleteModelRequestApiDeleteModelResponse&ApiDownloadModelInstanceVersionRequestApiGetModelInstanceRequestApiGetModelRequest%ApiListModelGatingUserConsentsRequest&ApiListModelGatingUserConsentsResponseApiListModelInstancesRequestApiListModelInstancesResponse'ApiListModelInstanceVersionFilesRequest(ApiListModelInstanceVersionFilesResponse#ApiListModelInstanceVersionsRequest$ApiListModelInstanceVersionsResponseApiListModelsRequestApiListModelsResponseApiModelApiModelInstance&ApiReviewModelGatingUserConsentRequestApiUpdateModelInstanceRequestApiUpdateModelRequestApiUpdateModelResponseApiUploadModelFileRequestApiUploadModelFileResponseCreateModelSigningTokenRequestCreateModelSigningTokenResponseKeysRequestKeysResponseWellKnowEndpointRequestWellKnowEndpointResponsec                   @   s  e Zd ZdefddZd1dedefddZd1dedefd	d
Z	d1de
defddZd1dedefddZd1dedefddZd1dedefddZd1dedefddZd1dedefddZd1dedefddZd1dedefddZd1dede fddZ!d1de"de#fddZ$d1de%de&fdd Z'd1de(de)fd!d"Z*d1de+de)fd#d$Z,d1de-de.fd%d&Z/d1de0de1fd'd(Z2d1de3de4fd)d*Z5d1de6de7fd+d,Z8d1de9de:fd-d.Z;d1de<fd/d0Z=dS )2ModelApiClientclientc                 C   s
   || _ d S N)_client)selfr(    r,   _/home/ubuntu/.local/lib/python3.10/site-packages/kagglesdk/models/services/model_api_service.py__init__   s   
zModelApiClient.__init__Nrequestreturnc                 C       |du rt  }| jdd|tS )z
    Args:
      request (ApiCreateModelRequest):
        The request object; initialized to empty instance if not specified.
    Nmodels.ModelApiServiceCreateModel)r   r*   callr   r+   r/   r,   r,   r-   create_model
      zModelApiClient.create_modelc                 C   r1   )z
    Args:
      request (ApiCreateModelInstanceRequest):
        The request object; initialized to empty instance if not specified.
    Nr2   CreateModelInstance)r   r*   r4   r   r5   r,   r,   r-   create_model_instance   r7   z$ModelApiClient.create_model_instancec                 C   r1   )z
    Args:
      request (ApiCreateModelInstanceVersionRequest):
        The request object; initialized to empty instance if not specified.
    Nr2   CreateModelInstanceVersion)r   r*   r4   r   r5   r,   r,   r-   create_model_instance_version"   r7   z,ModelApiClient.create_model_instance_versionc                 C   r1   )z
    Args:
      request (ApiDeleteModelRequest):
        The request object; initialized to empty instance if not specified.
    Nr2   DeleteModel)r
   r*   r4   r   r5   r,   r,   r-   delete_model.   r7   zModelApiClient.delete_modelc                 C   r1   )z
    Args:
      request (ApiDeleteModelInstanceRequest):
        The request object; initialized to empty instance if not specified.
    Nr2   DeleteModelInstance)r   r*   r4   r   r5   r,   r,   r-   delete_model_instance:   r7   z$ModelApiClient.delete_model_instancec                 C   r1   )z
    Args:
      request (ApiDeleteModelInstanceVersionRequest):
        The request object; initialized to empty instance if not specified.
    Nr2   DeleteModelInstanceVersion)r	   r*   r4   r   r5   r,   r,   r-   delete_model_instance_versionF   r7   z,ModelApiClient.delete_model_instance_versionc                 C   r1   )z
    Args:
      request (ApiGetModelRequest):
        The request object; initialized to empty instance if not specified.
    Nr2   GetModel)r   r*   r4   r   r5   r,   r,   r-   	get_modelR   r7   zModelApiClient.get_modelc                 C   r1   )z
    Args:
      request (ApiGetModelInstanceRequest):
        The request object; initialized to empty instance if not specified.
    Nr2   GetModelInstance)r   r*   r4   r   r5   r,   r,   r-   get_model_instance^   r7   z!ModelApiClient.get_model_instancec                 C   r1   )z
    Args:
      request (ApiDownloadModelInstanceVersionRequest):
        The request object; initialized to empty instance if not specified.
    Nr2   DownloadModelInstanceVersion)r   r*   r4   r   r5   r,   r,   r-   download_model_instance_versionj   r7   z.ModelApiClient.download_model_instance_versionc                 C   r1   )z
    Args:
      request (ApiListModelsRequest):
        The request object; initialized to empty instance if not specified.
    Nr2   
ListModels)r   r*   r4   r   r5   r,   r,   r-   list_modelsv   r7   zModelApiClient.list_modelsc                 C   r1   )z
    Args:
      request (ApiListModelInstancesRequest):
        The request object; initialized to empty instance if not specified.
    Nr2   ListModelInstances)r   r*   r4   r   r5   r,   r,   r-   list_model_instances   r7   z#ModelApiClient.list_model_instancesc                 C   r1   )z
    Args:
      request (ApiListModelInstanceVersionsRequest):
        The request object; initialized to empty instance if not specified.
    Nr2   ListModelInstanceVersions)r   r*   r4   r   r5   r,   r,   r-   list_model_instance_versions   r7   z+ModelApiClient.list_model_instance_versionsc                 C   r1   )z
    Args:
      request (ApiListModelInstanceVersionFilesRequest):
        The request object; initialized to empty instance if not specified.
    Nr2   ListModelInstanceVersionFiles)r   r*   r4   r   r5   r,   r,   r-   !list_model_instance_version_files   r7   z0ModelApiClient.list_model_instance_version_filesc                 C   r1   )z
    Args:
      request (ApiUpdateModelRequest):
        The request object; initialized to empty instance if not specified.
    Nr2   UpdateModel)r   r*   r4   r   r5   r,   r,   r-   update_model   r7   zModelApiClient.update_modelc                 C   r1   )z
    Args:
      request (ApiUpdateModelInstanceRequest):
        The request object; initialized to empty instance if not specified.
    Nr2   UpdateModelInstance)r   r*   r4   r   r5   r,   r,   r-   update_model_instance   r7   z$ModelApiClient.update_model_instancec                 C   r1   )z
    Deprecated. Use the new unified BlobApiService#StartBlobUpload rpc.

    Args:
      request (ApiUploadModelFileRequest):
        The request object; initialized to empty instance if not specified.
    Nr2   UploadModelFile)r   r*   r4   r    r5   r,   r,   r-   upload_model_file   s   	z ModelApiClient.upload_model_filec                 C   r1   )a5  
    Creates an Kaggle issued identity token. The token is signed using a
    private key held in KMS that is only accessible by Kaggle model-signer
    service account.

    Args:
      request (CreateModelSigningTokenRequest):
        The request object; initialized to empty instance if not specified.
    Nr2   CreateModelSigningToken)r!   r*   r4   r"   r5   r,   r,   r-   create_model_signing_token      z)ModelApiClient.create_model_signing_tokenc                 C   r1   )a"  
    see spec -
    https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderConfig.
    Must support CORS. The service will have a path component.

    Args:
      request (WellKnowEndpointRequest):
        The request object; initialized to empty instance if not specified.
    Nr2   WellKnowEndpoint)r%   r*   r4   r&   r5   r,   r,   r-   well_know_endpoint   rX   z!ModelApiClient.well_know_endpointc                 C   r1   )z
    The JWKS endpoint containing the keys to validate the signature of a kaggle
    issued signing identity token.

    Args:
      request (KeysRequest):
        The request object; initialized to empty instance if not specified.
    Nr2   Keys)r#   r*   r4   r$   r5   r,   r,   r-   keys   s   
zModelApiClient.keysc                 C   r1   )a  
    Model gating
    List the user consents for a gated model, under the model's current active
    agreement.

    Args:
      request (ApiListModelGatingUserConsentsRequest):
        The request object; initialized to empty instance if not specified.
    Nr2   ListModelGatingUserConsents)r   r*   r4   r   r5   r,   r,   r-   list_model_gating_user_consents   rX   z.ModelApiClient.list_model_gating_user_consentsc                 C   s$   |du rt  }| jdd|d dS )z
    Review the user consents for a gated model, under the model's current
    active agreement.

    Args:
      request (ApiReviewModelGatingUserConsentRequest):
        The request object; initialized to empty instance if not specified.
    Nr2   ReviewModelGatingUserConsent)r   r*   r4   r5   r,   r,   r-    review_model_gating_user_consent  s   
z/ModelApiClient.review_model_gating_user_consentr)   )>__name__
__module____qualname__r   r.   r   r   r6   r   r9   r   r;   r
   r   r=   r   r?   r	   rA   r   r   rC   r   r   rE   r   r   rG   r   r   rI   r   r   rK   r   r   rM   r   r   rO   r   r   rQ   r   rS   r   r    rU   r!   r"   rW   r%   r&   rZ   r#   r$   r\   r   r   r^   r   r`   r,   r,   r,   r-   r'      s.    r'   N)*$kagglesdk.common.types.http_redirectr   kagglesdk.kaggle_http_clientr   (kagglesdk.models.types.model_api_servicer   r   r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   objectr'   r,   r,   r,   r-   <module>   s    