def test_endpoint(self, string): # type: (str) -> str _headers = { 'Accept': 'application/json', 'Content-Type': 'application/json', } # type: Dict[str, Any] _params = {} # type: Dict[str, Any] _path_params = {} # type: Dict[str, Any] _json = ConjureEncoder().default(string) # type: Any _path = '/catalog/testEndpoint' _path = _path.format(**_path_params) _response = self._request( # type: ignore 'POST', self._uri + _path, params=_params, headers=_headers, json=_json) _decoder = ConjureDecoder() return _decoder.decode(_response.json(), str)
def create_dataset(self, auth_header: str, request: "product_CreateDatasetRequest", test_header_arg: str) -> "product_datasets_Dataset": _headers: Dict[str, Any] = { 'Accept': 'application/json', 'Content-Type': 'application/json', 'Authorization': auth_header, 'Test-Header': test_header_arg, } _params: Dict[str, Any] = {} _path_params: Dict[str, Any] = {} _json: Any = ConjureEncoder().default(request) _path = '/catalog/datasets' _path = _path.format(**_path_params) _response: Response = self._request('POST', self._uri + _path, params=_params, headers=_headers, json=_json) _decoder = ConjureDecoder() return _decoder.decode(_response.json(), product_datasets_Dataset)
def get_dataset(self, auth_header: str, dataset_rid: str) -> Optional["product_datasets_Dataset"]: _headers: Dict[str, Any] = { 'Accept': 'application/json', 'Authorization': auth_header, } _params: Dict[str, Any] = {} _path_params: Dict[str, Any] = { 'datasetRid': dataset_rid, } _json: Any = None _path = '/catalog/datasets/{datasetRid}' _path = _path.format(**_path_params) _response: Response = self._request('GET', self._uri + _path, params=_params, headers=_headers, json=_json) _decoder = ConjureDecoder() return None if _response.status_code == 204 else _decoder.decode( _response.json(), OptionalTypeWrapper[product_datasets_Dataset])
def test_query_params(self, auth_header: str, implicit: str, something: str) -> int: _headers: Dict[str, Any] = { 'Accept': 'application/json', 'Authorization': auth_header, } _params: Dict[str, Any] = { 'different': something, 'implicit': implicit, } _path_params: Dict[str, Any] = {} _json: Any = None _path = '/catalog/test-query-params' _path = _path.format(**_path_params) _response: Response = self._request('GET', self._uri + _path, params=_params, headers=_headers, json=_json) _decoder = ConjureDecoder() return _decoder.decode(_response.json(), int)
def get_file_systems( self, auth_header: str ) -> Dict[str, "product_datasets_BackingFileSystem"]: """ Returns a mapping from file system id to backing file system configuration. """ _headers: Dict[str, Any] = { 'Accept': 'application/json', 'Authorization': auth_header, } _params: Dict[str, Any] = {} _path_params: Dict[str, Any] = {} _json: Any = None _path = '/catalog/fileSystems' _path = _path.format(**_path_params) _response: Response = self._request('GET', self._uri + _path, params=_params, headers=_headers, json=_json) _decoder = ConjureDecoder() return _decoder.decode(_response.json(), Dict[str, product_datasets_BackingFileSystem])
def resolve_branch(self, auth_header: str, branch: str, dataset_rid: str) -> Optional[str]: _headers: Dict[str, Any] = { 'Accept': 'application/json', 'Authorization': auth_header, } _params: Dict[str, Any] = {} _path_params: Dict[str, Any] = { 'datasetRid': dataset_rid, 'branch': branch, } _json: Any = None _path = '/catalog/datasets/{datasetRid}/branches/{branch}/resolve' _path = _path.format(**_path_params) _response: Response = self._request('GET', self._uri + _path, params=_params, headers=_headers, json=_json) _decoder = ConjureDecoder() return None if _response.status_code == 204 else _decoder.decode( _response.json(), OptionalTypeWrapper[str])
def get_branches(self, auth_header: str, dataset_rid: str, message: Optional[str] = None, page_size: Optional[int] = None) -> List[str]: _headers: Dict[str, Any] = { 'Accept': 'application/json', 'Authorization': auth_header, 'Special-Message': message, } _params: Dict[str, Any] = { 'pageSize': page_size, } _path_params: Dict[str, Any] = { 'datasetRid': dataset_rid, } _json: Any = None _path = '/catalog/datasets/{datasetRid}/branches' _path = _path.format(**_path_params) _response: Response = self._request('GET', self._uri + _path, params=_params, headers=_headers, json=_json) _decoder = ConjureDecoder() return _decoder.decode(_response.json(), List[str])
def get_branches_deprecated(self, auth_header: str, dataset_rid: str) -> List[str]: """ Gets all branches of this dataset. """ _headers: Dict[str, Any] = { 'Accept': 'application/json', 'Authorization': auth_header, } _params: Dict[str, Any] = {} _path_params: Dict[str, Any] = { 'datasetRid': dataset_rid, } _json: Any = None _path = '/catalog/datasets/{datasetRid}/branchesDeprecated' _path = _path.format(**_path_params) _response: Response = self._request('GET', self._uri + _path, params=_params, headers=_headers, json=_json) _decoder = ConjureDecoder() return _decoder.decode(_response.json(), List[str])
def get_dataset(self, auth_header, dataset_rid): # type: (str, str) -> Optional[Dataset] _headers = { 'Accept': 'application/json', 'Authorization': auth_header, } # type: Dict[str, Any] _params = {} # type: Dict[str, Any] _path_params = { 'datasetRid': dataset_rid, } # type: Dict[str, Any] _json = None # type: Any _path = '/catalog/datasets/{datasetRid}' _path = _path.format(**_path_params) _response = self._request( # type: ignore 'GET', self._uri + _path, params=_params, headers=_headers, json=_json) _decoder = ConjureDecoder() return None if _response.status_code == 204 else _decoder.decode( _response.json(), OptionalType(Dataset))
def get_file_systems(self, auth_header): # type: (str) -> Dict[str, BackingFileSystem] """Returns a mapping from file system id to backing file system configuration.""" _headers = { 'Accept': 'application/json', 'Authorization': auth_header, } # type: Dict[str, Any] _params = {} # type: Dict[str, Any] _path_params = {} # type: Dict[str, Any] _json = None # type: Any _path = '/catalog/fileSystems' _path = _path.format(**_path_params) _response = self._request( # type: ignore 'GET', self._uri + _path, params=_params, headers=_headers, json=_json) _decoder = ConjureDecoder() return _decoder.decode(_response.json(), DictType(str, BackingFileSystem))
def test_integer(self, auth_header): # type: (str) -> int _headers = { 'Accept': 'application/json', 'Authorization': auth_header, } # type: Dict[str, Any] _params = {} # type: Dict[str, Any] _path_params = {} # type: Dict[str, Any] _json = None # type: Any _path = '/catalog/integer' _path = _path.format(**_path_params) _response = self._request( # type: ignore 'GET', self._uri + _path, params=_params, headers=_headers, json=_json) _decoder = ConjureDecoder() return _decoder.decode(_response.json(), int)
def create_dataset(self, auth_header, request, test_header_arg): # type: (str, CreateDatasetRequest, str) -> Dataset _headers = { 'Accept': 'application/json', 'Content-Type': 'application/json', 'Authorization': auth_header, 'Test-Header': test_header_arg, } # type: Dict[str, Any] _params = {} # type: Dict[str, Any] _path_params = {} # type: Dict[str, Any] _json = ConjureEncoder().default(request) # type: Any _path = '/catalog/datasets' _path = _path.format(**_path_params) _response = self._request( # type: ignore 'POST', self._uri + _path, params=_params, headers=_headers, json=_json) _decoder = ConjureDecoder() return _decoder.decode(_response.json(), Dataset)
def test_query_params(self, auth_header, implicit, something): # type: (str, str, str) -> int _headers = { 'Accept': 'application/json', 'Authorization': auth_header, } # type: Dict[str, Any] _params = { 'different': something, 'implicit': implicit, } # type: Dict[str, Any] _path_params = {} # type: Dict[str, Any] _json = None # type: Any _path = '/catalog/test-query-params' _path = _path.format(**_path_params) _response = self._request( # type: ignore 'GET', self._uri + _path, params=_params, headers=_headers, json=_json) _decoder = ConjureDecoder() return _decoder.decode(_response.json(), int)
def get_branches_deprecated(self, auth_header, dataset_rid): # type: (str, str) -> List[str] """Gets all branches of this dataset.""" _headers = { 'Accept': 'application/json', 'Authorization': auth_header, } # type: Dict[str, Any] _params = {} # type: Dict[str, Any] _path_params = { 'datasetRid': dataset_rid, } # type: Dict[str, Any] _json = None # type: Any _path = '/catalog/datasets/{datasetRid}/branchesDeprecated' _path = _path.format(**_path_params) _response = self._request( # type: ignore 'GET', self._uri + _path, params=_params, headers=_headers, json=_json) _decoder = ConjureDecoder() return _decoder.decode(_response.json(), ListType(str))
def get_branches(self, auth_header, dataset_rid, message=None, page_size=None): # type: (str, str, Optional[str], Optional[int]) -> List[str] _headers = { 'Accept': 'application/json', 'Authorization': auth_header, 'Special-Message': message, } # type: Dict[str, Any] _params = { 'pageSize': page_size, } # type: Dict[str, Any] _path_params = { 'datasetRid': dataset_rid, } # type: Dict[str, Any] _json = None # type: Any _path = '/catalog/datasets/{datasetRid}/branches' _path = _path.format(**_path_params) _response = self._request( # type: ignore 'GET', self._uri + _path, params=_params, headers=_headers, json=_json) _decoder = ConjureDecoder() return _decoder.decode(_response.json(), ListType(str))
def test_integer(self, auth_header: str) -> int: _headers: Dict[str, Any] = { 'Accept': 'application/json', 'Authorization': auth_header, } _params: Dict[str, Any] = {} _path_params: Dict[str, Any] = {} _json: Any = None _path = '/catalog/integer' _path = _path.format(**_path_params) _response: Response = self._request('GET', self._uri + _path, params=_params, headers=_headers, json=_json) _decoder = ConjureDecoder() return _decoder.decode(_response.json(), int)