|
| 1 | +""" |
| 2 | + Groundlight API |
| 3 | +
|
| 4 | + Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501 |
| 5 | +
|
| 6 | + The version of the OpenAPI document: 0.18.2 |
| 7 | + Contact: support@groundlight.ai |
| 8 | + Generated by: https://openapi-generator.tech |
| 9 | +""" |
| 10 | + |
| 11 | +import re # noqa: F401 |
| 12 | +import sys # noqa: F401 |
| 13 | + |
| 14 | +from groundlight_openapi_client.api_client import ApiClient, Endpoint as _Endpoint |
| 15 | +from groundlight_openapi_client.model_utils import ( # noqa: F401 |
| 16 | + check_allowed_values, |
| 17 | + check_validations, |
| 18 | + date, |
| 19 | + datetime, |
| 20 | + file_type, |
| 21 | + none_type, |
| 22 | + validate_and_convert_types, |
| 23 | +) |
| 24 | +from groundlight_openapi_client.model.edge_model_info import EdgeModelInfo |
| 25 | + |
| 26 | + |
| 27 | +class EdgeApi(object): |
| 28 | + """NOTE: This class is auto generated by OpenAPI Generator |
| 29 | + Ref: https://openapi-generator.tech |
| 30 | +
|
| 31 | + Do not edit the class manually. |
| 32 | + """ |
| 33 | + |
| 34 | + def __init__(self, api_client=None): |
| 35 | + if api_client is None: |
| 36 | + api_client = ApiClient() |
| 37 | + self.api_client = api_client |
| 38 | + self.get_model_urls_endpoint = _Endpoint( |
| 39 | + settings={ |
| 40 | + "response_type": (EdgeModelInfo,), |
| 41 | + "auth": ["ApiToken"], |
| 42 | + "endpoint_path": "/v1/edge/fetch-model-urls/{detector_id}/", |
| 43 | + "operation_id": "get_model_urls", |
| 44 | + "http_method": "GET", |
| 45 | + "servers": None, |
| 46 | + }, |
| 47 | + params_map={ |
| 48 | + "all": [ |
| 49 | + "detector_id", |
| 50 | + ], |
| 51 | + "required": [ |
| 52 | + "detector_id", |
| 53 | + ], |
| 54 | + "nullable": [], |
| 55 | + "enum": [], |
| 56 | + "validation": [], |
| 57 | + }, |
| 58 | + root_map={ |
| 59 | + "validations": {}, |
| 60 | + "allowed_values": {}, |
| 61 | + "openapi_types": { |
| 62 | + "detector_id": (str,), |
| 63 | + }, |
| 64 | + "attribute_map": { |
| 65 | + "detector_id": "detector_id", |
| 66 | + }, |
| 67 | + "location_map": { |
| 68 | + "detector_id": "path", |
| 69 | + }, |
| 70 | + "collection_format_map": {}, |
| 71 | + }, |
| 72 | + headers_map={ |
| 73 | + "accept": ["application/json"], |
| 74 | + "content_type": [], |
| 75 | + }, |
| 76 | + api_client=api_client, |
| 77 | + ) |
| 78 | + |
| 79 | + def get_model_urls(self, detector_id, **kwargs): |
| 80 | + """get_model_urls # noqa: E501 |
| 81 | +
|
| 82 | + Gets time limited pre-authenticated URLs to download a detector's edge model and oodd model. # noqa: E501 |
| 83 | + This method makes a synchronous HTTP request by default. To make an |
| 84 | + asynchronous HTTP request, please pass async_req=True |
| 85 | +
|
| 86 | + >>> thread = api.get_model_urls(detector_id, async_req=True) |
| 87 | + >>> result = thread.get() |
| 88 | +
|
| 89 | + Args: |
| 90 | + detector_id (str): |
| 91 | +
|
| 92 | + Keyword Args: |
| 93 | + _return_http_data_only (bool): response data without head status |
| 94 | + code and headers. Default is True. |
| 95 | + _preload_content (bool): if False, the urllib3.HTTPResponse object |
| 96 | + will be returned without reading/decoding response data. |
| 97 | + Default is True. |
| 98 | + _request_timeout (int/float/tuple): timeout setting for this request. If |
| 99 | + one number provided, it will be total request timeout. It can also |
| 100 | + be a pair (tuple) of (connection, read) timeouts. |
| 101 | + Default is None. |
| 102 | + _check_input_type (bool): specifies if type checking |
| 103 | + should be done one the data sent to the server. |
| 104 | + Default is True. |
| 105 | + _check_return_type (bool): specifies if type checking |
| 106 | + should be done one the data received from the server. |
| 107 | + Default is True. |
| 108 | + _spec_property_naming (bool): True if the variable names in the input data |
| 109 | + are serialized names, as specified in the OpenAPI document. |
| 110 | + False if the variable names in the input data |
| 111 | + are pythonic names, e.g. snake case (default) |
| 112 | + _content_type (str/None): force body content-type. |
| 113 | + Default is None and content-type will be predicted by allowed |
| 114 | + content-types and body. |
| 115 | + _host_index (int/None): specifies the index of the server |
| 116 | + that we want to use. |
| 117 | + Default is read from the configuration. |
| 118 | + async_req (bool): execute request asynchronously |
| 119 | +
|
| 120 | + Returns: |
| 121 | + EdgeModelInfo |
| 122 | + If the method is called asynchronously, returns the request |
| 123 | + thread. |
| 124 | + """ |
| 125 | + kwargs["async_req"] = kwargs.get("async_req", False) |
| 126 | + kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) |
| 127 | + kwargs["_preload_content"] = kwargs.get("_preload_content", True) |
| 128 | + kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) |
| 129 | + kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) |
| 130 | + kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) |
| 131 | + kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) |
| 132 | + kwargs["_content_type"] = kwargs.get("_content_type") |
| 133 | + kwargs["_host_index"] = kwargs.get("_host_index") |
| 134 | + kwargs["detector_id"] = detector_id |
| 135 | + return self.get_model_urls_endpoint.call_with_http_info(**kwargs) |
0 commit comments