Skip to content

create_config async

create_config(
    name: SafeName,
    config_data: ConfigTypeData,
    *,
    config_overrides: Optional[AsyncGroundStationClientConfig] = None,
    tags: Optional[TagsMap] = None,
) -> ConfigIdResponse

Creates a Config with the specified configData parameters.

Only one type of configData can be specified.

Parameters:

Raises:

Source code in docs_src/capo_groundstation/_services/async_ground_station.py
async def create_config(
    self,
    name: "capo_groundstation.types.safe_name.SafeName",
    config_data: "capo_groundstation.types.config_type_data.ConfigTypeData",
    *,
    config_overrides: Optional[AsyncGroundStationClientConfig] = None,
    tags: Optional["capo_groundstation.types.tags_map.TagsMap"] = None,
) -> "capo_groundstation.types.config_id_response.ConfigIdResponse":
    """<p>Creates a <code>Config</code> with the specified <code>configData</code> parameters.</p> <p>Only one type of <code>configData</code> can be specified.</p>

    Args:
        name: <p>Name of a <code>Config</code>.</p>
        config_data: <p>Parameters of a <code>Config</code>.</p>
        tags: <p>Tags assigned to a <code>Config</code>.</p>

    Raises:
        capo_groundstation.errors.dependency_exception.DependencyException: <p>Dependency encountered an error.</p>
        capo_groundstation.errors.invalid_parameter_exception.InvalidParameterException: <p>One or more parameters are not valid.</p>
        capo_groundstation.errors.resource_limit_exceeded_exception.ResourceLimitExceededException: <p>Account limits for this resource have been exceeded.</p>
        capo_groundstation.errors.resource_not_found_exception.ResourceNotFoundException: <p>Resource was not found.</p>
        capo_groundstation.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_groundstation.types.create_config_request.CreateConfigRequest]",
    ) -> AsyncOperationResponse[
        "capo_groundstation.types.config_id_response.ConfigIdResponse"
    ]:
        import capo_groundstation._operations.ground_station.create_config

        (
            output,
            http_response,
        ) = await capo_groundstation._operations.ground_station.create_config.async_create_config(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateConfig")
    )
    input_: capo_groundstation.types.create_config_request.CreateConfigRequest = {
        "name": name,
        "config_data": config_data,
    }
    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