Skip to content

create_application async

create_application(
    *,
    config_overrides: Optional[AsyncServerlessApplicationRepositoryClientConfig] = None,
    author: Optional[__string] = None,
    description: Optional[__string] = None,
    home_page_url: Optional[__string] = None,
    labels: Optional[__listOf__string] = None,
    license_body: Optional[__string] = None,
    license_url: Optional[__string] = None,
    name: Optional[__string] = None,
    readme_body: Optional[__string] = None,
    readme_url: Optional[__string] = None,
    semantic_version: Optional[__string] = None,
    source_code_archive_url: Optional[__string] = None,
    source_code_url: Optional[__string] = None,
    spdx_license_id: Optional[__string] = None,
    template_body: Optional[__string] = None,
    template_url: Optional[__string] = None,
) -> CreateApplicationResponse

Creates an application, optionally including an AWS SAM file to create the first application version in the same call.

Parameters:

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

    The name of the author publishing the app.

    Minimum length=1. Maximum length=127.

    Pattern "^[a-z0-9](([a-z0-9]|-(?!-))*[a-z0-9])?$";

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

    The description of the application.

    Minimum length=1. Maximum length=256

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

    A URL with more information about the application, for example the location of your GitHub repository for the application.

  • labels (Optional[__listOf__string], default: None ) –

    Labels to improve discovery of apps in search results.

    Minimum length=1. Maximum length=127. Maximum number of labels: 10

    Pattern: "^[a-zA-Z0-9+\\-_:\\/@]+$";

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

    A local text file that contains the license of the app that matches the spdxLicenseID value of your application. The file has the format file://<path>/<filename>.

    Maximum size 5 MB

    You can specify only one of licenseBody and licenseUrl; otherwise, an error results.

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

    A link to the S3 object that contains the license of the app that matches the spdxLicenseID value of your application.

    Maximum size 5 MB

    You can specify only one of licenseBody and licenseUrl; otherwise, an error results.

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

    The name of the application that you want to publish.

    Minimum length=1. Maximum length=140

    Pattern: "[a-zA-Z0-9\\-]+";

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

    A local text readme file in Markdown language that contains a more detailed description of the application and how it works. The file has the format file://<path>/<filename>.

    Maximum size 5 MB

    You can specify only one of readmeBody and readmeUrl; otherwise, an error results.

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

    A link to the S3 object in Markdown language that contains a more detailed description of the application and how it works.

    Maximum size 5 MB

    You can specify only one of readmeBody and readmeUrl; otherwise, an error results.

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

    The semantic version of the application:

    https://semver.org/

  • 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.

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

    A valid identifier from https://spdx.org/licenses/.

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

    The local raw packaged AWS SAM template file of your application. The file has the format file://<path>/<filename>.

    You can specify only one of templateBody and templateUrl; otherwise an error results.

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

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

    You can specify only one of templateBody and templateUrl; otherwise an error results.

Raises:

Source code in docs_src/capo_serverlessapplicationrepository/_services/async_serverless_application_repository.py
async def create_application(
    self,
    *,
    config_overrides: Optional[
        AsyncServerlessApplicationRepositoryClientConfig
    ] = None,
    author: Optional[
        "capo_serverlessapplicationrepository.types.__string.__string"
    ] = None,
    description: Optional[
        "capo_serverlessapplicationrepository.types.__string.__string"
    ] = None,
    home_page_url: Optional[
        "capo_serverlessapplicationrepository.types.__string.__string"
    ] = None,
    labels: Optional[
        "capo_serverlessapplicationrepository.types.__list_of__string.__listOf__string"
    ] = None,
    license_body: Optional[
        "capo_serverlessapplicationrepository.types.__string.__string"
    ] = None,
    license_url: Optional[
        "capo_serverlessapplicationrepository.types.__string.__string"
    ] = None,
    name: Optional[
        "capo_serverlessapplicationrepository.types.__string.__string"
    ] = None,
    readme_body: Optional[
        "capo_serverlessapplicationrepository.types.__string.__string"
    ] = None,
    readme_url: Optional[
        "capo_serverlessapplicationrepository.types.__string.__string"
    ] = None,
    semantic_version: Optional[
        "capo_serverlessapplicationrepository.types.__string.__string"
    ] = None,
    source_code_archive_url: Optional[
        "capo_serverlessapplicationrepository.types.__string.__string"
    ] = None,
    source_code_url: Optional[
        "capo_serverlessapplicationrepository.types.__string.__string"
    ] = None,
    spdx_license_id: 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_response.CreateApplicationResponse":
    r"""<p>Creates an application, optionally including an AWS SAM file to create the first application version in the same call.</p>

    Args:
        author: <p>The name of the author publishing the app.</p><p>Minimum length=1. Maximum length=127.</p><p>Pattern "^[a-z0-9](([a-z0-9]|-(?!-))*[a-z0-9])?$";</p>
        description: <p>The description of the application.</p><p>Minimum length=1. Maximum length=256</p>
        home_page_url: <p>A URL with more information about the application, for example the location of your GitHub repository for the application.</p>
        labels: <p>Labels to improve discovery of apps in search results.</p><p>Minimum length=1. Maximum length=127. Maximum number of labels: 10</p><p>Pattern: "^[a-zA-Z0-9+\\-_:\\/@]+$";</p>
        license_body: <p>A local text file that contains the license of the app that matches the spdxLicenseID value of your application. The file has the format file://&lt;path>/&lt;filename>.</p><p>Maximum size 5 MB</p><p>You can specify only one of licenseBody and licenseUrl; otherwise, an error results.</p>
        license_url: <p>A link to the S3 object that contains the license of the app that matches the spdxLicenseID value of your application.</p><p>Maximum size 5 MB</p><p>You can specify only one of licenseBody and licenseUrl; otherwise, an error results.</p>
        name: <p>The name of the application that you want to publish.</p><p>Minimum length=1. Maximum length=140</p><p>Pattern: "[a-zA-Z0-9\\-]+";</p>
        readme_body: <p>A local text readme file in Markdown language that contains a more detailed description of the application and how it works. The file has the format file://&lt;path>/&lt;filename>.</p><p>Maximum size 5 MB</p><p>You can specify only one of readmeBody and readmeUrl; otherwise, an error results.</p>
        readme_url: <p>A link to the S3 object in Markdown language that contains a more detailed description of the application and how it works.</p><p>Maximum size 5 MB</p><p>You can specify only one of readmeBody and readmeUrl; otherwise, an error results.</p>
        semantic_version: <p>The semantic version of the application:</p><p> <a href="https://semver.org/">https://semver.org/</a> </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>
        spdx_license_id: <p>A valid identifier from <a href="https://spdx.org/licenses/">https://spdx.org/licenses/</a>.</p>
        template_body: <p>The local raw packaged AWS SAM template file of your application. The file has the format file://&lt;path>/&lt;filename>.</p><p>You can specify only one of templateBody and templateUrl; otherwise an error results.</p>
        template_url: <p>A link to the S3 object containing the packaged AWS SAM template of your application.</p><p>You can specify only one of templateBody and templateUrl; otherwise an error results.</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_request.CreateApplicationRequest]",
    ) -> AsyncOperationResponse[
        "capo_serverlessapplicationrepository.types.create_application_response.CreateApplicationResponse"
    ]:
        import capo_serverlessapplicationrepository._operations.serverless_application_repository.create_application

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateApplication")
    )
    input_: capo_serverlessapplicationrepository.types.create_application_request.CreateApplicationRequest = {}
    if author is not None:
        input_["author"] = author
    if description is not None:
        input_["description"] = description
    if home_page_url is not None:
        input_["home_page_url"] = home_page_url
    if labels is not None:
        input_["labels"] = labels
    if license_body is not None:
        input_["license_body"] = license_body
    if license_url is not None:
        input_["license_url"] = license_url
    if name is not None:
        input_["name"] = name
    if readme_body is not None:
        input_["readme_body"] = readme_body
    if readme_url is not None:
        input_["readme_url"] = readme_url
    if semantic_version is not None:
        input_["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 spdx_license_id is not None:
        input_["spdx_license_id"] = spdx_license_id
    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