Skip to content

create_data_set async

create_data_set(
    asset_type: AssetType,
    description: Description,
    name: Name,
    *,
    config_overrides: Optional[AsyncDataExchangeClientConfig] = None,
    tags: Optional[MapOf__string] = None,
) -> CreateDataSetResponse

This operation creates a data set.

Parameters:

  • asset_type (AssetType) –

    The type of asset that is added to a data set.

  • description (Description) –

    A description for the data set. This value can be up to 16,348 characters long.

  • name (Name) –

    The name of the data set.

  • tags (Optional[MapOf__string], default: None ) –

    A data set tag is an optional label that you can assign to a data set when you create it. Each tag consists of a key and an optional value, both of which you define. When you use tagging, you can also use tag-based access control in IAM policies to control access to these data sets and revisions.

Raises:

Source code in docs_src/capo_dataexchange/_services/async_data_exchange.py
async def create_data_set(
    self,
    asset_type: "capo_dataexchange.types.asset_type.AssetType",
    description: "capo_dataexchange.types.description.Description",
    name: "capo_dataexchange.types.name.Name",
    *,
    config_overrides: Optional[AsyncDataExchangeClientConfig] = None,
    tags: Optional["capo_dataexchange.types.map_of__string.MapOf__string"] = None,
) -> "capo_dataexchange.types.create_data_set_response.CreateDataSetResponse":
    """<p>This operation creates a data set.</p>

    Args:
        asset_type: <p>The type of asset that is added to a data set.</p>
        description: <p>A description for the data set. This value can be up to 16,348 characters long.</p>
        name: <p>The name of the data set.</p>
        tags: <p>A data set tag is an optional label that you can assign to a data set when you create it. Each tag consists of a key and an optional value, both of which you define. When you use tagging, you can also use tag-based access control in IAM policies to control access to these data sets and revisions.</p>

    Raises:
        capo_dataexchange.errors.access_denied_exception.AccessDeniedException: <p>Access to the resource is denied.</p>
        capo_dataexchange.errors.internal_server_exception.InternalServerException: <p>An exception occurred with the service.</p>
        capo_dataexchange.errors.service_limit_exceeded_exception.ServiceLimitExceededException: <p>The request has exceeded the quotas imposed by the service.</p>
        capo_dataexchange.errors.throttling_exception.ThrottlingException: <p>The limit on the number of requests per second was exceeded.</p>
        capo_dataexchange.errors.validation_exception.ValidationException: <p>The request was invalid.</p>
        capo_dataexchange.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_dataexchange.types.create_data_set_request.CreateDataSetRequest]",
    ) -> AsyncOperationResponse[
        "capo_dataexchange.types.create_data_set_response.CreateDataSetResponse"
    ]:
        import capo_dataexchange._operations.data_exchange.create_data_set

        (
            output,
            http_response,
        ) = await capo_dataexchange._operations.data_exchange.create_data_set.async_create_data_set(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateDataSet")
    )
    input_: capo_dataexchange.types.create_data_set_request.CreateDataSetRequest = {
        "asset_type": asset_type,
        "description": description,
        "name": name,
    }
    if tags is not None:
        input_["tags"] = tags

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output