diff --git a/dph_services/common_constants.py b/dph_services/common_constants.py index f91ce15..585c79c 100644 --- a/dph_services/common_constants.py +++ b/dph_services/common_constants.py @@ -1,4 +1,5 @@ # coding: utf-8 + # Copyright 2019, 2020 IBM All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -36,9 +37,7 @@ URL_UPDATE_DATA_PRODUCT_RELEASE = '/data_product_exchange/v1/data_products/{data_product_id}/releases/{release_id}' URL_GET_RELEASE_CONTRACT_TERMS_DOCUMENT = '/data_product_exchange/v1/data_products/{data_product_id}/releases/{release_id}/contract_terms/{contract_terms_id}/documents/{document_id}' URL_LIST_DATA_PRODUCT_RELEASES = '/data_product_exchange/v1/data_products/{data_product_id}/releases' -URL_RETIRE_DATA_PRODUCT_RELEASE = ( - '/data_product_exchange/v1/data_products/{data_product_id}/releases/{release_id}/retire' -) +URL_RETIRE_DATA_PRODUCT_RELEASE = '/data_product_exchange/v1/data_products/{data_product_id}/releases/{release_id}/retire' # Dph Api Headers CONTENT_TYPE_JSON = 'application/json' @@ -46,3 +45,4 @@ SERVICE_NAME = 'data_product_hub_api_service' SERVICE_VERSION = 'V1' + diff --git a/dph_services/dph_v1.py b/dph_services/dph_v1.py index e787a3f..4a7df60 100644 --- a/dph_services/dph_v1.py +++ b/dph_services/dph_v1.py @@ -24,7 +24,7 @@ from datetime import datetime from enum import Enum -from typing import Dict, List, Optional +from typing import BinaryIO, Dict, List, Optional import json from ibm_cloud_sdk_core import BaseService, DetailedResponse @@ -75,6 +75,52 @@ def __init__( """ BaseService.__init__(self, service_url=self.DEFAULT_SERVICE_URL, authenticator=authenticator) + ######################### + # Helper Methods + ######################### + + def _prepare_headers(self, operation_id: str, **kwargs) -> Dict: + """ + Prepare request headers with SDK headers and custom headers from kwargs. + + :param operation_id: The operation ID for SDK headers + :param kwargs: Additional keyword arguments that may contain 'headers' + :return: Dictionary of prepared headers + """ + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id=operation_id, + ) + headers.update(sdk_headers) + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + + return headers + + def _set_accept_header(self, headers: Dict, accept_type: Optional[str] = 'application/json') -> None: + """ + Set the Accept header if not already present. + + :param headers: Headers dictionary to update + :param accept_type: The accept type to set (default: 'application/json') + """ + if accept_type and 'Accept' not in headers: + headers['Accept'] = accept_type + + def _prepare_json_data(self, data: Dict) -> str: + """ + Prepare JSON data by removing None values and converting to JSON string. + + :param data: Dictionary of data to prepare + :return: JSON string + """ + data = {k: v for (k, v) in data.items() if v is not None} + return json.dumps(data) + ######################### # Configuration ######################### @@ -105,23 +151,13 @@ def get_initialize_status( :rtype: DetailedResponse with `dict` result representing a `InitializeResource` object """ - headers = {} - sdk_headers = get_sdk_headers( - service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_initialize_status', - ) - headers.update(sdk_headers) + headers = self._prepare_headers('get_initialize_status', **kwargs) + self._set_accept_header(headers) params = { 'container.id': container_id, } - if 'headers' in kwargs: - headers.update(kwargs.get('headers')) - del kwargs['headers'] - headers['Accept'] = 'application/json' - url = '/data_product_exchange/v1/configuration/initialize/status' request = self.prepare_request( method='GET', @@ -147,18 +183,8 @@ def get_service_id_credentials( :rtype: DetailedResponse with `dict` result representing a `ServiceIdCredentials` object """ - headers = {} - sdk_headers = get_sdk_headers( - service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_service_id_credentials', - ) - headers.update(sdk_headers) - - if 'headers' in kwargs: - headers.update(kwargs.get('headers')) - del kwargs['headers'] - headers['Accept'] = 'application/json' + headers = self._prepare_headers('get_service_id_credentials', **kwargs) + self._set_accept_header(headers) url = '/data_product_exchange/v1/configuration/credentials' request = self.prepare_request( @@ -212,27 +238,16 @@ def initialize( if container is not None: container = convert_model(container) - headers = {} - sdk_headers = get_sdk_headers( - service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='initialize', - ) - headers.update(sdk_headers) + + headers = self._prepare_headers('initialize', **kwargs) + self._set_accept_header(headers) - data = { + data = self._prepare_json_data({ 'container': container, 'include': include, - } - data = {k: v for (k, v) in data.items() if v is not None} - data = json.dumps(data) + }) headers['content-type'] = 'application/json' - if 'headers' in kwargs: - headers.update(kwargs.get('headers')) - del kwargs['headers'] - headers['Accept'] = 'application/json' - url = '/data_product_exchange/v1/configuration/initialize' request = self.prepare_request( method='POST', @@ -258,17 +273,7 @@ def manage_api_keys( :rtype: DetailedResponse """ - headers = {} - sdk_headers = get_sdk_headers( - service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='manage_api_keys', - ) - headers.update(sdk_headers) - - if 'headers' in kwargs: - headers.update(kwargs.get('headers')) - del kwargs['headers'] + headers = self._prepare_headers('manage_api_keys', **kwargs) url = '/data_product_exchange/v1/configuration/rotate_credentials' request = self.prepare_request( @@ -711,6 +716,7 @@ def create_data_product_draft( comments: Optional[str] = None, access_control: Optional['AssetListAccessControl'] = None, last_updated_at: Optional[datetime] = None, + sub_container: Optional['ContainerIdentity'] = None, is_restricted: Optional[bool] = None, **kwargs, ) -> DetailedResponse: @@ -760,6 +766,8 @@ def create_data_product_draft( :param AssetListAccessControl access_control: (optional) Access control object. :param datetime last_updated_at: (optional) Timestamp of last asset update. + :param ContainerIdentity sub_container: (optional) The identity schema for + a IBM knowledge catalog container (catalog/project/space). :param bool is_restricted: (optional) Indicates whether the data product is restricted or not. A restricted data product indicates that orders of the data product requires explicit approval before data is delivered. @@ -789,6 +797,8 @@ def create_data_product_draft( access_control = convert_model(access_control) if last_updated_at is not None: last_updated_at = datetime_to_string(last_updated_at) + if sub_container is not None: + sub_container = convert_model(sub_container) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, @@ -815,6 +825,7 @@ def create_data_product_draft( 'comments': comments, 'access_control': access_control, 'last_updated_at': last_updated_at, + 'sub_container': sub_container, 'is_restricted': is_restricted, } data = {k: v for (k, v) in data.items() if v is not None} @@ -1296,6 +1307,8 @@ def get_data_product_draft_contract_terms( *, accept: Optional[str] = None, include_contract_documents: Optional[bool] = None, + autopopulate_server_information: Optional[bool] = None, + server_asset_id: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -1307,14 +1320,18 @@ def get_data_product_draft_contract_terms( data product ID explicitly. :param str draft_id: Data product draft id. :param str contract_terms_id: Contract terms id. - :param str accept: (optional) The type of the response: - application/odcs+yaml or application/json. + :param str accept: (optional) The type of the response: application/json or + application/odcs+yaml. :param bool include_contract_documents: (optional) Set to false to exclude external contract documents (e.g., Terms and Conditions URLs) from the response. By default, these are included. + :param bool autopopulate_server_information: (optional) Set to true to + autopopulate server information from connection details. Default is false. + :param str server_asset_id: (optional) Asset ID of the server used for + autopopulating connection details. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `BinaryIO` result + :rtype: DetailedResponse with `dict` result representing a `ContractTerms` object """ if not data_product_id: @@ -1335,6 +1352,8 @@ def get_data_product_draft_contract_terms( params = { 'include_contract_documents': include_contract_documents, + 'autopopulate_server_information': autopopulate_server_information, + 'server_asset_id': server_asset_id, } if 'headers' in kwargs: @@ -1374,6 +1393,7 @@ def replace_data_product_draft_contract_terms( support_and_communication: Optional[List['ContractTemplateSupportAndCommunication']] = None, custom_properties: Optional[List['ContractTemplateCustomProperty']] = None, contract_test: Optional['ContractTest'] = None, + servers: Optional[List['ContractServer']] = None, schema: Optional[List['ContractSchema']] = None, **kwargs, ) -> DetailedResponse: @@ -1411,6 +1431,7 @@ def replace_data_product_draft_contract_terms( Custom properties that are not part of the standard contract. :param ContractTest contract_test: (optional) Contains the contract test status and related metadata. + :param List[ContractServer] servers: (optional) List of server definitions. :param List[ContractSchema] schema: (optional) Schema details of the data asset. :param dict headers: A `dict` containing the request headers @@ -1446,6 +1467,8 @@ def replace_data_product_draft_contract_terms( custom_properties = [convert_model(x) for x in custom_properties] if contract_test is not None: contract_test = convert_model(contract_test) + if servers is not None: + servers = [convert_model(x) for x in servers] if schema is not None: schema = [convert_model(x) for x in schema] headers = {} @@ -1470,6 +1493,7 @@ def replace_data_product_draft_contract_terms( 'support_and_communication': support_and_communication, 'custom_properties': custom_properties, 'contract_test': contract_test, + 'servers': servers, 'schema': schema, } data = {k: v for (k, v) in data.items() if v is not None} @@ -1565,6 +1589,80 @@ def update_data_product_draft_contract_terms( response = self.send(request, **kwargs) return response + def get_contract_terms_in_specified_format( + self, + data_product_id: str, + draft_id: str, + contract_terms_id: str, + format: str, + format_version: str, + *, + accept: Optional[str] = None, + **kwargs, + ) -> DetailedResponse: + """ + Retrieve a data product contract terms identified by id in specified format. + + Retrieve a data product contract terms identified by id in specified format. + + :param str data_product_id: Data product ID. Use '-' to skip specifying the + data product ID explicitly. + :param str draft_id: Data product draft id. + :param str contract_terms_id: Contract terms id. + :param str format: The format for returning contract terms. For example: + odcs. + :param str format_version: The version of the format for returning contract + terms. For example: 3. + :param str accept: (optional) The type of the response: + application/odcs+yaml or application/json. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `BinaryIO` result + """ + + if not data_product_id: + raise ValueError('data_product_id must be provided') + if not draft_id: + raise ValueError('draft_id must be provided') + if not contract_terms_id: + raise ValueError('contract_terms_id must be provided') + if not format: + raise ValueError('format must be provided') + if not format_version: + raise ValueError('format_version must be provided') + headers = { + 'Accept': accept, + } + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_contract_terms_in_specified_format', + ) + headers.update(sdk_headers) + + params = { + 'format': format, + 'format_version': format_version, + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + + path_param_keys = ['data_product_id', 'draft_id', 'contract_terms_id'] + path_param_values = self.encode_path_vars(data_product_id, draft_id, contract_terms_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/data_product_exchange/v1/data_products/{data_product_id}/drafts/{draft_id}/contract_terms/{contract_terms_id}/format'.format(**path_param_dict) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) + + response = self.send(request, **kwargs) + return response + def publish_data_product_draft( self, data_product_id: str, @@ -1807,6 +1905,73 @@ def get_release_contract_terms_document( response = self.send(request, **kwargs) return response + def get_published_data_product_draft_contract_terms( + self, + data_product_id: str, + release_id: str, + contract_terms_id: str, + *, + accept: Optional[str] = None, + include_contract_documents: Optional[bool] = None, + **kwargs, + ) -> DetailedResponse: + """ + Retrieve a published data product contract terms identified by id. + + Retrieve a published data product contract terms identified by id. + + :param str data_product_id: Data product ID. Use '-' to skip specifying the + data product ID explicitly. + :param str release_id: Data product release id. + :param str contract_terms_id: Contract terms id. + :param str accept: (optional) The type of the response: + application/odcs+yaml or application/json. + :param bool include_contract_documents: (optional) Set to false to exclude + external contract documents (e.g., Terms and Conditions URLs) from the + response. By default, these are included. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `BinaryIO` result + """ + + if not data_product_id: + raise ValueError('data_product_id must be provided') + if not release_id: + raise ValueError('release_id must be provided') + if not contract_terms_id: + raise ValueError('contract_terms_id must be provided') + headers = { + 'Accept': accept, + } + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_published_data_product_draft_contract_terms', + ) + headers.update(sdk_headers) + + params = { + 'include_contract_documents': include_contract_documents, + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + + path_param_keys = ['data_product_id', 'release_id', 'contract_terms_id'] + path_param_values = self.encode_path_vars(data_product_id, release_id, contract_terms_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/data_product_exchange/v1/data_products/{data_product_id}/releases/{release_id}/contract_terms/{contract_terms_id}'.format(**path_param_dict) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) + + response = self.send(request, **kwargs) + return response + def list_data_product_releases( self, data_product_id: str, @@ -1884,6 +2049,7 @@ def retire_data_product_release( release_id: str, *, revoke_access: Optional[bool] = None, + start_at: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -1898,6 +2064,9 @@ def retire_data_product_release( :param bool revoke_access: (optional) Revoke's Access from all the Subscriptions of the Data Product. No user's can able to see the subscribed assets anymore. + :param str start_at: (optional) The date and time when the revoke access + operation should start (ISO 8601 format, e.g., 2025-09-24T06:55:29Z). If + not provided, the operation starts immediately. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `DataProductRelease` object @@ -1917,6 +2086,7 @@ def retire_data_product_release( params = { 'revoke_access': revoke_access, + 'start_at': start_at, } if 'headers' in kwargs: @@ -1938,6 +2108,71 @@ def retire_data_product_release( response = self.send(request, **kwargs) return response + def create_revoke_access_process( + self, + data_product_id: str, + release_id: str, + *, + body: Optional[BinaryIO] = None, + content_type: Optional[str] = None, + **kwargs, + ) -> DetailedResponse: + """ + Revoke access from Data Product subscriptions. + + Revoke's access from Subscriptions of the data product id passed in the path + parameter. Optionally specify a future date-time when the revoke access operation + should start using the start_at field in ISO 8601 format (e.g., + 2025-09-24T06:55:29Z). If start_at is not provided, the revoke access operation + starts immediately. + + :param str data_product_id: Data product ID. Use '-' to skip specifying the + data product ID explicitly. + :param str release_id: The unique identifier of the data product release. + :param BinaryIO body: (optional) Request parameters to handle revoke access + from subscriptions. The start_at field can be used to schedule the revoke + access operation for a future date-time. + :param str content_type: (optional) The type of the input. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `RevokeAccessResponse` object + """ + + if not data_product_id: + raise ValueError('data_product_id must be provided') + if not release_id: + raise ValueError('release_id must be provided') + headers = { + 'Content-Type': content_type, + } + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='create_revoke_access_process', + ) + headers.update(sdk_headers) + + data = body + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + path_param_keys = ['data_product_id', 'release_id'] + path_param_values = self.encode_path_vars(data_product_id, release_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/data_product_exchange/v1/data_products/{data_product_id}/releases/{release_id}/revoke_access'.format(**path_param_dict) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + data=data, + ) + + response = self.send(request, **kwargs) + return response + ######################### # Data Product Contract Templates ######################### @@ -1947,6 +2182,7 @@ def list_data_product_contract_template( *, container_id: Optional[str] = None, contract_template_name: Optional[str] = None, + domain_ids: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -1960,6 +2196,9 @@ def list_data_product_contract_template( :param str contract_template_name: (optional) Name of the data product contract template. If not supplied, the data product templates within the catalog will returned. + :param str domain_ids: (optional) Comma-separated domain IDs to filter data + product contract templates. If not supplied, the data product templates + within the catalog will returned. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `DataProductContractTemplateCollection` object @@ -1976,6 +2215,7 @@ def list_data_product_contract_template( params = { 'container.id': container_id, 'contract_template.name': contract_template_name, + 'domain.ids': domain_ids, } if 'headers' in kwargs: @@ -1999,11 +2239,14 @@ def create_contract_template( container: 'ContainerReference', *, id: Optional[str] = None, + creator_id: Optional[str] = None, + created_at: Optional[str] = None, name: Optional[str] = None, error: Optional['ErrorMessage'] = None, contract_terms: Optional['ContractTerms'] = None, container_id: Optional[str] = None, contract_template_name: Optional[str] = None, + domain_ids: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -2014,6 +2257,10 @@ def create_contract_template( :param ContainerReference container: Container reference. :param str id: (optional) The identifier of the data product contract template. + :param str creator_id: (optional) The identifier of the user who created + the data product contract template. + :param str created_at: (optional) The timestamp when the data product + contract template was created. :param str name: (optional) The name of the contract template. :param ErrorMessage error: (optional) Contains the code and details. :param ContractTerms contract_terms: (optional) Defines the complete @@ -2024,6 +2271,9 @@ def create_contract_template( :param str contract_template_name: (optional) Name of the data product contract template. If not supplied, the data product templates within the catalog will returned. + :param str domain_ids: (optional) Comma-separated domain IDs to filter data + product contract templates. If not supplied, the data product templates + within the catalog will returned. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `DataProductContractTemplate` object @@ -2047,11 +2297,14 @@ def create_contract_template( params = { 'container.id': container_id, 'contract_template.name': contract_template_name, + 'domain.ids': domain_ids, } data = { 'container': container, 'id': id, + 'creator_id': creator_id, + 'created_at': created_at, 'name': name, 'error': error, 'contract_terms': contract_terms, @@ -2258,6 +2511,7 @@ def list_data_product_domains( self, *, container_id: Optional[str] = None, + include_subdomains: Optional[bool] = None, **kwargs, ) -> DetailedResponse: """ @@ -2268,6 +2522,8 @@ def list_data_product_domains( :param str container_id: (optional) Container ID of the data product catalog. If not supplied, the data product catalog is looked up by using the uid of the default data product catalog. + :param bool include_subdomains: (optional) Include subdomains in the + response. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `DataProductDomainCollection` object @@ -2283,6 +2539,7 @@ def list_data_product_domains( params = { 'container.id': container_id, + 'include_subdomains': include_subdomains, } if 'headers' in kwargs: @@ -2310,10 +2567,12 @@ def create_data_product_domain( name: Optional[str] = None, description: Optional[str] = None, id: Optional[str] = None, + created_by: Optional[str] = None, member_roles: Optional['MemberRolesSchema'] = None, properties: Optional['PropertiesSchema'] = None, sub_domains: Optional[List['InitializeSubDomain']] = None, - container_id: Optional[str] = None, + sub_container: Optional['ContainerIdentity'] = None, + link_to_subcontainers: Optional[bool] = None, **kwargs, ) -> DetailedResponse: """ @@ -2329,15 +2588,18 @@ def create_data_product_domain( :param str description: (optional) The description of the data product domain. :param str id: (optional) The identifier of the data product domain. + :param str created_by: (optional) The identifier of the creator of the data + product domain. :param MemberRolesSchema member_roles: (optional) Member roles of a corresponding asset. :param PropertiesSchema properties: (optional) Properties of the corresponding asset. :param List[InitializeSubDomain] sub_domains: (optional) List of sub domains to be added within a domain. - :param str container_id: (optional) Container ID of the data product - catalog. If not supplied, the data product catalog is looked up by using - the uid of the default data product catalog. + :param ContainerIdentity sub_container: (optional) The identity schema for + a IBM knowledge catalog container (catalog/project/space). + :param bool link_to_subcontainers: (optional) Link domains to + subcontainers. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `DataProductDomain` object @@ -2354,6 +2616,8 @@ def create_data_product_domain( properties = convert_model(properties) if sub_domains is not None: sub_domains = [convert_model(x) for x in sub_domains] + if sub_container is not None: + sub_container = convert_model(sub_container) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, @@ -2363,7 +2627,7 @@ def create_data_product_domain( headers.update(sdk_headers) params = { - 'container.id': container_id, + 'link_to_subcontainers': link_to_subcontainers, } data = { @@ -2373,9 +2637,11 @@ def create_data_product_domain( 'name': name, 'description': description, 'id': id, + 'created_by': created_by, 'member_roles': member_roles, 'properties': properties, 'sub_domains': sub_domains, + 'sub_container': sub_container, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -2773,13 +3039,100 @@ def get_s3_bucket_validation( response = self.send(request, **kwargs) return response + ######################### + # Data Product Revoke Access Job Runs + ######################### -class GetDataProductDraftContractTermsEnums: - """ - Enums for get_data_product_draft_contract_terms parameters. - """ - - class Accept(str, Enum): + def get_revoke_access_process_state( + self, + release_id: str, + *, + limit: Optional[int] = None, + start: Optional[str] = None, + **kwargs, + ) -> DetailedResponse: + """ + Access revoke status of the subscriptions against the data product release id. + + Retrieves the status of revoke access requests. + + :param str release_id: Pass the data product release version id to retrieve + job runs state for that specific DPV ID. + :param int limit: (optional) Limit the number of tracking assets in the + results. The maximum is 200. + :param str start: (optional) Start token for pagination. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `RevokeAccessStateResponse` object + """ + + if not release_id: + raise ValueError('release_id must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_revoke_access_process_state', + ) + headers.update(sdk_headers) + + params = { + 'release_id': release_id, + 'limit': limit, + 'start': start, + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + url = '/data_product_exchange/v1/data_product_revoke_access/job_runs' + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) + + response = self.send(request, **kwargs) + return response + + +class GetDataProductDraftContractTermsEnums: + """ + Enums for get_data_product_draft_contract_terms parameters. + """ + + class Accept(str, Enum): + """ + The type of the response: application/json or application/odcs+yaml. + """ + + APPLICATION_JSON = 'application/json' + APPLICATION_ODCS_YAML = 'application/odcs+yaml' + + +class GetContractTermsInSpecifiedFormatEnums: + """ + Enums for get_contract_terms_in_specified_format parameters. + """ + + class Accept(str, Enum): + """ + The type of the response: application/odcs+yaml or application/json. + """ + + APPLICATION_ODCS_YAML = 'application/odcs+yaml' + APPLICATION_JSON = 'application/json' + + +class GetPublishedDataProductDraftContractTermsEnums: + """ + Enums for get_published_data_product_draft_contract_terms parameters. + """ + + class Accept(str, Enum): """ The type of the response: application/odcs+yaml or application/json. """ @@ -2808,6 +3161,72 @@ class State(str, Enum): ############################################################################## +class Asset: + """ + Asset. + + :param dict metadata: (optional) + :param dict entity: (optional) + """ + + def __init__( + self, + *, + metadata: Optional[dict] = None, + entity: Optional[dict] = None, + ) -> None: + """ + Initialize a Asset object. + + :param dict metadata: (optional) + :param dict entity: (optional) + """ + self.metadata = metadata + self.entity = entity + + @classmethod + def from_dict(cls, _dict: Dict) -> 'Asset': + """Initialize a Asset object from a json dictionary.""" + args = {} + if (metadata := _dict.get('metadata')) is not None: + args['metadata'] = metadata + if (entity := _dict.get('entity')) is not None: + args['entity'] = entity + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a Asset object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'metadata') and self.metadata is not None: + _dict['metadata'] = self.metadata + if hasattr(self, 'entity') and self.entity is not None: + _dict['entity'] = self.entity + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this Asset object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'Asset') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'Asset') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class AssetListAccessControl: """ Access control object. @@ -3390,50 +3809,359 @@ class TypeEnum(str, Enum): +class ContractAsset: + """ + Defines a data asset name and id. + + :param str id: (optional) ID of the data asset. + :param str name: (optional) Name of the data asset. + """ + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + ) -> None: + """ + Initialize a ContractAsset object. + + :param str id: (optional) ID of the data asset. + :param str name: (optional) Name of the data asset. + """ + self.id = id + self.name = name + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ContractAsset': + """Initialize a ContractAsset object from a json dictionary.""" + args = {} + if (id := _dict.get('id')) is not None: + args['id'] = id + if (name := _dict.get('name')) is not None: + args['name'] = name + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ContractAsset object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this ContractAsset object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ContractAsset') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ContractAsset') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class ContractQualityRule: + """ + Defines a quality rule for validating data assets. + + :param str type: The type of the quality rule: 'text', 'library', or 'sql'. + :param str description: (optional) A descriptive explanation of the quality + rule. + :param str rule: (optional) The name or identifier of the library-based quality + rule to be applied. + :param str implementation: (optional) A text (non-parsed) block of code required + for the third-party DQ engine to run. + :param str engine: (optional) Required for custom DQ rule: name of the + third-party engine being used. Common values include soda, greatExpectations, + montecarlo, etc. + :param str must_be_less_than: (optional) The threshold value that the quality + check result must be less than. + :param str must_be_less_or_equal_to: (optional) The threshold value that the + quality check result must be less than or equal to. + :param str must_be_greater_than: (optional) The threshold value that the quality + check result must be greater than. + :param str must_be_greater_or_equal_to: (optional) The threshold value that the + quality check result must be greater than or equal to. + :param List[str] must_be_between: (optional) Inclusive range (min and max) for + the quality check result. + :param List[str] must_not_be_between: (optional) Inclusive range (min and max) + the quality check must not fall within. + :param str must_be: (optional) The exact value(s) the quality check result must + match. + :param str must_not_be: (optional) The exact value(s) the quality check result + must not match. + :param str name: (optional) User-friendly name for the quality rule. + :param str unit: (optional) Unit used for evaluating the quality rule (e.g., + rows, records). + :param str query: (optional) The SQL query to execute for validating quality in + case of a 'sql' rule type. + """ + + def __init__( + self, + type: str, + *, + description: Optional[str] = None, + rule: Optional[str] = None, + implementation: Optional[str] = None, + engine: Optional[str] = None, + must_be_less_than: Optional[str] = None, + must_be_less_or_equal_to: Optional[str] = None, + must_be_greater_than: Optional[str] = None, + must_be_greater_or_equal_to: Optional[str] = None, + must_be_between: Optional[List[str]] = None, + must_not_be_between: Optional[List[str]] = None, + must_be: Optional[str] = None, + must_not_be: Optional[str] = None, + name: Optional[str] = None, + unit: Optional[str] = None, + query: Optional[str] = None, + ) -> None: + """ + Initialize a ContractQualityRule object. + + :param str type: The type of the quality rule: 'text', 'library', or 'sql'. + :param str description: (optional) A descriptive explanation of the quality + rule. + :param str rule: (optional) The name or identifier of the library-based + quality rule to be applied. + :param str implementation: (optional) A text (non-parsed) block of code + required for the third-party DQ engine to run. + :param str engine: (optional) Required for custom DQ rule: name of the + third-party engine being used. Common values include soda, + greatExpectations, montecarlo, etc. + :param str must_be_less_than: (optional) The threshold value that the + quality check result must be less than. + :param str must_be_less_or_equal_to: (optional) The threshold value that + the quality check result must be less than or equal to. + :param str must_be_greater_than: (optional) The threshold value that the + quality check result must be greater than. + :param str must_be_greater_or_equal_to: (optional) The threshold value that + the quality check result must be greater than or equal to. + :param List[str] must_be_between: (optional) Inclusive range (min and max) + for the quality check result. + :param List[str] must_not_be_between: (optional) Inclusive range (min and + max) the quality check must not fall within. + :param str must_be: (optional) The exact value(s) the quality check result + must match. + :param str must_not_be: (optional) The exact value(s) the quality check + result must not match. + :param str name: (optional) User-friendly name for the quality rule. + :param str unit: (optional) Unit used for evaluating the quality rule + (e.g., rows, records). + :param str query: (optional) The SQL query to execute for validating + quality in case of a 'sql' rule type. + """ + self.type = type + self.description = description + self.rule = rule + self.implementation = implementation + self.engine = engine + self.must_be_less_than = must_be_less_than + self.must_be_less_or_equal_to = must_be_less_or_equal_to + self.must_be_greater_than = must_be_greater_than + self.must_be_greater_or_equal_to = must_be_greater_or_equal_to + self.must_be_between = must_be_between + self.must_not_be_between = must_not_be_between + self.must_be = must_be + self.must_not_be = must_not_be + self.name = name + self.unit = unit + self.query = query + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ContractQualityRule': + """Initialize a ContractQualityRule object from a json dictionary.""" + args = {} + if (type := _dict.get('type')) is not None: + args['type'] = type + else: + raise ValueError('Required property \'type\' not present in ContractQualityRule JSON') + if (description := _dict.get('description')) is not None: + args['description'] = description + if (rule := _dict.get('rule')) is not None: + args['rule'] = rule + if (implementation := _dict.get('implementation')) is not None: + args['implementation'] = implementation + if (engine := _dict.get('engine')) is not None: + args['engine'] = engine + if (must_be_less_than := _dict.get('must_be_less_than')) is not None: + args['must_be_less_than'] = must_be_less_than + if (must_be_less_or_equal_to := _dict.get('must_be_less_or_equal_to')) is not None: + args['must_be_less_or_equal_to'] = must_be_less_or_equal_to + if (must_be_greater_than := _dict.get('must_be_greater_than')) is not None: + args['must_be_greater_than'] = must_be_greater_than + if (must_be_greater_or_equal_to := _dict.get('must_be_greater_or_equal_to')) is not None: + args['must_be_greater_or_equal_to'] = must_be_greater_or_equal_to + if (must_be_between := _dict.get('must_be_between')) is not None: + args['must_be_between'] = must_be_between + if (must_not_be_between := _dict.get('must_not_be_between')) is not None: + args['must_not_be_between'] = must_not_be_between + if (must_be := _dict.get('must_be')) is not None: + args['must_be'] = must_be + if (must_not_be := _dict.get('must_not_be')) is not None: + args['must_not_be'] = must_not_be + if (name := _dict.get('name')) is not None: + args['name'] = name + if (unit := _dict.get('unit')) is not None: + args['unit'] = unit + if (query := _dict.get('query')) is not None: + args['query'] = query + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ContractQualityRule object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'description') and self.description is not None: + _dict['description'] = self.description + if hasattr(self, 'rule') and self.rule is not None: + _dict['rule'] = self.rule + if hasattr(self, 'implementation') and self.implementation is not None: + _dict['implementation'] = self.implementation + if hasattr(self, 'engine') and self.engine is not None: + _dict['engine'] = self.engine + if hasattr(self, 'must_be_less_than') and self.must_be_less_than is not None: + _dict['must_be_less_than'] = self.must_be_less_than + if hasattr(self, 'must_be_less_or_equal_to') and self.must_be_less_or_equal_to is not None: + _dict['must_be_less_or_equal_to'] = self.must_be_less_or_equal_to + if hasattr(self, 'must_be_greater_than') and self.must_be_greater_than is not None: + _dict['must_be_greater_than'] = self.must_be_greater_than + if hasattr(self, 'must_be_greater_or_equal_to') and self.must_be_greater_or_equal_to is not None: + _dict['must_be_greater_or_equal_to'] = self.must_be_greater_or_equal_to + if hasattr(self, 'must_be_between') and self.must_be_between is not None: + _dict['must_be_between'] = self.must_be_between + if hasattr(self, 'must_not_be_between') and self.must_not_be_between is not None: + _dict['must_not_be_between'] = self.must_not_be_between + if hasattr(self, 'must_be') and self.must_be is not None: + _dict['must_be'] = self.must_be + if hasattr(self, 'must_not_be') and self.must_not_be is not None: + _dict['must_not_be'] = self.must_not_be + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'unit') and self.unit is not None: + _dict['unit'] = self.unit + if hasattr(self, 'query') and self.query is not None: + _dict['query'] = self.query + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this ContractQualityRule object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ContractQualityRule') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ContractQualityRule') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class ContractSchema: """ Schema definition of the data asset. + :param str asset_id: Id of the data asset whose schema information is stored. + :param str connection_id: Connection Id of the data asset whose schema + information is stored. :param str name: (optional) Name of the schema or data asset part. :param str description: (optional) Description of the schema. + :param str connection_path: (optional) Connection path of the asset. :param str physical_type: (optional) MIME type or physical type. :param List[ContractSchemaProperty] properties: (optional) List of properties. + :param List[ContractQualityRule] quality: (optional) List of quality rules + defined for the asset. """ def __init__( self, + asset_id: str, + connection_id: str, *, name: Optional[str] = None, description: Optional[str] = None, + connection_path: Optional[str] = None, physical_type: Optional[str] = None, properties: Optional[List['ContractSchemaProperty']] = None, + quality: Optional[List['ContractQualityRule']] = None, ) -> None: """ Initialize a ContractSchema object. + :param str asset_id: Id of the data asset whose schema information is + stored. + :param str connection_id: Connection Id of the data asset whose schema + information is stored. :param str name: (optional) Name of the schema or data asset part. :param str description: (optional) Description of the schema. + :param str connection_path: (optional) Connection path of the asset. :param str physical_type: (optional) MIME type or physical type. :param List[ContractSchemaProperty] properties: (optional) List of properties. + :param List[ContractQualityRule] quality: (optional) List of quality rules + defined for the asset. """ + self.asset_id = asset_id + self.connection_id = connection_id self.name = name self.description = description + self.connection_path = connection_path self.physical_type = physical_type self.properties = properties + self.quality = quality @classmethod def from_dict(cls, _dict: Dict) -> 'ContractSchema': """Initialize a ContractSchema object from a json dictionary.""" args = {} + if (asset_id := _dict.get('asset_id')) is not None: + args['asset_id'] = asset_id + else: + raise ValueError('Required property \'asset_id\' not present in ContractSchema JSON') + if (connection_id := _dict.get('connection_id')) is not None: + args['connection_id'] = connection_id + else: + raise ValueError('Required property \'connection_id\' not present in ContractSchema JSON') if (name := _dict.get('name')) is not None: args['name'] = name if (description := _dict.get('description')) is not None: args['description'] = description + if (connection_path := _dict.get('connection_path')) is not None: + args['connection_path'] = connection_path if (physical_type := _dict.get('physical_type')) is not None: args['physical_type'] = physical_type if (properties := _dict.get('properties')) is not None: args['properties'] = [ContractSchemaProperty.from_dict(v) for v in properties] + if (quality := _dict.get('quality')) is not None: + args['quality'] = [ContractQualityRule.from_dict(v) for v in quality] return cls(**args) @classmethod @@ -3444,10 +4172,16 @@ def _from_dict(cls, _dict): def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'asset_id') and self.asset_id is not None: + _dict['asset_id'] = self.asset_id + if hasattr(self, 'connection_id') and self.connection_id is not None: + _dict['connection_id'] = self.connection_id if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'description') and self.description is not None: _dict['description'] = self.description + if hasattr(self, 'connection_path') and self.connection_path is not None: + _dict['connection_path'] = self.connection_path if hasattr(self, 'physical_type') and self.physical_type is not None: _dict['physical_type'] = self.physical_type if hasattr(self, 'properties') and self.properties is not None: @@ -3458,6 +4192,14 @@ def to_dict(self) -> Dict: else: properties_list.append(v.to_dict()) _dict['properties'] = properties_list + if hasattr(self, 'quality') and self.quality is not None: + quality_list = [] + for v in self.quality: + if isinstance(v, dict): + quality_list.append(v) + else: + quality_list.append(v.to_dict()) + _dict['quality'] = quality_list return _dict def _to_dict(self): @@ -3486,6 +4228,8 @@ class ContractSchemaProperty: :param str name: Property name. :param ContractSchemaPropertyType type: (optional) Detailed type definition of a schema property. + :param List[ContractQualityRule] quality: (optional) List of quality rules + defined for the column. """ def __init__( @@ -3493,6 +4237,7 @@ def __init__( name: str, *, type: Optional['ContractSchemaPropertyType'] = None, + quality: Optional[List['ContractQualityRule']] = None, ) -> None: """ Initialize a ContractSchemaProperty object. @@ -3500,9 +4245,12 @@ def __init__( :param str name: Property name. :param ContractSchemaPropertyType type: (optional) Detailed type definition of a schema property. + :param List[ContractQualityRule] quality: (optional) List of quality rules + defined for the column. """ self.name = name self.type = type + self.quality = quality @classmethod def from_dict(cls, _dict: Dict) -> 'ContractSchemaProperty': @@ -3514,6 +4262,8 @@ def from_dict(cls, _dict: Dict) -> 'ContractSchemaProperty': raise ValueError('Required property \'name\' not present in ContractSchemaProperty JSON') if (type := _dict.get('type')) is not None: args['type'] = ContractSchemaPropertyType.from_dict(type) + if (quality := _dict.get('quality')) is not None: + args['quality'] = [ContractQualityRule.from_dict(v) for v in quality] return cls(**args) @classmethod @@ -3531,6 +4281,14 @@ def to_dict(self) -> Dict: _dict['type'] = self.type else: _dict['type'] = self.type.to_dict() + if hasattr(self, 'quality') and self.quality is not None: + quality_list = [] + for v in self.quality: + if isinstance(v, dict): + quality_list.append(v) + else: + quality_list.append(v.to_dict()) + _dict['quality'] = quality_list return _dict def _to_dict(self): @@ -3575,60 +4333,342 @@ def __init__( native_type: Optional[str] = None, ) -> None: """ - Initialize a ContractSchemaPropertyType object. - - :param str type: (optional) Type of the field. - :param str length: (optional) Length of the field as string. - :param str scale: (optional) Scale of the field as string. - :param str nullable: (optional) Is field nullable? true/false as string. - :param str signed: (optional) Is field signed? true/false as string. - :param str native_type: (optional) Native type of the field. + Initialize a ContractSchemaPropertyType object. + + :param str type: (optional) Type of the field. + :param str length: (optional) Length of the field as string. + :param str scale: (optional) Scale of the field as string. + :param str nullable: (optional) Is field nullable? true/false as string. + :param str signed: (optional) Is field signed? true/false as string. + :param str native_type: (optional) Native type of the field. + """ + self.type = type + self.length = length + self.scale = scale + self.nullable = nullable + self.signed = signed + self.native_type = native_type + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ContractSchemaPropertyType': + """Initialize a ContractSchemaPropertyType object from a json dictionary.""" + args = {} + if (type := _dict.get('type')) is not None: + args['type'] = type + if (length := _dict.get('length')) is not None: + args['length'] = length + if (scale := _dict.get('scale')) is not None: + args['scale'] = scale + if (nullable := _dict.get('nullable')) is not None: + args['nullable'] = nullable + if (signed := _dict.get('signed')) is not None: + args['signed'] = signed + if (native_type := _dict.get('native_type')) is not None: + args['native_type'] = native_type + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ContractSchemaPropertyType object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'length') and self.length is not None: + _dict['length'] = self.length + if hasattr(self, 'scale') and self.scale is not None: + _dict['scale'] = self.scale + if hasattr(self, 'nullable') and self.nullable is not None: + _dict['nullable'] = self.nullable + if hasattr(self, 'signed') and self.signed is not None: + _dict['signed'] = self.signed + if hasattr(self, 'native_type') and self.native_type is not None: + _dict['native_type'] = self.native_type + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this ContractSchemaPropertyType object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ContractSchemaPropertyType') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ContractSchemaPropertyType') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class ContractServer: + """ + Schema definition of a server configuration for the asset. + + :param str server: Name of the server. + :param ContractAsset asset: (optional) Defines a data asset name and id. + :param str connection_id: (optional) ID of the data source associated with data + asset. + :param str type: (optional) Type of the server. + :param str description: (optional) Description of the server. + :param str environment: (optional) Environment in which the server operates. + :param str account: (optional) Account used by the server. + :param str catalog: (optional) Catalog name. + :param str database: (optional) Database name. + :param str dataset: (optional) Dataset name. + :param str delimiter: (optional) Delimiter. + :param str endpoint_url: (optional) Server endpoint URL. + :param str format: (optional) File format. + :param str host: (optional) Host name or IP address. + :param str location: (optional) Location URL. + :param str path: (optional) Relative or absolute path to the data. + :param str port: (optional) Port to the server. + :param str project: (optional) Project name. + :param str region: (optional) Cloud region. + :param str region_name: (optional) Region name. + :param str schema: (optional) Schema name. + :param str service_name: (optional) Service name. + :param str staging_dir: (optional) Staging directory. + :param str stream: (optional) Data stream name. + :param str warehouse: (optional) Warehouse or cluster name. + :param List[str] roles: (optional) List of roles for the server. + :param List[ContractTemplateCustomProperty] custom_properties: (optional) List + of custom properties for the server. + """ + + def __init__( + self, + server: str, + *, + asset: Optional['ContractAsset'] = None, + connection_id: Optional[str] = None, + type: Optional[str] = None, + description: Optional[str] = None, + environment: Optional[str] = None, + account: Optional[str] = None, + catalog: Optional[str] = None, + database: Optional[str] = None, + dataset: Optional[str] = None, + delimiter: Optional[str] = None, + endpoint_url: Optional[str] = None, + format: Optional[str] = None, + host: Optional[str] = None, + location: Optional[str] = None, + path: Optional[str] = None, + port: Optional[str] = None, + project: Optional[str] = None, + region: Optional[str] = None, + region_name: Optional[str] = None, + schema: Optional[str] = None, + service_name: Optional[str] = None, + staging_dir: Optional[str] = None, + stream: Optional[str] = None, + warehouse: Optional[str] = None, + roles: Optional[List[str]] = None, + custom_properties: Optional[List['ContractTemplateCustomProperty']] = None, + ) -> None: + """ + Initialize a ContractServer object. + + :param str server: Name of the server. + :param ContractAsset asset: (optional) Defines a data asset name and id. + :param str connection_id: (optional) ID of the data source associated with + data asset. + :param str type: (optional) Type of the server. + :param str description: (optional) Description of the server. + :param str environment: (optional) Environment in which the server + operates. + :param str account: (optional) Account used by the server. + :param str catalog: (optional) Catalog name. + :param str database: (optional) Database name. + :param str dataset: (optional) Dataset name. + :param str delimiter: (optional) Delimiter. + :param str endpoint_url: (optional) Server endpoint URL. + :param str format: (optional) File format. + :param str host: (optional) Host name or IP address. + :param str location: (optional) Location URL. + :param str path: (optional) Relative or absolute path to the data. + :param str port: (optional) Port to the server. + :param str project: (optional) Project name. + :param str region: (optional) Cloud region. + :param str region_name: (optional) Region name. + :param str schema: (optional) Schema name. + :param str service_name: (optional) Service name. + :param str staging_dir: (optional) Staging directory. + :param str stream: (optional) Data stream name. + :param str warehouse: (optional) Warehouse or cluster name. + :param List[str] roles: (optional) List of roles for the server. + :param List[ContractTemplateCustomProperty] custom_properties: (optional) + List of custom properties for the server. """ + self.server = server + self.asset = asset + self.connection_id = connection_id self.type = type - self.length = length - self.scale = scale - self.nullable = nullable - self.signed = signed - self.native_type = native_type + self.description = description + self.environment = environment + self.account = account + self.catalog = catalog + self.database = database + self.dataset = dataset + self.delimiter = delimiter + self.endpoint_url = endpoint_url + self.format = format + self.host = host + self.location = location + self.path = path + self.port = port + self.project = project + self.region = region + self.region_name = region_name + self.schema = schema + self.service_name = service_name + self.staging_dir = staging_dir + self.stream = stream + self.warehouse = warehouse + self.roles = roles + self.custom_properties = custom_properties @classmethod - def from_dict(cls, _dict: Dict) -> 'ContractSchemaPropertyType': - """Initialize a ContractSchemaPropertyType object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ContractServer': + """Initialize a ContractServer object from a json dictionary.""" args = {} + if (server := _dict.get('server')) is not None: + args['server'] = server + else: + raise ValueError('Required property \'server\' not present in ContractServer JSON') + if (asset := _dict.get('asset')) is not None: + args['asset'] = ContractAsset.from_dict(asset) + if (connection_id := _dict.get('connection_id')) is not None: + args['connection_id'] = connection_id if (type := _dict.get('type')) is not None: args['type'] = type - if (length := _dict.get('length')) is not None: - args['length'] = length - if (scale := _dict.get('scale')) is not None: - args['scale'] = scale - if (nullable := _dict.get('nullable')) is not None: - args['nullable'] = nullable - if (signed := _dict.get('signed')) is not None: - args['signed'] = signed - if (native_type := _dict.get('native_type')) is not None: - args['native_type'] = native_type + if (description := _dict.get('description')) is not None: + args['description'] = description + if (environment := _dict.get('environment')) is not None: + args['environment'] = environment + if (account := _dict.get('account')) is not None: + args['account'] = account + if (catalog := _dict.get('catalog')) is not None: + args['catalog'] = catalog + if (database := _dict.get('database')) is not None: + args['database'] = database + if (dataset := _dict.get('dataset')) is not None: + args['dataset'] = dataset + if (delimiter := _dict.get('delimiter')) is not None: + args['delimiter'] = delimiter + if (endpoint_url := _dict.get('endpoint_url')) is not None: + args['endpoint_url'] = endpoint_url + if (format := _dict.get('format')) is not None: + args['format'] = format + if (host := _dict.get('host')) is not None: + args['host'] = host + if (location := _dict.get('location')) is not None: + args['location'] = location + if (path := _dict.get('path')) is not None: + args['path'] = path + if (port := _dict.get('port')) is not None: + args['port'] = port + if (project := _dict.get('project')) is not None: + args['project'] = project + if (region := _dict.get('region')) is not None: + args['region'] = region + if (region_name := _dict.get('region_name')) is not None: + args['region_name'] = region_name + if (schema := _dict.get('schema')) is not None: + args['schema'] = schema + if (service_name := _dict.get('service_name')) is not None: + args['service_name'] = service_name + if (staging_dir := _dict.get('staging_dir')) is not None: + args['staging_dir'] = staging_dir + if (stream := _dict.get('stream')) is not None: + args['stream'] = stream + if (warehouse := _dict.get('warehouse')) is not None: + args['warehouse'] = warehouse + if (roles := _dict.get('roles')) is not None: + args['roles'] = roles + if (custom_properties := _dict.get('custom_properties')) is not None: + args['custom_properties'] = [ContractTemplateCustomProperty.from_dict(v) for v in custom_properties] return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ContractSchemaPropertyType object from a json dictionary.""" + """Initialize a ContractServer object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'server') and self.server is not None: + _dict['server'] = self.server + if hasattr(self, 'asset') and self.asset is not None: + if isinstance(self.asset, dict): + _dict['asset'] = self.asset + else: + _dict['asset'] = self.asset.to_dict() + if hasattr(self, 'connection_id') and self.connection_id is not None: + _dict['connection_id'] = self.connection_id if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type - if hasattr(self, 'length') and self.length is not None: - _dict['length'] = self.length - if hasattr(self, 'scale') and self.scale is not None: - _dict['scale'] = self.scale - if hasattr(self, 'nullable') and self.nullable is not None: - _dict['nullable'] = self.nullable - if hasattr(self, 'signed') and self.signed is not None: - _dict['signed'] = self.signed - if hasattr(self, 'native_type') and self.native_type is not None: - _dict['native_type'] = self.native_type + if hasattr(self, 'description') and self.description is not None: + _dict['description'] = self.description + if hasattr(self, 'environment') and self.environment is not None: + _dict['environment'] = self.environment + if hasattr(self, 'account') and self.account is not None: + _dict['account'] = self.account + if hasattr(self, 'catalog') and self.catalog is not None: + _dict['catalog'] = self.catalog + if hasattr(self, 'database') and self.database is not None: + _dict['database'] = self.database + if hasattr(self, 'dataset') and self.dataset is not None: + _dict['dataset'] = self.dataset + if hasattr(self, 'delimiter') and self.delimiter is not None: + _dict['delimiter'] = self.delimiter + if hasattr(self, 'endpoint_url') and self.endpoint_url is not None: + _dict['endpoint_url'] = self.endpoint_url + if hasattr(self, 'format') and self.format is not None: + _dict['format'] = self.format + if hasattr(self, 'host') and self.host is not None: + _dict['host'] = self.host + if hasattr(self, 'location') and self.location is not None: + _dict['location'] = self.location + if hasattr(self, 'path') and self.path is not None: + _dict['path'] = self.path + if hasattr(self, 'port') and self.port is not None: + _dict['port'] = self.port + if hasattr(self, 'project') and self.project is not None: + _dict['project'] = self.project + if hasattr(self, 'region') and self.region is not None: + _dict['region'] = self.region + if hasattr(self, 'region_name') and self.region_name is not None: + _dict['region_name'] = self.region_name + if hasattr(self, 'schema') and self.schema is not None: + _dict['schema'] = self.schema + if hasattr(self, 'service_name') and self.service_name is not None: + _dict['service_name'] = self.service_name + if hasattr(self, 'staging_dir') and self.staging_dir is not None: + _dict['staging_dir'] = self.staging_dir + if hasattr(self, 'stream') and self.stream is not None: + _dict['stream'] = self.stream + if hasattr(self, 'warehouse') and self.warehouse is not None: + _dict['warehouse'] = self.warehouse + if hasattr(self, 'roles') and self.roles is not None: + _dict['roles'] = self.roles + if hasattr(self, 'custom_properties') and self.custom_properties is not None: + custom_properties_list = [] + for v in self.custom_properties: + if isinstance(v, dict): + custom_properties_list.append(v) + else: + custom_properties_list.append(v.to_dict()) + _dict['custom_properties'] = custom_properties_list return _dict def _to_dict(self): @@ -3636,16 +4676,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ContractSchemaPropertyType object.""" + """Return a `str` version of this ContractServer object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ContractSchemaPropertyType') -> bool: + def __eq__(self, other: 'ContractServer') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ContractSchemaPropertyType') -> bool: + def __ne__(self, other: 'ContractServer') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -4028,6 +5068,7 @@ class ContractTerms: properties that are not part of the standard contract. :param ContractTest contract_test: (optional) Contains the contract test status and related metadata. + :param List[ContractServer] servers: (optional) List of server definitions. :param List[ContractSchema] schema: (optional) Schema details of the data asset. """ @@ -4047,6 +5088,7 @@ def __init__( support_and_communication: Optional[List['ContractTemplateSupportAndCommunication']] = None, custom_properties: Optional[List['ContractTemplateCustomProperty']] = None, contract_test: Optional['ContractTest'] = None, + servers: Optional[List['ContractServer']] = None, schema: Optional[List['ContractSchema']] = None, ) -> None: """ @@ -4077,6 +5119,7 @@ def __init__( Custom properties that are not part of the standard contract. :param ContractTest contract_test: (optional) Contains the contract test status and related metadata. + :param List[ContractServer] servers: (optional) List of server definitions. :param List[ContractSchema] schema: (optional) Schema details of the data asset. """ @@ -4093,6 +5136,7 @@ def __init__( self.support_and_communication = support_and_communication self.custom_properties = custom_properties self.contract_test = contract_test + self.servers = servers self.schema = schema @classmethod @@ -4125,6 +5169,8 @@ def from_dict(cls, _dict: Dict) -> 'ContractTerms': args['custom_properties'] = [ContractTemplateCustomProperty.from_dict(v) for v in custom_properties] if (contract_test := _dict.get('contract_test')) is not None: args['contract_test'] = ContractTest.from_dict(contract_test) + if (servers := _dict.get('servers')) is not None: + args['servers'] = [ContractServer.from_dict(v) for v in servers] if (schema := _dict.get('schema')) is not None: args['schema'] = [ContractSchema.from_dict(v) for v in schema] return cls(**args) @@ -4214,6 +5260,14 @@ def to_dict(self) -> Dict: _dict['contract_test'] = self.contract_test else: _dict['contract_test'] = self.contract_test.to_dict() + if hasattr(self, 'servers') and self.servers is not None: + servers_list = [] + for v in self.servers: + if isinstance(v, dict): + servers_list.append(v) + else: + servers_list.append(v.to_dict()) + _dict['servers'] = servers_list if hasattr(self, 'schema') and self.schema is not None: schema_list = [] for v in self.schema: @@ -4993,6 +6047,10 @@ class DataProductContractTemplate: :param ContainerReference container: Container reference. :param str id: (optional) The identifier of the data product contract template. + :param str creator_id: (optional) The identifier of the user who created the + data product contract template. + :param str created_at: (optional) The timestamp when the data product contract + template was created. :param str name: (optional) The name of the contract template. :param ErrorMessage error: (optional) Contains the code and details. :param ContractTerms contract_terms: (optional) Defines the complete structure @@ -5004,6 +6062,8 @@ def __init__( container: 'ContainerReference', *, id: Optional[str] = None, + creator_id: Optional[str] = None, + created_at: Optional[str] = None, name: Optional[str] = None, error: Optional['ErrorMessage'] = None, contract_terms: Optional['ContractTerms'] = None, @@ -5014,6 +6074,10 @@ def __init__( :param ContainerReference container: Container reference. :param str id: (optional) The identifier of the data product contract template. + :param str creator_id: (optional) The identifier of the user who created + the data product contract template. + :param str created_at: (optional) The timestamp when the data product + contract template was created. :param str name: (optional) The name of the contract template. :param ErrorMessage error: (optional) Contains the code and details. :param ContractTerms contract_terms: (optional) Defines the complete @@ -5021,6 +6085,8 @@ def __init__( """ self.container = container self.id = id + self.creator_id = creator_id + self.created_at = created_at self.name = name self.error = error self.contract_terms = contract_terms @@ -5035,6 +6101,10 @@ def from_dict(cls, _dict: Dict) -> 'DataProductContractTemplate': raise ValueError('Required property \'container\' not present in DataProductContractTemplate JSON') if (id := _dict.get('id')) is not None: args['id'] = id + if (creator_id := _dict.get('creator_id')) is not None: + args['creator_id'] = creator_id + if (created_at := _dict.get('created_at')) is not None: + args['created_at'] = created_at if (name := _dict.get('name')) is not None: args['name'] = name if (error := _dict.get('error')) is not None: @@ -5058,6 +6128,10 @@ def to_dict(self) -> Dict: _dict['container'] = self.container.to_dict() if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id + if hasattr(self, 'creator_id') and self.creator_id is not None: + _dict['creator_id'] = self.creator_id + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = self.created_at if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'error') and self.error is not None: @@ -5228,12 +6302,16 @@ class DataProductDomain: :param str name: (optional) The name of the data product domain. :param str description: (optional) The description of the data product domain. :param str id: (optional) The identifier of the data product domain. + :param str created_by: (optional) The identifier of the creator of the data + product domain. :param MemberRolesSchema member_roles: (optional) Member roles of a corresponding asset. :param PropertiesSchema properties: (optional) Properties of the corresponding asset. :param List[InitializeSubDomain] sub_domains: (optional) List of sub domains to be added within a domain. + :param ContainerIdentity sub_container: (optional) The identity schema for a IBM + knowledge catalog container (catalog/project/space). """ def __init__( @@ -5245,9 +6323,11 @@ def __init__( name: Optional[str] = None, description: Optional[str] = None, id: Optional[str] = None, + created_by: Optional[str] = None, member_roles: Optional['MemberRolesSchema'] = None, properties: Optional['PropertiesSchema'] = None, sub_domains: Optional[List['InitializeSubDomain']] = None, + sub_container: Optional['ContainerIdentity'] = None, ) -> None: """ Initialize a DataProductDomain object. @@ -5260,12 +6340,16 @@ def __init__( :param str description: (optional) The description of the data product domain. :param str id: (optional) The identifier of the data product domain. + :param str created_by: (optional) The identifier of the creator of the data + product domain. :param MemberRolesSchema member_roles: (optional) Member roles of a corresponding asset. :param PropertiesSchema properties: (optional) Properties of the corresponding asset. :param List[InitializeSubDomain] sub_domains: (optional) List of sub domains to be added within a domain. + :param ContainerIdentity sub_container: (optional) The identity schema for + a IBM knowledge catalog container (catalog/project/space). """ self.container = container self.trace = trace @@ -5273,9 +6357,11 @@ def __init__( self.name = name self.description = description self.id = id + self.created_by = created_by self.member_roles = member_roles self.properties = properties self.sub_domains = sub_domains + self.sub_container = sub_container @classmethod def from_dict(cls, _dict: Dict) -> 'DataProductDomain': @@ -5295,12 +6381,16 @@ def from_dict(cls, _dict: Dict) -> 'DataProductDomain': args['description'] = description if (id := _dict.get('id')) is not None: args['id'] = id + if (created_by := _dict.get('created_by')) is not None: + args['created_by'] = created_by if (member_roles := _dict.get('member_roles')) is not None: args['member_roles'] = MemberRolesSchema.from_dict(member_roles) if (properties := _dict.get('properties')) is not None: args['properties'] = PropertiesSchema.from_dict(properties) if (sub_domains := _dict.get('sub_domains')) is not None: args['sub_domains'] = [InitializeSubDomain.from_dict(v) for v in sub_domains] + if (sub_container := _dict.get('sub_container')) is not None: + args['sub_container'] = ContainerIdentity.from_dict(sub_container) return cls(**args) @classmethod @@ -5332,6 +6422,8 @@ def to_dict(self) -> Dict: _dict['description'] = self.description if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id + if hasattr(self, 'created_by') and self.created_by is not None: + _dict['created_by'] = self.created_by if hasattr(self, 'member_roles') and self.member_roles is not None: if isinstance(self.member_roles, dict): _dict['member_roles'] = self.member_roles @@ -5350,6 +6442,11 @@ def to_dict(self) -> Dict: else: sub_domains_list.append(v.to_dict()) _dict['sub_domains'] = sub_domains_list + if hasattr(self, 'sub_container') and self.sub_container is not None: + if isinstance(self.sub_container, dict): + _dict['sub_container'] = self.sub_container + else: + _dict['sub_container'] = self.sub_container.to_dict() return _dict def _to_dict(self): @@ -5470,6 +6567,8 @@ class DataProductDraft: at the time of data product version creation or retiring. :param AssetListAccessControl access_control: (optional) Access control object. :param datetime last_updated_at: (optional) Timestamp of last asset update. + :param ContainerIdentity sub_container: (optional) The identity schema for a IBM + knowledge catalog container (catalog/project/space). :param bool is_restricted: Indicates whether the data product is restricted or not. A restricted data product indicates that orders of the data product requires explicit approval before data is delivered. @@ -5510,6 +6609,7 @@ def __init__( comments: Optional[str] = None, access_control: Optional['AssetListAccessControl'] = None, last_updated_at: Optional[datetime] = None, + sub_container: Optional['ContainerIdentity'] = None, published_by: Optional[str] = None, published_at: Optional[datetime] = None, properties: Optional[dict] = None, @@ -5558,6 +6658,8 @@ def __init__( :param AssetListAccessControl access_control: (optional) Access control object. :param datetime last_updated_at: (optional) Timestamp of last asset update. + :param ContainerIdentity sub_container: (optional) The identity schema for + a IBM knowledge catalog container (catalog/project/space). :param str published_by: (optional) The user who published this data product version. :param datetime published_at: (optional) The time when this data product @@ -5582,6 +6684,7 @@ def __init__( self.comments = comments self.access_control = access_control self.last_updated_at = last_updated_at + self.sub_container = sub_container self.is_restricted = is_restricted self.id = id self.asset = asset @@ -5648,6 +6751,8 @@ def from_dict(cls, _dict: Dict) -> 'DataProductDraft': args['access_control'] = AssetListAccessControl.from_dict(access_control) if (last_updated_at := _dict.get('last_updated_at')) is not None: args['last_updated_at'] = string_to_datetime(last_updated_at) + if (sub_container := _dict.get('sub_container')) is not None: + args['sub_container'] = ContainerIdentity.from_dict(sub_container) if (is_restricted := _dict.get('is_restricted')) is not None: args['is_restricted'] = is_restricted else: @@ -5748,6 +6853,11 @@ def to_dict(self) -> Dict: _dict['access_control'] = self.access_control.to_dict() if hasattr(self, 'last_updated_at') and self.last_updated_at is not None: _dict['last_updated_at'] = datetime_to_string(self.last_updated_at) + if hasattr(self, 'sub_container') and self.sub_container is not None: + if isinstance(self.sub_container, dict): + _dict['sub_container'] = self.sub_container + else: + _dict['sub_container'] = self.sub_container.to_dict() if hasattr(self, 'is_restricted') and self.is_restricted is not None: _dict['is_restricted'] = self.is_restricted if hasattr(self, 'id') and self.id is not None: @@ -6052,6 +7162,8 @@ class DataProductDraftPrototype: at the time of data product version creation or retiring. :param AssetListAccessControl access_control: (optional) Access control object. :param datetime last_updated_at: (optional) Timestamp of last asset update. + :param ContainerIdentity sub_container: (optional) The identity schema for a IBM + knowledge catalog container (catalog/project/space). :param bool is_restricted: (optional) Indicates whether the data product is restricted or not. A restricted data product indicates that orders of the data product requires explicit approval before data is delivered. @@ -6078,6 +7190,7 @@ def __init__( comments: Optional[str] = None, access_control: Optional['AssetListAccessControl'] = None, last_updated_at: Optional[datetime] = None, + sub_container: Optional['ContainerIdentity'] = None, is_restricted: Optional[bool] = None, ) -> None: """ @@ -6123,6 +7236,8 @@ def __init__( :param AssetListAccessControl access_control: (optional) Access control object. :param datetime last_updated_at: (optional) Timestamp of last asset update. + :param ContainerIdentity sub_container: (optional) The identity schema for + a IBM knowledge catalog container (catalog/project/space). :param bool is_restricted: (optional) Indicates whether the data product is restricted or not. A restricted data product indicates that orders of the data product requires explicit approval before data is delivered. @@ -6143,6 +7258,7 @@ def __init__( self.comments = comments self.access_control = access_control self.last_updated_at = last_updated_at + self.sub_container = sub_container self.is_restricted = is_restricted self.asset = asset @@ -6182,6 +7298,8 @@ def from_dict(cls, _dict: Dict) -> 'DataProductDraftPrototype': args['access_control'] = AssetListAccessControl.from_dict(access_control) if (last_updated_at := _dict.get('last_updated_at')) is not None: args['last_updated_at'] = string_to_datetime(last_updated_at) + if (sub_container := _dict.get('sub_container')) is not None: + args['sub_container'] = ContainerIdentity.from_dict(sub_container) if (is_restricted := _dict.get('is_restricted')) is not None: args['is_restricted'] = is_restricted if (asset := _dict.get('asset')) is not None: @@ -6260,6 +7378,11 @@ def to_dict(self) -> Dict: _dict['access_control'] = self.access_control.to_dict() if hasattr(self, 'last_updated_at') and self.last_updated_at is not None: _dict['last_updated_at'] = datetime_to_string(self.last_updated_at) + if hasattr(self, 'sub_container') and self.sub_container is not None: + if isinstance(self.sub_container, dict): + _dict['sub_container'] = self.sub_container + else: + _dict['sub_container'] = self.sub_container.to_dict() if hasattr(self, 'is_restricted') and self.is_restricted is not None: _dict['is_restricted'] = self.is_restricted if hasattr(self, 'asset') and self.asset is not None: @@ -6342,6 +7465,8 @@ class DataProductDraftSummary: at the time of data product version creation or retiring. :param AssetListAccessControl access_control: (optional) Access control object. :param datetime last_updated_at: (optional) Timestamp of last asset update. + :param ContainerIdentity sub_container: (optional) The identity schema for a IBM + knowledge catalog container (catalog/project/space). :param bool is_restricted: Indicates whether the data product is restricted or not. A restricted data product indicates that orders of the data product requires explicit approval before data is delivered. @@ -6371,6 +7496,7 @@ def __init__( comments: Optional[str] = None, access_control: Optional['AssetListAccessControl'] = None, last_updated_at: Optional[datetime] = None, + sub_container: Optional['ContainerIdentity'] = None, ) -> None: """ Initialize a DataProductDraftSummary object. @@ -6413,6 +7539,8 @@ def __init__( :param AssetListAccessControl access_control: (optional) Access control object. :param datetime last_updated_at: (optional) Timestamp of last asset update. + :param ContainerIdentity sub_container: (optional) The identity schema for + a IBM knowledge catalog container (catalog/project/space). """ self.version = version self.state = state @@ -6430,6 +7558,7 @@ def __init__( self.comments = comments self.access_control = access_control self.last_updated_at = last_updated_at + self.sub_container = sub_container self.is_restricted = is_restricted self.id = id self.asset = asset @@ -6490,6 +7619,8 @@ def from_dict(cls, _dict: Dict) -> 'DataProductDraftSummary': args['access_control'] = AssetListAccessControl.from_dict(access_control) if (last_updated_at := _dict.get('last_updated_at')) is not None: args['last_updated_at'] = string_to_datetime(last_updated_at) + if (sub_container := _dict.get('sub_container')) is not None: + args['sub_container'] = ContainerIdentity.from_dict(sub_container) if (is_restricted := _dict.get('is_restricted')) is not None: args['is_restricted'] = is_restricted else: @@ -6574,6 +7705,11 @@ def to_dict(self) -> Dict: _dict['access_control'] = self.access_control.to_dict() if hasattr(self, 'last_updated_at') and self.last_updated_at is not None: _dict['last_updated_at'] = datetime_to_string(self.last_updated_at) + if hasattr(self, 'sub_container') and self.sub_container is not None: + if isinstance(self.sub_container, dict): + _dict['sub_container'] = self.sub_container + else: + _dict['sub_container'] = self.sub_container.to_dict() if hasattr(self, 'is_restricted') and self.is_restricted is not None: _dict['is_restricted'] = self.is_restricted if hasattr(self, 'id') and self.id is not None: @@ -7039,6 +8175,8 @@ class DataProductRelease: at the time of data product version creation or retiring. :param AssetListAccessControl access_control: (optional) Access control object. :param datetime last_updated_at: (optional) Timestamp of last asset update. + :param ContainerIdentity sub_container: (optional) The identity schema for a IBM + knowledge catalog container (catalog/project/space). :param bool is_restricted: Indicates whether the data product is restricted or not. A restricted data product indicates that orders of the data product requires explicit approval before data is delivered. @@ -7079,6 +8217,7 @@ def __init__( comments: Optional[str] = None, access_control: Optional['AssetListAccessControl'] = None, last_updated_at: Optional[datetime] = None, + sub_container: Optional['ContainerIdentity'] = None, published_by: Optional[str] = None, published_at: Optional[datetime] = None, properties: Optional[dict] = None, @@ -7127,6 +8266,8 @@ def __init__( :param AssetListAccessControl access_control: (optional) Access control object. :param datetime last_updated_at: (optional) Timestamp of last asset update. + :param ContainerIdentity sub_container: (optional) The identity schema for + a IBM knowledge catalog container (catalog/project/space). :param str published_by: (optional) The user who published this data product version. :param datetime published_at: (optional) The time when this data product @@ -7151,6 +8292,7 @@ def __init__( self.comments = comments self.access_control = access_control self.last_updated_at = last_updated_at + self.sub_container = sub_container self.is_restricted = is_restricted self.id = id self.asset = asset @@ -7217,6 +8359,8 @@ def from_dict(cls, _dict: Dict) -> 'DataProductRelease': args['access_control'] = AssetListAccessControl.from_dict(access_control) if (last_updated_at := _dict.get('last_updated_at')) is not None: args['last_updated_at'] = string_to_datetime(last_updated_at) + if (sub_container := _dict.get('sub_container')) is not None: + args['sub_container'] = ContainerIdentity.from_dict(sub_container) if (is_restricted := _dict.get('is_restricted')) is not None: args['is_restricted'] = is_restricted else: @@ -7317,6 +8461,11 @@ def to_dict(self) -> Dict: _dict['access_control'] = self.access_control.to_dict() if hasattr(self, 'last_updated_at') and self.last_updated_at is not None: _dict['last_updated_at'] = datetime_to_string(self.last_updated_at) + if hasattr(self, 'sub_container') and self.sub_container is not None: + if isinstance(self.sub_container, dict): + _dict['sub_container'] = self.sub_container + else: + _dict['sub_container'] = self.sub_container.to_dict() if hasattr(self, 'is_restricted') and self.is_restricted is not None: _dict['is_restricted'] = self.is_restricted if hasattr(self, 'id') and self.id is not None: @@ -7617,6 +8766,8 @@ class DataProductReleaseSummary: at the time of data product version creation or retiring. :param AssetListAccessControl access_control: (optional) Access control object. :param datetime last_updated_at: (optional) Timestamp of last asset update. + :param ContainerIdentity sub_container: (optional) The identity schema for a IBM + knowledge catalog container (catalog/project/space). :param bool is_restricted: Indicates whether the data product is restricted or not. A restricted data product indicates that orders of the data product requires explicit approval before data is delivered. @@ -7646,6 +8797,7 @@ def __init__( comments: Optional[str] = None, access_control: Optional['AssetListAccessControl'] = None, last_updated_at: Optional[datetime] = None, + sub_container: Optional['ContainerIdentity'] = None, ) -> None: """ Initialize a DataProductReleaseSummary object. @@ -7689,6 +8841,8 @@ def __init__( :param AssetListAccessControl access_control: (optional) Access control object. :param datetime last_updated_at: (optional) Timestamp of last asset update. + :param ContainerIdentity sub_container: (optional) The identity schema for + a IBM knowledge catalog container (catalog/project/space). """ self.version = version self.state = state @@ -7706,6 +8860,7 @@ def __init__( self.comments = comments self.access_control = access_control self.last_updated_at = last_updated_at + self.sub_container = sub_container self.is_restricted = is_restricted self.id = id self.asset = asset @@ -7760,6 +8915,8 @@ def from_dict(cls, _dict: Dict) -> 'DataProductReleaseSummary': args['access_control'] = AssetListAccessControl.from_dict(access_control) if (last_updated_at := _dict.get('last_updated_at')) is not None: args['last_updated_at'] = string_to_datetime(last_updated_at) + if (sub_container := _dict.get('sub_container')) is not None: + args['sub_container'] = ContainerIdentity.from_dict(sub_container) if (is_restricted := _dict.get('is_restricted')) is not None: args['is_restricted'] = is_restricted else: @@ -7844,6 +9001,11 @@ def to_dict(self) -> Dict: _dict['access_control'] = self.access_control.to_dict() if hasattr(self, 'last_updated_at') and self.last_updated_at is not None: _dict['last_updated_at'] = datetime_to_string(self.last_updated_at) + if hasattr(self, 'sub_container') and self.sub_container is not None: + if isinstance(self.sub_container, dict): + _dict['sub_container'] = self.sub_container + else: + _dict['sub_container'] = self.sub_container.to_dict() if hasattr(self, 'is_restricted') and self.is_restricted is not None: _dict['is_restricted'] = self.is_restricted if hasattr(self, 'id') and self.id is not None: @@ -8220,6 +9382,8 @@ class DataProductVersionSummary: at the time of data product version creation or retiring. :param AssetListAccessControl access_control: (optional) Access control object. :param datetime last_updated_at: (optional) Timestamp of last asset update. + :param ContainerIdentity sub_container: (optional) The identity schema for a IBM + knowledge catalog container (catalog/project/space). :param bool is_restricted: Indicates whether the data product is restricted or not. A restricted data product indicates that orders of the data product requires explicit approval before data is delivered. @@ -8249,6 +9413,7 @@ def __init__( comments: Optional[str] = None, access_control: Optional['AssetListAccessControl'] = None, last_updated_at: Optional[datetime] = None, + sub_container: Optional['ContainerIdentity'] = None, ) -> None: """ Initialize a DataProductVersionSummary object. @@ -8292,6 +9457,8 @@ def __init__( :param AssetListAccessControl access_control: (optional) Access control object. :param datetime last_updated_at: (optional) Timestamp of last asset update. + :param ContainerIdentity sub_container: (optional) The identity schema for + a IBM knowledge catalog container (catalog/project/space). """ self.version = version self.state = state @@ -8309,6 +9476,7 @@ def __init__( self.comments = comments self.access_control = access_control self.last_updated_at = last_updated_at + self.sub_container = sub_container self.is_restricted = is_restricted self.id = id self.asset = asset @@ -8363,6 +9531,8 @@ def from_dict(cls, _dict: Dict) -> 'DataProductVersionSummary': args['access_control'] = AssetListAccessControl.from_dict(access_control) if (last_updated_at := _dict.get('last_updated_at')) is not None: args['last_updated_at'] = string_to_datetime(last_updated_at) + if (sub_container := _dict.get('sub_container')) is not None: + args['sub_container'] = ContainerIdentity.from_dict(sub_container) if (is_restricted := _dict.get('is_restricted')) is not None: args['is_restricted'] = is_restricted else: @@ -8447,6 +9617,11 @@ def to_dict(self) -> Dict: _dict['access_control'] = self.access_control.to_dict() if hasattr(self, 'last_updated_at') and self.last_updated_at is not None: _dict['last_updated_at'] = datetime_to_string(self.last_updated_at) + if hasattr(self, 'sub_container') and self.sub_container is not None: + if isinstance(self.sub_container, dict): + _dict['sub_container'] = self.sub_container + else: + _dict['sub_container'] = self.sub_container.to_dict() if hasattr(self, 'is_restricted') and self.is_restricted is not None: _dict['is_restricted'] = self.is_restricted if hasattr(self, 'id') and self.id is not None: @@ -8990,12 +10165,14 @@ class EngineDetailsModel: product producer. :param str engine_host: (optional) The host of the engine defined by the data product producer. + :param str engine_type: The type of the engine (eg: Presto/Spark). :param List[str] associated_catalogs: (optional) The list of associated catalogs. """ def __init__( self, + engine_type: str, *, display_name: Optional[str] = None, engine_id: Optional[str] = None, @@ -9006,6 +10183,7 @@ def __init__( """ Initialize a EngineDetailsModel object. + :param str engine_type: The type of the engine (eg: Presto/Spark). :param str display_name: (optional) The name of the engine defined by the data product producer. :param str engine_id: (optional) The id of the engine defined by the data @@ -9021,6 +10199,7 @@ def __init__( self.engine_id = engine_id self.engine_port = engine_port self.engine_host = engine_host + self.engine_type = engine_type self.associated_catalogs = associated_catalogs @classmethod @@ -9035,6 +10214,10 @@ def from_dict(cls, _dict: Dict) -> 'EngineDetailsModel': args['engine_port'] = engine_port if (engine_host := _dict.get('engine_host')) is not None: args['engine_host'] = engine_host + if (engine_type := _dict.get('engine_type')) is not None: + args['engine_type'] = engine_type + else: + raise ValueError('Required property \'engine_type\' not present in EngineDetailsModel JSON') if (associated_catalogs := _dict.get('associated_catalogs')) is not None: args['associated_catalogs'] = associated_catalogs return cls(**args) @@ -9055,6 +10238,8 @@ def to_dict(self) -> Dict: _dict['engine_port'] = self.engine_port if hasattr(self, 'engine_host') and self.engine_host is not None: _dict['engine_host'] = self.engine_host + if hasattr(self, 'engine_type') and self.engine_type is not None: + _dict['engine_type'] = self.engine_type if hasattr(self, 'associated_catalogs') and self.associated_catalogs is not None: _dict['associated_catalogs'] = self.associated_catalogs return _dict @@ -9077,6 +10262,15 @@ def __ne__(self, other: 'EngineDetailsModel') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class EngineTypeEnum(str, Enum): + """ + The type of the engine (eg: Presto/Spark). + """ + + SPARK = 'spark' + PRESTO = 'presto' + + class ErrorExtraResource: """ @@ -10180,20 +11374,26 @@ class ProducerInputModel: :param EngineDetailsModel engine_details: (optional) Engine details as defined by the data product producer. + :param List[EngineDetailsModel] engines: (optional) List of engines defined by + the data product producer. """ def __init__( self, *, engine_details: Optional['EngineDetailsModel'] = None, + engines: Optional[List['EngineDetailsModel']] = None, ) -> None: """ Initialize a ProducerInputModel object. :param EngineDetailsModel engine_details: (optional) Engine details as defined by the data product producer. + :param List[EngineDetailsModel] engines: (optional) List of engines defined + by the data product producer. """ self.engine_details = engine_details + self.engines = engines @classmethod def from_dict(cls, _dict: Dict) -> 'ProducerInputModel': @@ -10201,6 +11401,8 @@ def from_dict(cls, _dict: Dict) -> 'ProducerInputModel': args = {} if (engine_details := _dict.get('engine_details')) is not None: args['engine_details'] = EngineDetailsModel.from_dict(engine_details) + if (engines := _dict.get('engines')) is not None: + args['engines'] = [EngineDetailsModel.from_dict(v) for v in engines] return cls(**args) @classmethod @@ -10216,6 +11418,14 @@ def to_dict(self) -> Dict: _dict['engine_details'] = self.engine_details else: _dict['engine_details'] = self.engine_details.to_dict() + if hasattr(self, 'engines') and self.engines is not None: + engines_list = [] + for v in self.engines: + if isinstance(v, dict): + engines_list.append(v) + else: + engines_list.append(v.to_dict()) + _dict['engines'] = engines_list return _dict def _to_dict(self): @@ -10434,6 +11644,149 @@ def __ne__(self, other: 'ProvidedWorkflowResource') -> bool: return not self == other +class RevokeAccessResponse: + """ + This class holds the response message from the revoke access operation. + + :param str message: (optional) Response message of revoke access. + """ + + def __init__( + self, + *, + message: Optional[str] = None, + ) -> None: + """ + Initialize a RevokeAccessResponse object. + + :param str message: (optional) Response message of revoke access. + """ + self.message = message + + @classmethod + def from_dict(cls, _dict: Dict) -> 'RevokeAccessResponse': + """Initialize a RevokeAccessResponse object from a json dictionary.""" + args = {} + if (message := _dict.get('message')) is not None: + args['message'] = message + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a RevokeAccessResponse object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'message') and self.message is not None: + _dict['message'] = self.message + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this RevokeAccessResponse object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'RevokeAccessResponse') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'RevokeAccessResponse') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class RevokeAccessStateResponse: + """ + Revoke access states with pagination support. + + :param List[Asset] results: (optional) Holds revoke access state. + :param int total_count: (optional) Total number of rows available. + :param SearchAssetPaginationInfo next: (optional) Pagination information for the + next page of results. + """ + + def __init__( + self, + *, + results: Optional[List['Asset']] = None, + total_count: Optional[int] = None, + next: Optional['SearchAssetPaginationInfo'] = None, + ) -> None: + """ + Initialize a RevokeAccessStateResponse object. + + :param List[Asset] results: (optional) Holds revoke access state. + :param int total_count: (optional) Total number of rows available. + :param SearchAssetPaginationInfo next: (optional) Pagination information + for the next page of results. + """ + self.results = results + self.total_count = total_count + self.next = next + + @classmethod + def from_dict(cls, _dict: Dict) -> 'RevokeAccessStateResponse': + """Initialize a RevokeAccessStateResponse object from a json dictionary.""" + args = {} + if (results := _dict.get('results')) is not None: + args['results'] = [Asset.from_dict(v) for v in results] + if (total_count := _dict.get('total_count')) is not None: + args['total_count'] = total_count + if (next := _dict.get('next')) is not None: + args['next'] = SearchAssetPaginationInfo.from_dict(next) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a RevokeAccessStateResponse object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'results') and self.results is not None: + results_list = [] + for v in self.results: + if isinstance(v, dict): + results_list.append(v) + else: + results_list.append(v.to_dict()) + _dict['results'] = results_list + if hasattr(self, 'total_count') and self.total_count is not None: + _dict['total_count'] = self.total_count + if hasattr(self, 'next') and self.next is not None: + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this RevokeAccessStateResponse object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'RevokeAccessStateResponse') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'RevokeAccessStateResponse') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class Roles: """ Represents a role associated with the contract. @@ -10492,6 +11845,96 @@ def __ne__(self, other: 'Roles') -> bool: return not self == other +class SearchAssetPaginationInfo: + """ + Pagination information for the next page of results. + + :param str query: (optional) Search query for filtering results. + :param int limit: (optional) Number of items per page. + :param str bookmark: (optional) Bookmark for pagination. + :param str include: (optional) What to include in the results. + :param int skip: (optional) Number of items to skip. + """ + + def __init__( + self, + *, + query: Optional[str] = None, + limit: Optional[int] = None, + bookmark: Optional[str] = None, + include: Optional[str] = None, + skip: Optional[int] = None, + ) -> None: + """ + Initialize a SearchAssetPaginationInfo object. + + :param str query: (optional) Search query for filtering results. + :param int limit: (optional) Number of items per page. + :param str bookmark: (optional) Bookmark for pagination. + :param str include: (optional) What to include in the results. + :param int skip: (optional) Number of items to skip. + """ + self.query = query + self.limit = limit + self.bookmark = bookmark + self.include = include + self.skip = skip + + @classmethod + def from_dict(cls, _dict: Dict) -> 'SearchAssetPaginationInfo': + """Initialize a SearchAssetPaginationInfo object from a json dictionary.""" + args = {} + if (query := _dict.get('query')) is not None: + args['query'] = query + if (limit := _dict.get('limit')) is not None: + args['limit'] = limit + if (bookmark := _dict.get('bookmark')) is not None: + args['bookmark'] = bookmark + if (include := _dict.get('include')) is not None: + args['include'] = include + if (skip := _dict.get('skip')) is not None: + args['skip'] = skip + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a SearchAssetPaginationInfo object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'query') and self.query is not None: + _dict['query'] = self.query + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'bookmark') and self.bookmark is not None: + _dict['bookmark'] = self.bookmark + if hasattr(self, 'include') and self.include is not None: + _dict['include'] = self.include + if hasattr(self, 'skip') and self.skip is not None: + _dict['skip'] = self.skip + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this SearchAssetPaginationInfo object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'SearchAssetPaginationInfo') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'SearchAssetPaginationInfo') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class ServiceIdCredentials: """ Service id credentials. diff --git a/examples/test_dph_v1_examples.py b/examples/test_dph_v1_examples.py index a7444f5..84f475b 100644 --- a/examples/test_dph_v1_examples.py +++ b/examples/test_dph_v1_examples.py @@ -19,6 +19,7 @@ from ibm_cloud_sdk_core import ApiException, read_external_sources from ibm_cloud_sdk_core.utils import datetime_to_string, string_to_datetime +import io import os import pytest from dph_services.dph_v1 import * @@ -718,10 +719,9 @@ def test_get_data_product_draft_contract_terms_example(self): draft_id='testString', contract_terms_id='testString', ) - result = response.get_result() + contract_terms = response.get_result() - with open('/tmp/result.out', 'wb') as fp: - fp.write(result) + print(json.dumps(contract_terms, indent=2)) # end-get_data_product_draft_contract_terms @@ -751,6 +751,8 @@ def test_replace_data_product_draft_contract_terms_example(self): } overview_model = { + 'api_version': 'v3.0.1', + 'kind': 'DataContract', 'name': 'Sample Data Contract', 'version': 'v0.0', 'domain': domain_model, @@ -779,6 +781,12 @@ def test_replace_data_product_draft_contract_terms_example(self): 'role': 'IAM Role', } + pricing_model = { + 'amount': 'Amount', + 'currency': 'Currency', + 'unit': 'Unit', + } + contract_template_sla_property_model = { 'property': 'slaproperty', 'value': 'slavalue', @@ -799,6 +807,62 @@ def test_replace_data_product_draft_contract_terms_example(self): 'value': 'The value of the key.', } + contract_asset_model = { + 'id': '684d6aa0-9f93-4564-8a20-e354bc469857', + 'name': 'PAYMENT_TRANSACTIONS1', + } + + contract_server_model = { + 'server': 'snowflake-server-01', + 'asset': contract_asset_model, + 'connection_id': '8d7701be-709a-49c0-ae4e-a7daeaae6def', + 'type': 'snowflake', + 'description': 'Snowflake analytics server', + 'environment': 'dev', + 'account': 'acc-456', + 'catalog': 'analytics_cat', + 'database': 'analytics_db', + 'dataset': 'customer_data', + 'delimiter': ',', + 'endpoint_url': 'https://xy12345.snowflakecomputing.com', + 'format': 'parquet', + 'host': 'xy12345.snowflakecomputing.com', + 'location': 'Mumbai', + 'path': '/analytics/data', + 'port': '443', + 'project': 'projectY', + 'region': 'ap-south-1', + 'region_name': 'Asia South 1', + 'schema': 'PAYMENT_TRANSACTIONS1', + 'service_name': 'snowflake', + 'staging_dir': '/snowflake/staging', + 'stream': 'stream_analytics', + 'warehouse': 'wh_xlarge', + 'custom_properties': [contract_template_custom_property_model], + } + + contract_schema_property_type_model = { + 'type': 'varchar', + 'length': '1024', + 'scale': '0', + 'nullable': 'true', + 'signed': 'false', + } + + contract_schema_property_model = { + 'name': 'product_brand_code', + 'type': contract_schema_property_type_model, + } + + contract_schema_model = { + 'asset_id': '09ca6b40-7c89-412a-8951-ad820da709d1', + 'connection_id': '6cc57d4d-2229-438f-91a0-2c455556422b', + 'name': '000000_0-2025-06-20-20-28-52.csv', + 'connection_path': '/dpx-test-bucket/000000_0-2025-06-20-20-28-52.csv', + 'physical_type': 'text/csv', + 'properties': [contract_schema_property_model], + } + response = dph_service.replace_data_product_draft_contract_terms( data_product_id='testString', draft_id='testString', @@ -808,9 +872,12 @@ def test_replace_data_product_draft_contract_terms_example(self): description=description_model, organization=[contract_template_organization_model], roles=[roles_model], + price=pricing_model, sla=[contract_template_sla_model], support_and_communication=[contract_template_support_and_communication_model], custom_properties=[contract_template_custom_property_model], + servers=[contract_server_model], + schema=[contract_schema_model], ) contract_terms = response.get_result() @@ -851,6 +918,33 @@ def test_update_data_product_draft_contract_terms_example(self): except ApiException as e: pytest.fail(str(e)) + @needscredentials + def test_get_contract_terms_in_specified_format_example(self): + """ + get_contract_terms_in_specified_format request example + """ + try: + print('\nget_contract_terms_in_specified_format() result:') + + # begin-get_contract_terms_in_specified_format + + response = dph_service.get_contract_terms_in_specified_format( + data_product_id='testString', + draft_id='testString', + contract_terms_id='testString', + format='testString', + format_version='testString', + ) + result = response.get_result() + + with open('/tmp/result.out', 'wb') as fp: + fp.write(result) + + # end-get_contract_terms_in_specified_format + + except ApiException as e: + pytest.fail(str(e)) + @needscredentials def test_get_data_product_release_example(self): """ @@ -928,6 +1022,31 @@ def test_get_release_contract_terms_document_example(self): except ApiException as e: pytest.fail(str(e)) + @needscredentials + def test_get_published_data_product_draft_contract_terms_example(self): + """ + get_published_data_product_draft_contract_terms request example + """ + try: + print('\nget_published_data_product_draft_contract_terms() result:') + + # begin-get_published_data_product_draft_contract_terms + + response = dph_service.get_published_data_product_draft_contract_terms( + data_product_id='testString', + release_id='testString', + contract_terms_id='testString', + ) + result = response.get_result() + + with open('/tmp/result.out', 'wb') as fp: + fp.write(result) + + # end-get_published_data_product_draft_contract_terms + + except ApiException as e: + pytest.fail(str(e)) + @needscredentials def test_list_data_product_releases_example(self): """ @@ -981,6 +1100,30 @@ def test_retire_data_product_release_example(self): except ApiException as e: pytest.fail(str(e)) + @needscredentials + def test_create_revoke_access_process_example(self): + """ + create_revoke_access_process request example + """ + try: + print('\ncreate_revoke_access_process() result:') + + # begin-create_revoke_access_process + + response = dph_service.create_revoke_access_process( + data_product_id='testString', + release_id='testString', + body=io.BytesIO(b'This is a mock file.').getvalue(), + ) + revoke_access_response = response.get_result() + + print(json.dumps(revoke_access_response, indent=2)) + + # end-create_revoke_access_process + + except ApiException as e: + pytest.fail(str(e)) + @needscredentials def test_list_data_product_contract_template_example(self): """ @@ -1012,13 +1155,13 @@ def test_create_contract_template_example(self): # begin-create_contract_template container_reference_model = { - 'id': 'f531f74a-01c8-4e91-8e29-b018db683c86', + 'id': '531f74a-01c8-4e91-8e29-b018db683c86', 'type': 'catalog', } domain_model = { - 'id': 'b38df608-d34b-4d58-8136-ed25e6c6684e', - 'name': 'domain_name', + 'id': '0094ebe9-abc3-473b-80ea-c777ede095ea', + 'name': 'Test Domain New', } overview_model = { @@ -1351,6 +1494,28 @@ def test_get_s3_bucket_validation_example(self): except ApiException as e: pytest.fail(str(e)) + @needscredentials + def test_get_revoke_access_process_state_example(self): + """ + get_revoke_access_process_state request example + """ + try: + print('\nget_revoke_access_process_state() result:') + + # begin-get_revoke_access_process_state + + response = dph_service.get_revoke_access_process_state( + release_id='testString', + ) + revoke_access_state_response = response.get_result() + + print(json.dumps(revoke_access_state_response, indent=2)) + + # end-get_revoke_access_process_state + + except ApiException as e: + pytest.fail(str(e)) + @needscredentials def test_delete_draft_contract_terms_document_example(self): """ diff --git a/test/integration/test_dph_v1.py b/test/integration/test_dph_v1.py index 025b4d7..bf4b963 100644 --- a/test/integration/test_dph_v1.py +++ b/test/integration/test_dph_v1.py @@ -18,6 +18,7 @@ """ from ibm_cloud_sdk_core import * +import io import os import pytest from dph_services.dph_v1 import * @@ -107,7 +108,7 @@ def test_initialize(self): # Construct a dict representation of a ContainerReference model container_reference_model = { - 'id': 'a7ca67e8-1fac-4061-ae9b-7604e15c4ab3', + 'id': 'ef065526-1aba-4a8d-b998-e47cd34f98fd', 'type': 'catalog', } @@ -181,31 +182,183 @@ def test_create_data_product(self): 'id': create_data_product_by_catalog_id_link, 'type': 'catalog', } - # Construct a dict representation of a ContainerIdentity model container_identity_model = { 'id': create_data_product_by_catalog_id_link, } - # Construct a dict representation of a AssetPrototype model - asset_prototype_model = { - 'id': '2b0bf220-079c-11ee-be56-0242ac120002', - 'container': container_identity_model, + # Construct a dict representation of a AssetReference model + asset_reference_model = { + 'id': 'caeee3f3-756e-47d5-846d-da4600809e22', + 'name': 'testString', + 'container': container_reference_model, } # Construct a dict representation of a Domain model domain_model = { - 'id': 'ccacbfb4-7180-4632-b1ed-6709c7001f1e', - 'name': 'Customer Management', + 'id': '35b3ca59-98ee-4eb0-adb2-a1858ea5f5d7', + 'name': 'Accounting and Finance', 'container': container_reference_model, } + # Construct a dict representation of a Overview model + overview_model = { + 'api_version': 'v3.0.1', + 'kind': 'DataContract', + 'name': 'Sample Data Contract', + 'version': '0.0.0', + 'domain': domain_model, + 'more_info': 'List of links to sources that provide more details on the data contract.', + } + # Construct a dict representation of a ContractTermsMoreInfo model + contract_terms_more_info_model = { + 'type': 'privacy-statement', + 'url': 'https://moreinfo.example.com', + } + # Construct a dict representation of a Description model + description_model = { + 'purpose': 'Used for customer behavior analysis.', + 'limitations': 'Data cannot be used for marketing.', + 'usage': 'Data should be used only for analytics.', + 'more_info': [contract_terms_more_info_model], + 'custom_properties': '{"property1":"value1"}', + } + # Construct a dict representation of a ContractTemplateOrganization model + contract_template_organization_model = { + 'user_id': 'IBMid-691000IN4G', + 'role': 'owner', + } + # Construct a dict representation of a Roles model + roles_model = { + 'role': 'owner', + } + # Construct a dict representation of a Pricing model + pricing_model = { + 'amount': '100.0', + 'currency': 'USD', + 'unit': 'megabyte', + } + # Construct a dict representation of a ContractTemplateSLAProperty model + contract_template_sla_property_model = { + 'property': 'Uptime Guarantee', + 'value': '99.9', + } + # Construct a dict representation of a ContractTemplateSLA model + contract_template_sla_model = { + 'default_element': 'Standard SLA Policy', + 'properties': [contract_template_sla_property_model], + } + # Construct a dict representation of a ContractTemplateSupportAndCommunication model + contract_template_support_and_communication_model = { + 'channel': 'Email Support', + 'url': 'https://support.example.com', + } + # Construct a dict representation of a ContractTemplateCustomProperty model + contract_template_custom_property_model = { + 'key': 'customPropertyKey', + 'value': 'customPropertyValue', + } + # Construct a dict representation of a ContractAsset model + contract_asset_model = { + 'id': 'testString', + 'name': 'testString', + } + # Construct a dict representation of a ContractServer model + contract_server_model = { + 'server': 'testString', + 'asset': contract_asset_model, + 'connection_id': 'testString', + 'type': 'testString', + 'description': 'testString', + 'environment': 'testString', + 'account': 'testString', + 'catalog': 'testString', + 'database': 'testString', + 'dataset': 'testString', + 'delimiter': 'testString', + 'endpoint_url': 'testString', + 'format': 'testString', + 'host': 'testString', + 'location': 'testString', + 'path': 'testString', + 'port': 'testString', + 'project': 'testString', + 'region': 'testString', + 'region_name': 'testString', + 'schema': 'testString', + 'service_name': 'testString', + 'staging_dir': 'testString', + 'stream': 'testString', + 'warehouse': 'testString', + 'roles': ['testString'], + 'custom_properties': [contract_template_custom_property_model], + } + # Construct a dict representation of a ContractSchemaPropertyType model + contract_schema_property_type_model = { + 'type': 'testString', + 'length': 'testString', + 'scale': 'testString', + 'nullable': 'testString', + 'signed': 'testString', + 'native_type': 'testString', + } + # Construct a dict representation of a ContractQualityRule model + contract_quality_rule_model = { + 'type': 'sql', + 'description': 'testString', + 'rule': 'testString', + 'implementation': 'testString', + 'engine': 'testString', + 'must_be_less_than': 'testString', + 'must_be_less_or_equal_to': 'testString', + 'must_be_greater_than': 'testString', + 'must_be_greater_or_equal_to': 'testString', + 'must_be_between': ['testString'], + 'must_not_be_between': ['testString'], + 'must_be': 'testString', + 'must_not_be': 'testString', + 'name': 'testString', + 'unit': 'testString', + 'query': 'testString', + } + # Construct a dict representation of a ContractSchemaProperty model + contract_schema_property_model = { + 'name': 'testString', + 'type': contract_schema_property_type_model, + 'quality': [contract_quality_rule_model], + } + # Construct a dict representation of a ContractSchema model + contract_schema_model = { + 'asset_id': '2b0bf220-079c-11ee-be56-0242ac120002', + 'connection_id': '2b0bf220-079c-11ee-be56-0242ac120002', + 'name': 'testString', + 'description': 'testString', + 'connection_path': 'testString', + 'physical_type': 'testString', + 'properties': [contract_schema_property_model], + 'quality': [contract_quality_rule_model], + } + # Construct a dict representation of a ContractTerms model + contract_terms_model = { + 'asset': asset_reference_model, + 'overview': overview_model, + 'description': description_model, + 'organization': [contract_template_organization_model], + 'roles': [roles_model], + 'price': pricing_model, + 'sla': [contract_template_sla_model], + 'support_and_communication': [contract_template_support_and_communication_model], + 'custom_properties': [contract_template_custom_property_model], + 'servers': [contract_server_model], + 'schema': [contract_schema_model], + } # Construct a dict representation of a AssetPartReference model asset_part_reference_model = { - 'id': '16a8f683-f947-48d9-a92c-b81758b1a5f5', + 'id': '5fc42c45-303b-4da1-9355-46c32e84c7c1', + 'name': 'testString', 'container': container_reference_model, 'type': 'data_asset', } # Construct a dict representation of a DeliveryMethod model delivery_method_model = { - 'id': '8848fd43-7384-4435-aff3-6a9f113768c4', + 'id': '1fdcb2d8-fe28-4467-b9cd-9655af8a8f0c', 'container': container_reference_model, } # Construct a dict representation of a DataProductPart model @@ -213,28 +366,41 @@ def test_create_data_product(self): 'asset': asset_part_reference_model, 'delivery_methods': [delivery_method_model], } - - # Construct a dict representation of a DataProductVersionPrototype model - data_product_version_prototype_model = { + # Construct a dict representation of a AssetListAccessControl model + asset_list_access_control_model = { + 'owner': 'IBMid-696000KYV9', + } + # Construct a dict representation of a AssetPrototype model + asset_prototype_model = { + 'id': '2b0bf220-079c-11ee-be56-0242ac120002', + 'container': container_identity_model, + } + # Construct a dict representation of a DataProductDraftPrototype model + data_product_draft_prototype_model = { 'version': '1.0.0', 'state': 'draft', - 'name': 'My New Data Product using Python SDK', - 'description': 'My Data Product generation using Python SDK.', + 'name': 'My New Data Product - Python SDK', + 'description': 'This is a description of My Data Product.', 'types': ['data'], - 'asset': asset_prototype_model, + 'contract_terms': [contract_terms_model], 'domain': domain_model, 'parts_out': [data_product_part_model], + 'dataview_enabled': False, + 'comments': 'Comments by a producer that are provided either at the time of data product version creation or retiring', + 'access_control': asset_list_access_control_model, + 'sub_container': container_identity_model, + 'is_restricted': False, + 'asset': asset_prototype_model, } response = self.dph_service.create_data_product( - drafts=[data_product_version_prototype_model], + drafts=[data_product_draft_prototype_model], ) assert response.get_status_code() == 201 data_product = response.get_result() assert data_product is not None - print(data_product) create_new_draft_by_data_product_id_link = data_product['id'] get_contract_document_by_data_product_id_link = data_product['id'] retire_a_releases_of_data_product_by_data_product_id_link = data_product['id'] @@ -309,7 +475,7 @@ def test_list_data_products_with_pager(self): @needscredentials def test_get_data_product_draft(self): response = self.dph_service.get_data_product_draft( - data_product_id='-', + data_product_id=get_a_draft_of_data_product_by_data_product_id_link, draft_id=get_draft_by_draft_id_link, ) @@ -324,12 +490,12 @@ def test_update_data_product_draft(self): json_patch_operation_model = { 'op': 'replace', 'path': '/description', - 'value': 'Updated the description by Node SDK.', + 'value': 'Updated the description by Python SDK.', } response = self.dph_service.update_data_product_draft( data_product_id='-', - draft_id=create_a_contract_terms_doc_by_draft_id_link, + draft_id=get_draft_by_draft_id_link, json_patch_instructions=[json_patch_operation_model], ) @@ -408,84 +574,16 @@ def test_get_data_product_draft_contract_terms(self): data_product_id=get_contract_document_by_data_product_id_link, draft_id=create_a_contract_terms_doc_by_draft_id_link, contract_terms_id=create_a_contract_terms_doc_by_contract_terms_id_link, + accept='application/json', include_contract_documents=True, ) assert response.get_status_code() == 200 - result = response.get_result() - assert result is not None + contract_terms = response.get_result() + assert contract_terms is not None @pytest.mark.dependency(depends=["test_get_data_product_draft_contract_terms"]) @needscredentials - def test_publish_data_product_draft(self): - global update_a_release_by_release_id_link - global get_a_release_contract_terms_by_release_id_link - global retire_a_release_contract_terms_by_release_id_link - global get_a_release_by_release_id_link - - response = self.dph_service.publish_data_product_draft( - data_product_id=publish_a_draft_of_data_product_by_data_product_id_link, - draft_id=get_draft_by_draft_id_link, - ) - - assert response.get_status_code() == 200 - data_product_release = response.get_result() - assert data_product_release is not None - - update_a_release_by_release_id_link = data_product_release['id'] - get_a_release_contract_terms_by_release_id_link = data_product_release['id'] - retire_a_release_contract_terms_by_release_id_link = data_product_release['id'] - get_a_release_by_release_id_link = data_product_release['id'] - - @pytest.mark.dependency(depends=["test_publish_data_product_draft"]) - @needscredentials - def test_get_data_product_release(self): - response = self.dph_service.get_data_product_release( - data_product_id=get_a_release_of_data_product_by_data_product_id_link, - release_id=get_a_release_by_release_id_link, - check_caller_approval=False, - ) - - assert response.get_status_code() == 200 - data_product_release = response.get_result() - assert data_product_release is not None - - @pytest.mark.dependency(depends=["test_get_data_product_release"]) - @needscredentials - def test_update_data_product_release(self): - # Construct a dict representation of a JsonPatchOperation model - json_patch_operation_model = { - 'op': 'replace', - 'path': '/description', - 'value': 'New description for my data product', - } - - response = self.dph_service.update_data_product_release( - data_product_id=update_release_of_data_product_by_data_product_id_link, - release_id=get_a_release_by_release_id_link, - json_patch_instructions=[json_patch_operation_model], - ) - - assert response.get_status_code() == 200 - data_product_release = response.get_result() - assert data_product_release is not None - - @pytest.mark.dependency(depends=["test_update_data_product_release"]) - @needscredentials - def test_get_release_contract_terms_document(self): - response = self.dph_service.get_release_contract_terms_document( - data_product_id=get_release_contract_document_by_data_product_id_link, - release_id=get_a_release_contract_terms_by_release_id_link, - contract_terms_id=get_a_release_contract_terms_by_contract_terms_id_link, - document_id=get_release_contract_document_by_document_id_link, - ) - - assert response.get_status_code() == 200 - contract_terms_document = response.get_result() - assert contract_terms_document is not None - - @pytest.mark.dependency(depends=["test_get_release_contract_terms_document"]) - @needscredentials def test_replace_data_product_draft_contract_terms(self): # Construct a dict representation of a ContractTermsDocumentAttachment model @@ -502,8 +600,8 @@ def test_replace_data_product_draft_contract_terms(self): } # Construct a dict representation of a Domain model domain_model = { - 'id': 'b38df608-d34b-4d58-8136-ed25e6c6684e', - 'name': 'domain_name', + 'id': '35b3ca59-98ee-4eb0-adb2-a1858ea5f5d7', + 'name': 'Accounting and Finance', } # Construct a dict representation of a Overview model overview_model = { @@ -562,19 +660,12 @@ def test_replace_data_product_draft_contract_terms(self): 'key': 'The name of the key.', 'value': 'The value of the key.', } - # Construct a dict representation of a ContractTest model - contract_test_model = { - 'status': 'pass', - 'last_tested_time': 'testString', - 'message': 'testString', - } response = self.dph_service.replace_data_product_draft_contract_terms( data_product_id=get_contract_document_by_data_product_id_link, draft_id=create_a_contract_terms_doc_by_draft_id_link, contract_terms_id=create_a_contract_terms_doc_by_contract_terms_id_link, documents=[contract_terms_document_model], - error_msg='testString', overview=overview_model, description=description_model, organization=[contract_template_organization_model], @@ -583,7 +674,6 @@ def test_replace_data_product_draft_contract_terms(self): sla=[contract_template_sla_model], support_and_communication=[contract_template_support_and_communication_model], custom_properties=[contract_template_custom_property_model], - contract_test=contract_test_model, ) assert response.get_status_code() == 200 @@ -593,17 +683,15 @@ def test_replace_data_product_draft_contract_terms(self): @pytest.mark.dependency(depends=["test_replace_data_product_draft_contract_terms"]) @needscredentials def test_update_data_product_draft_contract_terms(self): - + # Construct a dict representation of a Domain model domain_model = { - 'id': 'b38df608-d34b-4d58-8136-ed25e6c6684e', - 'name': 'domain_name', + 'id': '35b3ca59-98ee-4eb0-adb2-a1858ea5f5d7', + 'name': 'Accounting and Finance', } - + # Construct a dict representation of a Overview model overview_model = { - 'api_version': 'v3.0.1', - 'kind': 'DataContract', 'name': 'Sample Data Contract', 'version': 'v0.0', 'domain': domain_model, @@ -627,7 +715,107 @@ def test_update_data_product_draft_contract_terms(self): contract_terms = response.get_result() assert contract_terms is not None - @pytest.mark.dependency(depends=["test_update_data_product_draft_contract_terms"]) + @pytest.mark.dependency(depends=["test_get_data_product_draft_contract_terms"]) + @needscredentials + def test_get_contract_terms_in_specified_format(self): + response = self.dph_service.get_contract_terms_in_specified_format( + data_product_id=get_contract_document_by_data_product_id_link, + draft_id=create_a_contract_terms_doc_by_draft_id_link, + contract_terms_id=create_a_contract_terms_doc_by_contract_terms_id_link, + format='odcs', + format_version='3', + accept='application/odcs+yaml', + ) + + assert response.get_status_code() == 200 + result = response.get_result() + assert result is not None + + @pytest.mark.dependency(depends=["test_get_contract_terms_in_specified_format"]) + @needscredentials + def test_publish_data_product_draft(self): + global update_a_release_by_release_id_link + global get_a_release_contract_terms_by_release_id_link + global retire_a_release_contract_terms_by_release_id_link + global get_a_release_by_release_id_link + + response = self.dph_service.publish_data_product_draft( + data_product_id=publish_a_draft_of_data_product_by_data_product_id_link, + draft_id=get_draft_by_draft_id_link, + ) + + assert response.get_status_code() == 200 + data_product_release = response.get_result() + assert data_product_release is not None + + update_a_release_by_release_id_link = data_product_release['id'] + get_a_release_contract_terms_by_release_id_link = data_product_release['id'] + retire_a_release_contract_terms_by_release_id_link = data_product_release['id'] + get_a_release_by_release_id_link = data_product_release['id'] + + @pytest.mark.dependency(depends=["test_publish_data_product_draft"]) + @needscredentials + def test_get_published_data_product_draft_contract_terms(self): + response = self.dph_service.get_published_data_product_draft_contract_terms( + data_product_id=get_release_contract_document_by_data_product_id_link, + release_id=get_a_release_contract_terms_by_release_id_link, + contract_terms_id=get_a_release_contract_terms_by_contract_terms_id_link, + accept='application/odcs+yaml', + include_contract_documents=True, + ) + + assert response.get_status_code() == 200 + result = response.get_result() + assert result is not None + + @pytest.mark.dependency(depends=["test_get_published_data_product_draft_contract_terms"]) + @needscredentials + def test_get_data_product_release(self): + response = self.dph_service.get_data_product_release( + data_product_id=get_a_release_of_data_product_by_data_product_id_link, + release_id=get_a_release_by_release_id_link, + check_caller_approval=False, + ) + + assert response.get_status_code() == 200 + data_product_release = response.get_result() + assert data_product_release is not None + + @pytest.mark.dependency(depends=["test_get_data_product_release"]) + @needscredentials + def test_update_data_product_release(self): + # Construct a dict representation of a JsonPatchOperation model + json_patch_operation_model = { + 'op': 'replace', + 'path': '/description', + 'value': 'New description for my data product', + } + + response = self.dph_service.update_data_product_release( + data_product_id=update_release_of_data_product_by_data_product_id_link, + release_id=get_a_release_by_release_id_link, + json_patch_instructions=[json_patch_operation_model], + ) + + assert response.get_status_code() == 200 + data_product_release = response.get_result() + assert data_product_release is not None + + @pytest.mark.dependency(depends=["test_update_data_product_release"]) + @needscredentials + def test_get_release_contract_terms_document(self): + response = self.dph_service.get_release_contract_terms_document( + data_product_id=get_release_contract_document_by_data_product_id_link, + release_id=get_a_release_contract_terms_by_release_id_link, + contract_terms_id=get_a_release_contract_terms_by_contract_terms_id_link, + document_id=get_release_contract_document_by_document_id_link, + ) + + assert response.get_status_code() == 200 + contract_terms_document = response.get_result() + assert contract_terms_document is not None + + @pytest.mark.dependency(depends=["test_get_release_contract_terms_document"]) @needscredentials def test_list_data_product_releases(self): response = self.dph_service.list_data_product_releases( @@ -775,34 +963,10 @@ def test_create_contract_template(self): 'id': get_status_by_catalog_id_link, 'type': 'catalog', } - # Construct a dict representation of a ErrorMessage model - error_message_model = { - 'code': 'testString', - 'message': 'testString', - } - # Construct a dict representation of a AssetReference model - asset_reference_model = { - 'id': '2b0bf220-079c-11ee-be56-0242ac120002', - 'name': 'testString', - 'container': container_reference_model, - } - # Construct a dict representation of a ContractTermsDocumentAttachment model - contract_terms_document_attachment_model = { - 'id': 'testString', - } - # Construct a dict representation of a ContractTermsDocument model - contract_terms_document_model = { - 'url': 'testString', - 'type': 'terms_and_conditions', - 'name': 'testString', - 'id': '2b0bf220-079c-11ee-be56-0242ac120002', - 'attachment': contract_terms_document_attachment_model, - 'upload_url': 'testString', - } # Construct a dict representation of a Domain model domain_model = { - 'id': 'b38df608-d34b-4d58-8136-ed25e6c6684e', - 'name': 'domain_name', + 'id': '35b3ca59-98ee-4eb0-adb2-a1858ea5f5d7', + 'name': 'Accounting and Finance', 'container': container_reference_model, } # Construct a dict representation of a Overview model @@ -914,7 +1078,7 @@ def test_create_contract_template(self): assert response.get_status_code() == 201 data_product_contract_template = response.get_result() create_contract_template_id = data_product_contract_template['id'] - + assert data_product_contract_template is not None @pytest.mark.dependency(depends=["test_create_contract_template"]) @@ -973,19 +1137,13 @@ def test_delete_data_product_contract_template(self): @pytest.mark.dependency(depends=["test_delete_data_product_contract_template"]) @needscredentials - def test_create_data_product_draft(self): + def test_create_data_product_draft_for_delete_op(self): global delete_a_contract_document_by_draft_id_link global delete_a_draft_by_contract_terms_id_link global create_a_contract_terms_doc_by_contract_terms_id_link global delete_a_draft_by_draft_id_link global create_a_contract_terms_doc_by_draft_id_link - # Construct a dict representation of a ContainerReference model - container_reference_model = { - 'id': create_data_product_by_catalog_id_link, - 'type': 'catalog', - } - # Construct a dict representation of a ContainerIdentity model container_identity_model = { 'id': create_data_product_by_catalog_id_link, @@ -995,28 +1153,6 @@ def test_create_data_product_draft(self): 'id': '2b0bf220-079c-11ee-be56-0242ac120002', 'container': container_identity_model, } - # Construct a dict representation of a Domain model - domain_model = { - 'id': 'ccacbfb4-7180-4632-b1ed-6709c7001f1e', - 'name': 'Customer Management', - 'container': container_reference_model, - } - # Construct a dict representation of a AssetPartReference model - asset_part_reference_model = { - 'id': '16a8f683-f947-48d9-a92c-b81758b1a5f5', - 'container': container_reference_model, - 'type': 'data_asset', - } - # Construct a dict representation of a DeliveryMethod model - delivery_method_model = { - 'id': '8848fd43-7384-4435-aff3-6a9f113768c4', - 'container': container_reference_model, - } - # Construct a dict representation of a DataProductPart model - data_product_part_model = { - 'asset': asset_part_reference_model, - 'delivery_methods': [delivery_method_model], - } # Construct a dict representation of a DataProductVersionPrototype model data_product_version_prototype_model = { @@ -1026,8 +1162,6 @@ def test_create_data_product_draft(self): 'description': 'This is a description of My Data Product which will get deleted using Python SDK.', 'types': ['data'], 'asset': asset_prototype_model, - 'domain': domain_model, - 'parts_out': [data_product_part_model], } response = self.dph_service.create_data_product( @@ -1128,40 +1262,20 @@ def test_delete_draft_contract_terms_document(self): assert response.get_status_code() == 204 - @pytest.mark.dependency(depends=["test_delete_draft_contract_terms_document"]) - @needscredentials - def test_list_data_product_domains(self): - response = self.dph_service.list_data_product_domains( - container_id=get_status_by_catalog_id_link, - ) - - assert response.get_status_code() == 200 - data_product_domain_collection = response.get_result() - assert data_product_domain_collection is not None - @pytest.mark.dependency(depends=["test_list_data_product_domains"]) @needscredentials def test_create_data_product_domain(self): global create_data_product_domain_id # Construct a dict representation of a ContainerReference model container_reference_model = { - 'id': get_status_by_catalog_id_link, + 'id': create_data_product_by_catalog_id_link, 'type': 'catalog', } - # Construct a dict representation of a InitializeSubDomain model - initialize_sub_domain_model = { - 'name': 'Sub domain 1', - 'id': 'testString', - 'description': 'New sub domain 1', - } - response = self.dph_service.create_data_product_domain( container=container_reference_model, name='Test domain - python sdk', description='The sample description for new domain', - sub_domains=[initialize_sub_domain_model], - container_id=get_status_by_catalog_id_link, ) assert response.get_status_code() == 201 @@ -1235,6 +1349,17 @@ def test_delete_domain(self): assert response.get_status_code() == 204 + @pytest.mark.dependency(depends=["test_delete_draft_contract_terms_document"]) + @needscredentials + def test_list_data_product_domains(self): + response = self.dph_service.list_data_product_domains( + container_id=get_status_by_catalog_id_link, + ) + + assert response.get_status_code() == 200 + data_product_domain_collection = response.get_result() + assert data_product_domain_collection is not None + @pytest.mark.skip(reason="Skipping unneccesary creation of bucket") def test_create_s3_bucket(self): response = self.dph_service.create_s3_bucket( @@ -1255,6 +1380,31 @@ def test_get_s3_bucket_validation(self): bucket_validation_response = response.get_result() assert bucket_validation_response is not None + @pytest.mark.skip(reason="Skipping revoke access") + def test_create_revoke_access_process(self): + response = self.dph_service.create_revoke_access_process( + data_product_id='testString', + release_id='testString', + body=io.BytesIO(b'This is a mock file.').getvalue(), + content_type='testString', + ) + + assert response.get_status_code() == 202 + revoke_access_response = response.get_result() + assert revoke_access_response is not None + + @pytest.mark.skip(reason="Skipping revoke access") + def test_get_revoke_access_process_state(self): + response = self.dph_service.get_revoke_access_process_state( + release_id='testString', + limit=200, + start='testString', + ) + + assert response.get_status_code() == 200 + revoke_access_state_response = response.get_result() + assert revoke_access_state_response is not None + @pytest.mark.dependency(depends=["test_delete_domain"]) @needscredentials def test_delete_data_product_draft(self): @@ -1264,5 +1414,3 @@ def test_delete_data_product_draft(self): ) assert response.get_status_code() == 204 - - diff --git a/test/unit/test_dph_v1.py b/test/unit/test_dph_v1.py index 41fda8c..bce6417 100644 --- a/test/unit/test_dph_v1.py +++ b/test/unit/test_dph_v1.py @@ -21,12 +21,14 @@ from ibm_cloud_sdk_core.authenticators.no_auth_authenticator import NoAuthAuthenticator from ibm_cloud_sdk_core.utils import datetime_to_string, string_to_datetime import inspect +import io import json import os import pytest import re import requests import responses +import tempfile import urllib from dph_services.dph_v1 import * @@ -691,7 +693,7 @@ def test_create_data_product_all_params(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/data_products') - mock_response = '{"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "name": "name", "latest_release": {"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "associated_catalogs": ["associated_catalogs"]}}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}}, "drafts": [{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "associated_catalogs": ["associated_catalogs"]}}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}}]}' + mock_response = '{"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "name": "name", "latest_release": {"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}, "engines": [{"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}]}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "sub_container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd"}, "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}}, "drafts": [{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}, "engines": [{"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}]}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "sub_container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd"}, "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}}]}' responses.add( responses.POST, url, @@ -808,6 +810,41 @@ def test_create_data_product_all_params(self): contract_test_model['last_tested_time'] = 'testString' contract_test_model['message'] = 'testString' + # Construct a dict representation of a ContractAsset model + contract_asset_model = {} + contract_asset_model['id'] = 'testString' + contract_asset_model['name'] = 'testString' + + # Construct a dict representation of a ContractServer model + contract_server_model = {} + contract_server_model['server'] = 'testString' + contract_server_model['asset'] = contract_asset_model + contract_server_model['connection_id'] = 'testString' + contract_server_model['type'] = 'testString' + contract_server_model['description'] = 'testString' + contract_server_model['environment'] = 'testString' + contract_server_model['account'] = 'testString' + contract_server_model['catalog'] = 'testString' + contract_server_model['database'] = 'testString' + contract_server_model['dataset'] = 'testString' + contract_server_model['delimiter'] = 'testString' + contract_server_model['endpoint_url'] = 'testString' + contract_server_model['format'] = 'testString' + contract_server_model['host'] = 'testString' + contract_server_model['location'] = 'testString' + contract_server_model['path'] = 'testString' + contract_server_model['port'] = 'testString' + contract_server_model['project'] = 'testString' + contract_server_model['region'] = 'testString' + contract_server_model['region_name'] = 'testString' + contract_server_model['schema'] = 'testString' + contract_server_model['service_name'] = 'testString' + contract_server_model['staging_dir'] = 'testString' + contract_server_model['stream'] = 'testString' + contract_server_model['warehouse'] = 'testString' + contract_server_model['roles'] = ['testString'] + contract_server_model['custom_properties'] = [contract_template_custom_property_model] + # Construct a dict representation of a ContractSchemaPropertyType model contract_schema_property_type_model = {} contract_schema_property_type_model['type'] = 'testString' @@ -817,17 +854,41 @@ def test_create_data_product_all_params(self): contract_schema_property_type_model['signed'] = 'testString' contract_schema_property_type_model['native_type'] = 'testString' + # Construct a dict representation of a ContractQualityRule model + contract_quality_rule_model = {} + contract_quality_rule_model['type'] = 'sql' + contract_quality_rule_model['description'] = 'testString' + contract_quality_rule_model['rule'] = 'testString' + contract_quality_rule_model['implementation'] = 'testString' + contract_quality_rule_model['engine'] = 'testString' + contract_quality_rule_model['must_be_less_than'] = 'testString' + contract_quality_rule_model['must_be_less_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_greater_than'] = 'testString' + contract_quality_rule_model['must_be_greater_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_between'] = ['testString'] + contract_quality_rule_model['must_not_be_between'] = ['testString'] + contract_quality_rule_model['must_be'] = 'testString' + contract_quality_rule_model['must_not_be'] = 'testString' + contract_quality_rule_model['name'] = 'testString' + contract_quality_rule_model['unit'] = 'testString' + contract_quality_rule_model['query'] = 'testString' + # Construct a dict representation of a ContractSchemaProperty model contract_schema_property_model = {} contract_schema_property_model['name'] = 'testString' contract_schema_property_model['type'] = contract_schema_property_type_model + contract_schema_property_model['quality'] = [contract_quality_rule_model] # Construct a dict representation of a ContractSchema model contract_schema_model = {} + contract_schema_model['asset_id'] = '2b0bf220-079c-11ee-be56-0242ac120002' + contract_schema_model['connection_id'] = '2b0bf220-079c-11ee-be56-0242ac120002' contract_schema_model['name'] = 'testString' contract_schema_model['description'] = 'testString' + contract_schema_model['connection_path'] = 'testString' contract_schema_model['physical_type'] = 'testString' contract_schema_model['properties'] = [contract_schema_property_model] + contract_schema_model['quality'] = [contract_quality_rule_model] # Construct a dict representation of a ContractTerms model contract_terms_model = {} @@ -844,6 +905,7 @@ def test_create_data_product_all_params(self): contract_terms_model['support_and_communication'] = [contract_template_support_and_communication_model] contract_terms_model['custom_properties'] = [contract_template_custom_property_model] contract_terms_model['contract_test'] = contract_test_model + contract_terms_model['servers'] = [contract_server_model] contract_terms_model['schema'] = [contract_schema_model] # Construct a dict representation of a AssetPartReference model @@ -859,11 +921,13 @@ def test_create_data_product_all_params(self): engine_details_model_model['engine_id'] = 'presto767' engine_details_model_model['engine_port'] = '34567' engine_details_model_model['engine_host'] = 'a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud' + engine_details_model_model['engine_type'] = 'spark' engine_details_model_model['associated_catalogs'] = ['testString'] # Construct a dict representation of a ProducerInputModel model producer_input_model_model = {} producer_input_model_model['engine_details'] = engine_details_model_model + producer_input_model_model['engines'] = [engine_details_model_model] # Construct a dict representation of a DeliveryMethodPropertiesModel model delivery_method_properties_model_model = {} @@ -925,6 +989,7 @@ def test_create_data_product_all_params(self): data_product_draft_prototype_model['comments'] = 'Comments by a producer that are provided either at the time of data product version creation or retiring' data_product_draft_prototype_model['access_control'] = asset_list_access_control_model data_product_draft_prototype_model['last_updated_at'] = '2019-01-01T12:00:00Z' + data_product_draft_prototype_model['sub_container'] = container_identity_model data_product_draft_prototype_model['is_restricted'] = True data_product_draft_prototype_model['asset'] = asset_prototype_model @@ -969,7 +1034,7 @@ def test_create_data_product_required_params(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/data_products') - mock_response = '{"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "name": "name", "latest_release": {"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "associated_catalogs": ["associated_catalogs"]}}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}}, "drafts": [{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "associated_catalogs": ["associated_catalogs"]}}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}}]}' + mock_response = '{"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "name": "name", "latest_release": {"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}, "engines": [{"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}]}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "sub_container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd"}, "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}}, "drafts": [{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}, "engines": [{"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}]}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "sub_container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd"}, "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}}]}' responses.add( responses.POST, url, @@ -1086,6 +1151,41 @@ def test_create_data_product_required_params(self): contract_test_model['last_tested_time'] = 'testString' contract_test_model['message'] = 'testString' + # Construct a dict representation of a ContractAsset model + contract_asset_model = {} + contract_asset_model['id'] = 'testString' + contract_asset_model['name'] = 'testString' + + # Construct a dict representation of a ContractServer model + contract_server_model = {} + contract_server_model['server'] = 'testString' + contract_server_model['asset'] = contract_asset_model + contract_server_model['connection_id'] = 'testString' + contract_server_model['type'] = 'testString' + contract_server_model['description'] = 'testString' + contract_server_model['environment'] = 'testString' + contract_server_model['account'] = 'testString' + contract_server_model['catalog'] = 'testString' + contract_server_model['database'] = 'testString' + contract_server_model['dataset'] = 'testString' + contract_server_model['delimiter'] = 'testString' + contract_server_model['endpoint_url'] = 'testString' + contract_server_model['format'] = 'testString' + contract_server_model['host'] = 'testString' + contract_server_model['location'] = 'testString' + contract_server_model['path'] = 'testString' + contract_server_model['port'] = 'testString' + contract_server_model['project'] = 'testString' + contract_server_model['region'] = 'testString' + contract_server_model['region_name'] = 'testString' + contract_server_model['schema'] = 'testString' + contract_server_model['service_name'] = 'testString' + contract_server_model['staging_dir'] = 'testString' + contract_server_model['stream'] = 'testString' + contract_server_model['warehouse'] = 'testString' + contract_server_model['roles'] = ['testString'] + contract_server_model['custom_properties'] = [contract_template_custom_property_model] + # Construct a dict representation of a ContractSchemaPropertyType model contract_schema_property_type_model = {} contract_schema_property_type_model['type'] = 'testString' @@ -1095,17 +1195,41 @@ def test_create_data_product_required_params(self): contract_schema_property_type_model['signed'] = 'testString' contract_schema_property_type_model['native_type'] = 'testString' + # Construct a dict representation of a ContractQualityRule model + contract_quality_rule_model = {} + contract_quality_rule_model['type'] = 'sql' + contract_quality_rule_model['description'] = 'testString' + contract_quality_rule_model['rule'] = 'testString' + contract_quality_rule_model['implementation'] = 'testString' + contract_quality_rule_model['engine'] = 'testString' + contract_quality_rule_model['must_be_less_than'] = 'testString' + contract_quality_rule_model['must_be_less_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_greater_than'] = 'testString' + contract_quality_rule_model['must_be_greater_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_between'] = ['testString'] + contract_quality_rule_model['must_not_be_between'] = ['testString'] + contract_quality_rule_model['must_be'] = 'testString' + contract_quality_rule_model['must_not_be'] = 'testString' + contract_quality_rule_model['name'] = 'testString' + contract_quality_rule_model['unit'] = 'testString' + contract_quality_rule_model['query'] = 'testString' + # Construct a dict representation of a ContractSchemaProperty model contract_schema_property_model = {} contract_schema_property_model['name'] = 'testString' contract_schema_property_model['type'] = contract_schema_property_type_model + contract_schema_property_model['quality'] = [contract_quality_rule_model] # Construct a dict representation of a ContractSchema model contract_schema_model = {} + contract_schema_model['asset_id'] = '2b0bf220-079c-11ee-be56-0242ac120002' + contract_schema_model['connection_id'] = '2b0bf220-079c-11ee-be56-0242ac120002' contract_schema_model['name'] = 'testString' contract_schema_model['description'] = 'testString' + contract_schema_model['connection_path'] = 'testString' contract_schema_model['physical_type'] = 'testString' contract_schema_model['properties'] = [contract_schema_property_model] + contract_schema_model['quality'] = [contract_quality_rule_model] # Construct a dict representation of a ContractTerms model contract_terms_model = {} @@ -1122,6 +1246,7 @@ def test_create_data_product_required_params(self): contract_terms_model['support_and_communication'] = [contract_template_support_and_communication_model] contract_terms_model['custom_properties'] = [contract_template_custom_property_model] contract_terms_model['contract_test'] = contract_test_model + contract_terms_model['servers'] = [contract_server_model] contract_terms_model['schema'] = [contract_schema_model] # Construct a dict representation of a AssetPartReference model @@ -1137,11 +1262,13 @@ def test_create_data_product_required_params(self): engine_details_model_model['engine_id'] = 'presto767' engine_details_model_model['engine_port'] = '34567' engine_details_model_model['engine_host'] = 'a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud' + engine_details_model_model['engine_type'] = 'spark' engine_details_model_model['associated_catalogs'] = ['testString'] # Construct a dict representation of a ProducerInputModel model producer_input_model_model = {} producer_input_model_model['engine_details'] = engine_details_model_model + producer_input_model_model['engines'] = [engine_details_model_model] # Construct a dict representation of a DeliveryMethodPropertiesModel model delivery_method_properties_model_model = {} @@ -1203,6 +1330,7 @@ def test_create_data_product_required_params(self): data_product_draft_prototype_model['comments'] = 'Comments by a producer that are provided either at the time of data product version creation or retiring' data_product_draft_prototype_model['access_control'] = asset_list_access_control_model data_product_draft_prototype_model['last_updated_at'] = '2019-01-01T12:00:00Z' + data_product_draft_prototype_model['sub_container'] = container_identity_model data_product_draft_prototype_model['is_restricted'] = True data_product_draft_prototype_model['asset'] = asset_prototype_model @@ -1238,7 +1366,7 @@ def test_create_data_product_value_error(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/data_products') - mock_response = '{"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "name": "name", "latest_release": {"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "associated_catalogs": ["associated_catalogs"]}}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}}, "drafts": [{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "associated_catalogs": ["associated_catalogs"]}}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}}]}' + mock_response = '{"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "name": "name", "latest_release": {"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}, "engines": [{"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}]}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "sub_container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd"}, "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}}, "drafts": [{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}, "engines": [{"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}]}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "sub_container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd"}, "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}}]}' responses.add( responses.POST, url, @@ -1355,6 +1483,41 @@ def test_create_data_product_value_error(self): contract_test_model['last_tested_time'] = 'testString' contract_test_model['message'] = 'testString' + # Construct a dict representation of a ContractAsset model + contract_asset_model = {} + contract_asset_model['id'] = 'testString' + contract_asset_model['name'] = 'testString' + + # Construct a dict representation of a ContractServer model + contract_server_model = {} + contract_server_model['server'] = 'testString' + contract_server_model['asset'] = contract_asset_model + contract_server_model['connection_id'] = 'testString' + contract_server_model['type'] = 'testString' + contract_server_model['description'] = 'testString' + contract_server_model['environment'] = 'testString' + contract_server_model['account'] = 'testString' + contract_server_model['catalog'] = 'testString' + contract_server_model['database'] = 'testString' + contract_server_model['dataset'] = 'testString' + contract_server_model['delimiter'] = 'testString' + contract_server_model['endpoint_url'] = 'testString' + contract_server_model['format'] = 'testString' + contract_server_model['host'] = 'testString' + contract_server_model['location'] = 'testString' + contract_server_model['path'] = 'testString' + contract_server_model['port'] = 'testString' + contract_server_model['project'] = 'testString' + contract_server_model['region'] = 'testString' + contract_server_model['region_name'] = 'testString' + contract_server_model['schema'] = 'testString' + contract_server_model['service_name'] = 'testString' + contract_server_model['staging_dir'] = 'testString' + contract_server_model['stream'] = 'testString' + contract_server_model['warehouse'] = 'testString' + contract_server_model['roles'] = ['testString'] + contract_server_model['custom_properties'] = [contract_template_custom_property_model] + # Construct a dict representation of a ContractSchemaPropertyType model contract_schema_property_type_model = {} contract_schema_property_type_model['type'] = 'testString' @@ -1364,17 +1527,41 @@ def test_create_data_product_value_error(self): contract_schema_property_type_model['signed'] = 'testString' contract_schema_property_type_model['native_type'] = 'testString' + # Construct a dict representation of a ContractQualityRule model + contract_quality_rule_model = {} + contract_quality_rule_model['type'] = 'sql' + contract_quality_rule_model['description'] = 'testString' + contract_quality_rule_model['rule'] = 'testString' + contract_quality_rule_model['implementation'] = 'testString' + contract_quality_rule_model['engine'] = 'testString' + contract_quality_rule_model['must_be_less_than'] = 'testString' + contract_quality_rule_model['must_be_less_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_greater_than'] = 'testString' + contract_quality_rule_model['must_be_greater_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_between'] = ['testString'] + contract_quality_rule_model['must_not_be_between'] = ['testString'] + contract_quality_rule_model['must_be'] = 'testString' + contract_quality_rule_model['must_not_be'] = 'testString' + contract_quality_rule_model['name'] = 'testString' + contract_quality_rule_model['unit'] = 'testString' + contract_quality_rule_model['query'] = 'testString' + # Construct a dict representation of a ContractSchemaProperty model contract_schema_property_model = {} contract_schema_property_model['name'] = 'testString' contract_schema_property_model['type'] = contract_schema_property_type_model + contract_schema_property_model['quality'] = [contract_quality_rule_model] # Construct a dict representation of a ContractSchema model contract_schema_model = {} + contract_schema_model['asset_id'] = '2b0bf220-079c-11ee-be56-0242ac120002' + contract_schema_model['connection_id'] = '2b0bf220-079c-11ee-be56-0242ac120002' contract_schema_model['name'] = 'testString' contract_schema_model['description'] = 'testString' + contract_schema_model['connection_path'] = 'testString' contract_schema_model['physical_type'] = 'testString' contract_schema_model['properties'] = [contract_schema_property_model] + contract_schema_model['quality'] = [contract_quality_rule_model] # Construct a dict representation of a ContractTerms model contract_terms_model = {} @@ -1391,6 +1578,7 @@ def test_create_data_product_value_error(self): contract_terms_model['support_and_communication'] = [contract_template_support_and_communication_model] contract_terms_model['custom_properties'] = [contract_template_custom_property_model] contract_terms_model['contract_test'] = contract_test_model + contract_terms_model['servers'] = [contract_server_model] contract_terms_model['schema'] = [contract_schema_model] # Construct a dict representation of a AssetPartReference model @@ -1406,11 +1594,13 @@ def test_create_data_product_value_error(self): engine_details_model_model['engine_id'] = 'presto767' engine_details_model_model['engine_port'] = '34567' engine_details_model_model['engine_host'] = 'a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud' + engine_details_model_model['engine_type'] = 'spark' engine_details_model_model['associated_catalogs'] = ['testString'] # Construct a dict representation of a ProducerInputModel model producer_input_model_model = {} producer_input_model_model['engine_details'] = engine_details_model_model + producer_input_model_model['engines'] = [engine_details_model_model] # Construct a dict representation of a DeliveryMethodPropertiesModel model delivery_method_properties_model_model = {} @@ -1472,6 +1662,7 @@ def test_create_data_product_value_error(self): data_product_draft_prototype_model['comments'] = 'Comments by a producer that are provided either at the time of data product version creation or retiring' data_product_draft_prototype_model['access_control'] = asset_list_access_control_model data_product_draft_prototype_model['last_updated_at'] = '2019-01-01T12:00:00Z' + data_product_draft_prototype_model['sub_container'] = container_identity_model data_product_draft_prototype_model['is_restricted'] = True data_product_draft_prototype_model['asset'] = asset_prototype_model @@ -1509,7 +1700,7 @@ def test_get_data_product_all_params(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/data_products/testString') - mock_response = '{"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "name": "name", "latest_release": {"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "associated_catalogs": ["associated_catalogs"]}}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}}, "drafts": [{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "associated_catalogs": ["associated_catalogs"]}}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}}]}' + mock_response = '{"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "name": "name", "latest_release": {"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}, "engines": [{"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}]}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "sub_container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd"}, "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}}, "drafts": [{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}, "engines": [{"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}]}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "sub_container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd"}, "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}}]}' responses.add( responses.GET, url, @@ -1547,7 +1738,7 @@ def test_get_data_product_value_error(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/data_products/testString') - mock_response = '{"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "name": "name", "latest_release": {"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "associated_catalogs": ["associated_catalogs"]}}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}}, "drafts": [{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "associated_catalogs": ["associated_catalogs"]}}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}}]}' + mock_response = '{"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "name": "name", "latest_release": {"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}, "engines": [{"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}]}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "sub_container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd"}, "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}}, "drafts": [{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}, "engines": [{"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}]}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "sub_container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd"}, "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}}]}' responses.add( responses.GET, url, @@ -1722,7 +1913,7 @@ def test_list_data_product_drafts_all_params(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/data_products/testString/drafts') - mock_response = '{"limit": 200, "first": {"href": "https://api.example.com/collection"}, "next": {"href": "https://api.example.com/collection?start=eyJvZmZzZXQiOjAsImRvbmUiOnRydWV9", "start": "eyJvZmZzZXQiOjAsImRvbmUiOnRydWV9"}, "total_results": 200, "drafts": [{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "associated_catalogs": ["associated_catalogs"]}}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}}]}' + mock_response = '{"limit": 200, "first": {"href": "https://api.example.com/collection"}, "next": {"href": "https://api.example.com/collection?start=eyJvZmZzZXQiOjAsImRvbmUiOnRydWV9", "start": "eyJvZmZzZXQiOjAsImRvbmUiOnRydWV9"}, "total_results": 200, "drafts": [{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}, "engines": [{"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}]}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "sub_container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd"}, "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}}]}' responses.add( responses.GET, url, @@ -1775,7 +1966,7 @@ def test_list_data_product_drafts_required_params(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/data_products/testString/drafts') - mock_response = '{"limit": 200, "first": {"href": "https://api.example.com/collection"}, "next": {"href": "https://api.example.com/collection?start=eyJvZmZzZXQiOjAsImRvbmUiOnRydWV9", "start": "eyJvZmZzZXQiOjAsImRvbmUiOnRydWV9"}, "total_results": 200, "drafts": [{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "associated_catalogs": ["associated_catalogs"]}}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}}]}' + mock_response = '{"limit": 200, "first": {"href": "https://api.example.com/collection"}, "next": {"href": "https://api.example.com/collection?start=eyJvZmZzZXQiOjAsImRvbmUiOnRydWV9", "start": "eyJvZmZzZXQiOjAsImRvbmUiOnRydWV9"}, "total_results": 200, "drafts": [{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}, "engines": [{"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}]}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "sub_container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd"}, "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}}]}' responses.add( responses.GET, url, @@ -1813,7 +2004,7 @@ def test_list_data_product_drafts_value_error(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/data_products/testString/drafts') - mock_response = '{"limit": 200, "first": {"href": "https://api.example.com/collection"}, "next": {"href": "https://api.example.com/collection?start=eyJvZmZzZXQiOjAsImRvbmUiOnRydWV9", "start": "eyJvZmZzZXQiOjAsImRvbmUiOnRydWV9"}, "total_results": 200, "drafts": [{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "associated_catalogs": ["associated_catalogs"]}}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}}]}' + mock_response = '{"limit": 200, "first": {"href": "https://api.example.com/collection"}, "next": {"href": "https://api.example.com/collection?start=eyJvZmZzZXQiOjAsImRvbmUiOnRydWV9", "start": "eyJvZmZzZXQiOjAsImRvbmUiOnRydWV9"}, "total_results": 200, "drafts": [{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}, "engines": [{"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}]}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "sub_container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd"}, "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}}]}' responses.add( responses.GET, url, @@ -1850,8 +2041,8 @@ def test_list_data_product_drafts_with_pager_get_next(self): """ # Set up a two-page mock response url = preprocess_url('/data_product_exchange/v1/data_products/testString/drafts') - mock_response1 = '{"next":{"start":"1"},"total_count":2,"limit":1,"drafts":[{"version":"1.0.0","state":"draft","data_product":{"id":"b38df608-d34b-4d58-8136-ed25e6c6684e","release":{"id":"18bdbde1-918e-4ecf-aa23-6727bf319e14"},"container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"name":"My Data Product","description":"This is a description of My Data Product.","tags":["tags"],"use_cases":[{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}}],"types":["data"],"contract_terms":[{"asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"id":"id","documents":[{"url":"url","type":"terms_and_conditions","name":"name","id":"2b0bf220-079c-11ee-be56-0242ac120002","attachment":{"id":"id"},"upload_url":"upload_url"}],"error_msg":"error_msg","overview":{"api_version":"v3.0.1","kind":"DataContract","name":"Sample Data Contract","version":"0.0.0","domain":{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"more_info":"List of links to sources that provide more details on the data contract."},"description":{"purpose":"Used for customer behavior analysis.","limitations":"Data cannot be used for marketing.","usage":"Data should be used only for analytics.","more_info":[{"type":"privacy-statement","url":"https://moreinfo.example.com"}],"custom_properties":"{\\"property1\\":\\"value1\\"}"},"organization":[{"user_id":"IBMid-691000IN4G","role":"owner"}],"roles":[{"role":"owner"}],"price":{"amount":"100.0","currency":"USD","unit":"megabyte"},"sla":[{"default_element":"Standard SLA Policy","properties":[{"property":"Uptime Guarantee","value":"99.9"}]}],"support_and_communication":[{"channel":"Email Support","url":"https://support.example.com"}],"custom_properties":[{"key":"customPropertyKey","value":"customPropertyValue"}],"contract_test":{"status":"pass","last_tested_time":"last_tested_time","message":"message"},"schema":[{"name":"name","description":"description","physical_type":"physical_type","properties":[{"name":"name","type":{"type":"type","length":"length","scale":"scale","nullable":"nullable","signed":"signed","native_type":"native_type"}}]}]}],"domain":{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"parts_out":[{"asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"},"type":"data_asset"},"delivery_methods":[{"id":"09cf5fcc-cb9d-4995-a8e4-16517b25229f","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"},"getproperties":{"producer_input":{"engine_details":{"display_name":"Iceberg Engine","engine_id":"presto767","engine_port":"34567","engine_host":"a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud","associated_catalogs":["associated_catalogs"]}}}}]}],"workflows":{"order_access_request":{"task_assignee_users":["task_assignee_users"],"pre_approved_users":["pre_approved_users"],"custom_workflow_definition":{"id":"18bdbde1-918e-4ecf-aa23-6727bf319e14"}}},"dataview_enabled":true,"comments":"Comments by a producer that are provided either at the time of data product version creation or retiring","access_control":{"owner":"IBMid-696000KYV9"},"last_updated_at":"2019-01-01T12:00:00.000Z","is_restricted":false,"id":"2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd","asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}}}]}' - mock_response2 = '{"total_count":2,"limit":1,"drafts":[{"version":"1.0.0","state":"draft","data_product":{"id":"b38df608-d34b-4d58-8136-ed25e6c6684e","release":{"id":"18bdbde1-918e-4ecf-aa23-6727bf319e14"},"container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"name":"My Data Product","description":"This is a description of My Data Product.","tags":["tags"],"use_cases":[{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}}],"types":["data"],"contract_terms":[{"asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"id":"id","documents":[{"url":"url","type":"terms_and_conditions","name":"name","id":"2b0bf220-079c-11ee-be56-0242ac120002","attachment":{"id":"id"},"upload_url":"upload_url"}],"error_msg":"error_msg","overview":{"api_version":"v3.0.1","kind":"DataContract","name":"Sample Data Contract","version":"0.0.0","domain":{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"more_info":"List of links to sources that provide more details on the data contract."},"description":{"purpose":"Used for customer behavior analysis.","limitations":"Data cannot be used for marketing.","usage":"Data should be used only for analytics.","more_info":[{"type":"privacy-statement","url":"https://moreinfo.example.com"}],"custom_properties":"{\\"property1\\":\\"value1\\"}"},"organization":[{"user_id":"IBMid-691000IN4G","role":"owner"}],"roles":[{"role":"owner"}],"price":{"amount":"100.0","currency":"USD","unit":"megabyte"},"sla":[{"default_element":"Standard SLA Policy","properties":[{"property":"Uptime Guarantee","value":"99.9"}]}],"support_and_communication":[{"channel":"Email Support","url":"https://support.example.com"}],"custom_properties":[{"key":"customPropertyKey","value":"customPropertyValue"}],"contract_test":{"status":"pass","last_tested_time":"last_tested_time","message":"message"},"schema":[{"name":"name","description":"description","physical_type":"physical_type","properties":[{"name":"name","type":{"type":"type","length":"length","scale":"scale","nullable":"nullable","signed":"signed","native_type":"native_type"}}]}]}],"domain":{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"parts_out":[{"asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"},"type":"data_asset"},"delivery_methods":[{"id":"09cf5fcc-cb9d-4995-a8e4-16517b25229f","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"},"getproperties":{"producer_input":{"engine_details":{"display_name":"Iceberg Engine","engine_id":"presto767","engine_port":"34567","engine_host":"a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud","associated_catalogs":["associated_catalogs"]}}}}]}],"workflows":{"order_access_request":{"task_assignee_users":["task_assignee_users"],"pre_approved_users":["pre_approved_users"],"custom_workflow_definition":{"id":"18bdbde1-918e-4ecf-aa23-6727bf319e14"}}},"dataview_enabled":true,"comments":"Comments by a producer that are provided either at the time of data product version creation or retiring","access_control":{"owner":"IBMid-696000KYV9"},"last_updated_at":"2019-01-01T12:00:00.000Z","is_restricted":false,"id":"2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd","asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}}}]}' + mock_response1 = '{"next":{"start":"1"},"total_count":2,"limit":1,"drafts":[{"version":"1.0.0","state":"draft","data_product":{"id":"b38df608-d34b-4d58-8136-ed25e6c6684e","release":{"id":"18bdbde1-918e-4ecf-aa23-6727bf319e14"},"container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"name":"My Data Product","description":"This is a description of My Data Product.","tags":["tags"],"use_cases":[{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}}],"types":["data"],"contract_terms":[{"asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"id":"id","documents":[{"url":"url","type":"terms_and_conditions","name":"name","id":"2b0bf220-079c-11ee-be56-0242ac120002","attachment":{"id":"id"},"upload_url":"upload_url"}],"error_msg":"error_msg","overview":{"api_version":"v3.0.1","kind":"DataContract","name":"Sample Data Contract","version":"0.0.0","domain":{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"more_info":"List of links to sources that provide more details on the data contract."},"description":{"purpose":"Used for customer behavior analysis.","limitations":"Data cannot be used for marketing.","usage":"Data should be used only for analytics.","more_info":[{"type":"privacy-statement","url":"https://moreinfo.example.com"}],"custom_properties":"{\\"property1\\":\\"value1\\"}"},"organization":[{"user_id":"IBMid-691000IN4G","role":"owner"}],"roles":[{"role":"owner"}],"price":{"amount":"100.0","currency":"USD","unit":"megabyte"},"sla":[{"default_element":"Standard SLA Policy","properties":[{"property":"Uptime Guarantee","value":"99.9"}]}],"support_and_communication":[{"channel":"Email Support","url":"https://support.example.com"}],"custom_properties":[{"key":"customPropertyKey","value":"customPropertyValue"}],"contract_test":{"status":"pass","last_tested_time":"last_tested_time","message":"message"},"servers":[{"server":"server","asset":{"id":"id","name":"name"},"connection_id":"connection_id","type":"type","description":"description","environment":"environment","account":"account","catalog":"catalog","database":"database","dataset":"dataset","delimiter":"delimiter","endpoint_url":"endpoint_url","format":"format","host":"host","location":"location","path":"path","port":"port","project":"project","region":"region","region_name":"region_name","schema":"schema","service_name":"service_name","staging_dir":"staging_dir","stream":"stream","warehouse":"warehouse","roles":["roles"],"custom_properties":[{"key":"customPropertyKey","value":"customPropertyValue"}]}],"schema":[{"asset_id":"2b0bf220-079c-11ee-be56-0242ac120002","connection_id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","description":"description","connection_path":"connection_path","physical_type":"physical_type","properties":[{"name":"name","type":{"type":"type","length":"length","scale":"scale","nullable":"nullable","signed":"signed","native_type":"native_type"},"quality":[{"type":"sql","description":"description","rule":"rule","implementation":"implementation","engine":"engine","must_be_less_than":"must_be_less_than","must_be_less_or_equal_to":"must_be_less_or_equal_to","must_be_greater_than":"must_be_greater_than","must_be_greater_or_equal_to":"must_be_greater_or_equal_to","must_be_between":["must_be_between"],"must_not_be_between":["must_not_be_between"],"must_be":"must_be","must_not_be":"must_not_be","name":"name","unit":"unit","query":"query"}]}],"quality":[{"type":"sql","description":"description","rule":"rule","implementation":"implementation","engine":"engine","must_be_less_than":"must_be_less_than","must_be_less_or_equal_to":"must_be_less_or_equal_to","must_be_greater_than":"must_be_greater_than","must_be_greater_or_equal_to":"must_be_greater_or_equal_to","must_be_between":["must_be_between"],"must_not_be_between":["must_not_be_between"],"must_be":"must_be","must_not_be":"must_not_be","name":"name","unit":"unit","query":"query"}]}]}],"domain":{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"parts_out":[{"asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"},"type":"data_asset"},"delivery_methods":[{"id":"09cf5fcc-cb9d-4995-a8e4-16517b25229f","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"},"getproperties":{"producer_input":{"engine_details":{"display_name":"Iceberg Engine","engine_id":"presto767","engine_port":"34567","engine_host":"a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud","engine_type":"spark","associated_catalogs":["associated_catalogs"]},"engines":[{"display_name":"Iceberg Engine","engine_id":"presto767","engine_port":"34567","engine_host":"a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud","engine_type":"spark","associated_catalogs":["associated_catalogs"]}]}}}]}],"workflows":{"order_access_request":{"task_assignee_users":["task_assignee_users"],"pre_approved_users":["pre_approved_users"],"custom_workflow_definition":{"id":"18bdbde1-918e-4ecf-aa23-6727bf319e14"}}},"dataview_enabled":true,"comments":"Comments by a producer that are provided either at the time of data product version creation or retiring","access_control":{"owner":"IBMid-696000KYV9"},"last_updated_at":"2019-01-01T12:00:00.000Z","sub_container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd"},"is_restricted":false,"id":"2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd","asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}}}]}' + mock_response2 = '{"total_count":2,"limit":1,"drafts":[{"version":"1.0.0","state":"draft","data_product":{"id":"b38df608-d34b-4d58-8136-ed25e6c6684e","release":{"id":"18bdbde1-918e-4ecf-aa23-6727bf319e14"},"container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"name":"My Data Product","description":"This is a description of My Data Product.","tags":["tags"],"use_cases":[{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}}],"types":["data"],"contract_terms":[{"asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"id":"id","documents":[{"url":"url","type":"terms_and_conditions","name":"name","id":"2b0bf220-079c-11ee-be56-0242ac120002","attachment":{"id":"id"},"upload_url":"upload_url"}],"error_msg":"error_msg","overview":{"api_version":"v3.0.1","kind":"DataContract","name":"Sample Data Contract","version":"0.0.0","domain":{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"more_info":"List of links to sources that provide more details on the data contract."},"description":{"purpose":"Used for customer behavior analysis.","limitations":"Data cannot be used for marketing.","usage":"Data should be used only for analytics.","more_info":[{"type":"privacy-statement","url":"https://moreinfo.example.com"}],"custom_properties":"{\\"property1\\":\\"value1\\"}"},"organization":[{"user_id":"IBMid-691000IN4G","role":"owner"}],"roles":[{"role":"owner"}],"price":{"amount":"100.0","currency":"USD","unit":"megabyte"},"sla":[{"default_element":"Standard SLA Policy","properties":[{"property":"Uptime Guarantee","value":"99.9"}]}],"support_and_communication":[{"channel":"Email Support","url":"https://support.example.com"}],"custom_properties":[{"key":"customPropertyKey","value":"customPropertyValue"}],"contract_test":{"status":"pass","last_tested_time":"last_tested_time","message":"message"},"servers":[{"server":"server","asset":{"id":"id","name":"name"},"connection_id":"connection_id","type":"type","description":"description","environment":"environment","account":"account","catalog":"catalog","database":"database","dataset":"dataset","delimiter":"delimiter","endpoint_url":"endpoint_url","format":"format","host":"host","location":"location","path":"path","port":"port","project":"project","region":"region","region_name":"region_name","schema":"schema","service_name":"service_name","staging_dir":"staging_dir","stream":"stream","warehouse":"warehouse","roles":["roles"],"custom_properties":[{"key":"customPropertyKey","value":"customPropertyValue"}]}],"schema":[{"asset_id":"2b0bf220-079c-11ee-be56-0242ac120002","connection_id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","description":"description","connection_path":"connection_path","physical_type":"physical_type","properties":[{"name":"name","type":{"type":"type","length":"length","scale":"scale","nullable":"nullable","signed":"signed","native_type":"native_type"},"quality":[{"type":"sql","description":"description","rule":"rule","implementation":"implementation","engine":"engine","must_be_less_than":"must_be_less_than","must_be_less_or_equal_to":"must_be_less_or_equal_to","must_be_greater_than":"must_be_greater_than","must_be_greater_or_equal_to":"must_be_greater_or_equal_to","must_be_between":["must_be_between"],"must_not_be_between":["must_not_be_between"],"must_be":"must_be","must_not_be":"must_not_be","name":"name","unit":"unit","query":"query"}]}],"quality":[{"type":"sql","description":"description","rule":"rule","implementation":"implementation","engine":"engine","must_be_less_than":"must_be_less_than","must_be_less_or_equal_to":"must_be_less_or_equal_to","must_be_greater_than":"must_be_greater_than","must_be_greater_or_equal_to":"must_be_greater_or_equal_to","must_be_between":["must_be_between"],"must_not_be_between":["must_not_be_between"],"must_be":"must_be","must_not_be":"must_not_be","name":"name","unit":"unit","query":"query"}]}]}],"domain":{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"parts_out":[{"asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"},"type":"data_asset"},"delivery_methods":[{"id":"09cf5fcc-cb9d-4995-a8e4-16517b25229f","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"},"getproperties":{"producer_input":{"engine_details":{"display_name":"Iceberg Engine","engine_id":"presto767","engine_port":"34567","engine_host":"a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud","engine_type":"spark","associated_catalogs":["associated_catalogs"]},"engines":[{"display_name":"Iceberg Engine","engine_id":"presto767","engine_port":"34567","engine_host":"a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud","engine_type":"spark","associated_catalogs":["associated_catalogs"]}]}}}]}],"workflows":{"order_access_request":{"task_assignee_users":["task_assignee_users"],"pre_approved_users":["pre_approved_users"],"custom_workflow_definition":{"id":"18bdbde1-918e-4ecf-aa23-6727bf319e14"}}},"dataview_enabled":true,"comments":"Comments by a producer that are provided either at the time of data product version creation or retiring","access_control":{"owner":"IBMid-696000KYV9"},"last_updated_at":"2019-01-01T12:00:00.000Z","sub_container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd"},"is_restricted":false,"id":"2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd","asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}}}]}' responses.add( responses.GET, url, @@ -1889,8 +2080,8 @@ def test_list_data_product_drafts_with_pager_get_all(self): """ # Set up a two-page mock response url = preprocess_url('/data_product_exchange/v1/data_products/testString/drafts') - mock_response1 = '{"next":{"start":"1"},"total_count":2,"limit":1,"drafts":[{"version":"1.0.0","state":"draft","data_product":{"id":"b38df608-d34b-4d58-8136-ed25e6c6684e","release":{"id":"18bdbde1-918e-4ecf-aa23-6727bf319e14"},"container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"name":"My Data Product","description":"This is a description of My Data Product.","tags":["tags"],"use_cases":[{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}}],"types":["data"],"contract_terms":[{"asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"id":"id","documents":[{"url":"url","type":"terms_and_conditions","name":"name","id":"2b0bf220-079c-11ee-be56-0242ac120002","attachment":{"id":"id"},"upload_url":"upload_url"}],"error_msg":"error_msg","overview":{"api_version":"v3.0.1","kind":"DataContract","name":"Sample Data Contract","version":"0.0.0","domain":{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"more_info":"List of links to sources that provide more details on the data contract."},"description":{"purpose":"Used for customer behavior analysis.","limitations":"Data cannot be used for marketing.","usage":"Data should be used only for analytics.","more_info":[{"type":"privacy-statement","url":"https://moreinfo.example.com"}],"custom_properties":"{\\"property1\\":\\"value1\\"}"},"organization":[{"user_id":"IBMid-691000IN4G","role":"owner"}],"roles":[{"role":"owner"}],"price":{"amount":"100.0","currency":"USD","unit":"megabyte"},"sla":[{"default_element":"Standard SLA Policy","properties":[{"property":"Uptime Guarantee","value":"99.9"}]}],"support_and_communication":[{"channel":"Email Support","url":"https://support.example.com"}],"custom_properties":[{"key":"customPropertyKey","value":"customPropertyValue"}],"contract_test":{"status":"pass","last_tested_time":"last_tested_time","message":"message"},"schema":[{"name":"name","description":"description","physical_type":"physical_type","properties":[{"name":"name","type":{"type":"type","length":"length","scale":"scale","nullable":"nullable","signed":"signed","native_type":"native_type"}}]}]}],"domain":{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"parts_out":[{"asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"},"type":"data_asset"},"delivery_methods":[{"id":"09cf5fcc-cb9d-4995-a8e4-16517b25229f","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"},"getproperties":{"producer_input":{"engine_details":{"display_name":"Iceberg Engine","engine_id":"presto767","engine_port":"34567","engine_host":"a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud","associated_catalogs":["associated_catalogs"]}}}}]}],"workflows":{"order_access_request":{"task_assignee_users":["task_assignee_users"],"pre_approved_users":["pre_approved_users"],"custom_workflow_definition":{"id":"18bdbde1-918e-4ecf-aa23-6727bf319e14"}}},"dataview_enabled":true,"comments":"Comments by a producer that are provided either at the time of data product version creation or retiring","access_control":{"owner":"IBMid-696000KYV9"},"last_updated_at":"2019-01-01T12:00:00.000Z","is_restricted":false,"id":"2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd","asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}}}]}' - mock_response2 = '{"total_count":2,"limit":1,"drafts":[{"version":"1.0.0","state":"draft","data_product":{"id":"b38df608-d34b-4d58-8136-ed25e6c6684e","release":{"id":"18bdbde1-918e-4ecf-aa23-6727bf319e14"},"container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"name":"My Data Product","description":"This is a description of My Data Product.","tags":["tags"],"use_cases":[{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}}],"types":["data"],"contract_terms":[{"asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"id":"id","documents":[{"url":"url","type":"terms_and_conditions","name":"name","id":"2b0bf220-079c-11ee-be56-0242ac120002","attachment":{"id":"id"},"upload_url":"upload_url"}],"error_msg":"error_msg","overview":{"api_version":"v3.0.1","kind":"DataContract","name":"Sample Data Contract","version":"0.0.0","domain":{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"more_info":"List of links to sources that provide more details on the data contract."},"description":{"purpose":"Used for customer behavior analysis.","limitations":"Data cannot be used for marketing.","usage":"Data should be used only for analytics.","more_info":[{"type":"privacy-statement","url":"https://moreinfo.example.com"}],"custom_properties":"{\\"property1\\":\\"value1\\"}"},"organization":[{"user_id":"IBMid-691000IN4G","role":"owner"}],"roles":[{"role":"owner"}],"price":{"amount":"100.0","currency":"USD","unit":"megabyte"},"sla":[{"default_element":"Standard SLA Policy","properties":[{"property":"Uptime Guarantee","value":"99.9"}]}],"support_and_communication":[{"channel":"Email Support","url":"https://support.example.com"}],"custom_properties":[{"key":"customPropertyKey","value":"customPropertyValue"}],"contract_test":{"status":"pass","last_tested_time":"last_tested_time","message":"message"},"schema":[{"name":"name","description":"description","physical_type":"physical_type","properties":[{"name":"name","type":{"type":"type","length":"length","scale":"scale","nullable":"nullable","signed":"signed","native_type":"native_type"}}]}]}],"domain":{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"parts_out":[{"asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"},"type":"data_asset"},"delivery_methods":[{"id":"09cf5fcc-cb9d-4995-a8e4-16517b25229f","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"},"getproperties":{"producer_input":{"engine_details":{"display_name":"Iceberg Engine","engine_id":"presto767","engine_port":"34567","engine_host":"a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud","associated_catalogs":["associated_catalogs"]}}}}]}],"workflows":{"order_access_request":{"task_assignee_users":["task_assignee_users"],"pre_approved_users":["pre_approved_users"],"custom_workflow_definition":{"id":"18bdbde1-918e-4ecf-aa23-6727bf319e14"}}},"dataview_enabled":true,"comments":"Comments by a producer that are provided either at the time of data product version creation or retiring","access_control":{"owner":"IBMid-696000KYV9"},"last_updated_at":"2019-01-01T12:00:00.000Z","is_restricted":false,"id":"2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd","asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}}}]}' + mock_response1 = '{"next":{"start":"1"},"total_count":2,"limit":1,"drafts":[{"version":"1.0.0","state":"draft","data_product":{"id":"b38df608-d34b-4d58-8136-ed25e6c6684e","release":{"id":"18bdbde1-918e-4ecf-aa23-6727bf319e14"},"container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"name":"My Data Product","description":"This is a description of My Data Product.","tags":["tags"],"use_cases":[{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}}],"types":["data"],"contract_terms":[{"asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"id":"id","documents":[{"url":"url","type":"terms_and_conditions","name":"name","id":"2b0bf220-079c-11ee-be56-0242ac120002","attachment":{"id":"id"},"upload_url":"upload_url"}],"error_msg":"error_msg","overview":{"api_version":"v3.0.1","kind":"DataContract","name":"Sample Data Contract","version":"0.0.0","domain":{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"more_info":"List of links to sources that provide more details on the data contract."},"description":{"purpose":"Used for customer behavior analysis.","limitations":"Data cannot be used for marketing.","usage":"Data should be used only for analytics.","more_info":[{"type":"privacy-statement","url":"https://moreinfo.example.com"}],"custom_properties":"{\\"property1\\":\\"value1\\"}"},"organization":[{"user_id":"IBMid-691000IN4G","role":"owner"}],"roles":[{"role":"owner"}],"price":{"amount":"100.0","currency":"USD","unit":"megabyte"},"sla":[{"default_element":"Standard SLA Policy","properties":[{"property":"Uptime Guarantee","value":"99.9"}]}],"support_and_communication":[{"channel":"Email Support","url":"https://support.example.com"}],"custom_properties":[{"key":"customPropertyKey","value":"customPropertyValue"}],"contract_test":{"status":"pass","last_tested_time":"last_tested_time","message":"message"},"servers":[{"server":"server","asset":{"id":"id","name":"name"},"connection_id":"connection_id","type":"type","description":"description","environment":"environment","account":"account","catalog":"catalog","database":"database","dataset":"dataset","delimiter":"delimiter","endpoint_url":"endpoint_url","format":"format","host":"host","location":"location","path":"path","port":"port","project":"project","region":"region","region_name":"region_name","schema":"schema","service_name":"service_name","staging_dir":"staging_dir","stream":"stream","warehouse":"warehouse","roles":["roles"],"custom_properties":[{"key":"customPropertyKey","value":"customPropertyValue"}]}],"schema":[{"asset_id":"2b0bf220-079c-11ee-be56-0242ac120002","connection_id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","description":"description","connection_path":"connection_path","physical_type":"physical_type","properties":[{"name":"name","type":{"type":"type","length":"length","scale":"scale","nullable":"nullable","signed":"signed","native_type":"native_type"},"quality":[{"type":"sql","description":"description","rule":"rule","implementation":"implementation","engine":"engine","must_be_less_than":"must_be_less_than","must_be_less_or_equal_to":"must_be_less_or_equal_to","must_be_greater_than":"must_be_greater_than","must_be_greater_or_equal_to":"must_be_greater_or_equal_to","must_be_between":["must_be_between"],"must_not_be_between":["must_not_be_between"],"must_be":"must_be","must_not_be":"must_not_be","name":"name","unit":"unit","query":"query"}]}],"quality":[{"type":"sql","description":"description","rule":"rule","implementation":"implementation","engine":"engine","must_be_less_than":"must_be_less_than","must_be_less_or_equal_to":"must_be_less_or_equal_to","must_be_greater_than":"must_be_greater_than","must_be_greater_or_equal_to":"must_be_greater_or_equal_to","must_be_between":["must_be_between"],"must_not_be_between":["must_not_be_between"],"must_be":"must_be","must_not_be":"must_not_be","name":"name","unit":"unit","query":"query"}]}]}],"domain":{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"parts_out":[{"asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"},"type":"data_asset"},"delivery_methods":[{"id":"09cf5fcc-cb9d-4995-a8e4-16517b25229f","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"},"getproperties":{"producer_input":{"engine_details":{"display_name":"Iceberg Engine","engine_id":"presto767","engine_port":"34567","engine_host":"a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud","engine_type":"spark","associated_catalogs":["associated_catalogs"]},"engines":[{"display_name":"Iceberg Engine","engine_id":"presto767","engine_port":"34567","engine_host":"a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud","engine_type":"spark","associated_catalogs":["associated_catalogs"]}]}}}]}],"workflows":{"order_access_request":{"task_assignee_users":["task_assignee_users"],"pre_approved_users":["pre_approved_users"],"custom_workflow_definition":{"id":"18bdbde1-918e-4ecf-aa23-6727bf319e14"}}},"dataview_enabled":true,"comments":"Comments by a producer that are provided either at the time of data product version creation or retiring","access_control":{"owner":"IBMid-696000KYV9"},"last_updated_at":"2019-01-01T12:00:00.000Z","sub_container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd"},"is_restricted":false,"id":"2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd","asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}}}]}' + mock_response2 = '{"total_count":2,"limit":1,"drafts":[{"version":"1.0.0","state":"draft","data_product":{"id":"b38df608-d34b-4d58-8136-ed25e6c6684e","release":{"id":"18bdbde1-918e-4ecf-aa23-6727bf319e14"},"container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"name":"My Data Product","description":"This is a description of My Data Product.","tags":["tags"],"use_cases":[{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}}],"types":["data"],"contract_terms":[{"asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"id":"id","documents":[{"url":"url","type":"terms_and_conditions","name":"name","id":"2b0bf220-079c-11ee-be56-0242ac120002","attachment":{"id":"id"},"upload_url":"upload_url"}],"error_msg":"error_msg","overview":{"api_version":"v3.0.1","kind":"DataContract","name":"Sample Data Contract","version":"0.0.0","domain":{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"more_info":"List of links to sources that provide more details on the data contract."},"description":{"purpose":"Used for customer behavior analysis.","limitations":"Data cannot be used for marketing.","usage":"Data should be used only for analytics.","more_info":[{"type":"privacy-statement","url":"https://moreinfo.example.com"}],"custom_properties":"{\\"property1\\":\\"value1\\"}"},"organization":[{"user_id":"IBMid-691000IN4G","role":"owner"}],"roles":[{"role":"owner"}],"price":{"amount":"100.0","currency":"USD","unit":"megabyte"},"sla":[{"default_element":"Standard SLA Policy","properties":[{"property":"Uptime Guarantee","value":"99.9"}]}],"support_and_communication":[{"channel":"Email Support","url":"https://support.example.com"}],"custom_properties":[{"key":"customPropertyKey","value":"customPropertyValue"}],"contract_test":{"status":"pass","last_tested_time":"last_tested_time","message":"message"},"servers":[{"server":"server","asset":{"id":"id","name":"name"},"connection_id":"connection_id","type":"type","description":"description","environment":"environment","account":"account","catalog":"catalog","database":"database","dataset":"dataset","delimiter":"delimiter","endpoint_url":"endpoint_url","format":"format","host":"host","location":"location","path":"path","port":"port","project":"project","region":"region","region_name":"region_name","schema":"schema","service_name":"service_name","staging_dir":"staging_dir","stream":"stream","warehouse":"warehouse","roles":["roles"],"custom_properties":[{"key":"customPropertyKey","value":"customPropertyValue"}]}],"schema":[{"asset_id":"2b0bf220-079c-11ee-be56-0242ac120002","connection_id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","description":"description","connection_path":"connection_path","physical_type":"physical_type","properties":[{"name":"name","type":{"type":"type","length":"length","scale":"scale","nullable":"nullable","signed":"signed","native_type":"native_type"},"quality":[{"type":"sql","description":"description","rule":"rule","implementation":"implementation","engine":"engine","must_be_less_than":"must_be_less_than","must_be_less_or_equal_to":"must_be_less_or_equal_to","must_be_greater_than":"must_be_greater_than","must_be_greater_or_equal_to":"must_be_greater_or_equal_to","must_be_between":["must_be_between"],"must_not_be_between":["must_not_be_between"],"must_be":"must_be","must_not_be":"must_not_be","name":"name","unit":"unit","query":"query"}]}],"quality":[{"type":"sql","description":"description","rule":"rule","implementation":"implementation","engine":"engine","must_be_less_than":"must_be_less_than","must_be_less_or_equal_to":"must_be_less_or_equal_to","must_be_greater_than":"must_be_greater_than","must_be_greater_or_equal_to":"must_be_greater_or_equal_to","must_be_between":["must_be_between"],"must_not_be_between":["must_not_be_between"],"must_be":"must_be","must_not_be":"must_not_be","name":"name","unit":"unit","query":"query"}]}]}],"domain":{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"parts_out":[{"asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"},"type":"data_asset"},"delivery_methods":[{"id":"09cf5fcc-cb9d-4995-a8e4-16517b25229f","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"},"getproperties":{"producer_input":{"engine_details":{"display_name":"Iceberg Engine","engine_id":"presto767","engine_port":"34567","engine_host":"a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud","engine_type":"spark","associated_catalogs":["associated_catalogs"]},"engines":[{"display_name":"Iceberg Engine","engine_id":"presto767","engine_port":"34567","engine_host":"a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud","engine_type":"spark","associated_catalogs":["associated_catalogs"]}]}}}]}],"workflows":{"order_access_request":{"task_assignee_users":["task_assignee_users"],"pre_approved_users":["pre_approved_users"],"custom_workflow_definition":{"id":"18bdbde1-918e-4ecf-aa23-6727bf319e14"}}},"dataview_enabled":true,"comments":"Comments by a producer that are provided either at the time of data product version creation or retiring","access_control":{"owner":"IBMid-696000KYV9"},"last_updated_at":"2019-01-01T12:00:00.000Z","sub_container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd"},"is_restricted":false,"id":"2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd","asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}}}]}' responses.add( responses.GET, url, @@ -1931,7 +2122,7 @@ def test_create_data_product_draft_all_params(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/data_products/testString/drafts') - mock_response = '{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "associated_catalogs": ["associated_catalogs"]}}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "published_by": "published_by", "published_at": "2019-01-01T12:00:00.000Z", "created_by": "created_by", "created_at": "2019-01-01T12:00:00.000Z", "properties": {"anyKey": "anyValue"}, "visualization_errors": [{"visualization": {"id": "id", "name": "name"}, "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "related_asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "error": {"code": "code", "message": "message"}}]}' + mock_response = '{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}, "engines": [{"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}]}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "sub_container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd"}, "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "published_by": "published_by", "published_at": "2019-01-01T12:00:00.000Z", "created_by": "created_by", "created_at": "2019-01-01T12:00:00.000Z", "properties": {"anyKey": "anyValue"}, "visualization_errors": [{"visualization": {"id": "id", "name": "name"}, "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "related_asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "error": {"code": "code", "message": "message"}}]}' responses.add( responses.POST, url, @@ -2057,6 +2248,41 @@ def test_create_data_product_draft_all_params(self): contract_test_model['last_tested_time'] = 'testString' contract_test_model['message'] = 'testString' + # Construct a dict representation of a ContractAsset model + contract_asset_model = {} + contract_asset_model['id'] = 'testString' + contract_asset_model['name'] = 'testString' + + # Construct a dict representation of a ContractServer model + contract_server_model = {} + contract_server_model['server'] = 'testString' + contract_server_model['asset'] = contract_asset_model + contract_server_model['connection_id'] = 'testString' + contract_server_model['type'] = 'testString' + contract_server_model['description'] = 'testString' + contract_server_model['environment'] = 'testString' + contract_server_model['account'] = 'testString' + contract_server_model['catalog'] = 'testString' + contract_server_model['database'] = 'testString' + contract_server_model['dataset'] = 'testString' + contract_server_model['delimiter'] = 'testString' + contract_server_model['endpoint_url'] = 'testString' + contract_server_model['format'] = 'testString' + contract_server_model['host'] = 'testString' + contract_server_model['location'] = 'testString' + contract_server_model['path'] = 'testString' + contract_server_model['port'] = 'testString' + contract_server_model['project'] = 'testString' + contract_server_model['region'] = 'testString' + contract_server_model['region_name'] = 'testString' + contract_server_model['schema'] = 'testString' + contract_server_model['service_name'] = 'testString' + contract_server_model['staging_dir'] = 'testString' + contract_server_model['stream'] = 'testString' + contract_server_model['warehouse'] = 'testString' + contract_server_model['roles'] = ['testString'] + contract_server_model['custom_properties'] = [contract_template_custom_property_model] + # Construct a dict representation of a ContractSchemaPropertyType model contract_schema_property_type_model = {} contract_schema_property_type_model['type'] = 'testString' @@ -2066,17 +2292,41 @@ def test_create_data_product_draft_all_params(self): contract_schema_property_type_model['signed'] = 'testString' contract_schema_property_type_model['native_type'] = 'testString' + # Construct a dict representation of a ContractQualityRule model + contract_quality_rule_model = {} + contract_quality_rule_model['type'] = 'sql' + contract_quality_rule_model['description'] = 'testString' + contract_quality_rule_model['rule'] = 'testString' + contract_quality_rule_model['implementation'] = 'testString' + contract_quality_rule_model['engine'] = 'testString' + contract_quality_rule_model['must_be_less_than'] = 'testString' + contract_quality_rule_model['must_be_less_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_greater_than'] = 'testString' + contract_quality_rule_model['must_be_greater_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_between'] = ['testString'] + contract_quality_rule_model['must_not_be_between'] = ['testString'] + contract_quality_rule_model['must_be'] = 'testString' + contract_quality_rule_model['must_not_be'] = 'testString' + contract_quality_rule_model['name'] = 'testString' + contract_quality_rule_model['unit'] = 'testString' + contract_quality_rule_model['query'] = 'testString' + # Construct a dict representation of a ContractSchemaProperty model contract_schema_property_model = {} contract_schema_property_model['name'] = 'testString' contract_schema_property_model['type'] = contract_schema_property_type_model + contract_schema_property_model['quality'] = [contract_quality_rule_model] # Construct a dict representation of a ContractSchema model contract_schema_model = {} + contract_schema_model['asset_id'] = '2b0bf220-079c-11ee-be56-0242ac120002' + contract_schema_model['connection_id'] = '2b0bf220-079c-11ee-be56-0242ac120002' contract_schema_model['name'] = 'testString' contract_schema_model['description'] = 'testString' + contract_schema_model['connection_path'] = 'testString' contract_schema_model['physical_type'] = 'testString' contract_schema_model['properties'] = [contract_schema_property_model] + contract_schema_model['quality'] = [contract_quality_rule_model] # Construct a dict representation of a ContractTerms model contract_terms_model = {} @@ -2093,6 +2343,7 @@ def test_create_data_product_draft_all_params(self): contract_terms_model['support_and_communication'] = [contract_template_support_and_communication_model] contract_terms_model['custom_properties'] = [contract_template_custom_property_model] contract_terms_model['contract_test'] = contract_test_model + contract_terms_model['servers'] = [contract_server_model] contract_terms_model['schema'] = [contract_schema_model] # Construct a dict representation of a AssetPartReference model @@ -2108,11 +2359,13 @@ def test_create_data_product_draft_all_params(self): engine_details_model_model['engine_id'] = 'presto767' engine_details_model_model['engine_port'] = '34567' engine_details_model_model['engine_host'] = 'a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud' + engine_details_model_model['engine_type'] = 'spark' engine_details_model_model['associated_catalogs'] = ['testString'] # Construct a dict representation of a ProducerInputModel model producer_input_model_model = {} producer_input_model_model['engine_details'] = engine_details_model_model + producer_input_model_model['engines'] = [engine_details_model_model] # Construct a dict representation of a DeliveryMethodPropertiesModel model delivery_method_properties_model_model = {} @@ -2166,6 +2419,7 @@ def test_create_data_product_draft_all_params(self): comments = 'testString' access_control = asset_list_access_control_model last_updated_at = string_to_datetime('2019-01-01T12:00:00.000Z') + sub_container = container_identity_model is_restricted = True # Invoke method @@ -2188,6 +2442,7 @@ def test_create_data_product_draft_all_params(self): comments=comments, access_control=access_control, last_updated_at=last_updated_at, + sub_container=sub_container, is_restricted=is_restricted, headers={}, ) @@ -2214,6 +2469,7 @@ def test_create_data_product_draft_all_params(self): assert req_body['comments'] == 'testString' assert req_body['access_control'] == asset_list_access_control_model assert req_body['last_updated_at'] == '2019-01-01T12:00:00Z' + assert req_body['sub_container'] == container_identity_model assert req_body['is_restricted'] == True def test_create_data_product_draft_all_params_with_retries(self): @@ -2232,7 +2488,7 @@ def test_create_data_product_draft_value_error(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/data_products/testString/drafts') - mock_response = '{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "associated_catalogs": ["associated_catalogs"]}}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "published_by": "published_by", "published_at": "2019-01-01T12:00:00.000Z", "created_by": "created_by", "created_at": "2019-01-01T12:00:00.000Z", "properties": {"anyKey": "anyValue"}, "visualization_errors": [{"visualization": {"id": "id", "name": "name"}, "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "related_asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "error": {"code": "code", "message": "message"}}]}' + mock_response = '{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}, "engines": [{"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}]}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "sub_container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd"}, "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "published_by": "published_by", "published_at": "2019-01-01T12:00:00.000Z", "created_by": "created_by", "created_at": "2019-01-01T12:00:00.000Z", "properties": {"anyKey": "anyValue"}, "visualization_errors": [{"visualization": {"id": "id", "name": "name"}, "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "related_asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "error": {"code": "code", "message": "message"}}]}' responses.add( responses.POST, url, @@ -2358,6 +2614,41 @@ def test_create_data_product_draft_value_error(self): contract_test_model['last_tested_time'] = 'testString' contract_test_model['message'] = 'testString' + # Construct a dict representation of a ContractAsset model + contract_asset_model = {} + contract_asset_model['id'] = 'testString' + contract_asset_model['name'] = 'testString' + + # Construct a dict representation of a ContractServer model + contract_server_model = {} + contract_server_model['server'] = 'testString' + contract_server_model['asset'] = contract_asset_model + contract_server_model['connection_id'] = 'testString' + contract_server_model['type'] = 'testString' + contract_server_model['description'] = 'testString' + contract_server_model['environment'] = 'testString' + contract_server_model['account'] = 'testString' + contract_server_model['catalog'] = 'testString' + contract_server_model['database'] = 'testString' + contract_server_model['dataset'] = 'testString' + contract_server_model['delimiter'] = 'testString' + contract_server_model['endpoint_url'] = 'testString' + contract_server_model['format'] = 'testString' + contract_server_model['host'] = 'testString' + contract_server_model['location'] = 'testString' + contract_server_model['path'] = 'testString' + contract_server_model['port'] = 'testString' + contract_server_model['project'] = 'testString' + contract_server_model['region'] = 'testString' + contract_server_model['region_name'] = 'testString' + contract_server_model['schema'] = 'testString' + contract_server_model['service_name'] = 'testString' + contract_server_model['staging_dir'] = 'testString' + contract_server_model['stream'] = 'testString' + contract_server_model['warehouse'] = 'testString' + contract_server_model['roles'] = ['testString'] + contract_server_model['custom_properties'] = [contract_template_custom_property_model] + # Construct a dict representation of a ContractSchemaPropertyType model contract_schema_property_type_model = {} contract_schema_property_type_model['type'] = 'testString' @@ -2367,17 +2658,41 @@ def test_create_data_product_draft_value_error(self): contract_schema_property_type_model['signed'] = 'testString' contract_schema_property_type_model['native_type'] = 'testString' + # Construct a dict representation of a ContractQualityRule model + contract_quality_rule_model = {} + contract_quality_rule_model['type'] = 'sql' + contract_quality_rule_model['description'] = 'testString' + contract_quality_rule_model['rule'] = 'testString' + contract_quality_rule_model['implementation'] = 'testString' + contract_quality_rule_model['engine'] = 'testString' + contract_quality_rule_model['must_be_less_than'] = 'testString' + contract_quality_rule_model['must_be_less_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_greater_than'] = 'testString' + contract_quality_rule_model['must_be_greater_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_between'] = ['testString'] + contract_quality_rule_model['must_not_be_between'] = ['testString'] + contract_quality_rule_model['must_be'] = 'testString' + contract_quality_rule_model['must_not_be'] = 'testString' + contract_quality_rule_model['name'] = 'testString' + contract_quality_rule_model['unit'] = 'testString' + contract_quality_rule_model['query'] = 'testString' + # Construct a dict representation of a ContractSchemaProperty model contract_schema_property_model = {} contract_schema_property_model['name'] = 'testString' contract_schema_property_model['type'] = contract_schema_property_type_model + contract_schema_property_model['quality'] = [contract_quality_rule_model] # Construct a dict representation of a ContractSchema model contract_schema_model = {} + contract_schema_model['asset_id'] = '2b0bf220-079c-11ee-be56-0242ac120002' + contract_schema_model['connection_id'] = '2b0bf220-079c-11ee-be56-0242ac120002' contract_schema_model['name'] = 'testString' contract_schema_model['description'] = 'testString' + contract_schema_model['connection_path'] = 'testString' contract_schema_model['physical_type'] = 'testString' contract_schema_model['properties'] = [contract_schema_property_model] + contract_schema_model['quality'] = [contract_quality_rule_model] # Construct a dict representation of a ContractTerms model contract_terms_model = {} @@ -2394,6 +2709,7 @@ def test_create_data_product_draft_value_error(self): contract_terms_model['support_and_communication'] = [contract_template_support_and_communication_model] contract_terms_model['custom_properties'] = [contract_template_custom_property_model] contract_terms_model['contract_test'] = contract_test_model + contract_terms_model['servers'] = [contract_server_model] contract_terms_model['schema'] = [contract_schema_model] # Construct a dict representation of a AssetPartReference model @@ -2409,11 +2725,13 @@ def test_create_data_product_draft_value_error(self): engine_details_model_model['engine_id'] = 'presto767' engine_details_model_model['engine_port'] = '34567' engine_details_model_model['engine_host'] = 'a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud' + engine_details_model_model['engine_type'] = 'spark' engine_details_model_model['associated_catalogs'] = ['testString'] # Construct a dict representation of a ProducerInputModel model producer_input_model_model = {} producer_input_model_model['engine_details'] = engine_details_model_model + producer_input_model_model['engines'] = [engine_details_model_model] # Construct a dict representation of a DeliveryMethodPropertiesModel model delivery_method_properties_model_model = {} @@ -2467,6 +2785,7 @@ def test_create_data_product_draft_value_error(self): comments = 'testString' access_control = asset_list_access_control_model last_updated_at = string_to_datetime('2019-01-01T12:00:00.000Z') + sub_container = container_identity_model is_restricted = True # Pass in all but one required param and check for a ValueError @@ -2606,7 +2925,7 @@ def test_get_data_product_draft_all_params(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/data_products/testString/drafts/testString') - mock_response = '{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "associated_catalogs": ["associated_catalogs"]}}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "published_by": "published_by", "published_at": "2019-01-01T12:00:00.000Z", "created_by": "created_by", "created_at": "2019-01-01T12:00:00.000Z", "properties": {"anyKey": "anyValue"}, "visualization_errors": [{"visualization": {"id": "id", "name": "name"}, "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "related_asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "error": {"code": "code", "message": "message"}}]}' + mock_response = '{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}, "engines": [{"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}]}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "sub_container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd"}, "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "published_by": "published_by", "published_at": "2019-01-01T12:00:00.000Z", "created_by": "created_by", "created_at": "2019-01-01T12:00:00.000Z", "properties": {"anyKey": "anyValue"}, "visualization_errors": [{"visualization": {"id": "id", "name": "name"}, "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "related_asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "error": {"code": "code", "message": "message"}}]}' responses.add( responses.GET, url, @@ -2646,7 +2965,7 @@ def test_get_data_product_draft_value_error(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/data_products/testString/drafts/testString') - mock_response = '{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "associated_catalogs": ["associated_catalogs"]}}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "published_by": "published_by", "published_at": "2019-01-01T12:00:00.000Z", "created_by": "created_by", "created_at": "2019-01-01T12:00:00.000Z", "properties": {"anyKey": "anyValue"}, "visualization_errors": [{"visualization": {"id": "id", "name": "name"}, "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "related_asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "error": {"code": "code", "message": "message"}}]}' + mock_response = '{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}, "engines": [{"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}]}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "sub_container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd"}, "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "published_by": "published_by", "published_at": "2019-01-01T12:00:00.000Z", "created_by": "created_by", "created_at": "2019-01-01T12:00:00.000Z", "properties": {"anyKey": "anyValue"}, "visualization_errors": [{"visualization": {"id": "id", "name": "name"}, "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "related_asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "error": {"code": "code", "message": "message"}}]}' responses.add( responses.GET, url, @@ -2770,7 +3089,7 @@ def test_update_data_product_draft_all_params(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/data_products/testString/drafts/testString') - mock_response = '{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "associated_catalogs": ["associated_catalogs"]}}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "published_by": "published_by", "published_at": "2019-01-01T12:00:00.000Z", "created_by": "created_by", "created_at": "2019-01-01T12:00:00.000Z", "properties": {"anyKey": "anyValue"}, "visualization_errors": [{"visualization": {"id": "id", "name": "name"}, "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "related_asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "error": {"code": "code", "message": "message"}}]}' + mock_response = '{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}, "engines": [{"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}]}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "sub_container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd"}, "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "published_by": "published_by", "published_at": "2019-01-01T12:00:00.000Z", "created_by": "created_by", "created_at": "2019-01-01T12:00:00.000Z", "properties": {"anyKey": "anyValue"}, "visualization_errors": [{"visualization": {"id": "id", "name": "name"}, "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "related_asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "error": {"code": "code", "message": "message"}}]}' responses.add( responses.PATCH, url, @@ -2822,7 +3141,7 @@ def test_update_data_product_draft_value_error(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/data_products/testString/drafts/testString') - mock_response = '{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "associated_catalogs": ["associated_catalogs"]}}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "published_by": "published_by", "published_at": "2019-01-01T12:00:00.000Z", "created_by": "created_by", "created_at": "2019-01-01T12:00:00.000Z", "properties": {"anyKey": "anyValue"}, "visualization_errors": [{"visualization": {"id": "id", "name": "name"}, "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "related_asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "error": {"code": "code", "message": "message"}}]}' + mock_response = '{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}, "engines": [{"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}]}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "sub_container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd"}, "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "published_by": "published_by", "published_at": "2019-01-01T12:00:00.000Z", "created_by": "created_by", "created_at": "2019-01-01T12:00:00.000Z", "properties": {"anyKey": "anyValue"}, "visualization_errors": [{"visualization": {"id": "id", "name": "name"}, "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "related_asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "error": {"code": "code", "message": "message"}}]}' responses.add( responses.PATCH, url, @@ -3170,12 +3489,12 @@ def test_get_data_product_draft_contract_terms_all_params(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/data_products/testString/drafts/testString/contract_terms/testString') - mock_response = 'This is a mock binary response.' + mock_response = '{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}' responses.add( responses.GET, url, body=mock_response, - content_type='application/odcs+yaml', + content_type='application/json', status=200, ) @@ -3183,8 +3502,10 @@ def test_get_data_product_draft_contract_terms_all_params(self): data_product_id = 'testString' draft_id = 'testString' contract_terms_id = 'testString' - accept = 'application/odcs+yaml' + accept = 'application/json' include_contract_documents = True + autopopulate_server_information = False + server_asset_id = 'testString' # Invoke method response = _service.get_data_product_draft_contract_terms( @@ -3193,6 +3514,8 @@ def test_get_data_product_draft_contract_terms_all_params(self): contract_terms_id, accept=accept, include_contract_documents=include_contract_documents, + autopopulate_server_information=autopopulate_server_information, + server_asset_id=server_asset_id, headers={}, ) @@ -3203,6 +3526,8 @@ def test_get_data_product_draft_contract_terms_all_params(self): query_string = responses.calls[0].request.url.split('?', 1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'include_contract_documents={}'.format('true' if include_contract_documents else 'false') in query_string + assert 'autopopulate_server_information={}'.format('true' if autopopulate_server_information else 'false') in query_string + assert 'server_asset_id={}'.format(server_asset_id) in query_string def test_get_data_product_draft_contract_terms_all_params_with_retries(self): # Enable retries and run test_get_data_product_draft_contract_terms_all_params. @@ -3220,12 +3545,12 @@ def test_get_data_product_draft_contract_terms_required_params(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/data_products/testString/drafts/testString/contract_terms/testString') - mock_response = 'This is a mock binary response.' + mock_response = '{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}' responses.add( responses.GET, url, body=mock_response, - content_type='application/odcs+yaml', + content_type='application/json', status=200, ) @@ -3262,12 +3587,12 @@ def test_get_data_product_draft_contract_terms_value_error(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/data_products/testString/drafts/testString/contract_terms/testString') - mock_response = 'This is a mock binary response.' + mock_response = '{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}' responses.add( responses.GET, url, body=mock_response, - content_type='application/odcs+yaml', + content_type='application/json', status=200, ) @@ -3309,7 +3634,7 @@ def test_replace_data_product_draft_contract_terms_all_params(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/data_products/testString/drafts/testString/contract_terms/testString') - mock_response = '{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}' + mock_response = '{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}' responses.add( responses.PUT, url, @@ -3381,9 +3706,9 @@ def test_replace_data_product_draft_contract_terms_all_params(self): # Construct a dict representation of a Pricing model pricing_model = {} - pricing_model['amount'] = '100.0' - pricing_model['currency'] = 'USD' - pricing_model['unit'] = 'megabyte' + pricing_model['amount'] = 'Amount' + pricing_model['currency'] = 'Currency' + pricing_model['unit'] = 'Unit' # Construct a dict representation of a ContractTemplateSLAProperty model contract_template_sla_property_model = {} @@ -3411,26 +3736,85 @@ def test_replace_data_product_draft_contract_terms_all_params(self): contract_test_model['last_tested_time'] = 'testString' contract_test_model['message'] = 'testString' + # Construct a dict representation of a ContractAsset model + contract_asset_model = {} + contract_asset_model['id'] = '684d6aa0-9f93-4564-8a20-e354bc469857' + contract_asset_model['name'] = 'PAYMENT_TRANSACTIONS1' + + # Construct a dict representation of a ContractServer model + contract_server_model = {} + contract_server_model['server'] = 'snowflake-server-01' + contract_server_model['asset'] = contract_asset_model + contract_server_model['connection_id'] = '8d7701be-709a-49c0-ae4e-a7daeaae6def' + contract_server_model['type'] = 'snowflake' + contract_server_model['description'] = 'Snowflake analytics server' + contract_server_model['environment'] = 'dev' + contract_server_model['account'] = 'acc-456' + contract_server_model['catalog'] = 'analytics_cat' + contract_server_model['database'] = 'analytics_db' + contract_server_model['dataset'] = 'customer_data' + contract_server_model['delimiter'] = ',' + contract_server_model['endpoint_url'] = 'https://xy12345.snowflakecomputing.com' + contract_server_model['format'] = 'parquet' + contract_server_model['host'] = 'xy12345.snowflakecomputing.com' + contract_server_model['location'] = 'Mumbai' + contract_server_model['path'] = '/analytics/data' + contract_server_model['port'] = '443' + contract_server_model['project'] = 'projectY' + contract_server_model['region'] = 'ap-south-1' + contract_server_model['region_name'] = 'Asia South 1' + contract_server_model['schema'] = 'PAYMENT_TRANSACTIONS1' + contract_server_model['service_name'] = 'snowflake' + contract_server_model['staging_dir'] = '/snowflake/staging' + contract_server_model['stream'] = 'stream_analytics' + contract_server_model['warehouse'] = 'wh_xlarge' + contract_server_model['roles'] = ['testString'] + contract_server_model['custom_properties'] = [contract_template_custom_property_model] + # Construct a dict representation of a ContractSchemaPropertyType model contract_schema_property_type_model = {} - contract_schema_property_type_model['type'] = 'testString' - contract_schema_property_type_model['length'] = 'testString' - contract_schema_property_type_model['scale'] = 'testString' - contract_schema_property_type_model['nullable'] = 'testString' - contract_schema_property_type_model['signed'] = 'testString' + contract_schema_property_type_model['type'] = 'varchar' + contract_schema_property_type_model['length'] = '1024' + contract_schema_property_type_model['scale'] = '0' + contract_schema_property_type_model['nullable'] = 'true' + contract_schema_property_type_model['signed'] = 'false' contract_schema_property_type_model['native_type'] = 'testString' + # Construct a dict representation of a ContractQualityRule model + contract_quality_rule_model = {} + contract_quality_rule_model['type'] = 'sql' + contract_quality_rule_model['description'] = 'testString' + contract_quality_rule_model['rule'] = 'testString' + contract_quality_rule_model['implementation'] = 'testString' + contract_quality_rule_model['engine'] = 'testString' + contract_quality_rule_model['must_be_less_than'] = 'testString' + contract_quality_rule_model['must_be_less_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_greater_than'] = 'testString' + contract_quality_rule_model['must_be_greater_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_between'] = ['testString'] + contract_quality_rule_model['must_not_be_between'] = ['testString'] + contract_quality_rule_model['must_be'] = 'testString' + contract_quality_rule_model['must_not_be'] = 'testString' + contract_quality_rule_model['name'] = 'testString' + contract_quality_rule_model['unit'] = 'testString' + contract_quality_rule_model['query'] = 'testString' + # Construct a dict representation of a ContractSchemaProperty model contract_schema_property_model = {} - contract_schema_property_model['name'] = 'testString' + contract_schema_property_model['name'] = 'product_brand_code' contract_schema_property_model['type'] = contract_schema_property_type_model + contract_schema_property_model['quality'] = [contract_quality_rule_model] # Construct a dict representation of a ContractSchema model contract_schema_model = {} - contract_schema_model['name'] = 'testString' + contract_schema_model['asset_id'] = '09ca6b40-7c89-412a-8951-ad820da709d1' + contract_schema_model['connection_id'] = '6cc57d4d-2229-438f-91a0-2c455556422b' + contract_schema_model['name'] = '000000_0-2025-06-20-20-28-52.csv' contract_schema_model['description'] = 'testString' - contract_schema_model['physical_type'] = 'testString' + contract_schema_model['connection_path'] = '/dpx-test-bucket/000000_0-2025-06-20-20-28-52.csv' + contract_schema_model['physical_type'] = 'text/csv' contract_schema_model['properties'] = [contract_schema_property_model] + contract_schema_model['quality'] = [contract_quality_rule_model] # Set up parameter values data_product_id = 'testString' @@ -3449,6 +3833,7 @@ def test_replace_data_product_draft_contract_terms_all_params(self): support_and_communication = [contract_template_support_and_communication_model] custom_properties = [contract_template_custom_property_model] contract_test = contract_test_model + servers = [contract_server_model] schema = [contract_schema_model] # Invoke method @@ -3469,6 +3854,7 @@ def test_replace_data_product_draft_contract_terms_all_params(self): support_and_communication=support_and_communication, custom_properties=custom_properties, contract_test=contract_test, + servers=servers, schema=schema, headers={}, ) @@ -3491,6 +3877,7 @@ def test_replace_data_product_draft_contract_terms_all_params(self): assert req_body['support_and_communication'] == [contract_template_support_and_communication_model] assert req_body['custom_properties'] == [contract_template_custom_property_model] assert req_body['contract_test'] == contract_test_model + assert req_body['servers'] == [contract_server_model] assert req_body['schema'] == [contract_schema_model] def test_replace_data_product_draft_contract_terms_all_params_with_retries(self): @@ -3509,7 +3896,7 @@ def test_replace_data_product_draft_contract_terms_value_error(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/data_products/testString/drafts/testString/contract_terms/testString') - mock_response = '{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}' + mock_response = '{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}' responses.add( responses.PUT, url, @@ -3581,9 +3968,9 @@ def test_replace_data_product_draft_contract_terms_value_error(self): # Construct a dict representation of a Pricing model pricing_model = {} - pricing_model['amount'] = '100.0' - pricing_model['currency'] = 'USD' - pricing_model['unit'] = 'megabyte' + pricing_model['amount'] = 'Amount' + pricing_model['currency'] = 'Currency' + pricing_model['unit'] = 'Unit' # Construct a dict representation of a ContractTemplateSLAProperty model contract_template_sla_property_model = {} @@ -3611,26 +3998,85 @@ def test_replace_data_product_draft_contract_terms_value_error(self): contract_test_model['last_tested_time'] = 'testString' contract_test_model['message'] = 'testString' + # Construct a dict representation of a ContractAsset model + contract_asset_model = {} + contract_asset_model['id'] = '684d6aa0-9f93-4564-8a20-e354bc469857' + contract_asset_model['name'] = 'PAYMENT_TRANSACTIONS1' + + # Construct a dict representation of a ContractServer model + contract_server_model = {} + contract_server_model['server'] = 'snowflake-server-01' + contract_server_model['asset'] = contract_asset_model + contract_server_model['connection_id'] = '8d7701be-709a-49c0-ae4e-a7daeaae6def' + contract_server_model['type'] = 'snowflake' + contract_server_model['description'] = 'Snowflake analytics server' + contract_server_model['environment'] = 'dev' + contract_server_model['account'] = 'acc-456' + contract_server_model['catalog'] = 'analytics_cat' + contract_server_model['database'] = 'analytics_db' + contract_server_model['dataset'] = 'customer_data' + contract_server_model['delimiter'] = ',' + contract_server_model['endpoint_url'] = 'https://xy12345.snowflakecomputing.com' + contract_server_model['format'] = 'parquet' + contract_server_model['host'] = 'xy12345.snowflakecomputing.com' + contract_server_model['location'] = 'Mumbai' + contract_server_model['path'] = '/analytics/data' + contract_server_model['port'] = '443' + contract_server_model['project'] = 'projectY' + contract_server_model['region'] = 'ap-south-1' + contract_server_model['region_name'] = 'Asia South 1' + contract_server_model['schema'] = 'PAYMENT_TRANSACTIONS1' + contract_server_model['service_name'] = 'snowflake' + contract_server_model['staging_dir'] = '/snowflake/staging' + contract_server_model['stream'] = 'stream_analytics' + contract_server_model['warehouse'] = 'wh_xlarge' + contract_server_model['roles'] = ['testString'] + contract_server_model['custom_properties'] = [contract_template_custom_property_model] + # Construct a dict representation of a ContractSchemaPropertyType model contract_schema_property_type_model = {} - contract_schema_property_type_model['type'] = 'testString' - contract_schema_property_type_model['length'] = 'testString' - contract_schema_property_type_model['scale'] = 'testString' - contract_schema_property_type_model['nullable'] = 'testString' - contract_schema_property_type_model['signed'] = 'testString' + contract_schema_property_type_model['type'] = 'varchar' + contract_schema_property_type_model['length'] = '1024' + contract_schema_property_type_model['scale'] = '0' + contract_schema_property_type_model['nullable'] = 'true' + contract_schema_property_type_model['signed'] = 'false' contract_schema_property_type_model['native_type'] = 'testString' + # Construct a dict representation of a ContractQualityRule model + contract_quality_rule_model = {} + contract_quality_rule_model['type'] = 'sql' + contract_quality_rule_model['description'] = 'testString' + contract_quality_rule_model['rule'] = 'testString' + contract_quality_rule_model['implementation'] = 'testString' + contract_quality_rule_model['engine'] = 'testString' + contract_quality_rule_model['must_be_less_than'] = 'testString' + contract_quality_rule_model['must_be_less_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_greater_than'] = 'testString' + contract_quality_rule_model['must_be_greater_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_between'] = ['testString'] + contract_quality_rule_model['must_not_be_between'] = ['testString'] + contract_quality_rule_model['must_be'] = 'testString' + contract_quality_rule_model['must_not_be'] = 'testString' + contract_quality_rule_model['name'] = 'testString' + contract_quality_rule_model['unit'] = 'testString' + contract_quality_rule_model['query'] = 'testString' + # Construct a dict representation of a ContractSchemaProperty model contract_schema_property_model = {} - contract_schema_property_model['name'] = 'testString' + contract_schema_property_model['name'] = 'product_brand_code' contract_schema_property_model['type'] = contract_schema_property_type_model + contract_schema_property_model['quality'] = [contract_quality_rule_model] # Construct a dict representation of a ContractSchema model contract_schema_model = {} - contract_schema_model['name'] = 'testString' + contract_schema_model['asset_id'] = '09ca6b40-7c89-412a-8951-ad820da709d1' + contract_schema_model['connection_id'] = '6cc57d4d-2229-438f-91a0-2c455556422b' + contract_schema_model['name'] = '000000_0-2025-06-20-20-28-52.csv' contract_schema_model['description'] = 'testString' - contract_schema_model['physical_type'] = 'testString' + contract_schema_model['connection_path'] = '/dpx-test-bucket/000000_0-2025-06-20-20-28-52.csv' + contract_schema_model['physical_type'] = 'text/csv' contract_schema_model['properties'] = [contract_schema_property_model] + contract_schema_model['quality'] = [contract_quality_rule_model] # Set up parameter values data_product_id = 'testString' @@ -3649,6 +4095,7 @@ def test_replace_data_product_draft_contract_terms_value_error(self): support_and_communication = [contract_template_support_and_communication_model] custom_properties = [contract_template_custom_property_model] contract_test = contract_test_model + servers = [contract_server_model] schema = [contract_schema_model] # Pass in all but one required param and check for a ValueError @@ -3684,7 +4131,7 @@ def test_update_data_product_draft_contract_terms_all_params(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/data_products/testString/drafts/testString/contract_terms/testString') - mock_response = '{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}' + mock_response = '{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}' responses.add( responses.PATCH, url, @@ -3738,7 +4185,7 @@ def test_update_data_product_draft_contract_terms_value_error(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/data_products/testString/drafts/testString/contract_terms/testString') - mock_response = '{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}' + mock_response = '{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}' responses.add( responses.PATCH, url, @@ -3782,6 +4229,161 @@ def test_update_data_product_draft_contract_terms_value_error_with_retries(self) self.test_update_data_product_draft_contract_terms_value_error() +class TestGetContractTermsInSpecifiedFormat: + """ + Test Class for get_contract_terms_in_specified_format + """ + + @responses.activate + def test_get_contract_terms_in_specified_format_all_params(self): + """ + get_contract_terms_in_specified_format() + """ + # Set up mock + url = preprocess_url('/data_product_exchange/v1/data_products/testString/drafts/testString/contract_terms/testString/format') + mock_response = 'This is a mock binary response.' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/odcs+yaml', + status=200, + ) + + # Set up parameter values + data_product_id = 'testString' + draft_id = 'testString' + contract_terms_id = 'testString' + format = 'testString' + format_version = 'testString' + accept = 'application/odcs+yaml' + + # Invoke method + response = _service.get_contract_terms_in_specified_format( + data_product_id, + draft_id, + contract_terms_id, + format, + format_version, + accept=accept, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + # Validate query params + query_string = responses.calls[0].request.url.split('?', 1)[1] + query_string = urllib.parse.unquote_plus(query_string) + assert 'format={}'.format(format) in query_string + assert 'format_version={}'.format(format_version) in query_string + + def test_get_contract_terms_in_specified_format_all_params_with_retries(self): + # Enable retries and run test_get_contract_terms_in_specified_format_all_params. + _service.enable_retries() + self.test_get_contract_terms_in_specified_format_all_params() + + # Disable retries and run test_get_contract_terms_in_specified_format_all_params. + _service.disable_retries() + self.test_get_contract_terms_in_specified_format_all_params() + + @responses.activate + def test_get_contract_terms_in_specified_format_required_params(self): + """ + test_get_contract_terms_in_specified_format_required_params() + """ + # Set up mock + url = preprocess_url('/data_product_exchange/v1/data_products/testString/drafts/testString/contract_terms/testString/format') + mock_response = 'This is a mock binary response.' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/odcs+yaml', + status=200, + ) + + # Set up parameter values + data_product_id = 'testString' + draft_id = 'testString' + contract_terms_id = 'testString' + format = 'testString' + format_version = 'testString' + + # Invoke method + response = _service.get_contract_terms_in_specified_format( + data_product_id, + draft_id, + contract_terms_id, + format, + format_version, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + # Validate query params + query_string = responses.calls[0].request.url.split('?', 1)[1] + query_string = urllib.parse.unquote_plus(query_string) + assert 'format={}'.format(format) in query_string + assert 'format_version={}'.format(format_version) in query_string + + def test_get_contract_terms_in_specified_format_required_params_with_retries(self): + # Enable retries and run test_get_contract_terms_in_specified_format_required_params. + _service.enable_retries() + self.test_get_contract_terms_in_specified_format_required_params() + + # Disable retries and run test_get_contract_terms_in_specified_format_required_params. + _service.disable_retries() + self.test_get_contract_terms_in_specified_format_required_params() + + @responses.activate + def test_get_contract_terms_in_specified_format_value_error(self): + """ + test_get_contract_terms_in_specified_format_value_error() + """ + # Set up mock + url = preprocess_url('/data_product_exchange/v1/data_products/testString/drafts/testString/contract_terms/testString/format') + mock_response = 'This is a mock binary response.' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/odcs+yaml', + status=200, + ) + + # Set up parameter values + data_product_id = 'testString' + draft_id = 'testString' + contract_terms_id = 'testString' + format = 'testString' + format_version = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "data_product_id": data_product_id, + "draft_id": draft_id, + "contract_terms_id": contract_terms_id, + "format": format, + "format_version": format_version, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.get_contract_terms_in_specified_format(**req_copy) + + def test_get_contract_terms_in_specified_format_value_error_with_retries(self): + # Enable retries and run test_get_contract_terms_in_specified_format_value_error. + _service.enable_retries() + self.test_get_contract_terms_in_specified_format_value_error() + + # Disable retries and run test_get_contract_terms_in_specified_format_value_error. + _service.disable_retries() + self.test_get_contract_terms_in_specified_format_value_error() + + class TestPublishDataProductDraft: """ Test Class for publish_data_product_draft @@ -3794,7 +4396,7 @@ def test_publish_data_product_draft_all_params(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/data_products/testString/drafts/testString/publish') - mock_response = '{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "associated_catalogs": ["associated_catalogs"]}}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "published_by": "published_by", "published_at": "2019-01-01T12:00:00.000Z", "created_by": "created_by", "created_at": "2019-01-01T12:00:00.000Z", "properties": {"anyKey": "anyValue"}, "visualization_errors": [{"visualization": {"id": "id", "name": "name"}, "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "related_asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "error": {"code": "code", "message": "message"}}]}' + mock_response = '{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}, "engines": [{"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}]}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "sub_container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd"}, "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "published_by": "published_by", "published_at": "2019-01-01T12:00:00.000Z", "created_by": "created_by", "created_at": "2019-01-01T12:00:00.000Z", "properties": {"anyKey": "anyValue"}, "visualization_errors": [{"visualization": {"id": "id", "name": "name"}, "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "related_asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "error": {"code": "code", "message": "message"}}]}' responses.add( responses.POST, url, @@ -3834,7 +4436,7 @@ def test_publish_data_product_draft_value_error(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/data_products/testString/drafts/testString/publish') - mock_response = '{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "associated_catalogs": ["associated_catalogs"]}}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "published_by": "published_by", "published_at": "2019-01-01T12:00:00.000Z", "created_by": "created_by", "created_at": "2019-01-01T12:00:00.000Z", "properties": {"anyKey": "anyValue"}, "visualization_errors": [{"visualization": {"id": "id", "name": "name"}, "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "related_asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "error": {"code": "code", "message": "message"}}]}' + mock_response = '{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}, "engines": [{"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}]}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "sub_container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd"}, "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "published_by": "published_by", "published_at": "2019-01-01T12:00:00.000Z", "created_by": "created_by", "created_at": "2019-01-01T12:00:00.000Z", "properties": {"anyKey": "anyValue"}, "visualization_errors": [{"visualization": {"id": "id", "name": "name"}, "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "related_asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "error": {"code": "code", "message": "message"}}]}' responses.add( responses.POST, url, @@ -3918,7 +4520,7 @@ def test_get_data_product_release_all_params(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/data_products/testString/releases/testString') - mock_response = '{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "associated_catalogs": ["associated_catalogs"]}}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "published_by": "published_by", "published_at": "2019-01-01T12:00:00.000Z", "created_by": "created_by", "created_at": "2019-01-01T12:00:00.000Z", "properties": {"anyKey": "anyValue"}, "visualization_errors": [{"visualization": {"id": "id", "name": "name"}, "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "related_asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "error": {"code": "code", "message": "message"}}]}' + mock_response = '{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}, "engines": [{"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}]}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "sub_container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd"}, "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "published_by": "published_by", "published_at": "2019-01-01T12:00:00.000Z", "created_by": "created_by", "created_at": "2019-01-01T12:00:00.000Z", "properties": {"anyKey": "anyValue"}, "visualization_errors": [{"visualization": {"id": "id", "name": "name"}, "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "related_asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "error": {"code": "code", "message": "message"}}]}' responses.add( responses.GET, url, @@ -3964,7 +4566,7 @@ def test_get_data_product_release_required_params(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/data_products/testString/releases/testString') - mock_response = '{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "associated_catalogs": ["associated_catalogs"]}}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "published_by": "published_by", "published_at": "2019-01-01T12:00:00.000Z", "created_by": "created_by", "created_at": "2019-01-01T12:00:00.000Z", "properties": {"anyKey": "anyValue"}, "visualization_errors": [{"visualization": {"id": "id", "name": "name"}, "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "related_asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "error": {"code": "code", "message": "message"}}]}' + mock_response = '{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}, "engines": [{"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}]}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "sub_container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd"}, "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "published_by": "published_by", "published_at": "2019-01-01T12:00:00.000Z", "created_by": "created_by", "created_at": "2019-01-01T12:00:00.000Z", "properties": {"anyKey": "anyValue"}, "visualization_errors": [{"visualization": {"id": "id", "name": "name"}, "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "related_asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "error": {"code": "code", "message": "message"}}]}' responses.add( responses.GET, url, @@ -4004,7 +4606,7 @@ def test_get_data_product_release_value_error(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/data_products/testString/releases/testString') - mock_response = '{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "associated_catalogs": ["associated_catalogs"]}}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "published_by": "published_by", "published_at": "2019-01-01T12:00:00.000Z", "created_by": "created_by", "created_at": "2019-01-01T12:00:00.000Z", "properties": {"anyKey": "anyValue"}, "visualization_errors": [{"visualization": {"id": "id", "name": "name"}, "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "related_asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "error": {"code": "code", "message": "message"}}]}' + mock_response = '{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}, "engines": [{"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}]}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "sub_container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd"}, "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "published_by": "published_by", "published_at": "2019-01-01T12:00:00.000Z", "created_by": "created_by", "created_at": "2019-01-01T12:00:00.000Z", "properties": {"anyKey": "anyValue"}, "visualization_errors": [{"visualization": {"id": "id", "name": "name"}, "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "related_asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "error": {"code": "code", "message": "message"}}]}' responses.add( responses.GET, url, @@ -4049,7 +4651,7 @@ def test_update_data_product_release_all_params(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/data_products/testString/releases/testString') - mock_response = '{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "associated_catalogs": ["associated_catalogs"]}}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "published_by": "published_by", "published_at": "2019-01-01T12:00:00.000Z", "created_by": "created_by", "created_at": "2019-01-01T12:00:00.000Z", "properties": {"anyKey": "anyValue"}, "visualization_errors": [{"visualization": {"id": "id", "name": "name"}, "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "related_asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "error": {"code": "code", "message": "message"}}]}' + mock_response = '{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}, "engines": [{"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}]}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "sub_container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd"}, "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "published_by": "published_by", "published_at": "2019-01-01T12:00:00.000Z", "created_by": "created_by", "created_at": "2019-01-01T12:00:00.000Z", "properties": {"anyKey": "anyValue"}, "visualization_errors": [{"visualization": {"id": "id", "name": "name"}, "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "related_asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "error": {"code": "code", "message": "message"}}]}' responses.add( responses.PATCH, url, @@ -4101,7 +4703,7 @@ def test_update_data_product_release_value_error(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/data_products/testString/releases/testString') - mock_response = '{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "associated_catalogs": ["associated_catalogs"]}}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "published_by": "published_by", "published_at": "2019-01-01T12:00:00.000Z", "created_by": "created_by", "created_at": "2019-01-01T12:00:00.000Z", "properties": {"anyKey": "anyValue"}, "visualization_errors": [{"visualization": {"id": "id", "name": "name"}, "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "related_asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "error": {"code": "code", "message": "message"}}]}' + mock_response = '{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}, "engines": [{"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}]}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "sub_container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd"}, "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "published_by": "published_by", "published_at": "2019-01-01T12:00:00.000Z", "created_by": "created_by", "created_at": "2019-01-01T12:00:00.000Z", "properties": {"anyKey": "anyValue"}, "visualization_errors": [{"visualization": {"id": "id", "name": "name"}, "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "related_asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "error": {"code": "code", "message": "message"}}]}' responses.add( responses.PATCH, url, @@ -4236,43 +4838,41 @@ def test_get_release_contract_terms_document_value_error_with_retries(self): self.test_get_release_contract_terms_document_value_error() -class TestListDataProductReleases: +class TestGetPublishedDataProductDraftContractTerms: """ - Test Class for list_data_product_releases + Test Class for get_published_data_product_draft_contract_terms """ @responses.activate - def test_list_data_product_releases_all_params(self): + def test_get_published_data_product_draft_contract_terms_all_params(self): """ - list_data_product_releases() + get_published_data_product_draft_contract_terms() """ # Set up mock - url = preprocess_url('/data_product_exchange/v1/data_products/testString/releases') - mock_response = '{"limit": 200, "first": {"href": "https://api.example.com/collection"}, "next": {"href": "https://api.example.com/collection?start=eyJvZmZzZXQiOjAsImRvbmUiOnRydWV9", "start": "eyJvZmZzZXQiOjAsImRvbmUiOnRydWV9"}, "total_results": 200, "releases": [{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "associated_catalogs": ["associated_catalogs"]}}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}}]}' + url = preprocess_url('/data_product_exchange/v1/data_products/testString/releases/testString/contract_terms/testString') + mock_response = 'This is a mock binary response.' responses.add( responses.GET, url, body=mock_response, - content_type='application/json', + content_type='application/odcs+yaml', status=200, ) # Set up parameter values data_product_id = 'testString' - asset_container_id = 'testString' - state = ['available'] - version = 'testString' - limit = 200 - start = 'testString' + release_id = 'testString' + contract_terms_id = 'testString' + accept = 'application/odcs+yaml' + include_contract_documents = True # Invoke method - response = _service.list_data_product_releases( + response = _service.get_published_data_product_draft_contract_terms( data_product_id, - asset_container_id=asset_container_id, - state=state, - version=version, - limit=limit, - start=start, + release_id, + contract_terms_id, + accept=accept, + include_contract_documents=include_contract_documents, headers={}, ) @@ -4282,43 +4882,43 @@ def test_list_data_product_releases_all_params(self): # Validate query params query_string = responses.calls[0].request.url.split('?', 1)[1] query_string = urllib.parse.unquote_plus(query_string) - assert 'asset.container.id={}'.format(asset_container_id) in query_string - assert 'state={}'.format(','.join(state)) in query_string - assert 'version={}'.format(version) in query_string - assert 'limit={}'.format(limit) in query_string - assert 'start={}'.format(start) in query_string + assert 'include_contract_documents={}'.format('true' if include_contract_documents else 'false') in query_string - def test_list_data_product_releases_all_params_with_retries(self): - # Enable retries and run test_list_data_product_releases_all_params. + def test_get_published_data_product_draft_contract_terms_all_params_with_retries(self): + # Enable retries and run test_get_published_data_product_draft_contract_terms_all_params. _service.enable_retries() - self.test_list_data_product_releases_all_params() + self.test_get_published_data_product_draft_contract_terms_all_params() - # Disable retries and run test_list_data_product_releases_all_params. + # Disable retries and run test_get_published_data_product_draft_contract_terms_all_params. _service.disable_retries() - self.test_list_data_product_releases_all_params() + self.test_get_published_data_product_draft_contract_terms_all_params() @responses.activate - def test_list_data_product_releases_required_params(self): + def test_get_published_data_product_draft_contract_terms_required_params(self): """ - test_list_data_product_releases_required_params() + test_get_published_data_product_draft_contract_terms_required_params() """ # Set up mock - url = preprocess_url('/data_product_exchange/v1/data_products/testString/releases') - mock_response = '{"limit": 200, "first": {"href": "https://api.example.com/collection"}, "next": {"href": "https://api.example.com/collection?start=eyJvZmZzZXQiOjAsImRvbmUiOnRydWV9", "start": "eyJvZmZzZXQiOjAsImRvbmUiOnRydWV9"}, "total_results": 200, "releases": [{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "associated_catalogs": ["associated_catalogs"]}}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}}]}' + url = preprocess_url('/data_product_exchange/v1/data_products/testString/releases/testString/contract_terms/testString') + mock_response = 'This is a mock binary response.' responses.add( responses.GET, url, body=mock_response, - content_type='application/json', + content_type='application/odcs+yaml', status=200, ) # Set up parameter values data_product_id = 'testString' + release_id = 'testString' + contract_terms_id = 'testString' # Invoke method - response = _service.list_data_product_releases( + response = _service.get_published_data_product_draft_contract_terms( data_product_id, + release_id, + contract_terms_id, headers={}, ) @@ -4326,85 +4926,226 @@ def test_list_data_product_releases_required_params(self): assert len(responses.calls) == 1 assert response.status_code == 200 - def test_list_data_product_releases_required_params_with_retries(self): - # Enable retries and run test_list_data_product_releases_required_params. + def test_get_published_data_product_draft_contract_terms_required_params_with_retries(self): + # Enable retries and run test_get_published_data_product_draft_contract_terms_required_params. _service.enable_retries() - self.test_list_data_product_releases_required_params() + self.test_get_published_data_product_draft_contract_terms_required_params() - # Disable retries and run test_list_data_product_releases_required_params. + # Disable retries and run test_get_published_data_product_draft_contract_terms_required_params. _service.disable_retries() - self.test_list_data_product_releases_required_params() + self.test_get_published_data_product_draft_contract_terms_required_params() @responses.activate - def test_list_data_product_releases_value_error(self): + def test_get_published_data_product_draft_contract_terms_value_error(self): """ - test_list_data_product_releases_value_error() + test_get_published_data_product_draft_contract_terms_value_error() """ # Set up mock - url = preprocess_url('/data_product_exchange/v1/data_products/testString/releases') - mock_response = '{"limit": 200, "first": {"href": "https://api.example.com/collection"}, "next": {"href": "https://api.example.com/collection?start=eyJvZmZzZXQiOjAsImRvbmUiOnRydWV9", "start": "eyJvZmZzZXQiOjAsImRvbmUiOnRydWV9"}, "total_results": 200, "releases": [{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "associated_catalogs": ["associated_catalogs"]}}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}}]}' + url = preprocess_url('/data_product_exchange/v1/data_products/testString/releases/testString/contract_terms/testString') + mock_response = 'This is a mock binary response.' responses.add( responses.GET, url, body=mock_response, - content_type='application/json', + content_type='application/odcs+yaml', status=200, ) # Set up parameter values data_product_id = 'testString' + release_id = 'testString' + contract_terms_id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { "data_product_id": data_product_id, + "release_id": release_id, + "contract_terms_id": contract_terms_id, } for param in req_param_dict.keys(): req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): - _service.list_data_product_releases(**req_copy) + _service.get_published_data_product_draft_contract_terms(**req_copy) - def test_list_data_product_releases_value_error_with_retries(self): - # Enable retries and run test_list_data_product_releases_value_error. + def test_get_published_data_product_draft_contract_terms_value_error_with_retries(self): + # Enable retries and run test_get_published_data_product_draft_contract_terms_value_error. _service.enable_retries() - self.test_list_data_product_releases_value_error() + self.test_get_published_data_product_draft_contract_terms_value_error() - # Disable retries and run test_list_data_product_releases_value_error. + # Disable retries and run test_get_published_data_product_draft_contract_terms_value_error. _service.disable_retries() - self.test_list_data_product_releases_value_error() + self.test_get_published_data_product_draft_contract_terms_value_error() + + +class TestListDataProductReleases: + """ + Test Class for list_data_product_releases + """ @responses.activate - def test_list_data_product_releases_with_pager_get_next(self): + def test_list_data_product_releases_all_params(self): """ - test_list_data_product_releases_with_pager_get_next() + list_data_product_releases() """ - # Set up a two-page mock response + # Set up mock url = preprocess_url('/data_product_exchange/v1/data_products/testString/releases') - mock_response1 = '{"next":{"start":"1"},"total_count":2,"limit":1,"releases":[{"version":"1.0.0","state":"draft","data_product":{"id":"b38df608-d34b-4d58-8136-ed25e6c6684e","release":{"id":"18bdbde1-918e-4ecf-aa23-6727bf319e14"},"container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"name":"My Data Product","description":"This is a description of My Data Product.","tags":["tags"],"use_cases":[{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}}],"types":["data"],"contract_terms":[{"asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"id":"id","documents":[{"url":"url","type":"terms_and_conditions","name":"name","id":"2b0bf220-079c-11ee-be56-0242ac120002","attachment":{"id":"id"},"upload_url":"upload_url"}],"error_msg":"error_msg","overview":{"api_version":"v3.0.1","kind":"DataContract","name":"Sample Data Contract","version":"0.0.0","domain":{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"more_info":"List of links to sources that provide more details on the data contract."},"description":{"purpose":"Used for customer behavior analysis.","limitations":"Data cannot be used for marketing.","usage":"Data should be used only for analytics.","more_info":[{"type":"privacy-statement","url":"https://moreinfo.example.com"}],"custom_properties":"{\\"property1\\":\\"value1\\"}"},"organization":[{"user_id":"IBMid-691000IN4G","role":"owner"}],"roles":[{"role":"owner"}],"price":{"amount":"100.0","currency":"USD","unit":"megabyte"},"sla":[{"default_element":"Standard SLA Policy","properties":[{"property":"Uptime Guarantee","value":"99.9"}]}],"support_and_communication":[{"channel":"Email Support","url":"https://support.example.com"}],"custom_properties":[{"key":"customPropertyKey","value":"customPropertyValue"}],"contract_test":{"status":"pass","last_tested_time":"last_tested_time","message":"message"},"schema":[{"name":"name","description":"description","physical_type":"physical_type","properties":[{"name":"name","type":{"type":"type","length":"length","scale":"scale","nullable":"nullable","signed":"signed","native_type":"native_type"}}]}]}],"domain":{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"parts_out":[{"asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"},"type":"data_asset"},"delivery_methods":[{"id":"09cf5fcc-cb9d-4995-a8e4-16517b25229f","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"},"getproperties":{"producer_input":{"engine_details":{"display_name":"Iceberg Engine","engine_id":"presto767","engine_port":"34567","engine_host":"a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud","associated_catalogs":["associated_catalogs"]}}}}]}],"workflows":{"order_access_request":{"task_assignee_users":["task_assignee_users"],"pre_approved_users":["pre_approved_users"],"custom_workflow_definition":{"id":"18bdbde1-918e-4ecf-aa23-6727bf319e14"}}},"dataview_enabled":true,"comments":"Comments by a producer that are provided either at the time of data product version creation or retiring","access_control":{"owner":"IBMid-696000KYV9"},"last_updated_at":"2019-01-01T12:00:00.000Z","is_restricted":false,"id":"2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd","asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}}}]}' - mock_response2 = '{"total_count":2,"limit":1,"releases":[{"version":"1.0.0","state":"draft","data_product":{"id":"b38df608-d34b-4d58-8136-ed25e6c6684e","release":{"id":"18bdbde1-918e-4ecf-aa23-6727bf319e14"},"container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"name":"My Data Product","description":"This is a description of My Data Product.","tags":["tags"],"use_cases":[{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}}],"types":["data"],"contract_terms":[{"asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"id":"id","documents":[{"url":"url","type":"terms_and_conditions","name":"name","id":"2b0bf220-079c-11ee-be56-0242ac120002","attachment":{"id":"id"},"upload_url":"upload_url"}],"error_msg":"error_msg","overview":{"api_version":"v3.0.1","kind":"DataContract","name":"Sample Data Contract","version":"0.0.0","domain":{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"more_info":"List of links to sources that provide more details on the data contract."},"description":{"purpose":"Used for customer behavior analysis.","limitations":"Data cannot be used for marketing.","usage":"Data should be used only for analytics.","more_info":[{"type":"privacy-statement","url":"https://moreinfo.example.com"}],"custom_properties":"{\\"property1\\":\\"value1\\"}"},"organization":[{"user_id":"IBMid-691000IN4G","role":"owner"}],"roles":[{"role":"owner"}],"price":{"amount":"100.0","currency":"USD","unit":"megabyte"},"sla":[{"default_element":"Standard SLA Policy","properties":[{"property":"Uptime Guarantee","value":"99.9"}]}],"support_and_communication":[{"channel":"Email Support","url":"https://support.example.com"}],"custom_properties":[{"key":"customPropertyKey","value":"customPropertyValue"}],"contract_test":{"status":"pass","last_tested_time":"last_tested_time","message":"message"},"schema":[{"name":"name","description":"description","physical_type":"physical_type","properties":[{"name":"name","type":{"type":"type","length":"length","scale":"scale","nullable":"nullable","signed":"signed","native_type":"native_type"}}]}]}],"domain":{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"parts_out":[{"asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"},"type":"data_asset"},"delivery_methods":[{"id":"09cf5fcc-cb9d-4995-a8e4-16517b25229f","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"},"getproperties":{"producer_input":{"engine_details":{"display_name":"Iceberg Engine","engine_id":"presto767","engine_port":"34567","engine_host":"a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud","associated_catalogs":["associated_catalogs"]}}}}]}],"workflows":{"order_access_request":{"task_assignee_users":["task_assignee_users"],"pre_approved_users":["pre_approved_users"],"custom_workflow_definition":{"id":"18bdbde1-918e-4ecf-aa23-6727bf319e14"}}},"dataview_enabled":true,"comments":"Comments by a producer that are provided either at the time of data product version creation or retiring","access_control":{"owner":"IBMid-696000KYV9"},"last_updated_at":"2019-01-01T12:00:00.000Z","is_restricted":false,"id":"2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd","asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}}}]}' - responses.add( - responses.GET, - url, - body=mock_response1, - content_type='application/json', - status=200, - ) + mock_response = '{"limit": 200, "first": {"href": "https://api.example.com/collection"}, "next": {"href": "https://api.example.com/collection?start=eyJvZmZzZXQiOjAsImRvbmUiOnRydWV9", "start": "eyJvZmZzZXQiOjAsImRvbmUiOnRydWV9"}, "total_results": 200, "releases": [{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}, "engines": [{"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}]}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "sub_container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd"}, "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}}]}' responses.add( responses.GET, url, - body=mock_response2, + body=mock_response, content_type='application/json', status=200, ) - # Exercise the pager class for this operation - all_results = [] - pager = DataProductReleasesPager( - client=_service, - data_product_id='testString', - asset_container_id='testString', - state=['available'], - version='testString', - limit=10, + # Set up parameter values + data_product_id = 'testString' + asset_container_id = 'testString' + state = ['available'] + version = 'testString' + limit = 200 + start = 'testString' + + # Invoke method + response = _service.list_data_product_releases( + data_product_id, + asset_container_id=asset_container_id, + state=state, + version=version, + limit=limit, + start=start, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + # Validate query params + query_string = responses.calls[0].request.url.split('?', 1)[1] + query_string = urllib.parse.unquote_plus(query_string) + assert 'asset.container.id={}'.format(asset_container_id) in query_string + assert 'state={}'.format(','.join(state)) in query_string + assert 'version={}'.format(version) in query_string + assert 'limit={}'.format(limit) in query_string + assert 'start={}'.format(start) in query_string + + def test_list_data_product_releases_all_params_with_retries(self): + # Enable retries and run test_list_data_product_releases_all_params. + _service.enable_retries() + self.test_list_data_product_releases_all_params() + + # Disable retries and run test_list_data_product_releases_all_params. + _service.disable_retries() + self.test_list_data_product_releases_all_params() + + @responses.activate + def test_list_data_product_releases_required_params(self): + """ + test_list_data_product_releases_required_params() + """ + # Set up mock + url = preprocess_url('/data_product_exchange/v1/data_products/testString/releases') + mock_response = '{"limit": 200, "first": {"href": "https://api.example.com/collection"}, "next": {"href": "https://api.example.com/collection?start=eyJvZmZzZXQiOjAsImRvbmUiOnRydWV9", "start": "eyJvZmZzZXQiOjAsImRvbmUiOnRydWV9"}, "total_results": 200, "releases": [{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}, "engines": [{"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}]}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "sub_container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd"}, "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}}]}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + data_product_id = 'testString' + + # Invoke method + response = _service.list_data_product_releases( + data_product_id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_list_data_product_releases_required_params_with_retries(self): + # Enable retries and run test_list_data_product_releases_required_params. + _service.enable_retries() + self.test_list_data_product_releases_required_params() + + # Disable retries and run test_list_data_product_releases_required_params. + _service.disable_retries() + self.test_list_data_product_releases_required_params() + + @responses.activate + def test_list_data_product_releases_value_error(self): + """ + test_list_data_product_releases_value_error() + """ + # Set up mock + url = preprocess_url('/data_product_exchange/v1/data_products/testString/releases') + mock_response = '{"limit": 200, "first": {"href": "https://api.example.com/collection"}, "next": {"href": "https://api.example.com/collection?start=eyJvZmZzZXQiOjAsImRvbmUiOnRydWV9", "start": "eyJvZmZzZXQiOjAsImRvbmUiOnRydWV9"}, "total_results": 200, "releases": [{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}, "engines": [{"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}]}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "sub_container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd"}, "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}}]}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + data_product_id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "data_product_id": data_product_id, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.list_data_product_releases(**req_copy) + + def test_list_data_product_releases_value_error_with_retries(self): + # Enable retries and run test_list_data_product_releases_value_error. + _service.enable_retries() + self.test_list_data_product_releases_value_error() + + # Disable retries and run test_list_data_product_releases_value_error. + _service.disable_retries() + self.test_list_data_product_releases_value_error() + + @responses.activate + def test_list_data_product_releases_with_pager_get_next(self): + """ + test_list_data_product_releases_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/data_product_exchange/v1/data_products/testString/releases') + mock_response1 = '{"next":{"start":"1"},"total_count":2,"limit":1,"releases":[{"version":"1.0.0","state":"draft","data_product":{"id":"b38df608-d34b-4d58-8136-ed25e6c6684e","release":{"id":"18bdbde1-918e-4ecf-aa23-6727bf319e14"},"container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"name":"My Data Product","description":"This is a description of My Data Product.","tags":["tags"],"use_cases":[{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}}],"types":["data"],"contract_terms":[{"asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"id":"id","documents":[{"url":"url","type":"terms_and_conditions","name":"name","id":"2b0bf220-079c-11ee-be56-0242ac120002","attachment":{"id":"id"},"upload_url":"upload_url"}],"error_msg":"error_msg","overview":{"api_version":"v3.0.1","kind":"DataContract","name":"Sample Data Contract","version":"0.0.0","domain":{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"more_info":"List of links to sources that provide more details on the data contract."},"description":{"purpose":"Used for customer behavior analysis.","limitations":"Data cannot be used for marketing.","usage":"Data should be used only for analytics.","more_info":[{"type":"privacy-statement","url":"https://moreinfo.example.com"}],"custom_properties":"{\\"property1\\":\\"value1\\"}"},"organization":[{"user_id":"IBMid-691000IN4G","role":"owner"}],"roles":[{"role":"owner"}],"price":{"amount":"100.0","currency":"USD","unit":"megabyte"},"sla":[{"default_element":"Standard SLA Policy","properties":[{"property":"Uptime Guarantee","value":"99.9"}]}],"support_and_communication":[{"channel":"Email Support","url":"https://support.example.com"}],"custom_properties":[{"key":"customPropertyKey","value":"customPropertyValue"}],"contract_test":{"status":"pass","last_tested_time":"last_tested_time","message":"message"},"servers":[{"server":"server","asset":{"id":"id","name":"name"},"connection_id":"connection_id","type":"type","description":"description","environment":"environment","account":"account","catalog":"catalog","database":"database","dataset":"dataset","delimiter":"delimiter","endpoint_url":"endpoint_url","format":"format","host":"host","location":"location","path":"path","port":"port","project":"project","region":"region","region_name":"region_name","schema":"schema","service_name":"service_name","staging_dir":"staging_dir","stream":"stream","warehouse":"warehouse","roles":["roles"],"custom_properties":[{"key":"customPropertyKey","value":"customPropertyValue"}]}],"schema":[{"asset_id":"2b0bf220-079c-11ee-be56-0242ac120002","connection_id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","description":"description","connection_path":"connection_path","physical_type":"physical_type","properties":[{"name":"name","type":{"type":"type","length":"length","scale":"scale","nullable":"nullable","signed":"signed","native_type":"native_type"},"quality":[{"type":"sql","description":"description","rule":"rule","implementation":"implementation","engine":"engine","must_be_less_than":"must_be_less_than","must_be_less_or_equal_to":"must_be_less_or_equal_to","must_be_greater_than":"must_be_greater_than","must_be_greater_or_equal_to":"must_be_greater_or_equal_to","must_be_between":["must_be_between"],"must_not_be_between":["must_not_be_between"],"must_be":"must_be","must_not_be":"must_not_be","name":"name","unit":"unit","query":"query"}]}],"quality":[{"type":"sql","description":"description","rule":"rule","implementation":"implementation","engine":"engine","must_be_less_than":"must_be_less_than","must_be_less_or_equal_to":"must_be_less_or_equal_to","must_be_greater_than":"must_be_greater_than","must_be_greater_or_equal_to":"must_be_greater_or_equal_to","must_be_between":["must_be_between"],"must_not_be_between":["must_not_be_between"],"must_be":"must_be","must_not_be":"must_not_be","name":"name","unit":"unit","query":"query"}]}]}],"domain":{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"parts_out":[{"asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"},"type":"data_asset"},"delivery_methods":[{"id":"09cf5fcc-cb9d-4995-a8e4-16517b25229f","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"},"getproperties":{"producer_input":{"engine_details":{"display_name":"Iceberg Engine","engine_id":"presto767","engine_port":"34567","engine_host":"a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud","engine_type":"spark","associated_catalogs":["associated_catalogs"]},"engines":[{"display_name":"Iceberg Engine","engine_id":"presto767","engine_port":"34567","engine_host":"a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud","engine_type":"spark","associated_catalogs":["associated_catalogs"]}]}}}]}],"workflows":{"order_access_request":{"task_assignee_users":["task_assignee_users"],"pre_approved_users":["pre_approved_users"],"custom_workflow_definition":{"id":"18bdbde1-918e-4ecf-aa23-6727bf319e14"}}},"dataview_enabled":true,"comments":"Comments by a producer that are provided either at the time of data product version creation or retiring","access_control":{"owner":"IBMid-696000KYV9"},"last_updated_at":"2019-01-01T12:00:00.000Z","sub_container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd"},"is_restricted":false,"id":"2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd","asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}}}]}' + mock_response2 = '{"total_count":2,"limit":1,"releases":[{"version":"1.0.0","state":"draft","data_product":{"id":"b38df608-d34b-4d58-8136-ed25e6c6684e","release":{"id":"18bdbde1-918e-4ecf-aa23-6727bf319e14"},"container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"name":"My Data Product","description":"This is a description of My Data Product.","tags":["tags"],"use_cases":[{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}}],"types":["data"],"contract_terms":[{"asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"id":"id","documents":[{"url":"url","type":"terms_and_conditions","name":"name","id":"2b0bf220-079c-11ee-be56-0242ac120002","attachment":{"id":"id"},"upload_url":"upload_url"}],"error_msg":"error_msg","overview":{"api_version":"v3.0.1","kind":"DataContract","name":"Sample Data Contract","version":"0.0.0","domain":{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"more_info":"List of links to sources that provide more details on the data contract."},"description":{"purpose":"Used for customer behavior analysis.","limitations":"Data cannot be used for marketing.","usage":"Data should be used only for analytics.","more_info":[{"type":"privacy-statement","url":"https://moreinfo.example.com"}],"custom_properties":"{\\"property1\\":\\"value1\\"}"},"organization":[{"user_id":"IBMid-691000IN4G","role":"owner"}],"roles":[{"role":"owner"}],"price":{"amount":"100.0","currency":"USD","unit":"megabyte"},"sla":[{"default_element":"Standard SLA Policy","properties":[{"property":"Uptime Guarantee","value":"99.9"}]}],"support_and_communication":[{"channel":"Email Support","url":"https://support.example.com"}],"custom_properties":[{"key":"customPropertyKey","value":"customPropertyValue"}],"contract_test":{"status":"pass","last_tested_time":"last_tested_time","message":"message"},"servers":[{"server":"server","asset":{"id":"id","name":"name"},"connection_id":"connection_id","type":"type","description":"description","environment":"environment","account":"account","catalog":"catalog","database":"database","dataset":"dataset","delimiter":"delimiter","endpoint_url":"endpoint_url","format":"format","host":"host","location":"location","path":"path","port":"port","project":"project","region":"region","region_name":"region_name","schema":"schema","service_name":"service_name","staging_dir":"staging_dir","stream":"stream","warehouse":"warehouse","roles":["roles"],"custom_properties":[{"key":"customPropertyKey","value":"customPropertyValue"}]}],"schema":[{"asset_id":"2b0bf220-079c-11ee-be56-0242ac120002","connection_id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","description":"description","connection_path":"connection_path","physical_type":"physical_type","properties":[{"name":"name","type":{"type":"type","length":"length","scale":"scale","nullable":"nullable","signed":"signed","native_type":"native_type"},"quality":[{"type":"sql","description":"description","rule":"rule","implementation":"implementation","engine":"engine","must_be_less_than":"must_be_less_than","must_be_less_or_equal_to":"must_be_less_or_equal_to","must_be_greater_than":"must_be_greater_than","must_be_greater_or_equal_to":"must_be_greater_or_equal_to","must_be_between":["must_be_between"],"must_not_be_between":["must_not_be_between"],"must_be":"must_be","must_not_be":"must_not_be","name":"name","unit":"unit","query":"query"}]}],"quality":[{"type":"sql","description":"description","rule":"rule","implementation":"implementation","engine":"engine","must_be_less_than":"must_be_less_than","must_be_less_or_equal_to":"must_be_less_or_equal_to","must_be_greater_than":"must_be_greater_than","must_be_greater_or_equal_to":"must_be_greater_or_equal_to","must_be_between":["must_be_between"],"must_not_be_between":["must_not_be_between"],"must_be":"must_be","must_not_be":"must_not_be","name":"name","unit":"unit","query":"query"}]}]}],"domain":{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"parts_out":[{"asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"},"type":"data_asset"},"delivery_methods":[{"id":"09cf5fcc-cb9d-4995-a8e4-16517b25229f","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"},"getproperties":{"producer_input":{"engine_details":{"display_name":"Iceberg Engine","engine_id":"presto767","engine_port":"34567","engine_host":"a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud","engine_type":"spark","associated_catalogs":["associated_catalogs"]},"engines":[{"display_name":"Iceberg Engine","engine_id":"presto767","engine_port":"34567","engine_host":"a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud","engine_type":"spark","associated_catalogs":["associated_catalogs"]}]}}}]}],"workflows":{"order_access_request":{"task_assignee_users":["task_assignee_users"],"pre_approved_users":["pre_approved_users"],"custom_workflow_definition":{"id":"18bdbde1-918e-4ecf-aa23-6727bf319e14"}}},"dataview_enabled":true,"comments":"Comments by a producer that are provided either at the time of data product version creation or retiring","access_control":{"owner":"IBMid-696000KYV9"},"last_updated_at":"2019-01-01T12:00:00.000Z","sub_container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd"},"is_restricted":false,"id":"2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd","asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}}}]}' + responses.add( + responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200, + ) + responses.add( + responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200, + ) + + # Exercise the pager class for this operation + all_results = [] + pager = DataProductReleasesPager( + client=_service, + data_product_id='testString', + asset_container_id='testString', + state=['available'], + version='testString', + limit=10, ) while pager.has_next(): next_page = pager.get_next() @@ -4419,8 +5160,8 @@ def test_list_data_product_releases_with_pager_get_all(self): """ # Set up a two-page mock response url = preprocess_url('/data_product_exchange/v1/data_products/testString/releases') - mock_response1 = '{"next":{"start":"1"},"total_count":2,"limit":1,"releases":[{"version":"1.0.0","state":"draft","data_product":{"id":"b38df608-d34b-4d58-8136-ed25e6c6684e","release":{"id":"18bdbde1-918e-4ecf-aa23-6727bf319e14"},"container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"name":"My Data Product","description":"This is a description of My Data Product.","tags":["tags"],"use_cases":[{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}}],"types":["data"],"contract_terms":[{"asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"id":"id","documents":[{"url":"url","type":"terms_and_conditions","name":"name","id":"2b0bf220-079c-11ee-be56-0242ac120002","attachment":{"id":"id"},"upload_url":"upload_url"}],"error_msg":"error_msg","overview":{"api_version":"v3.0.1","kind":"DataContract","name":"Sample Data Contract","version":"0.0.0","domain":{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"more_info":"List of links to sources that provide more details on the data contract."},"description":{"purpose":"Used for customer behavior analysis.","limitations":"Data cannot be used for marketing.","usage":"Data should be used only for analytics.","more_info":[{"type":"privacy-statement","url":"https://moreinfo.example.com"}],"custom_properties":"{\\"property1\\":\\"value1\\"}"},"organization":[{"user_id":"IBMid-691000IN4G","role":"owner"}],"roles":[{"role":"owner"}],"price":{"amount":"100.0","currency":"USD","unit":"megabyte"},"sla":[{"default_element":"Standard SLA Policy","properties":[{"property":"Uptime Guarantee","value":"99.9"}]}],"support_and_communication":[{"channel":"Email Support","url":"https://support.example.com"}],"custom_properties":[{"key":"customPropertyKey","value":"customPropertyValue"}],"contract_test":{"status":"pass","last_tested_time":"last_tested_time","message":"message"},"schema":[{"name":"name","description":"description","physical_type":"physical_type","properties":[{"name":"name","type":{"type":"type","length":"length","scale":"scale","nullable":"nullable","signed":"signed","native_type":"native_type"}}]}]}],"domain":{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"parts_out":[{"asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"},"type":"data_asset"},"delivery_methods":[{"id":"09cf5fcc-cb9d-4995-a8e4-16517b25229f","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"},"getproperties":{"producer_input":{"engine_details":{"display_name":"Iceberg Engine","engine_id":"presto767","engine_port":"34567","engine_host":"a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud","associated_catalogs":["associated_catalogs"]}}}}]}],"workflows":{"order_access_request":{"task_assignee_users":["task_assignee_users"],"pre_approved_users":["pre_approved_users"],"custom_workflow_definition":{"id":"18bdbde1-918e-4ecf-aa23-6727bf319e14"}}},"dataview_enabled":true,"comments":"Comments by a producer that are provided either at the time of data product version creation or retiring","access_control":{"owner":"IBMid-696000KYV9"},"last_updated_at":"2019-01-01T12:00:00.000Z","is_restricted":false,"id":"2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd","asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}}}]}' - mock_response2 = '{"total_count":2,"limit":1,"releases":[{"version":"1.0.0","state":"draft","data_product":{"id":"b38df608-d34b-4d58-8136-ed25e6c6684e","release":{"id":"18bdbde1-918e-4ecf-aa23-6727bf319e14"},"container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"name":"My Data Product","description":"This is a description of My Data Product.","tags":["tags"],"use_cases":[{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}}],"types":["data"],"contract_terms":[{"asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"id":"id","documents":[{"url":"url","type":"terms_and_conditions","name":"name","id":"2b0bf220-079c-11ee-be56-0242ac120002","attachment":{"id":"id"},"upload_url":"upload_url"}],"error_msg":"error_msg","overview":{"api_version":"v3.0.1","kind":"DataContract","name":"Sample Data Contract","version":"0.0.0","domain":{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"more_info":"List of links to sources that provide more details on the data contract."},"description":{"purpose":"Used for customer behavior analysis.","limitations":"Data cannot be used for marketing.","usage":"Data should be used only for analytics.","more_info":[{"type":"privacy-statement","url":"https://moreinfo.example.com"}],"custom_properties":"{\\"property1\\":\\"value1\\"}"},"organization":[{"user_id":"IBMid-691000IN4G","role":"owner"}],"roles":[{"role":"owner"}],"price":{"amount":"100.0","currency":"USD","unit":"megabyte"},"sla":[{"default_element":"Standard SLA Policy","properties":[{"property":"Uptime Guarantee","value":"99.9"}]}],"support_and_communication":[{"channel":"Email Support","url":"https://support.example.com"}],"custom_properties":[{"key":"customPropertyKey","value":"customPropertyValue"}],"contract_test":{"status":"pass","last_tested_time":"last_tested_time","message":"message"},"schema":[{"name":"name","description":"description","physical_type":"physical_type","properties":[{"name":"name","type":{"type":"type","length":"length","scale":"scale","nullable":"nullable","signed":"signed","native_type":"native_type"}}]}]}],"domain":{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"parts_out":[{"asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"},"type":"data_asset"},"delivery_methods":[{"id":"09cf5fcc-cb9d-4995-a8e4-16517b25229f","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"},"getproperties":{"producer_input":{"engine_details":{"display_name":"Iceberg Engine","engine_id":"presto767","engine_port":"34567","engine_host":"a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud","associated_catalogs":["associated_catalogs"]}}}}]}],"workflows":{"order_access_request":{"task_assignee_users":["task_assignee_users"],"pre_approved_users":["pre_approved_users"],"custom_workflow_definition":{"id":"18bdbde1-918e-4ecf-aa23-6727bf319e14"}}},"dataview_enabled":true,"comments":"Comments by a producer that are provided either at the time of data product version creation or retiring","access_control":{"owner":"IBMid-696000KYV9"},"last_updated_at":"2019-01-01T12:00:00.000Z","is_restricted":false,"id":"2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd","asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}}}]}' + mock_response1 = '{"next":{"start":"1"},"total_count":2,"limit":1,"releases":[{"version":"1.0.0","state":"draft","data_product":{"id":"b38df608-d34b-4d58-8136-ed25e6c6684e","release":{"id":"18bdbde1-918e-4ecf-aa23-6727bf319e14"},"container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"name":"My Data Product","description":"This is a description of My Data Product.","tags":["tags"],"use_cases":[{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}}],"types":["data"],"contract_terms":[{"asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"id":"id","documents":[{"url":"url","type":"terms_and_conditions","name":"name","id":"2b0bf220-079c-11ee-be56-0242ac120002","attachment":{"id":"id"},"upload_url":"upload_url"}],"error_msg":"error_msg","overview":{"api_version":"v3.0.1","kind":"DataContract","name":"Sample Data Contract","version":"0.0.0","domain":{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"more_info":"List of links to sources that provide more details on the data contract."},"description":{"purpose":"Used for customer behavior analysis.","limitations":"Data cannot be used for marketing.","usage":"Data should be used only for analytics.","more_info":[{"type":"privacy-statement","url":"https://moreinfo.example.com"}],"custom_properties":"{\\"property1\\":\\"value1\\"}"},"organization":[{"user_id":"IBMid-691000IN4G","role":"owner"}],"roles":[{"role":"owner"}],"price":{"amount":"100.0","currency":"USD","unit":"megabyte"},"sla":[{"default_element":"Standard SLA Policy","properties":[{"property":"Uptime Guarantee","value":"99.9"}]}],"support_and_communication":[{"channel":"Email Support","url":"https://support.example.com"}],"custom_properties":[{"key":"customPropertyKey","value":"customPropertyValue"}],"contract_test":{"status":"pass","last_tested_time":"last_tested_time","message":"message"},"servers":[{"server":"server","asset":{"id":"id","name":"name"},"connection_id":"connection_id","type":"type","description":"description","environment":"environment","account":"account","catalog":"catalog","database":"database","dataset":"dataset","delimiter":"delimiter","endpoint_url":"endpoint_url","format":"format","host":"host","location":"location","path":"path","port":"port","project":"project","region":"region","region_name":"region_name","schema":"schema","service_name":"service_name","staging_dir":"staging_dir","stream":"stream","warehouse":"warehouse","roles":["roles"],"custom_properties":[{"key":"customPropertyKey","value":"customPropertyValue"}]}],"schema":[{"asset_id":"2b0bf220-079c-11ee-be56-0242ac120002","connection_id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","description":"description","connection_path":"connection_path","physical_type":"physical_type","properties":[{"name":"name","type":{"type":"type","length":"length","scale":"scale","nullable":"nullable","signed":"signed","native_type":"native_type"},"quality":[{"type":"sql","description":"description","rule":"rule","implementation":"implementation","engine":"engine","must_be_less_than":"must_be_less_than","must_be_less_or_equal_to":"must_be_less_or_equal_to","must_be_greater_than":"must_be_greater_than","must_be_greater_or_equal_to":"must_be_greater_or_equal_to","must_be_between":["must_be_between"],"must_not_be_between":["must_not_be_between"],"must_be":"must_be","must_not_be":"must_not_be","name":"name","unit":"unit","query":"query"}]}],"quality":[{"type":"sql","description":"description","rule":"rule","implementation":"implementation","engine":"engine","must_be_less_than":"must_be_less_than","must_be_less_or_equal_to":"must_be_less_or_equal_to","must_be_greater_than":"must_be_greater_than","must_be_greater_or_equal_to":"must_be_greater_or_equal_to","must_be_between":["must_be_between"],"must_not_be_between":["must_not_be_between"],"must_be":"must_be","must_not_be":"must_not_be","name":"name","unit":"unit","query":"query"}]}]}],"domain":{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"parts_out":[{"asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"},"type":"data_asset"},"delivery_methods":[{"id":"09cf5fcc-cb9d-4995-a8e4-16517b25229f","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"},"getproperties":{"producer_input":{"engine_details":{"display_name":"Iceberg Engine","engine_id":"presto767","engine_port":"34567","engine_host":"a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud","engine_type":"spark","associated_catalogs":["associated_catalogs"]},"engines":[{"display_name":"Iceberg Engine","engine_id":"presto767","engine_port":"34567","engine_host":"a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud","engine_type":"spark","associated_catalogs":["associated_catalogs"]}]}}}]}],"workflows":{"order_access_request":{"task_assignee_users":["task_assignee_users"],"pre_approved_users":["pre_approved_users"],"custom_workflow_definition":{"id":"18bdbde1-918e-4ecf-aa23-6727bf319e14"}}},"dataview_enabled":true,"comments":"Comments by a producer that are provided either at the time of data product version creation or retiring","access_control":{"owner":"IBMid-696000KYV9"},"last_updated_at":"2019-01-01T12:00:00.000Z","sub_container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd"},"is_restricted":false,"id":"2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd","asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}}}]}' + mock_response2 = '{"total_count":2,"limit":1,"releases":[{"version":"1.0.0","state":"draft","data_product":{"id":"b38df608-d34b-4d58-8136-ed25e6c6684e","release":{"id":"18bdbde1-918e-4ecf-aa23-6727bf319e14"},"container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"name":"My Data Product","description":"This is a description of My Data Product.","tags":["tags"],"use_cases":[{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}}],"types":["data"],"contract_terms":[{"asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"id":"id","documents":[{"url":"url","type":"terms_and_conditions","name":"name","id":"2b0bf220-079c-11ee-be56-0242ac120002","attachment":{"id":"id"},"upload_url":"upload_url"}],"error_msg":"error_msg","overview":{"api_version":"v3.0.1","kind":"DataContract","name":"Sample Data Contract","version":"0.0.0","domain":{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"more_info":"List of links to sources that provide more details on the data contract."},"description":{"purpose":"Used for customer behavior analysis.","limitations":"Data cannot be used for marketing.","usage":"Data should be used only for analytics.","more_info":[{"type":"privacy-statement","url":"https://moreinfo.example.com"}],"custom_properties":"{\\"property1\\":\\"value1\\"}"},"organization":[{"user_id":"IBMid-691000IN4G","role":"owner"}],"roles":[{"role":"owner"}],"price":{"amount":"100.0","currency":"USD","unit":"megabyte"},"sla":[{"default_element":"Standard SLA Policy","properties":[{"property":"Uptime Guarantee","value":"99.9"}]}],"support_and_communication":[{"channel":"Email Support","url":"https://support.example.com"}],"custom_properties":[{"key":"customPropertyKey","value":"customPropertyValue"}],"contract_test":{"status":"pass","last_tested_time":"last_tested_time","message":"message"},"servers":[{"server":"server","asset":{"id":"id","name":"name"},"connection_id":"connection_id","type":"type","description":"description","environment":"environment","account":"account","catalog":"catalog","database":"database","dataset":"dataset","delimiter":"delimiter","endpoint_url":"endpoint_url","format":"format","host":"host","location":"location","path":"path","port":"port","project":"project","region":"region","region_name":"region_name","schema":"schema","service_name":"service_name","staging_dir":"staging_dir","stream":"stream","warehouse":"warehouse","roles":["roles"],"custom_properties":[{"key":"customPropertyKey","value":"customPropertyValue"}]}],"schema":[{"asset_id":"2b0bf220-079c-11ee-be56-0242ac120002","connection_id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","description":"description","connection_path":"connection_path","physical_type":"physical_type","properties":[{"name":"name","type":{"type":"type","length":"length","scale":"scale","nullable":"nullable","signed":"signed","native_type":"native_type"},"quality":[{"type":"sql","description":"description","rule":"rule","implementation":"implementation","engine":"engine","must_be_less_than":"must_be_less_than","must_be_less_or_equal_to":"must_be_less_or_equal_to","must_be_greater_than":"must_be_greater_than","must_be_greater_or_equal_to":"must_be_greater_or_equal_to","must_be_between":["must_be_between"],"must_not_be_between":["must_not_be_between"],"must_be":"must_be","must_not_be":"must_not_be","name":"name","unit":"unit","query":"query"}]}],"quality":[{"type":"sql","description":"description","rule":"rule","implementation":"implementation","engine":"engine","must_be_less_than":"must_be_less_than","must_be_less_or_equal_to":"must_be_less_or_equal_to","must_be_greater_than":"must_be_greater_than","must_be_greater_or_equal_to":"must_be_greater_or_equal_to","must_be_between":["must_be_between"],"must_not_be_between":["must_not_be_between"],"must_be":"must_be","must_not_be":"must_not_be","name":"name","unit":"unit","query":"query"}]}]}],"domain":{"id":"id","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}},"parts_out":[{"asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"},"type":"data_asset"},"delivery_methods":[{"id":"09cf5fcc-cb9d-4995-a8e4-16517b25229f","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"},"getproperties":{"producer_input":{"engine_details":{"display_name":"Iceberg Engine","engine_id":"presto767","engine_port":"34567","engine_host":"a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud","engine_type":"spark","associated_catalogs":["associated_catalogs"]},"engines":[{"display_name":"Iceberg Engine","engine_id":"presto767","engine_port":"34567","engine_host":"a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud","engine_type":"spark","associated_catalogs":["associated_catalogs"]}]}}}]}],"workflows":{"order_access_request":{"task_assignee_users":["task_assignee_users"],"pre_approved_users":["pre_approved_users"],"custom_workflow_definition":{"id":"18bdbde1-918e-4ecf-aa23-6727bf319e14"}}},"dataview_enabled":true,"comments":"Comments by a producer that are provided either at the time of data product version creation or retiring","access_control":{"owner":"IBMid-696000KYV9"},"last_updated_at":"2019-01-01T12:00:00.000Z","sub_container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd"},"is_restricted":false,"id":"2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd","asset":{"id":"2b0bf220-079c-11ee-be56-0242ac120002","name":"name","container":{"id":"d29c42eb-7100-4b7a-8257-c196dbcca1cd","type":"catalog"}}}]}' responses.add( responses.GET, url, @@ -4462,7 +5203,7 @@ def test_retire_data_product_release_all_params(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/data_products/testString/releases/testString/retire') - mock_response = '{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "associated_catalogs": ["associated_catalogs"]}}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "published_by": "published_by", "published_at": "2019-01-01T12:00:00.000Z", "created_by": "created_by", "created_at": "2019-01-01T12:00:00.000Z", "properties": {"anyKey": "anyValue"}, "visualization_errors": [{"visualization": {"id": "id", "name": "name"}, "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "related_asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "error": {"code": "code", "message": "message"}}]}' + mock_response = '{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}, "engines": [{"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}]}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "sub_container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd"}, "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "published_by": "published_by", "published_at": "2019-01-01T12:00:00.000Z", "created_by": "created_by", "created_at": "2019-01-01T12:00:00.000Z", "properties": {"anyKey": "anyValue"}, "visualization_errors": [{"visualization": {"id": "id", "name": "name"}, "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "related_asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "error": {"code": "code", "message": "message"}}]}' responses.add( responses.POST, url, @@ -4475,12 +5216,14 @@ def test_retire_data_product_release_all_params(self): data_product_id = 'testString' release_id = 'testString' revoke_access = False + start_at = 'testString' # Invoke method response = _service.retire_data_product_release( data_product_id, release_id, revoke_access=revoke_access, + start_at=start_at, headers={}, ) @@ -4491,6 +5234,7 @@ def test_retire_data_product_release_all_params(self): query_string = responses.calls[0].request.url.split('?', 1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'revoke_access={}'.format('true' if revoke_access else 'false') in query_string + assert 'start_at={}'.format(start_at) in query_string def test_retire_data_product_release_all_params_with_retries(self): # Enable retries and run test_retire_data_product_release_all_params. @@ -4508,7 +5252,7 @@ def test_retire_data_product_release_required_params(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/data_products/testString/releases/testString/retire') - mock_response = '{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "associated_catalogs": ["associated_catalogs"]}}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "published_by": "published_by", "published_at": "2019-01-01T12:00:00.000Z", "created_by": "created_by", "created_at": "2019-01-01T12:00:00.000Z", "properties": {"anyKey": "anyValue"}, "visualization_errors": [{"visualization": {"id": "id", "name": "name"}, "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "related_asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "error": {"code": "code", "message": "message"}}]}' + mock_response = '{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}, "engines": [{"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}]}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "sub_container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd"}, "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "published_by": "published_by", "published_at": "2019-01-01T12:00:00.000Z", "created_by": "created_by", "created_at": "2019-01-01T12:00:00.000Z", "properties": {"anyKey": "anyValue"}, "visualization_errors": [{"visualization": {"id": "id", "name": "name"}, "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "related_asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "error": {"code": "code", "message": "message"}}]}' responses.add( responses.POST, url, @@ -4548,7 +5292,7 @@ def test_retire_data_product_release_value_error(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/data_products/testString/releases/testString/retire') - mock_response = '{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "associated_catalogs": ["associated_catalogs"]}}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "published_by": "published_by", "published_at": "2019-01-01T12:00:00.000Z", "created_by": "created_by", "created_at": "2019-01-01T12:00:00.000Z", "properties": {"anyKey": "anyValue"}, "visualization_errors": [{"visualization": {"id": "id", "name": "name"}, "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "related_asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "error": {"code": "code", "message": "message"}}]}' + mock_response = '{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}, "engines": [{"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}]}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "sub_container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd"}, "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "published_by": "published_by", "published_at": "2019-01-01T12:00:00.000Z", "created_by": "created_by", "created_at": "2019-01-01T12:00:00.000Z", "properties": {"anyKey": "anyValue"}, "visualization_errors": [{"visualization": {"id": "id", "name": "name"}, "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "related_asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "error": {"code": "code", "message": "message"}}]}' responses.add( responses.POST, url, @@ -4581,6 +5325,136 @@ def test_retire_data_product_release_value_error_with_retries(self): self.test_retire_data_product_release_value_error() +class TestCreateRevokeAccessProcess: + """ + Test Class for create_revoke_access_process + """ + + @responses.activate + def test_create_revoke_access_process_all_params(self): + """ + create_revoke_access_process() + """ + # Set up mock + url = preprocess_url('/data_product_exchange/v1/data_products/testString/releases/testString/revoke_access') + mock_response = '{"message": "message"}' + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=202, + ) + + # Set up parameter values + data_product_id = 'testString' + release_id = 'testString' + body = io.BytesIO(b'This is a mock file.').getvalue() + content_type = 'testString' + + # Invoke method + response = _service.create_revoke_access_process( + data_product_id, + release_id, + body=body, + content_type=content_type, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 202 + # Validate body params + + def test_create_revoke_access_process_all_params_with_retries(self): + # Enable retries and run test_create_revoke_access_process_all_params. + _service.enable_retries() + self.test_create_revoke_access_process_all_params() + + # Disable retries and run test_create_revoke_access_process_all_params. + _service.disable_retries() + self.test_create_revoke_access_process_all_params() + + @responses.activate + def test_create_revoke_access_process_required_params(self): + """ + test_create_revoke_access_process_required_params() + """ + # Set up mock + url = preprocess_url('/data_product_exchange/v1/data_products/testString/releases/testString/revoke_access') + mock_response = '{"message": "message"}' + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=202, + ) + + # Set up parameter values + data_product_id = 'testString' + release_id = 'testString' + + # Invoke method + response = _service.create_revoke_access_process( + data_product_id, + release_id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 202 + + def test_create_revoke_access_process_required_params_with_retries(self): + # Enable retries and run test_create_revoke_access_process_required_params. + _service.enable_retries() + self.test_create_revoke_access_process_required_params() + + # Disable retries and run test_create_revoke_access_process_required_params. + _service.disable_retries() + self.test_create_revoke_access_process_required_params() + + @responses.activate + def test_create_revoke_access_process_value_error(self): + """ + test_create_revoke_access_process_value_error() + """ + # Set up mock + url = preprocess_url('/data_product_exchange/v1/data_products/testString/releases/testString/revoke_access') + mock_response = '{"message": "message"}' + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=202, + ) + + # Set up parameter values + data_product_id = 'testString' + release_id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "data_product_id": data_product_id, + "release_id": release_id, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.create_revoke_access_process(**req_copy) + + def test_create_revoke_access_process_value_error_with_retries(self): + # Enable retries and run test_create_revoke_access_process_value_error. + _service.enable_retries() + self.test_create_revoke_access_process_value_error() + + # Disable retries and run test_create_revoke_access_process_value_error. + _service.disable_retries() + self.test_create_revoke_access_process_value_error() + + # endregion ############################################################################## # End of Service: DataProductReleases @@ -4632,7 +5506,7 @@ def test_list_data_product_contract_template_all_params(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/contract_templates') - mock_response = '{"contract_templates": [{"container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "id": "20aa7c97-cfcc-4d16-ae76-2ca1847ce733", "name": "Sample Data Contract Template", "error": {"code": "code", "message": "message"}, "contract_terms": {"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}}]}' + mock_response = '{"contract_templates": [{"container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "id": "20aa7c97-cfcc-4d16-ae76-2ca1847ce733", "creator_id": "IBMid-123456ABC", "created_at": "2025-06-26T12:30:20.000Z", "name": "Sample Data Contract Template", "error": {"code": "code", "message": "message"}, "contract_terms": {"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}}]}' responses.add( responses.GET, url, @@ -4644,11 +5518,13 @@ def test_list_data_product_contract_template_all_params(self): # Set up parameter values container_id = 'testString' contract_template_name = 'testString' + domain_ids = 'testString' # Invoke method response = _service.list_data_product_contract_template( container_id=container_id, contract_template_name=contract_template_name, + domain_ids=domain_ids, headers={}, ) @@ -4660,6 +5536,7 @@ def test_list_data_product_contract_template_all_params(self): query_string = urllib.parse.unquote_plus(query_string) assert 'container.id={}'.format(container_id) in query_string assert 'contract_template.name={}'.format(contract_template_name) in query_string + assert 'domain.ids={}'.format(domain_ids) in query_string def test_list_data_product_contract_template_all_params_with_retries(self): # Enable retries and run test_list_data_product_contract_template_all_params. @@ -4677,7 +5554,7 @@ def test_list_data_product_contract_template_required_params(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/contract_templates') - mock_response = '{"contract_templates": [{"container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "id": "20aa7c97-cfcc-4d16-ae76-2ca1847ce733", "name": "Sample Data Contract Template", "error": {"code": "code", "message": "message"}, "contract_terms": {"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}}]}' + mock_response = '{"contract_templates": [{"container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "id": "20aa7c97-cfcc-4d16-ae76-2ca1847ce733", "creator_id": "IBMid-123456ABC", "created_at": "2025-06-26T12:30:20.000Z", "name": "Sample Data Contract Template", "error": {"code": "code", "message": "message"}, "contract_terms": {"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}}]}' responses.add( responses.GET, url, @@ -4715,7 +5592,7 @@ def test_create_contract_template_all_params(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/contract_templates') - mock_response = '{"container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "id": "20aa7c97-cfcc-4d16-ae76-2ca1847ce733", "name": "Sample Data Contract Template", "error": {"code": "code", "message": "message"}, "contract_terms": {"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}}' + mock_response = '{"container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "id": "20aa7c97-cfcc-4d16-ae76-2ca1847ce733", "creator_id": "IBMid-123456ABC", "created_at": "2025-06-26T12:30:20.000Z", "name": "Sample Data Contract Template", "error": {"code": "code", "message": "message"}, "contract_terms": {"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}}' responses.add( responses.POST, url, @@ -4726,7 +5603,7 @@ def test_create_contract_template_all_params(self): # Construct a dict representation of a ContainerReference model container_reference_model = {} - container_reference_model['id'] = 'f531f74a-01c8-4e91-8e29-b018db683c86' + container_reference_model['id'] = '531f74a-01c8-4e91-8e29-b018db683c86' container_reference_model['type'] = 'catalog' # Construct a dict representation of a ErrorMessage model @@ -4755,8 +5632,8 @@ def test_create_contract_template_all_params(self): # Construct a dict representation of a Domain model domain_model = {} - domain_model['id'] = 'b38df608-d34b-4d58-8136-ed25e6c6684e' - domain_model['name'] = 'domain_name' + domain_model['id'] = '0094ebe9-abc3-473b-80ea-c777ede095ea' + domain_model['name'] = 'Test Domain New' domain_model['container'] = container_reference_model # Construct a dict representation of a Overview model @@ -4822,6 +5699,41 @@ def test_create_contract_template_all_params(self): contract_test_model['last_tested_time'] = 'testString' contract_test_model['message'] = 'testString' + # Construct a dict representation of a ContractAsset model + contract_asset_model = {} + contract_asset_model['id'] = 'testString' + contract_asset_model['name'] = 'testString' + + # Construct a dict representation of a ContractServer model + contract_server_model = {} + contract_server_model['server'] = 'testString' + contract_server_model['asset'] = contract_asset_model + contract_server_model['connection_id'] = 'testString' + contract_server_model['type'] = 'testString' + contract_server_model['description'] = 'testString' + contract_server_model['environment'] = 'testString' + contract_server_model['account'] = 'testString' + contract_server_model['catalog'] = 'testString' + contract_server_model['database'] = 'testString' + contract_server_model['dataset'] = 'testString' + contract_server_model['delimiter'] = 'testString' + contract_server_model['endpoint_url'] = 'testString' + contract_server_model['format'] = 'testString' + contract_server_model['host'] = 'testString' + contract_server_model['location'] = 'testString' + contract_server_model['path'] = 'testString' + contract_server_model['port'] = 'testString' + contract_server_model['project'] = 'testString' + contract_server_model['region'] = 'testString' + contract_server_model['region_name'] = 'testString' + contract_server_model['schema'] = 'testString' + contract_server_model['service_name'] = 'testString' + contract_server_model['staging_dir'] = 'testString' + contract_server_model['stream'] = 'testString' + contract_server_model['warehouse'] = 'testString' + contract_server_model['roles'] = ['testString'] + contract_server_model['custom_properties'] = [contract_template_custom_property_model] + # Construct a dict representation of a ContractSchemaPropertyType model contract_schema_property_type_model = {} contract_schema_property_type_model['type'] = 'testString' @@ -4831,17 +5743,41 @@ def test_create_contract_template_all_params(self): contract_schema_property_type_model['signed'] = 'testString' contract_schema_property_type_model['native_type'] = 'testString' + # Construct a dict representation of a ContractQualityRule model + contract_quality_rule_model = {} + contract_quality_rule_model['type'] = 'sql' + contract_quality_rule_model['description'] = 'testString' + contract_quality_rule_model['rule'] = 'testString' + contract_quality_rule_model['implementation'] = 'testString' + contract_quality_rule_model['engine'] = 'testString' + contract_quality_rule_model['must_be_less_than'] = 'testString' + contract_quality_rule_model['must_be_less_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_greater_than'] = 'testString' + contract_quality_rule_model['must_be_greater_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_between'] = ['testString'] + contract_quality_rule_model['must_not_be_between'] = ['testString'] + contract_quality_rule_model['must_be'] = 'testString' + contract_quality_rule_model['must_not_be'] = 'testString' + contract_quality_rule_model['name'] = 'testString' + contract_quality_rule_model['unit'] = 'testString' + contract_quality_rule_model['query'] = 'testString' + # Construct a dict representation of a ContractSchemaProperty model contract_schema_property_model = {} contract_schema_property_model['name'] = 'testString' contract_schema_property_model['type'] = contract_schema_property_type_model + contract_schema_property_model['quality'] = [contract_quality_rule_model] # Construct a dict representation of a ContractSchema model contract_schema_model = {} + contract_schema_model['asset_id'] = '2b0bf220-079c-11ee-be56-0242ac120002' + contract_schema_model['connection_id'] = '2b0bf220-079c-11ee-be56-0242ac120002' contract_schema_model['name'] = 'testString' contract_schema_model['description'] = 'testString' + contract_schema_model['connection_path'] = 'testString' contract_schema_model['physical_type'] = 'testString' contract_schema_model['properties'] = [contract_schema_property_model] + contract_schema_model['quality'] = [contract_quality_rule_model] # Construct a dict representation of a ContractTerms model contract_terms_model = {} @@ -4858,26 +5794,33 @@ def test_create_contract_template_all_params(self): contract_terms_model['support_and_communication'] = [contract_template_support_and_communication_model] contract_terms_model['custom_properties'] = [contract_template_custom_property_model] contract_terms_model['contract_test'] = contract_test_model + contract_terms_model['servers'] = [contract_server_model] contract_terms_model['schema'] = [contract_schema_model] # Set up parameter values container = container_reference_model id = 'testString' + creator_id = 'testString' + created_at = 'testString' name = 'Sample Data Contract Template' error = error_message_model contract_terms = contract_terms_model container_id = 'testString' contract_template_name = 'testString' + domain_ids = 'testString' # Invoke method response = _service.create_contract_template( container, id=id, + creator_id=creator_id, + created_at=created_at, name=name, error=error, contract_terms=contract_terms, container_id=container_id, contract_template_name=contract_template_name, + domain_ids=domain_ids, headers={}, ) @@ -4889,10 +5832,13 @@ def test_create_contract_template_all_params(self): query_string = urllib.parse.unquote_plus(query_string) assert 'container.id={}'.format(container_id) in query_string assert 'contract_template.name={}'.format(contract_template_name) in query_string + assert 'domain.ids={}'.format(domain_ids) in query_string # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body['container'] == container_reference_model assert req_body['id'] == 'testString' + assert req_body['creator_id'] == 'testString' + assert req_body['created_at'] == 'testString' assert req_body['name'] == 'Sample Data Contract Template' assert req_body['error'] == error_message_model assert req_body['contract_terms'] == contract_terms_model @@ -4913,7 +5859,7 @@ def test_create_contract_template_required_params(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/contract_templates') - mock_response = '{"container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "id": "20aa7c97-cfcc-4d16-ae76-2ca1847ce733", "name": "Sample Data Contract Template", "error": {"code": "code", "message": "message"}, "contract_terms": {"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}}' + mock_response = '{"container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "id": "20aa7c97-cfcc-4d16-ae76-2ca1847ce733", "creator_id": "IBMid-123456ABC", "created_at": "2025-06-26T12:30:20.000Z", "name": "Sample Data Contract Template", "error": {"code": "code", "message": "message"}, "contract_terms": {"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}}' responses.add( responses.POST, url, @@ -4924,7 +5870,7 @@ def test_create_contract_template_required_params(self): # Construct a dict representation of a ContainerReference model container_reference_model = {} - container_reference_model['id'] = 'f531f74a-01c8-4e91-8e29-b018db683c86' + container_reference_model['id'] = '531f74a-01c8-4e91-8e29-b018db683c86' container_reference_model['type'] = 'catalog' # Construct a dict representation of a ErrorMessage model @@ -4953,8 +5899,8 @@ def test_create_contract_template_required_params(self): # Construct a dict representation of a Domain model domain_model = {} - domain_model['id'] = 'b38df608-d34b-4d58-8136-ed25e6c6684e' - domain_model['name'] = 'domain_name' + domain_model['id'] = '0094ebe9-abc3-473b-80ea-c777ede095ea' + domain_model['name'] = 'Test Domain New' domain_model['container'] = container_reference_model # Construct a dict representation of a Overview model @@ -5020,6 +5966,41 @@ def test_create_contract_template_required_params(self): contract_test_model['last_tested_time'] = 'testString' contract_test_model['message'] = 'testString' + # Construct a dict representation of a ContractAsset model + contract_asset_model = {} + contract_asset_model['id'] = 'testString' + contract_asset_model['name'] = 'testString' + + # Construct a dict representation of a ContractServer model + contract_server_model = {} + contract_server_model['server'] = 'testString' + contract_server_model['asset'] = contract_asset_model + contract_server_model['connection_id'] = 'testString' + contract_server_model['type'] = 'testString' + contract_server_model['description'] = 'testString' + contract_server_model['environment'] = 'testString' + contract_server_model['account'] = 'testString' + contract_server_model['catalog'] = 'testString' + contract_server_model['database'] = 'testString' + contract_server_model['dataset'] = 'testString' + contract_server_model['delimiter'] = 'testString' + contract_server_model['endpoint_url'] = 'testString' + contract_server_model['format'] = 'testString' + contract_server_model['host'] = 'testString' + contract_server_model['location'] = 'testString' + contract_server_model['path'] = 'testString' + contract_server_model['port'] = 'testString' + contract_server_model['project'] = 'testString' + contract_server_model['region'] = 'testString' + contract_server_model['region_name'] = 'testString' + contract_server_model['schema'] = 'testString' + contract_server_model['service_name'] = 'testString' + contract_server_model['staging_dir'] = 'testString' + contract_server_model['stream'] = 'testString' + contract_server_model['warehouse'] = 'testString' + contract_server_model['roles'] = ['testString'] + contract_server_model['custom_properties'] = [contract_template_custom_property_model] + # Construct a dict representation of a ContractSchemaPropertyType model contract_schema_property_type_model = {} contract_schema_property_type_model['type'] = 'testString' @@ -5029,17 +6010,41 @@ def test_create_contract_template_required_params(self): contract_schema_property_type_model['signed'] = 'testString' contract_schema_property_type_model['native_type'] = 'testString' + # Construct a dict representation of a ContractQualityRule model + contract_quality_rule_model = {} + contract_quality_rule_model['type'] = 'sql' + contract_quality_rule_model['description'] = 'testString' + contract_quality_rule_model['rule'] = 'testString' + contract_quality_rule_model['implementation'] = 'testString' + contract_quality_rule_model['engine'] = 'testString' + contract_quality_rule_model['must_be_less_than'] = 'testString' + contract_quality_rule_model['must_be_less_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_greater_than'] = 'testString' + contract_quality_rule_model['must_be_greater_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_between'] = ['testString'] + contract_quality_rule_model['must_not_be_between'] = ['testString'] + contract_quality_rule_model['must_be'] = 'testString' + contract_quality_rule_model['must_not_be'] = 'testString' + contract_quality_rule_model['name'] = 'testString' + contract_quality_rule_model['unit'] = 'testString' + contract_quality_rule_model['query'] = 'testString' + # Construct a dict representation of a ContractSchemaProperty model contract_schema_property_model = {} contract_schema_property_model['name'] = 'testString' contract_schema_property_model['type'] = contract_schema_property_type_model + contract_schema_property_model['quality'] = [contract_quality_rule_model] # Construct a dict representation of a ContractSchema model contract_schema_model = {} + contract_schema_model['asset_id'] = '2b0bf220-079c-11ee-be56-0242ac120002' + contract_schema_model['connection_id'] = '2b0bf220-079c-11ee-be56-0242ac120002' contract_schema_model['name'] = 'testString' contract_schema_model['description'] = 'testString' + contract_schema_model['connection_path'] = 'testString' contract_schema_model['physical_type'] = 'testString' contract_schema_model['properties'] = [contract_schema_property_model] + contract_schema_model['quality'] = [contract_quality_rule_model] # Construct a dict representation of a ContractTerms model contract_terms_model = {} @@ -5056,11 +6061,14 @@ def test_create_contract_template_required_params(self): contract_terms_model['support_and_communication'] = [contract_template_support_and_communication_model] contract_terms_model['custom_properties'] = [contract_template_custom_property_model] contract_terms_model['contract_test'] = contract_test_model + contract_terms_model['servers'] = [contract_server_model] contract_terms_model['schema'] = [contract_schema_model] # Set up parameter values container = container_reference_model id = 'testString' + creator_id = 'testString' + created_at = 'testString' name = 'Sample Data Contract Template' error = error_message_model contract_terms = contract_terms_model @@ -5069,6 +6077,8 @@ def test_create_contract_template_required_params(self): response = _service.create_contract_template( container, id=id, + creator_id=creator_id, + created_at=created_at, name=name, error=error, contract_terms=contract_terms, @@ -5082,6 +6092,8 @@ def test_create_contract_template_required_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body['container'] == container_reference_model assert req_body['id'] == 'testString' + assert req_body['creator_id'] == 'testString' + assert req_body['created_at'] == 'testString' assert req_body['name'] == 'Sample Data Contract Template' assert req_body['error'] == error_message_model assert req_body['contract_terms'] == contract_terms_model @@ -5102,7 +6114,7 @@ def test_create_contract_template_value_error(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/contract_templates') - mock_response = '{"container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "id": "20aa7c97-cfcc-4d16-ae76-2ca1847ce733", "name": "Sample Data Contract Template", "error": {"code": "code", "message": "message"}, "contract_terms": {"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}}' + mock_response = '{"container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "id": "20aa7c97-cfcc-4d16-ae76-2ca1847ce733", "creator_id": "IBMid-123456ABC", "created_at": "2025-06-26T12:30:20.000Z", "name": "Sample Data Contract Template", "error": {"code": "code", "message": "message"}, "contract_terms": {"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}}' responses.add( responses.POST, url, @@ -5113,7 +6125,7 @@ def test_create_contract_template_value_error(self): # Construct a dict representation of a ContainerReference model container_reference_model = {} - container_reference_model['id'] = 'f531f74a-01c8-4e91-8e29-b018db683c86' + container_reference_model['id'] = '531f74a-01c8-4e91-8e29-b018db683c86' container_reference_model['type'] = 'catalog' # Construct a dict representation of a ErrorMessage model @@ -5142,8 +6154,8 @@ def test_create_contract_template_value_error(self): # Construct a dict representation of a Domain model domain_model = {} - domain_model['id'] = 'b38df608-d34b-4d58-8136-ed25e6c6684e' - domain_model['name'] = 'domain_name' + domain_model['id'] = '0094ebe9-abc3-473b-80ea-c777ede095ea' + domain_model['name'] = 'Test Domain New' domain_model['container'] = container_reference_model # Construct a dict representation of a Overview model @@ -5209,6 +6221,41 @@ def test_create_contract_template_value_error(self): contract_test_model['last_tested_time'] = 'testString' contract_test_model['message'] = 'testString' + # Construct a dict representation of a ContractAsset model + contract_asset_model = {} + contract_asset_model['id'] = 'testString' + contract_asset_model['name'] = 'testString' + + # Construct a dict representation of a ContractServer model + contract_server_model = {} + contract_server_model['server'] = 'testString' + contract_server_model['asset'] = contract_asset_model + contract_server_model['connection_id'] = 'testString' + contract_server_model['type'] = 'testString' + contract_server_model['description'] = 'testString' + contract_server_model['environment'] = 'testString' + contract_server_model['account'] = 'testString' + contract_server_model['catalog'] = 'testString' + contract_server_model['database'] = 'testString' + contract_server_model['dataset'] = 'testString' + contract_server_model['delimiter'] = 'testString' + contract_server_model['endpoint_url'] = 'testString' + contract_server_model['format'] = 'testString' + contract_server_model['host'] = 'testString' + contract_server_model['location'] = 'testString' + contract_server_model['path'] = 'testString' + contract_server_model['port'] = 'testString' + contract_server_model['project'] = 'testString' + contract_server_model['region'] = 'testString' + contract_server_model['region_name'] = 'testString' + contract_server_model['schema'] = 'testString' + contract_server_model['service_name'] = 'testString' + contract_server_model['staging_dir'] = 'testString' + contract_server_model['stream'] = 'testString' + contract_server_model['warehouse'] = 'testString' + contract_server_model['roles'] = ['testString'] + contract_server_model['custom_properties'] = [contract_template_custom_property_model] + # Construct a dict representation of a ContractSchemaPropertyType model contract_schema_property_type_model = {} contract_schema_property_type_model['type'] = 'testString' @@ -5218,17 +6265,41 @@ def test_create_contract_template_value_error(self): contract_schema_property_type_model['signed'] = 'testString' contract_schema_property_type_model['native_type'] = 'testString' + # Construct a dict representation of a ContractQualityRule model + contract_quality_rule_model = {} + contract_quality_rule_model['type'] = 'sql' + contract_quality_rule_model['description'] = 'testString' + contract_quality_rule_model['rule'] = 'testString' + contract_quality_rule_model['implementation'] = 'testString' + contract_quality_rule_model['engine'] = 'testString' + contract_quality_rule_model['must_be_less_than'] = 'testString' + contract_quality_rule_model['must_be_less_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_greater_than'] = 'testString' + contract_quality_rule_model['must_be_greater_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_between'] = ['testString'] + contract_quality_rule_model['must_not_be_between'] = ['testString'] + contract_quality_rule_model['must_be'] = 'testString' + contract_quality_rule_model['must_not_be'] = 'testString' + contract_quality_rule_model['name'] = 'testString' + contract_quality_rule_model['unit'] = 'testString' + contract_quality_rule_model['query'] = 'testString' + # Construct a dict representation of a ContractSchemaProperty model contract_schema_property_model = {} contract_schema_property_model['name'] = 'testString' contract_schema_property_model['type'] = contract_schema_property_type_model + contract_schema_property_model['quality'] = [contract_quality_rule_model] # Construct a dict representation of a ContractSchema model contract_schema_model = {} + contract_schema_model['asset_id'] = '2b0bf220-079c-11ee-be56-0242ac120002' + contract_schema_model['connection_id'] = '2b0bf220-079c-11ee-be56-0242ac120002' contract_schema_model['name'] = 'testString' contract_schema_model['description'] = 'testString' + contract_schema_model['connection_path'] = 'testString' contract_schema_model['physical_type'] = 'testString' contract_schema_model['properties'] = [contract_schema_property_model] + contract_schema_model['quality'] = [contract_quality_rule_model] # Construct a dict representation of a ContractTerms model contract_terms_model = {} @@ -5245,11 +6316,14 @@ def test_create_contract_template_value_error(self): contract_terms_model['support_and_communication'] = [contract_template_support_and_communication_model] contract_terms_model['custom_properties'] = [contract_template_custom_property_model] contract_terms_model['contract_test'] = contract_test_model + contract_terms_model['servers'] = [contract_server_model] contract_terms_model['schema'] = [contract_schema_model] # Set up parameter values container = container_reference_model id = 'testString' + creator_id = 'testString' + created_at = 'testString' name = 'Sample Data Contract Template' error = error_message_model contract_terms = contract_terms_model @@ -5285,7 +6359,7 @@ def test_get_contract_template_all_params(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/contract_templates/testString') - mock_response = '{"container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "id": "20aa7c97-cfcc-4d16-ae76-2ca1847ce733", "name": "Sample Data Contract Template", "error": {"code": "code", "message": "message"}, "contract_terms": {"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}}' + mock_response = '{"container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "id": "20aa7c97-cfcc-4d16-ae76-2ca1847ce733", "creator_id": "IBMid-123456ABC", "created_at": "2025-06-26T12:30:20.000Z", "name": "Sample Data Contract Template", "error": {"code": "code", "message": "message"}, "contract_terms": {"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}}' responses.add( responses.GET, url, @@ -5329,7 +6403,7 @@ def test_get_contract_template_value_error(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/contract_templates/testString') - mock_response = '{"container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "id": "20aa7c97-cfcc-4d16-ae76-2ca1847ce733", "name": "Sample Data Contract Template", "error": {"code": "code", "message": "message"}, "contract_terms": {"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}}' + mock_response = '{"container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "id": "20aa7c97-cfcc-4d16-ae76-2ca1847ce733", "creator_id": "IBMid-123456ABC", "created_at": "2025-06-26T12:30:20.000Z", "name": "Sample Data Contract Template", "error": {"code": "code", "message": "message"}, "contract_terms": {"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}}' responses.add( responses.GET, url, @@ -5457,7 +6531,7 @@ def test_update_data_product_contract_template_all_params(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/contract_templates/testString') - mock_response = '{"container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "id": "20aa7c97-cfcc-4d16-ae76-2ca1847ce733", "name": "Sample Data Contract Template", "error": {"code": "code", "message": "message"}, "contract_terms": {"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}}' + mock_response = '{"container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "id": "20aa7c97-cfcc-4d16-ae76-2ca1847ce733", "creator_id": "IBMid-123456ABC", "created_at": "2025-06-26T12:30:20.000Z", "name": "Sample Data Contract Template", "error": {"code": "code", "message": "message"}, "contract_terms": {"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}}' responses.add( responses.PATCH, url, @@ -5513,7 +6587,7 @@ def test_update_data_product_contract_template_value_error(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/contract_templates/testString') - mock_response = '{"container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "id": "20aa7c97-cfcc-4d16-ae76-2ca1847ce733", "name": "Sample Data Contract Template", "error": {"code": "code", "message": "message"}, "contract_terms": {"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}}' + mock_response = '{"container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "id": "20aa7c97-cfcc-4d16-ae76-2ca1847ce733", "creator_id": "IBMid-123456ABC", "created_at": "2025-06-26T12:30:20.000Z", "name": "Sample Data Contract Template", "error": {"code": "code", "message": "message"}, "contract_terms": {"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}}' responses.add( responses.PATCH, url, @@ -5606,7 +6680,7 @@ def test_list_data_product_domains_all_params(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/domains') - mock_response = '{"domains": [{"container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "trace": "trace", "errors": [{"code": "request_body_error", "message": "message", "extra": {"id": "id", "timestamp": "2019-01-01T12:00:00.000Z", "environment_name": "environment_name", "http_status": 0, "source_cluster": 0, "source_component": 0, "transaction_id": 0}, "more_info": "more_info"}], "name": "Operations", "description": "This is a description of the data product domain.", "id": "id", "member_roles": {"user_iam_id": "user_iam_id", "roles": ["roles"]}, "properties": {"value": "value"}, "sub_domains": [{"name": "Operations", "id": "id", "description": "description"}]}]}' + mock_response = '{"domains": [{"container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "trace": "trace", "errors": [{"code": "request_body_error", "message": "message", "extra": {"id": "id", "timestamp": "2019-01-01T12:00:00.000Z", "environment_name": "environment_name", "http_status": 0, "source_cluster": 0, "source_component": 0, "transaction_id": 0}, "more_info": "more_info"}], "name": "Operations", "description": "This is a description of the data product domain.", "id": "id", "created_by": "created_by", "member_roles": {"user_iam_id": "user_iam_id", "roles": ["roles"]}, "properties": {"value": "value"}, "sub_domains": [{"name": "Operations", "id": "id", "description": "description"}], "sub_container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd"}}]}' responses.add( responses.GET, url, @@ -5617,10 +6691,12 @@ def test_list_data_product_domains_all_params(self): # Set up parameter values container_id = 'testString' + include_subdomains = True # Invoke method response = _service.list_data_product_domains( container_id=container_id, + include_subdomains=include_subdomains, headers={}, ) @@ -5631,6 +6707,7 @@ def test_list_data_product_domains_all_params(self): query_string = responses.calls[0].request.url.split('?', 1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'container.id={}'.format(container_id) in query_string + assert 'include_subdomains={}'.format('true' if include_subdomains else 'false') in query_string def test_list_data_product_domains_all_params_with_retries(self): # Enable retries and run test_list_data_product_domains_all_params. @@ -5648,7 +6725,7 @@ def test_list_data_product_domains_required_params(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/domains') - mock_response = '{"domains": [{"container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "trace": "trace", "errors": [{"code": "request_body_error", "message": "message", "extra": {"id": "id", "timestamp": "2019-01-01T12:00:00.000Z", "environment_name": "environment_name", "http_status": 0, "source_cluster": 0, "source_component": 0, "transaction_id": 0}, "more_info": "more_info"}], "name": "Operations", "description": "This is a description of the data product domain.", "id": "id", "member_roles": {"user_iam_id": "user_iam_id", "roles": ["roles"]}, "properties": {"value": "value"}, "sub_domains": [{"name": "Operations", "id": "id", "description": "description"}]}]}' + mock_response = '{"domains": [{"container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "trace": "trace", "errors": [{"code": "request_body_error", "message": "message", "extra": {"id": "id", "timestamp": "2019-01-01T12:00:00.000Z", "environment_name": "environment_name", "http_status": 0, "source_cluster": 0, "source_component": 0, "transaction_id": 0}, "more_info": "more_info"}], "name": "Operations", "description": "This is a description of the data product domain.", "id": "id", "created_by": "created_by", "member_roles": {"user_iam_id": "user_iam_id", "roles": ["roles"]}, "properties": {"value": "value"}, "sub_domains": [{"name": "Operations", "id": "id", "description": "description"}], "sub_container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd"}}]}' responses.add( responses.GET, url, @@ -5686,7 +6763,7 @@ def test_create_data_product_domain_all_params(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/domains') - mock_response = '{"container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "trace": "trace", "errors": [{"code": "request_body_error", "message": "message", "extra": {"id": "id", "timestamp": "2019-01-01T12:00:00.000Z", "environment_name": "environment_name", "http_status": 0, "source_cluster": 0, "source_component": 0, "transaction_id": 0}, "more_info": "more_info"}], "name": "Operations", "description": "This is a description of the data product domain.", "id": "id", "member_roles": {"user_iam_id": "user_iam_id", "roles": ["roles"]}, "properties": {"value": "value"}, "sub_domains": [{"name": "Operations", "id": "id", "description": "description"}]}' + mock_response = '{"container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "trace": "trace", "errors": [{"code": "request_body_error", "message": "message", "extra": {"id": "id", "timestamp": "2019-01-01T12:00:00.000Z", "environment_name": "environment_name", "http_status": 0, "source_cluster": 0, "source_component": 0, "transaction_id": 0}, "more_info": "more_info"}], "name": "Operations", "description": "This is a description of the data product domain.", "id": "id", "created_by": "created_by", "member_roles": {"user_iam_id": "user_iam_id", "roles": ["roles"]}, "properties": {"value": "value"}, "sub_domains": [{"name": "Operations", "id": "id", "description": "description"}], "sub_container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd"}}' responses.add( responses.POST, url, @@ -5732,6 +6809,10 @@ def test_create_data_product_domain_all_params(self): initialize_sub_domain_model['id'] = 'testString' initialize_sub_domain_model['description'] = 'New sub domain 1' + # Construct a dict representation of a ContainerIdentity model + container_identity_model = {} + container_identity_model['id'] = 'd29c42eb-7100-4b7a-8257-c196dbcca1cd' + # Set up parameter values container = container_reference_model trace = 'testString' @@ -5739,10 +6820,12 @@ def test_create_data_product_domain_all_params(self): name = 'Test domain' description = 'The sample description for new domain' id = 'testString' + created_by = 'testString' member_roles = member_roles_schema_model properties = properties_schema_model sub_domains = [initialize_sub_domain_model] - container_id = 'testString' + sub_container = container_identity_model + link_to_subcontainers = False # Invoke method response = _service.create_data_product_domain( @@ -5752,10 +6835,12 @@ def test_create_data_product_domain_all_params(self): name=name, description=description, id=id, + created_by=created_by, member_roles=member_roles, properties=properties, sub_domains=sub_domains, - container_id=container_id, + sub_container=sub_container, + link_to_subcontainers=link_to_subcontainers, headers={}, ) @@ -5765,7 +6850,7 @@ def test_create_data_product_domain_all_params(self): # Validate query params query_string = responses.calls[0].request.url.split('?', 1)[1] query_string = urllib.parse.unquote_plus(query_string) - assert 'container.id={}'.format(container_id) in query_string + assert 'link_to_subcontainers={}'.format('true' if link_to_subcontainers else 'false') in query_string # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body['container'] == container_reference_model @@ -5774,9 +6859,11 @@ def test_create_data_product_domain_all_params(self): assert req_body['name'] == 'Test domain' assert req_body['description'] == 'The sample description for new domain' assert req_body['id'] == 'testString' + assert req_body['created_by'] == 'testString' assert req_body['member_roles'] == member_roles_schema_model assert req_body['properties'] == properties_schema_model assert req_body['sub_domains'] == [initialize_sub_domain_model] + assert req_body['sub_container'] == container_identity_model def test_create_data_product_domain_all_params_with_retries(self): # Enable retries and run test_create_data_product_domain_all_params. @@ -5794,7 +6881,7 @@ def test_create_data_product_domain_required_params(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/domains') - mock_response = '{"container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "trace": "trace", "errors": [{"code": "request_body_error", "message": "message", "extra": {"id": "id", "timestamp": "2019-01-01T12:00:00.000Z", "environment_name": "environment_name", "http_status": 0, "source_cluster": 0, "source_component": 0, "transaction_id": 0}, "more_info": "more_info"}], "name": "Operations", "description": "This is a description of the data product domain.", "id": "id", "member_roles": {"user_iam_id": "user_iam_id", "roles": ["roles"]}, "properties": {"value": "value"}, "sub_domains": [{"name": "Operations", "id": "id", "description": "description"}]}' + mock_response = '{"container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "trace": "trace", "errors": [{"code": "request_body_error", "message": "message", "extra": {"id": "id", "timestamp": "2019-01-01T12:00:00.000Z", "environment_name": "environment_name", "http_status": 0, "source_cluster": 0, "source_component": 0, "transaction_id": 0}, "more_info": "more_info"}], "name": "Operations", "description": "This is a description of the data product domain.", "id": "id", "created_by": "created_by", "member_roles": {"user_iam_id": "user_iam_id", "roles": ["roles"]}, "properties": {"value": "value"}, "sub_domains": [{"name": "Operations", "id": "id", "description": "description"}], "sub_container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd"}}' responses.add( responses.POST, url, @@ -5840,6 +6927,10 @@ def test_create_data_product_domain_required_params(self): initialize_sub_domain_model['id'] = 'testString' initialize_sub_domain_model['description'] = 'New sub domain 1' + # Construct a dict representation of a ContainerIdentity model + container_identity_model = {} + container_identity_model['id'] = 'd29c42eb-7100-4b7a-8257-c196dbcca1cd' + # Set up parameter values container = container_reference_model trace = 'testString' @@ -5847,9 +6938,11 @@ def test_create_data_product_domain_required_params(self): name = 'Test domain' description = 'The sample description for new domain' id = 'testString' + created_by = 'testString' member_roles = member_roles_schema_model properties = properties_schema_model sub_domains = [initialize_sub_domain_model] + sub_container = container_identity_model # Invoke method response = _service.create_data_product_domain( @@ -5859,9 +6952,11 @@ def test_create_data_product_domain_required_params(self): name=name, description=description, id=id, + created_by=created_by, member_roles=member_roles, properties=properties, sub_domains=sub_domains, + sub_container=sub_container, headers={}, ) @@ -5876,9 +6971,11 @@ def test_create_data_product_domain_required_params(self): assert req_body['name'] == 'Test domain' assert req_body['description'] == 'The sample description for new domain' assert req_body['id'] == 'testString' + assert req_body['created_by'] == 'testString' assert req_body['member_roles'] == member_roles_schema_model assert req_body['properties'] == properties_schema_model assert req_body['sub_domains'] == [initialize_sub_domain_model] + assert req_body['sub_container'] == container_identity_model def test_create_data_product_domain_required_params_with_retries(self): # Enable retries and run test_create_data_product_domain_required_params. @@ -5896,7 +6993,7 @@ def test_create_data_product_domain_value_error(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/domains') - mock_response = '{"container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "trace": "trace", "errors": [{"code": "request_body_error", "message": "message", "extra": {"id": "id", "timestamp": "2019-01-01T12:00:00.000Z", "environment_name": "environment_name", "http_status": 0, "source_cluster": 0, "source_component": 0, "transaction_id": 0}, "more_info": "more_info"}], "name": "Operations", "description": "This is a description of the data product domain.", "id": "id", "member_roles": {"user_iam_id": "user_iam_id", "roles": ["roles"]}, "properties": {"value": "value"}, "sub_domains": [{"name": "Operations", "id": "id", "description": "description"}]}' + mock_response = '{"container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "trace": "trace", "errors": [{"code": "request_body_error", "message": "message", "extra": {"id": "id", "timestamp": "2019-01-01T12:00:00.000Z", "environment_name": "environment_name", "http_status": 0, "source_cluster": 0, "source_component": 0, "transaction_id": 0}, "more_info": "more_info"}], "name": "Operations", "description": "This is a description of the data product domain.", "id": "id", "created_by": "created_by", "member_roles": {"user_iam_id": "user_iam_id", "roles": ["roles"]}, "properties": {"value": "value"}, "sub_domains": [{"name": "Operations", "id": "id", "description": "description"}], "sub_container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd"}}' responses.add( responses.POST, url, @@ -5942,6 +7039,10 @@ def test_create_data_product_domain_value_error(self): initialize_sub_domain_model['id'] = 'testString' initialize_sub_domain_model['description'] = 'New sub domain 1' + # Construct a dict representation of a ContainerIdentity model + container_identity_model = {} + container_identity_model['id'] = 'd29c42eb-7100-4b7a-8257-c196dbcca1cd' + # Set up parameter values container = container_reference_model trace = 'testString' @@ -5949,9 +7050,11 @@ def test_create_data_product_domain_value_error(self): name = 'Test domain' description = 'The sample description for new domain' id = 'testString' + created_by = 'testString' member_roles = member_roles_schema_model properties = properties_schema_model sub_domains = [initialize_sub_domain_model] + sub_container = container_identity_model # Pass in all but one required param and check for a ValueError req_param_dict = { @@ -6087,7 +7190,7 @@ def test_get_domain_all_params(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/domains/testString') - mock_response = '{"container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "trace": "trace", "errors": [{"code": "request_body_error", "message": "message", "extra": {"id": "id", "timestamp": "2019-01-01T12:00:00.000Z", "environment_name": "environment_name", "http_status": 0, "source_cluster": 0, "source_component": 0, "transaction_id": 0}, "more_info": "more_info"}], "name": "Operations", "description": "This is a description of the data product domain.", "id": "id", "member_roles": {"user_iam_id": "user_iam_id", "roles": ["roles"]}, "properties": {"value": "value"}, "sub_domains": [{"name": "Operations", "id": "id", "description": "description"}]}' + mock_response = '{"container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "trace": "trace", "errors": [{"code": "request_body_error", "message": "message", "extra": {"id": "id", "timestamp": "2019-01-01T12:00:00.000Z", "environment_name": "environment_name", "http_status": 0, "source_cluster": 0, "source_component": 0, "transaction_id": 0}, "more_info": "more_info"}], "name": "Operations", "description": "This is a description of the data product domain.", "id": "id", "created_by": "created_by", "member_roles": {"user_iam_id": "user_iam_id", "roles": ["roles"]}, "properties": {"value": "value"}, "sub_domains": [{"name": "Operations", "id": "id", "description": "description"}], "sub_container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd"}}' responses.add( responses.GET, url, @@ -6125,7 +7228,7 @@ def test_get_domain_value_error(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/domains/testString') - mock_response = '{"container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "trace": "trace", "errors": [{"code": "request_body_error", "message": "message", "extra": {"id": "id", "timestamp": "2019-01-01T12:00:00.000Z", "environment_name": "environment_name", "http_status": 0, "source_cluster": 0, "source_component": 0, "transaction_id": 0}, "more_info": "more_info"}], "name": "Operations", "description": "This is a description of the data product domain.", "id": "id", "member_roles": {"user_iam_id": "user_iam_id", "roles": ["roles"]}, "properties": {"value": "value"}, "sub_domains": [{"name": "Operations", "id": "id", "description": "description"}]}' + mock_response = '{"container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "trace": "trace", "errors": [{"code": "request_body_error", "message": "message", "extra": {"id": "id", "timestamp": "2019-01-01T12:00:00.000Z", "environment_name": "environment_name", "http_status": 0, "source_cluster": 0, "source_component": 0, "transaction_id": 0}, "more_info": "more_info"}], "name": "Operations", "description": "This is a description of the data product domain.", "id": "id", "created_by": "created_by", "member_roles": {"user_iam_id": "user_iam_id", "roles": ["roles"]}, "properties": {"value": "value"}, "sub_domains": [{"name": "Operations", "id": "id", "description": "description"}], "sub_container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd"}}' responses.add( responses.GET, url, @@ -6243,7 +7346,7 @@ def test_update_data_product_domain_all_params(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/domains/testString') - mock_response = '{"container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "trace": "trace", "errors": [{"code": "request_body_error", "message": "message", "extra": {"id": "id", "timestamp": "2019-01-01T12:00:00.000Z", "environment_name": "environment_name", "http_status": 0, "source_cluster": 0, "source_component": 0, "transaction_id": 0}, "more_info": "more_info"}], "name": "Operations", "description": "This is a description of the data product domain.", "id": "id", "member_roles": {"user_iam_id": "user_iam_id", "roles": ["roles"]}, "properties": {"value": "value"}, "sub_domains": [{"name": "Operations", "id": "id", "description": "description"}]}' + mock_response = '{"container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "trace": "trace", "errors": [{"code": "request_body_error", "message": "message", "extra": {"id": "id", "timestamp": "2019-01-01T12:00:00.000Z", "environment_name": "environment_name", "http_status": 0, "source_cluster": 0, "source_component": 0, "transaction_id": 0}, "more_info": "more_info"}], "name": "Operations", "description": "This is a description of the data product domain.", "id": "id", "created_by": "created_by", "member_roles": {"user_iam_id": "user_iam_id", "roles": ["roles"]}, "properties": {"value": "value"}, "sub_domains": [{"name": "Operations", "id": "id", "description": "description"}], "sub_container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd"}}' responses.add( responses.PATCH, url, @@ -6299,7 +7402,7 @@ def test_update_data_product_domain_value_error(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/domains/testString') - mock_response = '{"container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "trace": "trace", "errors": [{"code": "request_body_error", "message": "message", "extra": {"id": "id", "timestamp": "2019-01-01T12:00:00.000Z", "environment_name": "environment_name", "http_status": 0, "source_cluster": 0, "source_component": 0, "transaction_id": 0}, "more_info": "more_info"}], "name": "Operations", "description": "This is a description of the data product domain.", "id": "id", "member_roles": {"user_iam_id": "user_iam_id", "roles": ["roles"]}, "properties": {"value": "value"}, "sub_domains": [{"name": "Operations", "id": "id", "description": "description"}]}' + mock_response = '{"container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "trace": "trace", "errors": [{"code": "request_body_error", "message": "message", "extra": {"id": "id", "timestamp": "2019-01-01T12:00:00.000Z", "environment_name": "environment_name", "http_status": 0, "source_cluster": 0, "source_component": 0, "transaction_id": 0}, "more_info": "more_info"}], "name": "Operations", "description": "This is a description of the data product domain.", "id": "id", "created_by": "created_by", "member_roles": {"user_iam_id": "user_iam_id", "roles": ["roles"]}, "properties": {"value": "value"}, "sub_domains": [{"name": "Operations", "id": "id", "description": "description"}], "sub_container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd"}}' responses.add( responses.PATCH, url, @@ -6353,7 +7456,7 @@ def test_get_data_product_by_domain_all_params(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/domains/testString/data_products') - mock_response = '{"limit": 200, "first": {"href": "https://api.example.com/collection"}, "next": {"href": "https://api.example.com/collection?start=eyJvZmZzZXQiOjAsImRvbmUiOnRydWV9", "start": "eyJvZmZzZXQiOjAsImRvbmUiOnRydWV9"}, "total_results": 200, "data_product_versions": [{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "associated_catalogs": ["associated_catalogs"]}}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}}]}' + mock_response = '{"limit": 200, "first": {"href": "https://api.example.com/collection"}, "next": {"href": "https://api.example.com/collection?start=eyJvZmZzZXQiOjAsImRvbmUiOnRydWV9", "start": "eyJvZmZzZXQiOjAsImRvbmUiOnRydWV9"}, "total_results": 200, "data_product_versions": [{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}, "engines": [{"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}]}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "sub_container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd"}, "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}}]}' responses.add( responses.GET, url, @@ -6397,7 +7500,7 @@ def test_get_data_product_by_domain_value_error(self): """ # Set up mock url = preprocess_url('/data_product_exchange/v1/domains/testString/data_products') - mock_response = '{"limit": 200, "first": {"href": "https://api.example.com/collection"}, "next": {"href": "https://api.example.com/collection?start=eyJvZmZzZXQiOjAsImRvbmUiOnRydWV9", "start": "eyJvZmZzZXQiOjAsImRvbmUiOnRydWV9"}, "total_results": 200, "data_product_versions": [{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "schema": [{"name": "name", "description": "description", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "associated_catalogs": ["associated_catalogs"]}}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}}]}' + mock_response = '{"limit": 200, "first": {"href": "https://api.example.com/collection"}, "next": {"href": "https://api.example.com/collection?start=eyJvZmZzZXQiOjAsImRvbmUiOnRydWV9", "start": "eyJvZmZzZXQiOjAsImRvbmUiOnRydWV9"}, "total_results": 200, "data_product_versions": [{"version": "1.0.0", "state": "draft", "data_product": {"id": "b38df608-d34b-4d58-8136-ed25e6c6684e", "release": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}, "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "name": "My Data Product", "description": "This is a description of My Data Product.", "tags": ["tags"], "use_cases": [{"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}], "types": ["data"], "contract_terms": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "id": "id", "documents": [{"url": "url", "type": "terms_and_conditions", "name": "name", "id": "2b0bf220-079c-11ee-be56-0242ac120002", "attachment": {"id": "id"}, "upload_url": "upload_url"}], "error_msg": "error_msg", "overview": {"api_version": "v3.0.1", "kind": "DataContract", "name": "Sample Data Contract", "version": "0.0.0", "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "more_info": "List of links to sources that provide more details on the data contract."}, "description": {"purpose": "Used for customer behavior analysis.", "limitations": "Data cannot be used for marketing.", "usage": "Data should be used only for analytics.", "more_info": [{"type": "privacy-statement", "url": "https://moreinfo.example.com"}], "custom_properties": "{\\"property1\\":\\"value1\\"}"}, "organization": [{"user_id": "IBMid-691000IN4G", "role": "owner"}], "roles": [{"role": "owner"}], "price": {"amount": "100.0", "currency": "USD", "unit": "megabyte"}, "sla": [{"default_element": "Standard SLA Policy", "properties": [{"property": "Uptime Guarantee", "value": "99.9"}]}], "support_and_communication": [{"channel": "Email Support", "url": "https://support.example.com"}], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}], "contract_test": {"status": "pass", "last_tested_time": "last_tested_time", "message": "message"}, "servers": [{"server": "server", "asset": {"id": "id", "name": "name"}, "connection_id": "connection_id", "type": "type", "description": "description", "environment": "environment", "account": "account", "catalog": "catalog", "database": "database", "dataset": "dataset", "delimiter": "delimiter", "endpoint_url": "endpoint_url", "format": "format", "host": "host", "location": "location", "path": "path", "port": "port", "project": "project", "region": "region", "region_name": "region_name", "schema": "schema", "service_name": "service_name", "staging_dir": "staging_dir", "stream": "stream", "warehouse": "warehouse", "roles": ["roles"], "custom_properties": [{"key": "customPropertyKey", "value": "customPropertyValue"}]}], "schema": [{"asset_id": "2b0bf220-079c-11ee-be56-0242ac120002", "connection_id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "description": "description", "connection_path": "connection_path", "physical_type": "physical_type", "properties": [{"name": "name", "type": {"type": "type", "length": "length", "scale": "scale", "nullable": "nullable", "signed": "signed", "native_type": "native_type"}, "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}], "quality": [{"type": "sql", "description": "description", "rule": "rule", "implementation": "implementation", "engine": "engine", "must_be_less_than": "must_be_less_than", "must_be_less_or_equal_to": "must_be_less_or_equal_to", "must_be_greater_than": "must_be_greater_than", "must_be_greater_or_equal_to": "must_be_greater_or_equal_to", "must_be_between": ["must_be_between"], "must_not_be_between": ["must_not_be_between"], "must_be": "must_be", "must_not_be": "must_not_be", "name": "name", "unit": "unit", "query": "query"}]}]}], "domain": {"id": "id", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}, "parts_out": [{"asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "type": "data_asset"}, "delivery_methods": [{"id": "09cf5fcc-cb9d-4995-a8e4-16517b25229f", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}, "getproperties": {"producer_input": {"engine_details": {"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}, "engines": [{"display_name": "Iceberg Engine", "engine_id": "presto767", "engine_port": "34567", "engine_host": "a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud", "engine_type": "spark", "associated_catalogs": ["associated_catalogs"]}]}}}]}], "workflows": {"order_access_request": {"task_assignee_users": ["task_assignee_users"], "pre_approved_users": ["pre_approved_users"], "custom_workflow_definition": {"id": "18bdbde1-918e-4ecf-aa23-6727bf319e14"}}}, "dataview_enabled": true, "comments": "Comments by a producer that are provided either at the time of data product version creation or retiring", "access_control": {"owner": "IBMid-696000KYV9"}, "last_updated_at": "2019-01-01T12:00:00.000Z", "sub_container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd"}, "is_restricted": false, "id": "2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd", "asset": {"id": "2b0bf220-079c-11ee-be56-0242ac120002", "name": "name", "container": {"id": "d29c42eb-7100-4b7a-8257-c196dbcca1cd", "type": "catalog"}}}]}' responses.add( responses.GET, url, @@ -6507,66 +7610,234 @@ def test_create_s3_bucket_all_params(self): query_string = urllib.parse.unquote_plus(query_string) assert 'is_shared={}'.format('true' if is_shared else 'false') in query_string - def test_create_s3_bucket_all_params_with_retries(self): - # Enable retries and run test_create_s3_bucket_all_params. - _service.enable_retries() - self.test_create_s3_bucket_all_params() + def test_create_s3_bucket_all_params_with_retries(self): + # Enable retries and run test_create_s3_bucket_all_params. + _service.enable_retries() + self.test_create_s3_bucket_all_params() + + # Disable retries and run test_create_s3_bucket_all_params. + _service.disable_retries() + self.test_create_s3_bucket_all_params() + + @responses.activate + def test_create_s3_bucket_value_error(self): + """ + test_create_s3_bucket_value_error() + """ + # Set up mock + url = preprocess_url('/data_product_exchange/v1/bucket') + mock_response = '{"bucket_name": "bucket_name", "bucket_location": "bucket_location", "role_arn": "role_arn", "bucket_type": "bucket_type", "shared": true}' + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=201, + ) + + # Set up parameter values + is_shared = True + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "is_shared": is_shared, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.create_s3_bucket(**req_copy) + + def test_create_s3_bucket_value_error_with_retries(self): + # Enable retries and run test_create_s3_bucket_value_error. + _service.enable_retries() + self.test_create_s3_bucket_value_error() + + # Disable retries and run test_create_s3_bucket_value_error. + _service.disable_retries() + self.test_create_s3_bucket_value_error() + + +class TestGetS3BucketValidation: + """ + Test Class for get_s3_bucket_validation + """ + + @responses.activate + def test_get_s3_bucket_validation_all_params(self): + """ + get_s3_bucket_validation() + """ + # Set up mock + url = preprocess_url('/data_product_exchange/v1/bucket/validate/testString') + mock_response = '{"bucket_exists": false}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + bucket_name = 'testString' + + # Invoke method + response = _service.get_s3_bucket_validation( + bucket_name, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_get_s3_bucket_validation_all_params_with_retries(self): + # Enable retries and run test_get_s3_bucket_validation_all_params. + _service.enable_retries() + self.test_get_s3_bucket_validation_all_params() + + # Disable retries and run test_get_s3_bucket_validation_all_params. + _service.disable_retries() + self.test_get_s3_bucket_validation_all_params() + + @responses.activate + def test_get_s3_bucket_validation_value_error(self): + """ + test_get_s3_bucket_validation_value_error() + """ + # Set up mock + url = preprocess_url('/data_product_exchange/v1/bucket/validate/testString') + mock_response = '{"bucket_exists": false}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + bucket_name = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "bucket_name": bucket_name, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.get_s3_bucket_validation(**req_copy) + + def test_get_s3_bucket_validation_value_error_with_retries(self): + # Enable retries and run test_get_s3_bucket_validation_value_error. + _service.enable_retries() + self.test_get_s3_bucket_validation_value_error() + + # Disable retries and run test_get_s3_bucket_validation_value_error. + _service.disable_retries() + self.test_get_s3_bucket_validation_value_error() + + +# endregion +############################################################################## +# End of Service: BucketServices +############################################################################## + +############################################################################## +# Start of Service: DataProductRevokeAccessJobRuns +############################################################################## +# region + + +class TestNewInstance: + """ + Test Class for new_instance + """ + + def test_new_instance(self): + """ + new_instance() + """ + os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth' + + service = DphV1.new_instance( + service_name='TEST_SERVICE', + ) + + assert service is not None + assert isinstance(service, DphV1) + + def test_new_instance_without_authenticator(self): + """ + new_instance_without_authenticator() + """ + with pytest.raises(ValueError, match='authenticator must be provided'): + service = DphV1.new_instance( + service_name='TEST_SERVICE_NOT_FOUND', + ) + - # Disable retries and run test_create_s3_bucket_all_params. - _service.disable_retries() - self.test_create_s3_bucket_all_params() +class TestGetRevokeAccessProcessState: + """ + Test Class for get_revoke_access_process_state + """ @responses.activate - def test_create_s3_bucket_value_error(self): + def test_get_revoke_access_process_state_all_params(self): """ - test_create_s3_bucket_value_error() + get_revoke_access_process_state() """ # Set up mock - url = preprocess_url('/data_product_exchange/v1/bucket') - mock_response = '{"bucket_name": "bucket_name", "bucket_location": "bucket_location", "role_arn": "role_arn", "bucket_type": "bucket_type", "shared": true}' + url = preprocess_url('/data_product_exchange/v1/data_product_revoke_access/job_runs') + mock_response = '{"results": [{"metadata": {"anyKey": "anyValue"}, "entity": {"anyKey": "anyValue"}}], "total_count": 42, "next": {"query": "ibm_data_product_revoke_access.state:(SCHEDULED OR FAILED)", "limit": 1, "bookmark": "MQ==", "include": "entity", "skip": 0}}' responses.add( - responses.POST, + responses.GET, url, body=mock_response, content_type='application/json', - status=201, + status=200, ) # Set up parameter values - is_shared = True + release_id = 'testString' + limit = 200 + start = 'testString' - # Pass in all but one required param and check for a ValueError - req_param_dict = { - "is_shared": is_shared, - } - for param in req_param_dict.keys(): - req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} - with pytest.raises(ValueError): - _service.create_s3_bucket(**req_copy) + # Invoke method + response = _service.get_revoke_access_process_state( + release_id, + limit=limit, + start=start, + headers={}, + ) - def test_create_s3_bucket_value_error_with_retries(self): - # Enable retries and run test_create_s3_bucket_value_error. + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + # Validate query params + query_string = responses.calls[0].request.url.split('?', 1)[1] + query_string = urllib.parse.unquote_plus(query_string) + assert 'release_id={}'.format(release_id) in query_string + assert 'limit={}'.format(limit) in query_string + assert 'start={}'.format(start) in query_string + + def test_get_revoke_access_process_state_all_params_with_retries(self): + # Enable retries and run test_get_revoke_access_process_state_all_params. _service.enable_retries() - self.test_create_s3_bucket_value_error() + self.test_get_revoke_access_process_state_all_params() - # Disable retries and run test_create_s3_bucket_value_error. + # Disable retries and run test_get_revoke_access_process_state_all_params. _service.disable_retries() - self.test_create_s3_bucket_value_error() - - -class TestGetS3BucketValidation: - """ - Test Class for get_s3_bucket_validation - """ + self.test_get_revoke_access_process_state_all_params() @responses.activate - def test_get_s3_bucket_validation_all_params(self): + def test_get_revoke_access_process_state_required_params(self): """ - get_s3_bucket_validation() + test_get_revoke_access_process_state_required_params() """ # Set up mock - url = preprocess_url('/data_product_exchange/v1/bucket/validate/testString') - mock_response = '{"bucket_exists": false}' + url = preprocess_url('/data_product_exchange/v1/data_product_revoke_access/job_runs') + mock_response = '{"results": [{"metadata": {"anyKey": "anyValue"}, "entity": {"anyKey": "anyValue"}}], "total_count": 42, "next": {"query": "ibm_data_product_revoke_access.state:(SCHEDULED OR FAILED)", "limit": 1, "bookmark": "MQ==", "include": "entity", "skip": 0}}' responses.add( responses.GET, url, @@ -6576,35 +7847,39 @@ def test_get_s3_bucket_validation_all_params(self): ) # Set up parameter values - bucket_name = 'testString' + release_id = 'testString' # Invoke method - response = _service.get_s3_bucket_validation( - bucket_name, + response = _service.get_revoke_access_process_state( + release_id, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + # Validate query params + query_string = responses.calls[0].request.url.split('?', 1)[1] + query_string = urllib.parse.unquote_plus(query_string) + assert 'release_id={}'.format(release_id) in query_string - def test_get_s3_bucket_validation_all_params_with_retries(self): - # Enable retries and run test_get_s3_bucket_validation_all_params. + def test_get_revoke_access_process_state_required_params_with_retries(self): + # Enable retries and run test_get_revoke_access_process_state_required_params. _service.enable_retries() - self.test_get_s3_bucket_validation_all_params() + self.test_get_revoke_access_process_state_required_params() - # Disable retries and run test_get_s3_bucket_validation_all_params. + # Disable retries and run test_get_revoke_access_process_state_required_params. _service.disable_retries() - self.test_get_s3_bucket_validation_all_params() + self.test_get_revoke_access_process_state_required_params() @responses.activate - def test_get_s3_bucket_validation_value_error(self): + def test_get_revoke_access_process_state_value_error(self): """ - test_get_s3_bucket_validation_value_error() + test_get_revoke_access_process_state_value_error() """ # Set up mock - url = preprocess_url('/data_product_exchange/v1/bucket/validate/testString') - mock_response = '{"bucket_exists": false}' + url = preprocess_url('/data_product_exchange/v1/data_product_revoke_access/job_runs') + mock_response = '{"results": [{"metadata": {"anyKey": "anyValue"}, "entity": {"anyKey": "anyValue"}}], "total_count": 42, "next": {"query": "ibm_data_product_revoke_access.state:(SCHEDULED OR FAILED)", "limit": 1, "bookmark": "MQ==", "include": "entity", "skip": 0}}' responses.add( responses.GET, url, @@ -6614,30 +7889,30 @@ def test_get_s3_bucket_validation_value_error(self): ) # Set up parameter values - bucket_name = 'testString' + release_id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { - "bucket_name": bucket_name, + "release_id": release_id, } for param in req_param_dict.keys(): req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): - _service.get_s3_bucket_validation(**req_copy) + _service.get_revoke_access_process_state(**req_copy) - def test_get_s3_bucket_validation_value_error_with_retries(self): - # Enable retries and run test_get_s3_bucket_validation_value_error. + def test_get_revoke_access_process_state_value_error_with_retries(self): + # Enable retries and run test_get_revoke_access_process_state_value_error. _service.enable_retries() - self.test_get_s3_bucket_validation_value_error() + self.test_get_revoke_access_process_state_value_error() - # Disable retries and run test_get_s3_bucket_validation_value_error. + # Disable retries and run test_get_revoke_access_process_state_value_error. _service.disable_retries() - self.test_get_s3_bucket_validation_value_error() + self.test_get_revoke_access_process_state_value_error() # endregion ############################################################################## -# End of Service: BucketServices +# End of Service: DataProductRevokeAccessJobRuns ############################################################################## @@ -6647,6 +7922,37 @@ def test_get_s3_bucket_validation_value_error_with_retries(self): # region +class TestModel_Asset: + """ + Test Class for Asset + """ + + def test_asset_serialization(self): + """ + Test serialization/deserialization for Asset + """ + + # Construct a json representation of a Asset model + asset_model_json = {} + asset_model_json['metadata'] = {'anyKey': 'anyValue'} + asset_model_json['entity'] = {'anyKey': 'anyValue'} + + # Construct a model instance of Asset by calling from_dict on the json representation + asset_model = Asset.from_dict(asset_model_json) + assert asset_model != False + + # Construct a model instance of Asset by calling from_dict on the json representation + asset_model_dict = Asset.from_dict(asset_model_json).__dict__ + asset_model2 = Asset(**asset_model_dict) + + # Verify the model instances are equivalent + assert asset_model == asset_model2 + + # Convert model instance back to dict and verify no loss of data + asset_model_json2 = asset_model.to_dict() + assert asset_model_json2 == asset_model_json + + class TestModel_AssetListAccessControl: """ Test Class for AssetListAccessControl @@ -6915,6 +8221,82 @@ def test_container_reference_serialization(self): assert container_reference_model_json2 == container_reference_model_json +class TestModel_ContractAsset: + """ + Test Class for ContractAsset + """ + + def test_contract_asset_serialization(self): + """ + Test serialization/deserialization for ContractAsset + """ + + # Construct a json representation of a ContractAsset model + contract_asset_model_json = {} + contract_asset_model_json['id'] = 'testString' + contract_asset_model_json['name'] = 'testString' + + # Construct a model instance of ContractAsset by calling from_dict on the json representation + contract_asset_model = ContractAsset.from_dict(contract_asset_model_json) + assert contract_asset_model != False + + # Construct a model instance of ContractAsset by calling from_dict on the json representation + contract_asset_model_dict = ContractAsset.from_dict(contract_asset_model_json).__dict__ + contract_asset_model2 = ContractAsset(**contract_asset_model_dict) + + # Verify the model instances are equivalent + assert contract_asset_model == contract_asset_model2 + + # Convert model instance back to dict and verify no loss of data + contract_asset_model_json2 = contract_asset_model.to_dict() + assert contract_asset_model_json2 == contract_asset_model_json + + +class TestModel_ContractQualityRule: + """ + Test Class for ContractQualityRule + """ + + def test_contract_quality_rule_serialization(self): + """ + Test serialization/deserialization for ContractQualityRule + """ + + # Construct a json representation of a ContractQualityRule model + contract_quality_rule_model_json = {} + contract_quality_rule_model_json['type'] = 'sql' + contract_quality_rule_model_json['description'] = 'testString' + contract_quality_rule_model_json['rule'] = 'testString' + contract_quality_rule_model_json['implementation'] = 'testString' + contract_quality_rule_model_json['engine'] = 'testString' + contract_quality_rule_model_json['must_be_less_than'] = 'testString' + contract_quality_rule_model_json['must_be_less_or_equal_to'] = 'testString' + contract_quality_rule_model_json['must_be_greater_than'] = 'testString' + contract_quality_rule_model_json['must_be_greater_or_equal_to'] = 'testString' + contract_quality_rule_model_json['must_be_between'] = ['testString'] + contract_quality_rule_model_json['must_not_be_between'] = ['testString'] + contract_quality_rule_model_json['must_be'] = 'testString' + contract_quality_rule_model_json['must_not_be'] = 'testString' + contract_quality_rule_model_json['name'] = 'testString' + contract_quality_rule_model_json['unit'] = 'testString' + contract_quality_rule_model_json['query'] = 'testString' + + # Construct a model instance of ContractQualityRule by calling from_dict on the json representation + contract_quality_rule_model = ContractQualityRule.from_dict(contract_quality_rule_model_json) + assert contract_quality_rule_model != False + + # Construct a model instance of ContractQualityRule by calling from_dict on the json representation + contract_quality_rule_model_dict = ContractQualityRule.from_dict(contract_quality_rule_model_json).__dict__ + contract_quality_rule_model2 = ContractQualityRule(**contract_quality_rule_model_dict) + + # Verify the model instances are equivalent + assert contract_quality_rule_model == contract_quality_rule_model2 + + # Convert model instance back to dict and verify no loss of data + contract_quality_rule_model_json2 = contract_quality_rule_model.to_dict() + assert contract_quality_rule_model_json2 == contract_quality_rule_model_json + + class TestModel_ContractSchema: """ Test Class for ContractSchema @@ -6935,16 +8317,39 @@ def test_contract_schema_serialization(self): contract_schema_property_type_model['signed'] = 'testString' contract_schema_property_type_model['native_type'] = 'testString' + contract_quality_rule_model = {} # ContractQualityRule + contract_quality_rule_model['type'] = 'sql' + contract_quality_rule_model['description'] = 'testString' + contract_quality_rule_model['rule'] = 'testString' + contract_quality_rule_model['implementation'] = 'testString' + contract_quality_rule_model['engine'] = 'testString' + contract_quality_rule_model['must_be_less_than'] = 'testString' + contract_quality_rule_model['must_be_less_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_greater_than'] = 'testString' + contract_quality_rule_model['must_be_greater_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_between'] = ['testString'] + contract_quality_rule_model['must_not_be_between'] = ['testString'] + contract_quality_rule_model['must_be'] = 'testString' + contract_quality_rule_model['must_not_be'] = 'testString' + contract_quality_rule_model['name'] = 'testString' + contract_quality_rule_model['unit'] = 'testString' + contract_quality_rule_model['query'] = 'testString' + contract_schema_property_model = {} # ContractSchemaProperty contract_schema_property_model['name'] = 'testString' contract_schema_property_model['type'] = contract_schema_property_type_model + contract_schema_property_model['quality'] = [contract_quality_rule_model] # Construct a json representation of a ContractSchema model contract_schema_model_json = {} + contract_schema_model_json['asset_id'] = '2b0bf220-079c-11ee-be56-0242ac120002' + contract_schema_model_json['connection_id'] = '2b0bf220-079c-11ee-be56-0242ac120002' contract_schema_model_json['name'] = 'testString' contract_schema_model_json['description'] = 'testString' + contract_schema_model_json['connection_path'] = 'testString' contract_schema_model_json['physical_type'] = 'testString' contract_schema_model_json['properties'] = [contract_schema_property_model] + contract_schema_model_json['quality'] = [contract_quality_rule_model] # Construct a model instance of ContractSchema by calling from_dict on the json representation contract_schema_model = ContractSchema.from_dict(contract_schema_model_json) @@ -6982,10 +8387,29 @@ def test_contract_schema_property_serialization(self): contract_schema_property_type_model['signed'] = 'testString' contract_schema_property_type_model['native_type'] = 'testString' + contract_quality_rule_model = {} # ContractQualityRule + contract_quality_rule_model['type'] = 'sql' + contract_quality_rule_model['description'] = 'testString' + contract_quality_rule_model['rule'] = 'testString' + contract_quality_rule_model['implementation'] = 'testString' + contract_quality_rule_model['engine'] = 'testString' + contract_quality_rule_model['must_be_less_than'] = 'testString' + contract_quality_rule_model['must_be_less_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_greater_than'] = 'testString' + contract_quality_rule_model['must_be_greater_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_between'] = ['testString'] + contract_quality_rule_model['must_not_be_between'] = ['testString'] + contract_quality_rule_model['must_be'] = 'testString' + contract_quality_rule_model['must_not_be'] = 'testString' + contract_quality_rule_model['name'] = 'testString' + contract_quality_rule_model['unit'] = 'testString' + contract_quality_rule_model['query'] = 'testString' + # Construct a json representation of a ContractSchemaProperty model contract_schema_property_model_json = {} contract_schema_property_model_json['name'] = 'testString' contract_schema_property_model_json['type'] = contract_schema_property_type_model + contract_schema_property_model_json['quality'] = [contract_quality_rule_model] # Construct a model instance of ContractSchemaProperty by calling from_dict on the json representation contract_schema_property_model = ContractSchemaProperty.from_dict(contract_schema_property_model_json) @@ -7038,6 +8462,72 @@ def test_contract_schema_property_type_serialization(self): assert contract_schema_property_type_model_json2 == contract_schema_property_type_model_json +class TestModel_ContractServer: + """ + Test Class for ContractServer + """ + + def test_contract_server_serialization(self): + """ + Test serialization/deserialization for ContractServer + """ + + # Construct dict forms of any model objects needed in order to build this model. + + contract_asset_model = {} # ContractAsset + contract_asset_model['id'] = 'testString' + contract_asset_model['name'] = 'testString' + + contract_template_custom_property_model = {} # ContractTemplateCustomProperty + contract_template_custom_property_model['key'] = 'customPropertyKey' + contract_template_custom_property_model['value'] = 'customPropertyValue' + + # Construct a json representation of a ContractServer model + contract_server_model_json = {} + contract_server_model_json['server'] = 'testString' + contract_server_model_json['asset'] = contract_asset_model + contract_server_model_json['connection_id'] = 'testString' + contract_server_model_json['type'] = 'testString' + contract_server_model_json['description'] = 'testString' + contract_server_model_json['environment'] = 'testString' + contract_server_model_json['account'] = 'testString' + contract_server_model_json['catalog'] = 'testString' + contract_server_model_json['database'] = 'testString' + contract_server_model_json['dataset'] = 'testString' + contract_server_model_json['delimiter'] = 'testString' + contract_server_model_json['endpoint_url'] = 'testString' + contract_server_model_json['format'] = 'testString' + contract_server_model_json['host'] = 'testString' + contract_server_model_json['location'] = 'testString' + contract_server_model_json['path'] = 'testString' + contract_server_model_json['port'] = 'testString' + contract_server_model_json['project'] = 'testString' + contract_server_model_json['region'] = 'testString' + contract_server_model_json['region_name'] = 'testString' + contract_server_model_json['schema'] = 'testString' + contract_server_model_json['service_name'] = 'testString' + contract_server_model_json['staging_dir'] = 'testString' + contract_server_model_json['stream'] = 'testString' + contract_server_model_json['warehouse'] = 'testString' + contract_server_model_json['roles'] = ['testString'] + contract_server_model_json['custom_properties'] = [contract_template_custom_property_model] + + # Construct a model instance of ContractServer by calling from_dict on the json representation + contract_server_model = ContractServer.from_dict(contract_server_model_json) + assert contract_server_model != False + + # Construct a model instance of ContractServer by calling from_dict on the json representation + contract_server_model_dict = ContractServer.from_dict(contract_server_model_json).__dict__ + contract_server_model2 = ContractServer(**contract_server_model_dict) + + # Verify the model instances are equivalent + assert contract_server_model == contract_server_model2 + + # Convert model instance back to dict and verify no loss of data + contract_server_model_json2 = contract_server_model.to_dict() + assert contract_server_model_json2 == contract_server_model_json + + class TestModel_ContractTemplateCustomProperty: """ Test Class for ContractTemplateCustomProperty @@ -7288,6 +8778,39 @@ def test_contract_terms_serialization(self): contract_test_model['last_tested_time'] = 'testString' contract_test_model['message'] = 'testString' + contract_asset_model = {} # ContractAsset + contract_asset_model['id'] = 'testString' + contract_asset_model['name'] = 'testString' + + contract_server_model = {} # ContractServer + contract_server_model['server'] = 'testString' + contract_server_model['asset'] = contract_asset_model + contract_server_model['connection_id'] = 'testString' + contract_server_model['type'] = 'testString' + contract_server_model['description'] = 'testString' + contract_server_model['environment'] = 'testString' + contract_server_model['account'] = 'testString' + contract_server_model['catalog'] = 'testString' + contract_server_model['database'] = 'testString' + contract_server_model['dataset'] = 'testString' + contract_server_model['delimiter'] = 'testString' + contract_server_model['endpoint_url'] = 'testString' + contract_server_model['format'] = 'testString' + contract_server_model['host'] = 'testString' + contract_server_model['location'] = 'testString' + contract_server_model['path'] = 'testString' + contract_server_model['port'] = 'testString' + contract_server_model['project'] = 'testString' + contract_server_model['region'] = 'testString' + contract_server_model['region_name'] = 'testString' + contract_server_model['schema'] = 'testString' + contract_server_model['service_name'] = 'testString' + contract_server_model['staging_dir'] = 'testString' + contract_server_model['stream'] = 'testString' + contract_server_model['warehouse'] = 'testString' + contract_server_model['roles'] = ['testString'] + contract_server_model['custom_properties'] = [contract_template_custom_property_model] + contract_schema_property_type_model = {} # ContractSchemaPropertyType contract_schema_property_type_model['type'] = 'testString' contract_schema_property_type_model['length'] = 'testString' @@ -7296,15 +8819,38 @@ def test_contract_terms_serialization(self): contract_schema_property_type_model['signed'] = 'testString' contract_schema_property_type_model['native_type'] = 'testString' + contract_quality_rule_model = {} # ContractQualityRule + contract_quality_rule_model['type'] = 'sql' + contract_quality_rule_model['description'] = 'testString' + contract_quality_rule_model['rule'] = 'testString' + contract_quality_rule_model['implementation'] = 'testString' + contract_quality_rule_model['engine'] = 'testString' + contract_quality_rule_model['must_be_less_than'] = 'testString' + contract_quality_rule_model['must_be_less_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_greater_than'] = 'testString' + contract_quality_rule_model['must_be_greater_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_between'] = ['testString'] + contract_quality_rule_model['must_not_be_between'] = ['testString'] + contract_quality_rule_model['must_be'] = 'testString' + contract_quality_rule_model['must_not_be'] = 'testString' + contract_quality_rule_model['name'] = 'testString' + contract_quality_rule_model['unit'] = 'testString' + contract_quality_rule_model['query'] = 'testString' + contract_schema_property_model = {} # ContractSchemaProperty contract_schema_property_model['name'] = 'testString' contract_schema_property_model['type'] = contract_schema_property_type_model + contract_schema_property_model['quality'] = [contract_quality_rule_model] contract_schema_model = {} # ContractSchema + contract_schema_model['asset_id'] = '2b0bf220-079c-11ee-be56-0242ac120002' + contract_schema_model['connection_id'] = '2b0bf220-079c-11ee-be56-0242ac120002' contract_schema_model['name'] = 'testString' contract_schema_model['description'] = 'testString' + contract_schema_model['connection_path'] = 'testString' contract_schema_model['physical_type'] = 'testString' contract_schema_model['properties'] = [contract_schema_property_model] + contract_schema_model['quality'] = [contract_quality_rule_model] # Construct a json representation of a ContractTerms model contract_terms_model_json = {} @@ -7321,6 +8867,7 @@ def test_contract_terms_serialization(self): contract_terms_model_json['support_and_communication'] = [contract_template_support_and_communication_model] contract_terms_model_json['custom_properties'] = [contract_template_custom_property_model] contract_terms_model_json['contract_test'] = contract_test_model + contract_terms_model_json['servers'] = [contract_server_model] contract_terms_model_json['schema'] = [contract_schema_model] # Construct a model instance of ContractTerms by calling from_dict on the json representation @@ -7681,6 +9228,39 @@ def test_data_product_serialization(self): contract_test_model['last_tested_time'] = 'testString' contract_test_model['message'] = 'testString' + contract_asset_model = {} # ContractAsset + contract_asset_model['id'] = 'testString' + contract_asset_model['name'] = 'testString' + + contract_server_model = {} # ContractServer + contract_server_model['server'] = 'testString' + contract_server_model['asset'] = contract_asset_model + contract_server_model['connection_id'] = 'testString' + contract_server_model['type'] = 'testString' + contract_server_model['description'] = 'testString' + contract_server_model['environment'] = 'testString' + contract_server_model['account'] = 'testString' + contract_server_model['catalog'] = 'testString' + contract_server_model['database'] = 'testString' + contract_server_model['dataset'] = 'testString' + contract_server_model['delimiter'] = 'testString' + contract_server_model['endpoint_url'] = 'testString' + contract_server_model['format'] = 'testString' + contract_server_model['host'] = 'testString' + contract_server_model['location'] = 'testString' + contract_server_model['path'] = 'testString' + contract_server_model['port'] = 'testString' + contract_server_model['project'] = 'testString' + contract_server_model['region'] = 'testString' + contract_server_model['region_name'] = 'testString' + contract_server_model['schema'] = 'testString' + contract_server_model['service_name'] = 'testString' + contract_server_model['staging_dir'] = 'testString' + contract_server_model['stream'] = 'testString' + contract_server_model['warehouse'] = 'testString' + contract_server_model['roles'] = ['testString'] + contract_server_model['custom_properties'] = [contract_template_custom_property_model] + contract_schema_property_type_model = {} # ContractSchemaPropertyType contract_schema_property_type_model['type'] = 'testString' contract_schema_property_type_model['length'] = 'testString' @@ -7689,15 +9269,38 @@ def test_data_product_serialization(self): contract_schema_property_type_model['signed'] = 'testString' contract_schema_property_type_model['native_type'] = 'testString' + contract_quality_rule_model = {} # ContractQualityRule + contract_quality_rule_model['type'] = 'sql' + contract_quality_rule_model['description'] = 'testString' + contract_quality_rule_model['rule'] = 'testString' + contract_quality_rule_model['implementation'] = 'testString' + contract_quality_rule_model['engine'] = 'testString' + contract_quality_rule_model['must_be_less_than'] = 'testString' + contract_quality_rule_model['must_be_less_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_greater_than'] = 'testString' + contract_quality_rule_model['must_be_greater_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_between'] = ['testString'] + contract_quality_rule_model['must_not_be_between'] = ['testString'] + contract_quality_rule_model['must_be'] = 'testString' + contract_quality_rule_model['must_not_be'] = 'testString' + contract_quality_rule_model['name'] = 'testString' + contract_quality_rule_model['unit'] = 'testString' + contract_quality_rule_model['query'] = 'testString' + contract_schema_property_model = {} # ContractSchemaProperty contract_schema_property_model['name'] = 'testString' contract_schema_property_model['type'] = contract_schema_property_type_model + contract_schema_property_model['quality'] = [contract_quality_rule_model] contract_schema_model = {} # ContractSchema + contract_schema_model['asset_id'] = '2b0bf220-079c-11ee-be56-0242ac120002' + contract_schema_model['connection_id'] = '2b0bf220-079c-11ee-be56-0242ac120002' contract_schema_model['name'] = 'testString' contract_schema_model['description'] = 'testString' + contract_schema_model['connection_path'] = 'testString' contract_schema_model['physical_type'] = 'testString' contract_schema_model['properties'] = [contract_schema_property_model] + contract_schema_model['quality'] = [contract_quality_rule_model] contract_terms_model = {} # ContractTerms contract_terms_model['asset'] = asset_reference_model @@ -7713,6 +9316,7 @@ def test_data_product_serialization(self): contract_terms_model['support_and_communication'] = [contract_template_support_and_communication_model] contract_terms_model['custom_properties'] = [contract_template_custom_property_model] contract_terms_model['contract_test'] = contract_test_model + contract_terms_model['servers'] = [contract_server_model] contract_terms_model['schema'] = [contract_schema_model] asset_part_reference_model = {} # AssetPartReference @@ -7726,10 +9330,12 @@ def test_data_product_serialization(self): engine_details_model_model['engine_id'] = 'presto767' engine_details_model_model['engine_port'] = '34567' engine_details_model_model['engine_host'] = 'a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud' + engine_details_model_model['engine_type'] = 'spark' engine_details_model_model['associated_catalogs'] = ['testString'] producer_input_model_model = {} # ProducerInputModel producer_input_model_model['engine_details'] = engine_details_model_model + producer_input_model_model['engines'] = [engine_details_model_model] delivery_method_properties_model_model = {} # DeliveryMethodPropertiesModel delivery_method_properties_model_model['producer_input'] = producer_input_model_model @@ -7757,6 +9363,9 @@ def test_data_product_serialization(self): asset_list_access_control_model = {} # AssetListAccessControl asset_list_access_control_model['owner'] = 'IBMid-696000KYV9' + container_identity_model = {} # ContainerIdentity + container_identity_model['id'] = 'd29c42eb-7100-4b7a-8257-c196dbcca1cd' + data_product_version_summary_model = {} # DataProductVersionSummary data_product_version_summary_model['version'] = '1.0.0' data_product_version_summary_model['state'] = 'draft' @@ -7774,6 +9383,7 @@ def test_data_product_serialization(self): data_product_version_summary_model['comments'] = 'Comments by a producer that are provided either at the time of data product version creation or retiring' data_product_version_summary_model['access_control'] = asset_list_access_control_model data_product_version_summary_model['last_updated_at'] = '2019-01-01T12:00:00Z' + data_product_version_summary_model['sub_container'] = container_identity_model data_product_version_summary_model['is_restricted'] = True data_product_version_summary_model['id'] = '2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd' data_product_version_summary_model['asset'] = asset_reference_model @@ -7952,6 +9562,39 @@ def test_data_product_contract_template_serialization(self): contract_test_model['last_tested_time'] = 'testString' contract_test_model['message'] = 'testString' + contract_asset_model = {} # ContractAsset + contract_asset_model['id'] = 'testString' + contract_asset_model['name'] = 'testString' + + contract_server_model = {} # ContractServer + contract_server_model['server'] = 'testString' + contract_server_model['asset'] = contract_asset_model + contract_server_model['connection_id'] = 'testString' + contract_server_model['type'] = 'testString' + contract_server_model['description'] = 'testString' + contract_server_model['environment'] = 'testString' + contract_server_model['account'] = 'testString' + contract_server_model['catalog'] = 'testString' + contract_server_model['database'] = 'testString' + contract_server_model['dataset'] = 'testString' + contract_server_model['delimiter'] = 'testString' + contract_server_model['endpoint_url'] = 'testString' + contract_server_model['format'] = 'testString' + contract_server_model['host'] = 'testString' + contract_server_model['location'] = 'testString' + contract_server_model['path'] = 'testString' + contract_server_model['port'] = 'testString' + contract_server_model['project'] = 'testString' + contract_server_model['region'] = 'testString' + contract_server_model['region_name'] = 'testString' + contract_server_model['schema'] = 'testString' + contract_server_model['service_name'] = 'testString' + contract_server_model['staging_dir'] = 'testString' + contract_server_model['stream'] = 'testString' + contract_server_model['warehouse'] = 'testString' + contract_server_model['roles'] = ['testString'] + contract_server_model['custom_properties'] = [contract_template_custom_property_model] + contract_schema_property_type_model = {} # ContractSchemaPropertyType contract_schema_property_type_model['type'] = 'testString' contract_schema_property_type_model['length'] = 'testString' @@ -7960,15 +9603,38 @@ def test_data_product_contract_template_serialization(self): contract_schema_property_type_model['signed'] = 'testString' contract_schema_property_type_model['native_type'] = 'testString' + contract_quality_rule_model = {} # ContractQualityRule + contract_quality_rule_model['type'] = 'sql' + contract_quality_rule_model['description'] = 'testString' + contract_quality_rule_model['rule'] = 'testString' + contract_quality_rule_model['implementation'] = 'testString' + contract_quality_rule_model['engine'] = 'testString' + contract_quality_rule_model['must_be_less_than'] = 'testString' + contract_quality_rule_model['must_be_less_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_greater_than'] = 'testString' + contract_quality_rule_model['must_be_greater_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_between'] = ['testString'] + contract_quality_rule_model['must_not_be_between'] = ['testString'] + contract_quality_rule_model['must_be'] = 'testString' + contract_quality_rule_model['must_not_be'] = 'testString' + contract_quality_rule_model['name'] = 'testString' + contract_quality_rule_model['unit'] = 'testString' + contract_quality_rule_model['query'] = 'testString' + contract_schema_property_model = {} # ContractSchemaProperty contract_schema_property_model['name'] = 'testString' contract_schema_property_model['type'] = contract_schema_property_type_model + contract_schema_property_model['quality'] = [contract_quality_rule_model] contract_schema_model = {} # ContractSchema + contract_schema_model['asset_id'] = '2b0bf220-079c-11ee-be56-0242ac120002' + contract_schema_model['connection_id'] = '2b0bf220-079c-11ee-be56-0242ac120002' contract_schema_model['name'] = 'testString' contract_schema_model['description'] = 'testString' + contract_schema_model['connection_path'] = 'testString' contract_schema_model['physical_type'] = 'testString' contract_schema_model['properties'] = [contract_schema_property_model] + contract_schema_model['quality'] = [contract_quality_rule_model] contract_terms_model = {} # ContractTerms contract_terms_model['asset'] = asset_reference_model @@ -7984,12 +9650,15 @@ def test_data_product_contract_template_serialization(self): contract_terms_model['support_and_communication'] = [contract_template_support_and_communication_model] contract_terms_model['custom_properties'] = [contract_template_custom_property_model] contract_terms_model['contract_test'] = contract_test_model + contract_terms_model['servers'] = [contract_server_model] contract_terms_model['schema'] = [contract_schema_model] # Construct a json representation of a DataProductContractTemplate model data_product_contract_template_model_json = {} data_product_contract_template_model_json['container'] = container_reference_model data_product_contract_template_model_json['id'] = '20aa7c97-cfcc-4d16-ae76-2ca1847ce733' + data_product_contract_template_model_json['creator_id'] = 'IBMid-123456ABC' + data_product_contract_template_model_json['created_at'] = '2025-06-26T12:30:20.000Z' data_product_contract_template_model_json['name'] = 'Sample Data Contract Template' data_product_contract_template_model_json['error'] = error_message_model data_product_contract_template_model_json['contract_terms'] = contract_terms_model @@ -8103,6 +9772,39 @@ def test_data_product_contract_template_collection_serialization(self): contract_test_model['last_tested_time'] = 'testString' contract_test_model['message'] = 'testString' + contract_asset_model = {} # ContractAsset + contract_asset_model['id'] = 'testString' + contract_asset_model['name'] = 'testString' + + contract_server_model = {} # ContractServer + contract_server_model['server'] = 'testString' + contract_server_model['asset'] = contract_asset_model + contract_server_model['connection_id'] = 'testString' + contract_server_model['type'] = 'testString' + contract_server_model['description'] = 'testString' + contract_server_model['environment'] = 'testString' + contract_server_model['account'] = 'testString' + contract_server_model['catalog'] = 'testString' + contract_server_model['database'] = 'testString' + contract_server_model['dataset'] = 'testString' + contract_server_model['delimiter'] = 'testString' + contract_server_model['endpoint_url'] = 'testString' + contract_server_model['format'] = 'testString' + contract_server_model['host'] = 'testString' + contract_server_model['location'] = 'testString' + contract_server_model['path'] = 'testString' + contract_server_model['port'] = 'testString' + contract_server_model['project'] = 'testString' + contract_server_model['region'] = 'testString' + contract_server_model['region_name'] = 'testString' + contract_server_model['schema'] = 'testString' + contract_server_model['service_name'] = 'testString' + contract_server_model['staging_dir'] = 'testString' + contract_server_model['stream'] = 'testString' + contract_server_model['warehouse'] = 'testString' + contract_server_model['roles'] = ['testString'] + contract_server_model['custom_properties'] = [contract_template_custom_property_model] + contract_schema_property_type_model = {} # ContractSchemaPropertyType contract_schema_property_type_model['type'] = 'testString' contract_schema_property_type_model['length'] = 'testString' @@ -8111,15 +9813,38 @@ def test_data_product_contract_template_collection_serialization(self): contract_schema_property_type_model['signed'] = 'testString' contract_schema_property_type_model['native_type'] = 'testString' + contract_quality_rule_model = {} # ContractQualityRule + contract_quality_rule_model['type'] = 'sql' + contract_quality_rule_model['description'] = 'testString' + contract_quality_rule_model['rule'] = 'testString' + contract_quality_rule_model['implementation'] = 'testString' + contract_quality_rule_model['engine'] = 'testString' + contract_quality_rule_model['must_be_less_than'] = 'testString' + contract_quality_rule_model['must_be_less_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_greater_than'] = 'testString' + contract_quality_rule_model['must_be_greater_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_between'] = ['testString'] + contract_quality_rule_model['must_not_be_between'] = ['testString'] + contract_quality_rule_model['must_be'] = 'testString' + contract_quality_rule_model['must_not_be'] = 'testString' + contract_quality_rule_model['name'] = 'testString' + contract_quality_rule_model['unit'] = 'testString' + contract_quality_rule_model['query'] = 'testString' + contract_schema_property_model = {} # ContractSchemaProperty contract_schema_property_model['name'] = 'testString' contract_schema_property_model['type'] = contract_schema_property_type_model + contract_schema_property_model['quality'] = [contract_quality_rule_model] contract_schema_model = {} # ContractSchema + contract_schema_model['asset_id'] = '2b0bf220-079c-11ee-be56-0242ac120002' + contract_schema_model['connection_id'] = '2b0bf220-079c-11ee-be56-0242ac120002' contract_schema_model['name'] = 'testString' contract_schema_model['description'] = 'testString' + contract_schema_model['connection_path'] = 'testString' contract_schema_model['physical_type'] = 'testString' contract_schema_model['properties'] = [contract_schema_property_model] + contract_schema_model['quality'] = [contract_quality_rule_model] contract_terms_model = {} # ContractTerms contract_terms_model['asset'] = asset_reference_model @@ -8135,11 +9860,14 @@ def test_data_product_contract_template_collection_serialization(self): contract_terms_model['support_and_communication'] = [contract_template_support_and_communication_model] contract_terms_model['custom_properties'] = [contract_template_custom_property_model] contract_terms_model['contract_test'] = contract_test_model + contract_terms_model['servers'] = [contract_server_model] contract_terms_model['schema'] = [contract_schema_model] data_product_contract_template_model = {} # DataProductContractTemplate data_product_contract_template_model['container'] = container_reference_model data_product_contract_template_model['id'] = '20aa7c97-cfcc-4d16-ae76-2ca1847ce733' + data_product_contract_template_model['creator_id'] = 'IBMid-123456ABC' + data_product_contract_template_model['created_at'] = '2025-06-26T12:30:20.000Z' data_product_contract_template_model['name'] = 'Sample Data Contract Template' data_product_contract_template_model['error'] = error_message_model data_product_contract_template_model['contract_terms'] = contract_terms_model @@ -8237,6 +9965,9 @@ def test_data_product_domain_serialization(self): initialize_sub_domain_model['id'] = 'testString' initialize_sub_domain_model['description'] = 'testString' + container_identity_model = {} # ContainerIdentity + container_identity_model['id'] = 'd29c42eb-7100-4b7a-8257-c196dbcca1cd' + # Construct a json representation of a DataProductDomain model data_product_domain_model_json = {} data_product_domain_model_json['container'] = container_reference_model @@ -8245,9 +9976,11 @@ def test_data_product_domain_serialization(self): data_product_domain_model_json['name'] = 'Operations' data_product_domain_model_json['description'] = 'This is a description of the data product domain.' data_product_domain_model_json['id'] = 'testString' + data_product_domain_model_json['created_by'] = 'testString' data_product_domain_model_json['member_roles'] = member_roles_schema_model data_product_domain_model_json['properties'] = properties_schema_model data_product_domain_model_json['sub_domains'] = [initialize_sub_domain_model] + data_product_domain_model_json['sub_container'] = container_identity_model # Construct a model instance of DataProductDomain by calling from_dict on the json representation data_product_domain_model = DataProductDomain.from_dict(data_product_domain_model_json) @@ -8308,6 +10041,9 @@ def test_data_product_domain_collection_serialization(self): initialize_sub_domain_model['id'] = 'testString' initialize_sub_domain_model['description'] = 'testString' + container_identity_model = {} # ContainerIdentity + container_identity_model['id'] = 'd29c42eb-7100-4b7a-8257-c196dbcca1cd' + data_product_domain_model = {} # DataProductDomain data_product_domain_model['container'] = container_reference_model data_product_domain_model['trace'] = 'testString' @@ -8315,9 +10051,11 @@ def test_data_product_domain_collection_serialization(self): data_product_domain_model['name'] = 'Operations' data_product_domain_model['description'] = 'This is a description of the data product domain.' data_product_domain_model['id'] = 'testString' + data_product_domain_model['created_by'] = 'testString' data_product_domain_model['member_roles'] = member_roles_schema_model data_product_domain_model['properties'] = properties_schema_model data_product_domain_model['sub_domains'] = [initialize_sub_domain_model] + data_product_domain_model['sub_container'] = container_identity_model # Construct a json representation of a DataProductDomainCollection model data_product_domain_collection_model_json = {} @@ -8441,6 +10179,39 @@ def test_data_product_draft_serialization(self): contract_test_model['last_tested_time'] = 'testString' contract_test_model['message'] = 'testString' + contract_asset_model = {} # ContractAsset + contract_asset_model['id'] = 'testString' + contract_asset_model['name'] = 'testString' + + contract_server_model = {} # ContractServer + contract_server_model['server'] = 'testString' + contract_server_model['asset'] = contract_asset_model + contract_server_model['connection_id'] = 'testString' + contract_server_model['type'] = 'testString' + contract_server_model['description'] = 'testString' + contract_server_model['environment'] = 'testString' + contract_server_model['account'] = 'testString' + contract_server_model['catalog'] = 'testString' + contract_server_model['database'] = 'testString' + contract_server_model['dataset'] = 'testString' + contract_server_model['delimiter'] = 'testString' + contract_server_model['endpoint_url'] = 'testString' + contract_server_model['format'] = 'testString' + contract_server_model['host'] = 'testString' + contract_server_model['location'] = 'testString' + contract_server_model['path'] = 'testString' + contract_server_model['port'] = 'testString' + contract_server_model['project'] = 'testString' + contract_server_model['region'] = 'testString' + contract_server_model['region_name'] = 'testString' + contract_server_model['schema'] = 'testString' + contract_server_model['service_name'] = 'testString' + contract_server_model['staging_dir'] = 'testString' + contract_server_model['stream'] = 'testString' + contract_server_model['warehouse'] = 'testString' + contract_server_model['roles'] = ['testString'] + contract_server_model['custom_properties'] = [contract_template_custom_property_model] + contract_schema_property_type_model = {} # ContractSchemaPropertyType contract_schema_property_type_model['type'] = 'testString' contract_schema_property_type_model['length'] = 'testString' @@ -8449,15 +10220,38 @@ def test_data_product_draft_serialization(self): contract_schema_property_type_model['signed'] = 'testString' contract_schema_property_type_model['native_type'] = 'testString' + contract_quality_rule_model = {} # ContractQualityRule + contract_quality_rule_model['type'] = 'sql' + contract_quality_rule_model['description'] = 'testString' + contract_quality_rule_model['rule'] = 'testString' + contract_quality_rule_model['implementation'] = 'testString' + contract_quality_rule_model['engine'] = 'testString' + contract_quality_rule_model['must_be_less_than'] = 'testString' + contract_quality_rule_model['must_be_less_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_greater_than'] = 'testString' + contract_quality_rule_model['must_be_greater_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_between'] = ['testString'] + contract_quality_rule_model['must_not_be_between'] = ['testString'] + contract_quality_rule_model['must_be'] = 'testString' + contract_quality_rule_model['must_not_be'] = 'testString' + contract_quality_rule_model['name'] = 'testString' + contract_quality_rule_model['unit'] = 'testString' + contract_quality_rule_model['query'] = 'testString' + contract_schema_property_model = {} # ContractSchemaProperty contract_schema_property_model['name'] = 'testString' contract_schema_property_model['type'] = contract_schema_property_type_model + contract_schema_property_model['quality'] = [contract_quality_rule_model] contract_schema_model = {} # ContractSchema + contract_schema_model['asset_id'] = '2b0bf220-079c-11ee-be56-0242ac120002' + contract_schema_model['connection_id'] = '2b0bf220-079c-11ee-be56-0242ac120002' contract_schema_model['name'] = 'testString' contract_schema_model['description'] = 'testString' + contract_schema_model['connection_path'] = 'testString' contract_schema_model['physical_type'] = 'testString' contract_schema_model['properties'] = [contract_schema_property_model] + contract_schema_model['quality'] = [contract_quality_rule_model] contract_terms_model = {} # ContractTerms contract_terms_model['asset'] = asset_reference_model @@ -8473,6 +10267,7 @@ def test_data_product_draft_serialization(self): contract_terms_model['support_and_communication'] = [contract_template_support_and_communication_model] contract_terms_model['custom_properties'] = [contract_template_custom_property_model] contract_terms_model['contract_test'] = contract_test_model + contract_terms_model['servers'] = [contract_server_model] contract_terms_model['schema'] = [contract_schema_model] asset_part_reference_model = {} # AssetPartReference @@ -8486,10 +10281,12 @@ def test_data_product_draft_serialization(self): engine_details_model_model['engine_id'] = 'presto767' engine_details_model_model['engine_port'] = '34567' engine_details_model_model['engine_host'] = 'a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud' + engine_details_model_model['engine_type'] = 'spark' engine_details_model_model['associated_catalogs'] = ['testString'] producer_input_model_model = {} # ProducerInputModel producer_input_model_model['engine_details'] = engine_details_model_model + producer_input_model_model['engines'] = [engine_details_model_model] delivery_method_properties_model_model = {} # DeliveryMethodPropertiesModel delivery_method_properties_model_model['producer_input'] = producer_input_model_model @@ -8517,6 +10314,9 @@ def test_data_product_draft_serialization(self): asset_list_access_control_model = {} # AssetListAccessControl asset_list_access_control_model['owner'] = 'IBMid-696000KYV9' + container_identity_model = {} # ContainerIdentity + container_identity_model['id'] = 'd29c42eb-7100-4b7a-8257-c196dbcca1cd' + visualization_model = {} # Visualization visualization_model['id'] = 'testString' visualization_model['name'] = 'testString' @@ -8549,6 +10349,7 @@ def test_data_product_draft_serialization(self): data_product_draft_model_json['comments'] = 'Comments by a producer that are provided either at the time of data product version creation or retiring' data_product_draft_model_json['access_control'] = asset_list_access_control_model data_product_draft_model_json['last_updated_at'] = '2019-01-01T12:00:00Z' + data_product_draft_model_json['sub_container'] = container_identity_model data_product_draft_model_json['is_restricted'] = True data_product_draft_model_json['id'] = '2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd' data_product_draft_model_json['asset'] = asset_reference_model @@ -8684,6 +10485,39 @@ def test_data_product_draft_collection_serialization(self): contract_test_model['last_tested_time'] = 'testString' contract_test_model['message'] = 'testString' + contract_asset_model = {} # ContractAsset + contract_asset_model['id'] = 'testString' + contract_asset_model['name'] = 'testString' + + contract_server_model = {} # ContractServer + contract_server_model['server'] = 'testString' + contract_server_model['asset'] = contract_asset_model + contract_server_model['connection_id'] = 'testString' + contract_server_model['type'] = 'testString' + contract_server_model['description'] = 'testString' + contract_server_model['environment'] = 'testString' + contract_server_model['account'] = 'testString' + contract_server_model['catalog'] = 'testString' + contract_server_model['database'] = 'testString' + contract_server_model['dataset'] = 'testString' + contract_server_model['delimiter'] = 'testString' + contract_server_model['endpoint_url'] = 'testString' + contract_server_model['format'] = 'testString' + contract_server_model['host'] = 'testString' + contract_server_model['location'] = 'testString' + contract_server_model['path'] = 'testString' + contract_server_model['port'] = 'testString' + contract_server_model['project'] = 'testString' + contract_server_model['region'] = 'testString' + contract_server_model['region_name'] = 'testString' + contract_server_model['schema'] = 'testString' + contract_server_model['service_name'] = 'testString' + contract_server_model['staging_dir'] = 'testString' + contract_server_model['stream'] = 'testString' + contract_server_model['warehouse'] = 'testString' + contract_server_model['roles'] = ['testString'] + contract_server_model['custom_properties'] = [contract_template_custom_property_model] + contract_schema_property_type_model = {} # ContractSchemaPropertyType contract_schema_property_type_model['type'] = 'testString' contract_schema_property_type_model['length'] = 'testString' @@ -8692,15 +10526,38 @@ def test_data_product_draft_collection_serialization(self): contract_schema_property_type_model['signed'] = 'testString' contract_schema_property_type_model['native_type'] = 'testString' + contract_quality_rule_model = {} # ContractQualityRule + contract_quality_rule_model['type'] = 'sql' + contract_quality_rule_model['description'] = 'testString' + contract_quality_rule_model['rule'] = 'testString' + contract_quality_rule_model['implementation'] = 'testString' + contract_quality_rule_model['engine'] = 'testString' + contract_quality_rule_model['must_be_less_than'] = 'testString' + contract_quality_rule_model['must_be_less_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_greater_than'] = 'testString' + contract_quality_rule_model['must_be_greater_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_between'] = ['testString'] + contract_quality_rule_model['must_not_be_between'] = ['testString'] + contract_quality_rule_model['must_be'] = 'testString' + contract_quality_rule_model['must_not_be'] = 'testString' + contract_quality_rule_model['name'] = 'testString' + contract_quality_rule_model['unit'] = 'testString' + contract_quality_rule_model['query'] = 'testString' + contract_schema_property_model = {} # ContractSchemaProperty contract_schema_property_model['name'] = 'testString' contract_schema_property_model['type'] = contract_schema_property_type_model + contract_schema_property_model['quality'] = [contract_quality_rule_model] contract_schema_model = {} # ContractSchema + contract_schema_model['asset_id'] = '2b0bf220-079c-11ee-be56-0242ac120002' + contract_schema_model['connection_id'] = '2b0bf220-079c-11ee-be56-0242ac120002' contract_schema_model['name'] = 'testString' contract_schema_model['description'] = 'testString' + contract_schema_model['connection_path'] = 'testString' contract_schema_model['physical_type'] = 'testString' contract_schema_model['properties'] = [contract_schema_property_model] + contract_schema_model['quality'] = [contract_quality_rule_model] contract_terms_model = {} # ContractTerms contract_terms_model['asset'] = asset_reference_model @@ -8716,6 +10573,7 @@ def test_data_product_draft_collection_serialization(self): contract_terms_model['support_and_communication'] = [contract_template_support_and_communication_model] contract_terms_model['custom_properties'] = [contract_template_custom_property_model] contract_terms_model['contract_test'] = contract_test_model + contract_terms_model['servers'] = [contract_server_model] contract_terms_model['schema'] = [contract_schema_model] asset_part_reference_model = {} # AssetPartReference @@ -8729,10 +10587,12 @@ def test_data_product_draft_collection_serialization(self): engine_details_model_model['engine_id'] = 'presto767' engine_details_model_model['engine_port'] = '34567' engine_details_model_model['engine_host'] = 'a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud' + engine_details_model_model['engine_type'] = 'spark' engine_details_model_model['associated_catalogs'] = ['testString'] producer_input_model_model = {} # ProducerInputModel producer_input_model_model['engine_details'] = engine_details_model_model + producer_input_model_model['engines'] = [engine_details_model_model] delivery_method_properties_model_model = {} # DeliveryMethodPropertiesModel delivery_method_properties_model_model['producer_input'] = producer_input_model_model @@ -8760,6 +10620,9 @@ def test_data_product_draft_collection_serialization(self): asset_list_access_control_model = {} # AssetListAccessControl asset_list_access_control_model['owner'] = 'IBMid-696000KYV9' + container_identity_model = {} # ContainerIdentity + container_identity_model['id'] = 'd29c42eb-7100-4b7a-8257-c196dbcca1cd' + data_product_draft_summary_model = {} # DataProductDraftSummary data_product_draft_summary_model['version'] = '1.0.0' data_product_draft_summary_model['state'] = 'draft' @@ -8777,6 +10640,7 @@ def test_data_product_draft_collection_serialization(self): data_product_draft_summary_model['comments'] = 'Comments by a producer that are provided either at the time of data product version creation or retiring' data_product_draft_summary_model['access_control'] = asset_list_access_control_model data_product_draft_summary_model['last_updated_at'] = '2019-01-01T12:00:00Z' + data_product_draft_summary_model['sub_container'] = container_identity_model data_product_draft_summary_model['is_restricted'] = True data_product_draft_summary_model['id'] = '2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd' data_product_draft_summary_model['asset'] = asset_reference_model @@ -8947,6 +10811,39 @@ def test_data_product_draft_prototype_serialization(self): contract_test_model['last_tested_time'] = 'testString' contract_test_model['message'] = 'testString' + contract_asset_model = {} # ContractAsset + contract_asset_model['id'] = 'testString' + contract_asset_model['name'] = 'testString' + + contract_server_model = {} # ContractServer + contract_server_model['server'] = 'testString' + contract_server_model['asset'] = contract_asset_model + contract_server_model['connection_id'] = 'testString' + contract_server_model['type'] = 'testString' + contract_server_model['description'] = 'testString' + contract_server_model['environment'] = 'testString' + contract_server_model['account'] = 'testString' + contract_server_model['catalog'] = 'testString' + contract_server_model['database'] = 'testString' + contract_server_model['dataset'] = 'testString' + contract_server_model['delimiter'] = 'testString' + contract_server_model['endpoint_url'] = 'testString' + contract_server_model['format'] = 'testString' + contract_server_model['host'] = 'testString' + contract_server_model['location'] = 'testString' + contract_server_model['path'] = 'testString' + contract_server_model['port'] = 'testString' + contract_server_model['project'] = 'testString' + contract_server_model['region'] = 'testString' + contract_server_model['region_name'] = 'testString' + contract_server_model['schema'] = 'testString' + contract_server_model['service_name'] = 'testString' + contract_server_model['staging_dir'] = 'testString' + contract_server_model['stream'] = 'testString' + contract_server_model['warehouse'] = 'testString' + contract_server_model['roles'] = ['testString'] + contract_server_model['custom_properties'] = [contract_template_custom_property_model] + contract_schema_property_type_model = {} # ContractSchemaPropertyType contract_schema_property_type_model['type'] = 'testString' contract_schema_property_type_model['length'] = 'testString' @@ -8955,15 +10852,38 @@ def test_data_product_draft_prototype_serialization(self): contract_schema_property_type_model['signed'] = 'testString' contract_schema_property_type_model['native_type'] = 'testString' + contract_quality_rule_model = {} # ContractQualityRule + contract_quality_rule_model['type'] = 'sql' + contract_quality_rule_model['description'] = 'testString' + contract_quality_rule_model['rule'] = 'testString' + contract_quality_rule_model['implementation'] = 'testString' + contract_quality_rule_model['engine'] = 'testString' + contract_quality_rule_model['must_be_less_than'] = 'testString' + contract_quality_rule_model['must_be_less_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_greater_than'] = 'testString' + contract_quality_rule_model['must_be_greater_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_between'] = ['testString'] + contract_quality_rule_model['must_not_be_between'] = ['testString'] + contract_quality_rule_model['must_be'] = 'testString' + contract_quality_rule_model['must_not_be'] = 'testString' + contract_quality_rule_model['name'] = 'testString' + contract_quality_rule_model['unit'] = 'testString' + contract_quality_rule_model['query'] = 'testString' + contract_schema_property_model = {} # ContractSchemaProperty contract_schema_property_model['name'] = 'testString' contract_schema_property_model['type'] = contract_schema_property_type_model + contract_schema_property_model['quality'] = [contract_quality_rule_model] contract_schema_model = {} # ContractSchema + contract_schema_model['asset_id'] = '2b0bf220-079c-11ee-be56-0242ac120002' + contract_schema_model['connection_id'] = '2b0bf220-079c-11ee-be56-0242ac120002' contract_schema_model['name'] = 'testString' contract_schema_model['description'] = 'testString' + contract_schema_model['connection_path'] = 'testString' contract_schema_model['physical_type'] = 'testString' contract_schema_model['properties'] = [contract_schema_property_model] + contract_schema_model['quality'] = [contract_quality_rule_model] contract_terms_model = {} # ContractTerms contract_terms_model['asset'] = asset_reference_model @@ -8979,6 +10899,7 @@ def test_data_product_draft_prototype_serialization(self): contract_terms_model['support_and_communication'] = [contract_template_support_and_communication_model] contract_terms_model['custom_properties'] = [contract_template_custom_property_model] contract_terms_model['contract_test'] = contract_test_model + contract_terms_model['servers'] = [contract_server_model] contract_terms_model['schema'] = [contract_schema_model] asset_part_reference_model = {} # AssetPartReference @@ -8992,10 +10913,12 @@ def test_data_product_draft_prototype_serialization(self): engine_details_model_model['engine_id'] = 'presto767' engine_details_model_model['engine_port'] = '34567' engine_details_model_model['engine_host'] = 'a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud' + engine_details_model_model['engine_type'] = 'spark' engine_details_model_model['associated_catalogs'] = ['testString'] producer_input_model_model = {} # ProducerInputModel producer_input_model_model['engine_details'] = engine_details_model_model + producer_input_model_model['engines'] = [engine_details_model_model] delivery_method_properties_model_model = {} # DeliveryMethodPropertiesModel delivery_method_properties_model_model['producer_input'] = producer_input_model_model @@ -9048,6 +10971,7 @@ def test_data_product_draft_prototype_serialization(self): data_product_draft_prototype_model_json['comments'] = 'Comments by a producer that are provided either at the time of data product version creation or retiring' data_product_draft_prototype_model_json['access_control'] = asset_list_access_control_model data_product_draft_prototype_model_json['last_updated_at'] = '2019-01-01T12:00:00Z' + data_product_draft_prototype_model_json['sub_container'] = container_identity_model data_product_draft_prototype_model_json['is_restricted'] = True data_product_draft_prototype_model_json['asset'] = asset_prototype_model @@ -9169,6 +11093,39 @@ def test_data_product_draft_summary_serialization(self): contract_test_model['last_tested_time'] = 'testString' contract_test_model['message'] = 'testString' + contract_asset_model = {} # ContractAsset + contract_asset_model['id'] = 'testString' + contract_asset_model['name'] = 'testString' + + contract_server_model = {} # ContractServer + contract_server_model['server'] = 'testString' + contract_server_model['asset'] = contract_asset_model + contract_server_model['connection_id'] = 'testString' + contract_server_model['type'] = 'testString' + contract_server_model['description'] = 'testString' + contract_server_model['environment'] = 'testString' + contract_server_model['account'] = 'testString' + contract_server_model['catalog'] = 'testString' + contract_server_model['database'] = 'testString' + contract_server_model['dataset'] = 'testString' + contract_server_model['delimiter'] = 'testString' + contract_server_model['endpoint_url'] = 'testString' + contract_server_model['format'] = 'testString' + contract_server_model['host'] = 'testString' + contract_server_model['location'] = 'testString' + contract_server_model['path'] = 'testString' + contract_server_model['port'] = 'testString' + contract_server_model['project'] = 'testString' + contract_server_model['region'] = 'testString' + contract_server_model['region_name'] = 'testString' + contract_server_model['schema'] = 'testString' + contract_server_model['service_name'] = 'testString' + contract_server_model['staging_dir'] = 'testString' + contract_server_model['stream'] = 'testString' + contract_server_model['warehouse'] = 'testString' + contract_server_model['roles'] = ['testString'] + contract_server_model['custom_properties'] = [contract_template_custom_property_model] + contract_schema_property_type_model = {} # ContractSchemaPropertyType contract_schema_property_type_model['type'] = 'testString' contract_schema_property_type_model['length'] = 'testString' @@ -9177,15 +11134,38 @@ def test_data_product_draft_summary_serialization(self): contract_schema_property_type_model['signed'] = 'testString' contract_schema_property_type_model['native_type'] = 'testString' + contract_quality_rule_model = {} # ContractQualityRule + contract_quality_rule_model['type'] = 'sql' + contract_quality_rule_model['description'] = 'testString' + contract_quality_rule_model['rule'] = 'testString' + contract_quality_rule_model['implementation'] = 'testString' + contract_quality_rule_model['engine'] = 'testString' + contract_quality_rule_model['must_be_less_than'] = 'testString' + contract_quality_rule_model['must_be_less_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_greater_than'] = 'testString' + contract_quality_rule_model['must_be_greater_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_between'] = ['testString'] + contract_quality_rule_model['must_not_be_between'] = ['testString'] + contract_quality_rule_model['must_be'] = 'testString' + contract_quality_rule_model['must_not_be'] = 'testString' + contract_quality_rule_model['name'] = 'testString' + contract_quality_rule_model['unit'] = 'testString' + contract_quality_rule_model['query'] = 'testString' + contract_schema_property_model = {} # ContractSchemaProperty contract_schema_property_model['name'] = 'testString' contract_schema_property_model['type'] = contract_schema_property_type_model + contract_schema_property_model['quality'] = [contract_quality_rule_model] contract_schema_model = {} # ContractSchema + contract_schema_model['asset_id'] = '2b0bf220-079c-11ee-be56-0242ac120002' + contract_schema_model['connection_id'] = '2b0bf220-079c-11ee-be56-0242ac120002' contract_schema_model['name'] = 'testString' contract_schema_model['description'] = 'testString' + contract_schema_model['connection_path'] = 'testString' contract_schema_model['physical_type'] = 'testString' contract_schema_model['properties'] = [contract_schema_property_model] + contract_schema_model['quality'] = [contract_quality_rule_model] contract_terms_model = {} # ContractTerms contract_terms_model['asset'] = asset_reference_model @@ -9201,6 +11181,7 @@ def test_data_product_draft_summary_serialization(self): contract_terms_model['support_and_communication'] = [contract_template_support_and_communication_model] contract_terms_model['custom_properties'] = [contract_template_custom_property_model] contract_terms_model['contract_test'] = contract_test_model + contract_terms_model['servers'] = [contract_server_model] contract_terms_model['schema'] = [contract_schema_model] asset_part_reference_model = {} # AssetPartReference @@ -9214,10 +11195,12 @@ def test_data_product_draft_summary_serialization(self): engine_details_model_model['engine_id'] = 'presto767' engine_details_model_model['engine_port'] = '34567' engine_details_model_model['engine_host'] = 'a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud' + engine_details_model_model['engine_type'] = 'spark' engine_details_model_model['associated_catalogs'] = ['testString'] producer_input_model_model = {} # ProducerInputModel producer_input_model_model['engine_details'] = engine_details_model_model + producer_input_model_model['engines'] = [engine_details_model_model] delivery_method_properties_model_model = {} # DeliveryMethodPropertiesModel delivery_method_properties_model_model['producer_input'] = producer_input_model_model @@ -9245,6 +11228,9 @@ def test_data_product_draft_summary_serialization(self): asset_list_access_control_model = {} # AssetListAccessControl asset_list_access_control_model['owner'] = 'IBMid-696000KYV9' + container_identity_model = {} # ContainerIdentity + container_identity_model['id'] = 'd29c42eb-7100-4b7a-8257-c196dbcca1cd' + # Construct a json representation of a DataProductDraftSummary model data_product_draft_summary_model_json = {} data_product_draft_summary_model_json['version'] = '1.0.0' @@ -9263,6 +11249,7 @@ def test_data_product_draft_summary_serialization(self): data_product_draft_summary_model_json['comments'] = 'Comments by a producer that are provided either at the time of data product version creation or retiring' data_product_draft_summary_model_json['access_control'] = asset_list_access_control_model data_product_draft_summary_model_json['last_updated_at'] = '2019-01-01T12:00:00Z' + data_product_draft_summary_model_json['sub_container'] = container_identity_model data_product_draft_summary_model_json['is_restricted'] = True data_product_draft_summary_model_json['id'] = '2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd' data_product_draft_summary_model_json['asset'] = asset_reference_model @@ -9454,10 +11441,12 @@ def test_data_product_part_serialization(self): engine_details_model_model['engine_id'] = 'presto767' engine_details_model_model['engine_port'] = '34567' engine_details_model_model['engine_host'] = 'a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud' + engine_details_model_model['engine_type'] = 'spark' engine_details_model_model['associated_catalogs'] = ['testString'] producer_input_model_model = {} # ProducerInputModel producer_input_model_model['engine_details'] = engine_details_model_model + producer_input_model_model['engines'] = [engine_details_model_model] delivery_method_properties_model_model = {} # DeliveryMethodPropertiesModel delivery_method_properties_model_model['producer_input'] = producer_input_model_model @@ -9590,6 +11579,39 @@ def test_data_product_release_serialization(self): contract_test_model['last_tested_time'] = 'testString' contract_test_model['message'] = 'testString' + contract_asset_model = {} # ContractAsset + contract_asset_model['id'] = 'testString' + contract_asset_model['name'] = 'testString' + + contract_server_model = {} # ContractServer + contract_server_model['server'] = 'testString' + contract_server_model['asset'] = contract_asset_model + contract_server_model['connection_id'] = 'testString' + contract_server_model['type'] = 'testString' + contract_server_model['description'] = 'testString' + contract_server_model['environment'] = 'testString' + contract_server_model['account'] = 'testString' + contract_server_model['catalog'] = 'testString' + contract_server_model['database'] = 'testString' + contract_server_model['dataset'] = 'testString' + contract_server_model['delimiter'] = 'testString' + contract_server_model['endpoint_url'] = 'testString' + contract_server_model['format'] = 'testString' + contract_server_model['host'] = 'testString' + contract_server_model['location'] = 'testString' + contract_server_model['path'] = 'testString' + contract_server_model['port'] = 'testString' + contract_server_model['project'] = 'testString' + contract_server_model['region'] = 'testString' + contract_server_model['region_name'] = 'testString' + contract_server_model['schema'] = 'testString' + contract_server_model['service_name'] = 'testString' + contract_server_model['staging_dir'] = 'testString' + contract_server_model['stream'] = 'testString' + contract_server_model['warehouse'] = 'testString' + contract_server_model['roles'] = ['testString'] + contract_server_model['custom_properties'] = [contract_template_custom_property_model] + contract_schema_property_type_model = {} # ContractSchemaPropertyType contract_schema_property_type_model['type'] = 'testString' contract_schema_property_type_model['length'] = 'testString' @@ -9598,15 +11620,38 @@ def test_data_product_release_serialization(self): contract_schema_property_type_model['signed'] = 'testString' contract_schema_property_type_model['native_type'] = 'testString' + contract_quality_rule_model = {} # ContractQualityRule + contract_quality_rule_model['type'] = 'sql' + contract_quality_rule_model['description'] = 'testString' + contract_quality_rule_model['rule'] = 'testString' + contract_quality_rule_model['implementation'] = 'testString' + contract_quality_rule_model['engine'] = 'testString' + contract_quality_rule_model['must_be_less_than'] = 'testString' + contract_quality_rule_model['must_be_less_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_greater_than'] = 'testString' + contract_quality_rule_model['must_be_greater_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_between'] = ['testString'] + contract_quality_rule_model['must_not_be_between'] = ['testString'] + contract_quality_rule_model['must_be'] = 'testString' + contract_quality_rule_model['must_not_be'] = 'testString' + contract_quality_rule_model['name'] = 'testString' + contract_quality_rule_model['unit'] = 'testString' + contract_quality_rule_model['query'] = 'testString' + contract_schema_property_model = {} # ContractSchemaProperty contract_schema_property_model['name'] = 'testString' contract_schema_property_model['type'] = contract_schema_property_type_model + contract_schema_property_model['quality'] = [contract_quality_rule_model] contract_schema_model = {} # ContractSchema + contract_schema_model['asset_id'] = '2b0bf220-079c-11ee-be56-0242ac120002' + contract_schema_model['connection_id'] = '2b0bf220-079c-11ee-be56-0242ac120002' contract_schema_model['name'] = 'testString' contract_schema_model['description'] = 'testString' + contract_schema_model['connection_path'] = 'testString' contract_schema_model['physical_type'] = 'testString' contract_schema_model['properties'] = [contract_schema_property_model] + contract_schema_model['quality'] = [contract_quality_rule_model] contract_terms_model = {} # ContractTerms contract_terms_model['asset'] = asset_reference_model @@ -9622,6 +11667,7 @@ def test_data_product_release_serialization(self): contract_terms_model['support_and_communication'] = [contract_template_support_and_communication_model] contract_terms_model['custom_properties'] = [contract_template_custom_property_model] contract_terms_model['contract_test'] = contract_test_model + contract_terms_model['servers'] = [contract_server_model] contract_terms_model['schema'] = [contract_schema_model] asset_part_reference_model = {} # AssetPartReference @@ -9635,10 +11681,12 @@ def test_data_product_release_serialization(self): engine_details_model_model['engine_id'] = 'presto767' engine_details_model_model['engine_port'] = '34567' engine_details_model_model['engine_host'] = 'a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud' + engine_details_model_model['engine_type'] = 'spark' engine_details_model_model['associated_catalogs'] = ['testString'] producer_input_model_model = {} # ProducerInputModel producer_input_model_model['engine_details'] = engine_details_model_model + producer_input_model_model['engines'] = [engine_details_model_model] delivery_method_properties_model_model = {} # DeliveryMethodPropertiesModel delivery_method_properties_model_model['producer_input'] = producer_input_model_model @@ -9666,6 +11714,9 @@ def test_data_product_release_serialization(self): asset_list_access_control_model = {} # AssetListAccessControl asset_list_access_control_model['owner'] = 'IBMid-696000KYV9' + container_identity_model = {} # ContainerIdentity + container_identity_model['id'] = 'd29c42eb-7100-4b7a-8257-c196dbcca1cd' + visualization_model = {} # Visualization visualization_model['id'] = 'testString' visualization_model['name'] = 'testString' @@ -9698,6 +11749,7 @@ def test_data_product_release_serialization(self): data_product_release_model_json['comments'] = 'Comments by a producer that are provided either at the time of data product version creation or retiring' data_product_release_model_json['access_control'] = asset_list_access_control_model data_product_release_model_json['last_updated_at'] = '2019-01-01T12:00:00Z' + data_product_release_model_json['sub_container'] = container_identity_model data_product_release_model_json['is_restricted'] = True data_product_release_model_json['id'] = '2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd' data_product_release_model_json['asset'] = asset_reference_model @@ -9833,6 +11885,39 @@ def test_data_product_release_collection_serialization(self): contract_test_model['last_tested_time'] = 'testString' contract_test_model['message'] = 'testString' + contract_asset_model = {} # ContractAsset + contract_asset_model['id'] = 'testString' + contract_asset_model['name'] = 'testString' + + contract_server_model = {} # ContractServer + contract_server_model['server'] = 'testString' + contract_server_model['asset'] = contract_asset_model + contract_server_model['connection_id'] = 'testString' + contract_server_model['type'] = 'testString' + contract_server_model['description'] = 'testString' + contract_server_model['environment'] = 'testString' + contract_server_model['account'] = 'testString' + contract_server_model['catalog'] = 'testString' + contract_server_model['database'] = 'testString' + contract_server_model['dataset'] = 'testString' + contract_server_model['delimiter'] = 'testString' + contract_server_model['endpoint_url'] = 'testString' + contract_server_model['format'] = 'testString' + contract_server_model['host'] = 'testString' + contract_server_model['location'] = 'testString' + contract_server_model['path'] = 'testString' + contract_server_model['port'] = 'testString' + contract_server_model['project'] = 'testString' + contract_server_model['region'] = 'testString' + contract_server_model['region_name'] = 'testString' + contract_server_model['schema'] = 'testString' + contract_server_model['service_name'] = 'testString' + contract_server_model['staging_dir'] = 'testString' + contract_server_model['stream'] = 'testString' + contract_server_model['warehouse'] = 'testString' + contract_server_model['roles'] = ['testString'] + contract_server_model['custom_properties'] = [contract_template_custom_property_model] + contract_schema_property_type_model = {} # ContractSchemaPropertyType contract_schema_property_type_model['type'] = 'testString' contract_schema_property_type_model['length'] = 'testString' @@ -9841,15 +11926,38 @@ def test_data_product_release_collection_serialization(self): contract_schema_property_type_model['signed'] = 'testString' contract_schema_property_type_model['native_type'] = 'testString' + contract_quality_rule_model = {} # ContractQualityRule + contract_quality_rule_model['type'] = 'sql' + contract_quality_rule_model['description'] = 'testString' + contract_quality_rule_model['rule'] = 'testString' + contract_quality_rule_model['implementation'] = 'testString' + contract_quality_rule_model['engine'] = 'testString' + contract_quality_rule_model['must_be_less_than'] = 'testString' + contract_quality_rule_model['must_be_less_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_greater_than'] = 'testString' + contract_quality_rule_model['must_be_greater_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_between'] = ['testString'] + contract_quality_rule_model['must_not_be_between'] = ['testString'] + contract_quality_rule_model['must_be'] = 'testString' + contract_quality_rule_model['must_not_be'] = 'testString' + contract_quality_rule_model['name'] = 'testString' + contract_quality_rule_model['unit'] = 'testString' + contract_quality_rule_model['query'] = 'testString' + contract_schema_property_model = {} # ContractSchemaProperty contract_schema_property_model['name'] = 'testString' contract_schema_property_model['type'] = contract_schema_property_type_model + contract_schema_property_model['quality'] = [contract_quality_rule_model] contract_schema_model = {} # ContractSchema + contract_schema_model['asset_id'] = '2b0bf220-079c-11ee-be56-0242ac120002' + contract_schema_model['connection_id'] = '2b0bf220-079c-11ee-be56-0242ac120002' contract_schema_model['name'] = 'testString' contract_schema_model['description'] = 'testString' + contract_schema_model['connection_path'] = 'testString' contract_schema_model['physical_type'] = 'testString' contract_schema_model['properties'] = [contract_schema_property_model] + contract_schema_model['quality'] = [contract_quality_rule_model] contract_terms_model = {} # ContractTerms contract_terms_model['asset'] = asset_reference_model @@ -9865,6 +11973,7 @@ def test_data_product_release_collection_serialization(self): contract_terms_model['support_and_communication'] = [contract_template_support_and_communication_model] contract_terms_model['custom_properties'] = [contract_template_custom_property_model] contract_terms_model['contract_test'] = contract_test_model + contract_terms_model['servers'] = [contract_server_model] contract_terms_model['schema'] = [contract_schema_model] asset_part_reference_model = {} # AssetPartReference @@ -9878,10 +11987,12 @@ def test_data_product_release_collection_serialization(self): engine_details_model_model['engine_id'] = 'presto767' engine_details_model_model['engine_port'] = '34567' engine_details_model_model['engine_host'] = 'a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud' + engine_details_model_model['engine_type'] = 'spark' engine_details_model_model['associated_catalogs'] = ['testString'] producer_input_model_model = {} # ProducerInputModel producer_input_model_model['engine_details'] = engine_details_model_model + producer_input_model_model['engines'] = [engine_details_model_model] delivery_method_properties_model_model = {} # DeliveryMethodPropertiesModel delivery_method_properties_model_model['producer_input'] = producer_input_model_model @@ -9909,6 +12020,9 @@ def test_data_product_release_collection_serialization(self): asset_list_access_control_model = {} # AssetListAccessControl asset_list_access_control_model['owner'] = 'IBMid-696000KYV9' + container_identity_model = {} # ContainerIdentity + container_identity_model['id'] = 'd29c42eb-7100-4b7a-8257-c196dbcca1cd' + data_product_release_summary_model = {} # DataProductReleaseSummary data_product_release_summary_model['version'] = '1.0.0' data_product_release_summary_model['state'] = 'draft' @@ -9926,6 +12040,7 @@ def test_data_product_release_collection_serialization(self): data_product_release_summary_model['comments'] = 'Comments by a producer that are provided either at the time of data product version creation or retiring' data_product_release_summary_model['access_control'] = asset_list_access_control_model data_product_release_summary_model['last_updated_at'] = '2019-01-01T12:00:00Z' + data_product_release_summary_model['sub_container'] = container_identity_model data_product_release_summary_model['is_restricted'] = True data_product_release_summary_model['id'] = '2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd' data_product_release_summary_model['asset'] = asset_reference_model @@ -10097,6 +12212,39 @@ def test_data_product_release_summary_serialization(self): contract_test_model['last_tested_time'] = 'testString' contract_test_model['message'] = 'testString' + contract_asset_model = {} # ContractAsset + contract_asset_model['id'] = 'testString' + contract_asset_model['name'] = 'testString' + + contract_server_model = {} # ContractServer + contract_server_model['server'] = 'testString' + contract_server_model['asset'] = contract_asset_model + contract_server_model['connection_id'] = 'testString' + contract_server_model['type'] = 'testString' + contract_server_model['description'] = 'testString' + contract_server_model['environment'] = 'testString' + contract_server_model['account'] = 'testString' + contract_server_model['catalog'] = 'testString' + contract_server_model['database'] = 'testString' + contract_server_model['dataset'] = 'testString' + contract_server_model['delimiter'] = 'testString' + contract_server_model['endpoint_url'] = 'testString' + contract_server_model['format'] = 'testString' + contract_server_model['host'] = 'testString' + contract_server_model['location'] = 'testString' + contract_server_model['path'] = 'testString' + contract_server_model['port'] = 'testString' + contract_server_model['project'] = 'testString' + contract_server_model['region'] = 'testString' + contract_server_model['region_name'] = 'testString' + contract_server_model['schema'] = 'testString' + contract_server_model['service_name'] = 'testString' + contract_server_model['staging_dir'] = 'testString' + contract_server_model['stream'] = 'testString' + contract_server_model['warehouse'] = 'testString' + contract_server_model['roles'] = ['testString'] + contract_server_model['custom_properties'] = [contract_template_custom_property_model] + contract_schema_property_type_model = {} # ContractSchemaPropertyType contract_schema_property_type_model['type'] = 'testString' contract_schema_property_type_model['length'] = 'testString' @@ -10105,15 +12253,38 @@ def test_data_product_release_summary_serialization(self): contract_schema_property_type_model['signed'] = 'testString' contract_schema_property_type_model['native_type'] = 'testString' + contract_quality_rule_model = {} # ContractQualityRule + contract_quality_rule_model['type'] = 'sql' + contract_quality_rule_model['description'] = 'testString' + contract_quality_rule_model['rule'] = 'testString' + contract_quality_rule_model['implementation'] = 'testString' + contract_quality_rule_model['engine'] = 'testString' + contract_quality_rule_model['must_be_less_than'] = 'testString' + contract_quality_rule_model['must_be_less_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_greater_than'] = 'testString' + contract_quality_rule_model['must_be_greater_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_between'] = ['testString'] + contract_quality_rule_model['must_not_be_between'] = ['testString'] + contract_quality_rule_model['must_be'] = 'testString' + contract_quality_rule_model['must_not_be'] = 'testString' + contract_quality_rule_model['name'] = 'testString' + contract_quality_rule_model['unit'] = 'testString' + contract_quality_rule_model['query'] = 'testString' + contract_schema_property_model = {} # ContractSchemaProperty contract_schema_property_model['name'] = 'testString' contract_schema_property_model['type'] = contract_schema_property_type_model + contract_schema_property_model['quality'] = [contract_quality_rule_model] contract_schema_model = {} # ContractSchema + contract_schema_model['asset_id'] = '2b0bf220-079c-11ee-be56-0242ac120002' + contract_schema_model['connection_id'] = '2b0bf220-079c-11ee-be56-0242ac120002' contract_schema_model['name'] = 'testString' contract_schema_model['description'] = 'testString' + contract_schema_model['connection_path'] = 'testString' contract_schema_model['physical_type'] = 'testString' contract_schema_model['properties'] = [contract_schema_property_model] + contract_schema_model['quality'] = [contract_quality_rule_model] contract_terms_model = {} # ContractTerms contract_terms_model['asset'] = asset_reference_model @@ -10129,6 +12300,7 @@ def test_data_product_release_summary_serialization(self): contract_terms_model['support_and_communication'] = [contract_template_support_and_communication_model] contract_terms_model['custom_properties'] = [contract_template_custom_property_model] contract_terms_model['contract_test'] = contract_test_model + contract_terms_model['servers'] = [contract_server_model] contract_terms_model['schema'] = [contract_schema_model] asset_part_reference_model = {} # AssetPartReference @@ -10142,10 +12314,12 @@ def test_data_product_release_summary_serialization(self): engine_details_model_model['engine_id'] = 'presto767' engine_details_model_model['engine_port'] = '34567' engine_details_model_model['engine_host'] = 'a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud' + engine_details_model_model['engine_type'] = 'spark' engine_details_model_model['associated_catalogs'] = ['testString'] producer_input_model_model = {} # ProducerInputModel producer_input_model_model['engine_details'] = engine_details_model_model + producer_input_model_model['engines'] = [engine_details_model_model] delivery_method_properties_model_model = {} # DeliveryMethodPropertiesModel delivery_method_properties_model_model['producer_input'] = producer_input_model_model @@ -10173,6 +12347,9 @@ def test_data_product_release_summary_serialization(self): asset_list_access_control_model = {} # AssetListAccessControl asset_list_access_control_model['owner'] = 'IBMid-696000KYV9' + container_identity_model = {} # ContainerIdentity + container_identity_model['id'] = 'd29c42eb-7100-4b7a-8257-c196dbcca1cd' + # Construct a json representation of a DataProductReleaseSummary model data_product_release_summary_model_json = {} data_product_release_summary_model_json['version'] = '1.0.0' @@ -10191,6 +12368,7 @@ def test_data_product_release_summary_serialization(self): data_product_release_summary_model_json['comments'] = 'Comments by a producer that are provided either at the time of data product version creation or retiring' data_product_release_summary_model_json['access_control'] = asset_list_access_control_model data_product_release_summary_model_json['last_updated_at'] = '2019-01-01T12:00:00Z' + data_product_release_summary_model_json['sub_container'] = container_identity_model data_product_release_summary_model_json['is_restricted'] = True data_product_release_summary_model_json['id'] = '2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd' data_product_release_summary_model_json['asset'] = asset_reference_model @@ -10403,6 +12581,39 @@ def test_data_product_version_collection_serialization(self): contract_test_model['last_tested_time'] = 'testString' contract_test_model['message'] = 'testString' + contract_asset_model = {} # ContractAsset + contract_asset_model['id'] = 'testString' + contract_asset_model['name'] = 'testString' + + contract_server_model = {} # ContractServer + contract_server_model['server'] = 'testString' + contract_server_model['asset'] = contract_asset_model + contract_server_model['connection_id'] = 'testString' + contract_server_model['type'] = 'testString' + contract_server_model['description'] = 'testString' + contract_server_model['environment'] = 'testString' + contract_server_model['account'] = 'testString' + contract_server_model['catalog'] = 'testString' + contract_server_model['database'] = 'testString' + contract_server_model['dataset'] = 'testString' + contract_server_model['delimiter'] = 'testString' + contract_server_model['endpoint_url'] = 'testString' + contract_server_model['format'] = 'testString' + contract_server_model['host'] = 'testString' + contract_server_model['location'] = 'testString' + contract_server_model['path'] = 'testString' + contract_server_model['port'] = 'testString' + contract_server_model['project'] = 'testString' + contract_server_model['region'] = 'testString' + contract_server_model['region_name'] = 'testString' + contract_server_model['schema'] = 'testString' + contract_server_model['service_name'] = 'testString' + contract_server_model['staging_dir'] = 'testString' + contract_server_model['stream'] = 'testString' + contract_server_model['warehouse'] = 'testString' + contract_server_model['roles'] = ['testString'] + contract_server_model['custom_properties'] = [contract_template_custom_property_model] + contract_schema_property_type_model = {} # ContractSchemaPropertyType contract_schema_property_type_model['type'] = 'testString' contract_schema_property_type_model['length'] = 'testString' @@ -10411,15 +12622,38 @@ def test_data_product_version_collection_serialization(self): contract_schema_property_type_model['signed'] = 'testString' contract_schema_property_type_model['native_type'] = 'testString' + contract_quality_rule_model = {} # ContractQualityRule + contract_quality_rule_model['type'] = 'sql' + contract_quality_rule_model['description'] = 'testString' + contract_quality_rule_model['rule'] = 'testString' + contract_quality_rule_model['implementation'] = 'testString' + contract_quality_rule_model['engine'] = 'testString' + contract_quality_rule_model['must_be_less_than'] = 'testString' + contract_quality_rule_model['must_be_less_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_greater_than'] = 'testString' + contract_quality_rule_model['must_be_greater_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_between'] = ['testString'] + contract_quality_rule_model['must_not_be_between'] = ['testString'] + contract_quality_rule_model['must_be'] = 'testString' + contract_quality_rule_model['must_not_be'] = 'testString' + contract_quality_rule_model['name'] = 'testString' + contract_quality_rule_model['unit'] = 'testString' + contract_quality_rule_model['query'] = 'testString' + contract_schema_property_model = {} # ContractSchemaProperty contract_schema_property_model['name'] = 'testString' contract_schema_property_model['type'] = contract_schema_property_type_model + contract_schema_property_model['quality'] = [contract_quality_rule_model] contract_schema_model = {} # ContractSchema + contract_schema_model['asset_id'] = '2b0bf220-079c-11ee-be56-0242ac120002' + contract_schema_model['connection_id'] = '2b0bf220-079c-11ee-be56-0242ac120002' contract_schema_model['name'] = 'testString' contract_schema_model['description'] = 'testString' + contract_schema_model['connection_path'] = 'testString' contract_schema_model['physical_type'] = 'testString' contract_schema_model['properties'] = [contract_schema_property_model] + contract_schema_model['quality'] = [contract_quality_rule_model] contract_terms_model = {} # ContractTerms contract_terms_model['asset'] = asset_reference_model @@ -10435,6 +12669,7 @@ def test_data_product_version_collection_serialization(self): contract_terms_model['support_and_communication'] = [contract_template_support_and_communication_model] contract_terms_model['custom_properties'] = [contract_template_custom_property_model] contract_terms_model['contract_test'] = contract_test_model + contract_terms_model['servers'] = [contract_server_model] contract_terms_model['schema'] = [contract_schema_model] asset_part_reference_model = {} # AssetPartReference @@ -10448,10 +12683,12 @@ def test_data_product_version_collection_serialization(self): engine_details_model_model['engine_id'] = 'presto767' engine_details_model_model['engine_port'] = '34567' engine_details_model_model['engine_host'] = 'a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud' + engine_details_model_model['engine_type'] = 'spark' engine_details_model_model['associated_catalogs'] = ['testString'] producer_input_model_model = {} # ProducerInputModel producer_input_model_model['engine_details'] = engine_details_model_model + producer_input_model_model['engines'] = [engine_details_model_model] delivery_method_properties_model_model = {} # DeliveryMethodPropertiesModel delivery_method_properties_model_model['producer_input'] = producer_input_model_model @@ -10479,6 +12716,9 @@ def test_data_product_version_collection_serialization(self): asset_list_access_control_model = {} # AssetListAccessControl asset_list_access_control_model['owner'] = 'IBMid-696000KYV9' + container_identity_model = {} # ContainerIdentity + container_identity_model['id'] = 'd29c42eb-7100-4b7a-8257-c196dbcca1cd' + data_product_version_summary_model = {} # DataProductVersionSummary data_product_version_summary_model['version'] = '1.0.0' data_product_version_summary_model['state'] = 'draft' @@ -10496,6 +12736,7 @@ def test_data_product_version_collection_serialization(self): data_product_version_summary_model['comments'] = 'Comments by a producer that are provided either at the time of data product version creation or retiring' data_product_version_summary_model['access_control'] = asset_list_access_control_model data_product_version_summary_model['last_updated_at'] = '2019-01-01T12:00:00Z' + data_product_version_summary_model['sub_container'] = container_identity_model data_product_version_summary_model['is_restricted'] = True data_product_version_summary_model['id'] = '2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd' data_product_version_summary_model['asset'] = asset_reference_model @@ -10626,6 +12867,39 @@ def test_data_product_version_summary_serialization(self): contract_test_model['last_tested_time'] = 'testString' contract_test_model['message'] = 'testString' + contract_asset_model = {} # ContractAsset + contract_asset_model['id'] = 'testString' + contract_asset_model['name'] = 'testString' + + contract_server_model = {} # ContractServer + contract_server_model['server'] = 'testString' + contract_server_model['asset'] = contract_asset_model + contract_server_model['connection_id'] = 'testString' + contract_server_model['type'] = 'testString' + contract_server_model['description'] = 'testString' + contract_server_model['environment'] = 'testString' + contract_server_model['account'] = 'testString' + contract_server_model['catalog'] = 'testString' + contract_server_model['database'] = 'testString' + contract_server_model['dataset'] = 'testString' + contract_server_model['delimiter'] = 'testString' + contract_server_model['endpoint_url'] = 'testString' + contract_server_model['format'] = 'testString' + contract_server_model['host'] = 'testString' + contract_server_model['location'] = 'testString' + contract_server_model['path'] = 'testString' + contract_server_model['port'] = 'testString' + contract_server_model['project'] = 'testString' + contract_server_model['region'] = 'testString' + contract_server_model['region_name'] = 'testString' + contract_server_model['schema'] = 'testString' + contract_server_model['service_name'] = 'testString' + contract_server_model['staging_dir'] = 'testString' + contract_server_model['stream'] = 'testString' + contract_server_model['warehouse'] = 'testString' + contract_server_model['roles'] = ['testString'] + contract_server_model['custom_properties'] = [contract_template_custom_property_model] + contract_schema_property_type_model = {} # ContractSchemaPropertyType contract_schema_property_type_model['type'] = 'testString' contract_schema_property_type_model['length'] = 'testString' @@ -10634,15 +12908,38 @@ def test_data_product_version_summary_serialization(self): contract_schema_property_type_model['signed'] = 'testString' contract_schema_property_type_model['native_type'] = 'testString' + contract_quality_rule_model = {} # ContractQualityRule + contract_quality_rule_model['type'] = 'sql' + contract_quality_rule_model['description'] = 'testString' + contract_quality_rule_model['rule'] = 'testString' + contract_quality_rule_model['implementation'] = 'testString' + contract_quality_rule_model['engine'] = 'testString' + contract_quality_rule_model['must_be_less_than'] = 'testString' + contract_quality_rule_model['must_be_less_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_greater_than'] = 'testString' + contract_quality_rule_model['must_be_greater_or_equal_to'] = 'testString' + contract_quality_rule_model['must_be_between'] = ['testString'] + contract_quality_rule_model['must_not_be_between'] = ['testString'] + contract_quality_rule_model['must_be'] = 'testString' + contract_quality_rule_model['must_not_be'] = 'testString' + contract_quality_rule_model['name'] = 'testString' + contract_quality_rule_model['unit'] = 'testString' + contract_quality_rule_model['query'] = 'testString' + contract_schema_property_model = {} # ContractSchemaProperty contract_schema_property_model['name'] = 'testString' contract_schema_property_model['type'] = contract_schema_property_type_model + contract_schema_property_model['quality'] = [contract_quality_rule_model] contract_schema_model = {} # ContractSchema + contract_schema_model['asset_id'] = '2b0bf220-079c-11ee-be56-0242ac120002' + contract_schema_model['connection_id'] = '2b0bf220-079c-11ee-be56-0242ac120002' contract_schema_model['name'] = 'testString' contract_schema_model['description'] = 'testString' + contract_schema_model['connection_path'] = 'testString' contract_schema_model['physical_type'] = 'testString' contract_schema_model['properties'] = [contract_schema_property_model] + contract_schema_model['quality'] = [contract_quality_rule_model] contract_terms_model = {} # ContractTerms contract_terms_model['asset'] = asset_reference_model @@ -10658,6 +12955,7 @@ def test_data_product_version_summary_serialization(self): contract_terms_model['support_and_communication'] = [contract_template_support_and_communication_model] contract_terms_model['custom_properties'] = [contract_template_custom_property_model] contract_terms_model['contract_test'] = contract_test_model + contract_terms_model['servers'] = [contract_server_model] contract_terms_model['schema'] = [contract_schema_model] asset_part_reference_model = {} # AssetPartReference @@ -10671,10 +12969,12 @@ def test_data_product_version_summary_serialization(self): engine_details_model_model['engine_id'] = 'presto767' engine_details_model_model['engine_port'] = '34567' engine_details_model_model['engine_host'] = 'a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud' + engine_details_model_model['engine_type'] = 'spark' engine_details_model_model['associated_catalogs'] = ['testString'] producer_input_model_model = {} # ProducerInputModel producer_input_model_model['engine_details'] = engine_details_model_model + producer_input_model_model['engines'] = [engine_details_model_model] delivery_method_properties_model_model = {} # DeliveryMethodPropertiesModel delivery_method_properties_model_model['producer_input'] = producer_input_model_model @@ -10702,6 +13002,9 @@ def test_data_product_version_summary_serialization(self): asset_list_access_control_model = {} # AssetListAccessControl asset_list_access_control_model['owner'] = 'IBMid-696000KYV9' + container_identity_model = {} # ContainerIdentity + container_identity_model['id'] = 'd29c42eb-7100-4b7a-8257-c196dbcca1cd' + # Construct a json representation of a DataProductVersionSummary model data_product_version_summary_model_json = {} data_product_version_summary_model_json['version'] = '1.0.0' @@ -10720,6 +13023,7 @@ def test_data_product_version_summary_serialization(self): data_product_version_summary_model_json['comments'] = 'Comments by a producer that are provided either at the time of data product version creation or retiring' data_product_version_summary_model_json['access_control'] = asset_list_access_control_model data_product_version_summary_model_json['last_updated_at'] = '2019-01-01T12:00:00Z' + data_product_version_summary_model_json['sub_container'] = container_identity_model data_product_version_summary_model_json['is_restricted'] = True data_product_version_summary_model_json['id'] = '2b0bf220-079c-11ee-be56-0242ac120002@d29c42eb-7100-4b7a-8257-c196dbcca1cd' data_product_version_summary_model_json['asset'] = asset_reference_model @@ -10842,10 +13146,12 @@ def test_delivery_method_serialization(self): engine_details_model_model['engine_id'] = 'presto767' engine_details_model_model['engine_port'] = '34567' engine_details_model_model['engine_host'] = 'a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud' + engine_details_model_model['engine_type'] = 'spark' engine_details_model_model['associated_catalogs'] = ['testString'] producer_input_model_model = {} # ProducerInputModel producer_input_model_model['engine_details'] = engine_details_model_model + producer_input_model_model['engines'] = [engine_details_model_model] delivery_method_properties_model_model = {} # DeliveryMethodPropertiesModel delivery_method_properties_model_model['producer_input'] = producer_input_model_model @@ -10889,10 +13195,12 @@ def test_delivery_method_properties_model_serialization(self): engine_details_model_model['engine_id'] = 'presto767' engine_details_model_model['engine_port'] = '34567' engine_details_model_model['engine_host'] = 'a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud' + engine_details_model_model['engine_type'] = 'spark' engine_details_model_model['associated_catalogs'] = ['testString'] producer_input_model_model = {} # ProducerInputModel producer_input_model_model['engine_details'] = engine_details_model_model + producer_input_model_model['engines'] = [engine_details_model_model] # Construct a json representation of a DeliveryMethodPropertiesModel model delivery_method_properties_model_model_json = {} @@ -11008,6 +13316,7 @@ def test_engine_details_model_serialization(self): engine_details_model_model_json['engine_id'] = 'presto767' engine_details_model_model_json['engine_port'] = '34567' engine_details_model_model_json['engine_host'] = 'a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud' + engine_details_model_model_json['engine_type'] = 'spark' engine_details_model_model_json['associated_catalogs'] = ['testString'] # Construct a model instance of EngineDetailsModel by calling from_dict on the json representation @@ -11493,11 +13802,13 @@ def test_producer_input_model_serialization(self): engine_details_model_model['engine_id'] = 'presto767' engine_details_model_model['engine_port'] = '34567' engine_details_model_model['engine_host'] = 'a109e0f6-2dfc-4954-a0ff-343d70f7da7b.someId.lakehouse.appdomain.cloud' + engine_details_model_model['engine_type'] = 'spark' engine_details_model_model['associated_catalogs'] = ['testString'] # Construct a json representation of a ProducerInputModel model producer_input_model_model_json = {} producer_input_model_model_json['engine_details'] = engine_details_model_model + producer_input_model_model_json['engines'] = [engine_details_model_model] # Construct a model instance of ProducerInputModel by calling from_dict on the json representation producer_input_model_model = ProducerInputModel.from_dict(producer_input_model_model_json) @@ -11619,6 +13930,81 @@ def test_provided_workflow_resource_serialization(self): assert provided_workflow_resource_model_json2 == provided_workflow_resource_model_json +class TestModel_RevokeAccessResponse: + """ + Test Class for RevokeAccessResponse + """ + + def test_revoke_access_response_serialization(self): + """ + Test serialization/deserialization for RevokeAccessResponse + """ + + # Construct a json representation of a RevokeAccessResponse model + revoke_access_response_model_json = {} + revoke_access_response_model_json['message'] = 'testString' + + # Construct a model instance of RevokeAccessResponse by calling from_dict on the json representation + revoke_access_response_model = RevokeAccessResponse.from_dict(revoke_access_response_model_json) + assert revoke_access_response_model != False + + # Construct a model instance of RevokeAccessResponse by calling from_dict on the json representation + revoke_access_response_model_dict = RevokeAccessResponse.from_dict(revoke_access_response_model_json).__dict__ + revoke_access_response_model2 = RevokeAccessResponse(**revoke_access_response_model_dict) + + # Verify the model instances are equivalent + assert revoke_access_response_model == revoke_access_response_model2 + + # Convert model instance back to dict and verify no loss of data + revoke_access_response_model_json2 = revoke_access_response_model.to_dict() + assert revoke_access_response_model_json2 == revoke_access_response_model_json + + +class TestModel_RevokeAccessStateResponse: + """ + Test Class for RevokeAccessStateResponse + """ + + def test_revoke_access_state_response_serialization(self): + """ + Test serialization/deserialization for RevokeAccessStateResponse + """ + + # Construct dict forms of any model objects needed in order to build this model. + + asset_model = {} # Asset + asset_model['metadata'] = {'anyKey': 'anyValue'} + asset_model['entity'] = {'anyKey': 'anyValue'} + + search_asset_pagination_info_model = {} # SearchAssetPaginationInfo + search_asset_pagination_info_model['query'] = 'ibm_data_product_revoke_access.state:(SCHEDULED OR FAILED)' + search_asset_pagination_info_model['limit'] = 1 + search_asset_pagination_info_model['bookmark'] = 'MQ==' + search_asset_pagination_info_model['include'] = 'entity' + search_asset_pagination_info_model['skip'] = 0 + + # Construct a json representation of a RevokeAccessStateResponse model + revoke_access_state_response_model_json = {} + revoke_access_state_response_model_json['results'] = [asset_model] + revoke_access_state_response_model_json['total_count'] = 42 + revoke_access_state_response_model_json['next'] = search_asset_pagination_info_model + + # Construct a model instance of RevokeAccessStateResponse by calling from_dict on the json representation + revoke_access_state_response_model = RevokeAccessStateResponse.from_dict(revoke_access_state_response_model_json) + assert revoke_access_state_response_model != False + + # Construct a model instance of RevokeAccessStateResponse by calling from_dict on the json representation + revoke_access_state_response_model_dict = RevokeAccessStateResponse.from_dict(revoke_access_state_response_model_json).__dict__ + revoke_access_state_response_model2 = RevokeAccessStateResponse(**revoke_access_state_response_model_dict) + + # Verify the model instances are equivalent + assert revoke_access_state_response_model == revoke_access_state_response_model2 + + # Convert model instance back to dict and verify no loss of data + revoke_access_state_response_model_json2 = revoke_access_state_response_model.to_dict() + assert revoke_access_state_response_model_json2 == revoke_access_state_response_model_json + + class TestModel_Roles: """ Test Class for Roles @@ -11649,6 +14035,40 @@ def test_roles_serialization(self): assert roles_model_json2 == roles_model_json +class TestModel_SearchAssetPaginationInfo: + """ + Test Class for SearchAssetPaginationInfo + """ + + def test_search_asset_pagination_info_serialization(self): + """ + Test serialization/deserialization for SearchAssetPaginationInfo + """ + + # Construct a json representation of a SearchAssetPaginationInfo model + search_asset_pagination_info_model_json = {} + search_asset_pagination_info_model_json['query'] = 'ibm_data_product_revoke_access.state:(SCHEDULED OR FAILED)' + search_asset_pagination_info_model_json['limit'] = 1 + search_asset_pagination_info_model_json['bookmark'] = 'MQ==' + search_asset_pagination_info_model_json['include'] = 'entity' + search_asset_pagination_info_model_json['skip'] = 0 + + # Construct a model instance of SearchAssetPaginationInfo by calling from_dict on the json representation + search_asset_pagination_info_model = SearchAssetPaginationInfo.from_dict(search_asset_pagination_info_model_json) + assert search_asset_pagination_info_model != False + + # Construct a model instance of SearchAssetPaginationInfo by calling from_dict on the json representation + search_asset_pagination_info_model_dict = SearchAssetPaginationInfo.from_dict(search_asset_pagination_info_model_json).__dict__ + search_asset_pagination_info_model2 = SearchAssetPaginationInfo(**search_asset_pagination_info_model_dict) + + # Verify the model instances are equivalent + assert search_asset_pagination_info_model == search_asset_pagination_info_model2 + + # Convert model instance back to dict and verify no loss of data + search_asset_pagination_info_model_json2 = search_asset_pagination_info_model.to_dict() + assert search_asset_pagination_info_model_json2 == search_asset_pagination_info_model_json + + class TestModel_ServiceIdCredentials: """ Test Class for ServiceIdCredentials