Skip to content

create_template_sync_config async

create_template_sync_config(
    template_name: ResourceName,
    template_type: TemplateType,
    repository_provider: RepositoryProvider,
    repository_name: RepositoryName,
    branch: GitBranchName,
    *,
    config_overrides: Optional[AsyncProtonClientConfig] = None,
    subdirectory: Optional[Subdirectory] = None,
) -> CreateTemplateSyncConfigOutput

Set up a template to create new template versions automatically by tracking a linked repository. A linked repository is a repository that has been registered with Proton. For more information, see CreateRepository.

When a commit is pushed to your linked repository, Proton checks for changes to your repository template bundles. If it detects a template bundle change, a new major or minor version of its template is created, if the version doesn’t already exist. For more information, see Template sync configurations in the Proton User Guide.

Parameters:

  • template_name (ResourceName) –

    The name of your registered template.

  • template_type (TemplateType) –

    The type of the registered template.

  • repository_provider (RepositoryProvider) –

    The provider type for your repository.

  • repository_name (RepositoryName) –

    The repository name (for example, myrepos/myrepo).

  • branch (GitBranchName) –

    The repository branch for your template.

  • subdirectory (Optional[Subdirectory], default: None ) –

    A repository subdirectory path to your template bundle directory. When included, Proton limits the template bundle search to this repository directory.

Raises:

Source code in docs_src/capo_proton/_services/async_proton.py
async def create_template_sync_config(
    self,
    template_name: "capo_proton.types.resource_name.ResourceName",
    template_type: "capo_proton.types.template_type.TemplateType",
    repository_provider: "capo_proton.types.repository_provider.RepositoryProvider",
    repository_name: "capo_proton.types.repository_name.RepositoryName",
    branch: "capo_proton.types.git_branch_name.GitBranchName",
    *,
    config_overrides: Optional[AsyncProtonClientConfig] = None,
    subdirectory: Optional["capo_proton.types.subdirectory.Subdirectory"] = None,
) -> "capo_proton.types.create_template_sync_config_output.CreateTemplateSyncConfigOutput":
    """<p>Set up a template to create new template versions automatically by tracking a linked repository. A linked repository is a repository that has been registered with Proton. For more information, see <a>CreateRepository</a>.</p> <p>When a commit is pushed to your linked repository, Proton checks for changes to your repository template bundles. If it detects a template bundle change, a new major or minor version of its template is created, if the version doesn’t already exist. For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/ag-template-sync-configs.html">Template sync configurations</a> in the <i>Proton User Guide</i>.</p>

    Args:
        template_name: <p>The name of your registered template.</p>
        template_type: <p>The type of the registered template.</p>
        repository_provider: <p>The provider type for your repository.</p>
        repository_name: <p>The repository name (for example, <code>myrepos/myrepo</code>).</p>
        branch: <p>The repository branch for your template.</p>
        subdirectory: <p>A repository subdirectory path to your template bundle directory. When included, Proton limits the template bundle search to this repository directory.</p>

    Raises:
        capo_proton.errors.access_denied_exception.AccessDeniedException: <p>There <i>isn't</i> sufficient access for performing this action.</p>
        capo_proton.errors.conflict_exception.ConflictException: <p>The request <i>couldn't</i> be made due to a conflicting operation or resource.</p>
        capo_proton.errors.internal_server_exception.InternalServerException: <p>The request failed to register with the service.</p>
        capo_proton.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>A quota was exceeded. For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/ag-limits.html">Proton Quotas</a> in the <i>Proton User Guide</i>.</p>
        capo_proton.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_proton.errors.validation_exception.ValidationException: <p>The input is invalid or an out-of-range value was supplied for the input parameter.</p>
        capo_proton.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_proton.types.create_template_sync_config_input.CreateTemplateSyncConfigInput]",
    ) -> AsyncOperationResponse[
        "capo_proton.types.create_template_sync_config_output.CreateTemplateSyncConfigOutput"
    ]:
        import capo_proton._operations.aws_proton20200720.create_template_sync_config

        (
            output,
            http_response,
        ) = await capo_proton._operations.aws_proton20200720.create_template_sync_config.async_create_template_sync_config(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateTemplateSyncConfig")
    )
    input_: capo_proton.types.create_template_sync_config_input.CreateTemplateSyncConfigInput = {
        "template_name": template_name,
        "template_type": template_type,
        "repository_provider": repository_provider,
        "repository_name": repository_name,
        "branch": branch,
    }
    if subdirectory is not None:
        input_["subdirectory"] = subdirectory

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