Skip to content

create_application_version async

create_application_version(
    application_id: __string,
    semantic_version: __string,
    *,
    config_overrides: Optional[AsyncServerlessApplicationRepositoryClientConfig] = None,
    source_code_archive_url: Optional[__string] = None,
    source_code_url: Optional[__string] = None,
    template_body: Optional[__string] = None,
    template_url: Optional[__string] = None,
) -> CreateApplicationVersionResponse

Creates an application version.

Parameters:

  • application_id (__string) –

    The Amazon Resource Name (ARN) of the application.

  • semantic_version (__string) –

    The semantic version of the new version.

  • source_code_archive_url (Optional[__string], default: None ) –

    A link to the S3 object that contains the ZIP archive of the source code for this version of your application.

    Maximum size 50 MB

  • source_code_url (Optional[__string], default: None ) –

    A link to a public repository for the source code of your application, for example the URL of a specific GitHub commit.

  • template_body (Optional[__string], default: None ) –

    The raw packaged AWS SAM template of your application.

  • template_url (Optional[__string], default: None ) –

    A link to the packaged AWS SAM template of your application.

Raises:

Source code in docs_src/capo_serverlessapplicationrepository/_services/async_serverless_application_repository.py
async def create_application_version(
    self,
    application_id: "capo_serverlessapplicationrepository.types.__string.__string",
    semantic_version: "capo_serverlessapplicationrepository.types.__string.__string",
    *,
    config_overrides: Optional[
        AsyncServerlessApplicationRepositoryClientConfig
    ] = None,
    source_code_archive_url: Optional[
        "capo_serverlessapplicationrepository.types.__string.__string"
    ] = None,
    source_code_url: Optional[
        "capo_serverlessapplicationrepository.types.__string.__string"
    ] = None,
    template_body: Optional[
        "capo_serverlessapplicationrepository.types.__string.__string"
    ] = None,
    template_url: Optional[
        "capo_serverlessapplicationrepository.types.__string.__string"
    ] = None,
) -> "capo_serverlessapplicationrepository.types.create_application_version_response.CreateApplicationVersionResponse":
    """<p>Creates an application version.</p>

    Args:
        application_id: <p>The Amazon Resource Name (ARN) of the application.</p>
        semantic_version: <p>The semantic version of the new version.</p>
        source_code_archive_url: <p>A link to the S3 object that contains the ZIP archive of the source code for this version of your application.</p><p>Maximum size 50 MB</p>
        source_code_url: <p>A link to a public repository for the source code of your application, for example the URL of a specific GitHub commit.</p>
        template_body: <p>The raw packaged AWS SAM template of your application.</p>
        template_url: <p>A link to the packaged AWS SAM template of your application.</p>

    Raises:
        capo_serverlessapplicationrepository.errors.bad_request_exception.BadRequestException: <p>One of the parameters in the request is invalid.</p>
        capo_serverlessapplicationrepository.errors.conflict_exception.ConflictException: <p>The resource already exists.</p>
        capo_serverlessapplicationrepository.errors.forbidden_exception.ForbiddenException: <p>The client is not authenticated.</p>
        capo_serverlessapplicationrepository.errors.internal_server_error_exception.InternalServerErrorException: <p>The AWS Serverless Application Repository service encountered an internal error.</p>
        capo_serverlessapplicationrepository.errors.too_many_requests_exception.TooManyRequestsException: <p>The client is sending more than the allowed number of requests per unit of time.</p>
        capo_serverlessapplicationrepository.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_serverlessapplicationrepository.types.create_application_version_request.CreateApplicationVersionRequest]",
    ) -> AsyncOperationResponse[
        "capo_serverlessapplicationrepository.types.create_application_version_response.CreateApplicationVersionResponse"
    ]:
        import capo_serverlessapplicationrepository._operations.serverless_application_repository.create_application_version

        (
            output,
            http_response,
        ) = await capo_serverlessapplicationrepository._operations.serverless_application_repository.create_application_version.async_create_application_version(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateApplicationVersion")
    )
    input_: capo_serverlessapplicationrepository.types.create_application_version_request.CreateApplicationVersionRequest = {
        "application_id": application_id,
        "semantic_version": semantic_version,
    }
    if source_code_archive_url is not None:
        input_["source_code_archive_url"] = source_code_archive_url
    if source_code_url is not None:
        input_["source_code_url"] = source_code_url
    if template_body is not None:
        input_["template_body"] = template_body
    if template_url is not None:
        input_["template_url"] = template_url

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