Skip to content

create_repository_link

create_repository_link(
    connection_arn: ConnectionArn,
    owner_id: OwnerId,
    repository_name: RepositoryName,
    *,
    config_overrides: Optional[CodeStarconnectionsClientConfig] = None,
    encryption_key_arn: Optional[KmsKeyArn] = None,
    tags: Optional[TagList] = None,
) -> CreateRepositoryLinkOutput

Creates a link to a specified external Git repository. A repository link allows Git sync to monitor and sync changes to files in a specified Git repository.

Parameters:

  • connection_arn (ConnectionArn) –

    The Amazon Resource Name (ARN) of the connection to be associated with the repository link.

  • owner_id (OwnerId) –

    The owner ID for the repository associated with a specific sync configuration, such as the owner ID in GitHub.

  • repository_name (RepositoryName) –

    The name of the repository to be associated with the repository link.

  • encryption_key_arn (Optional[KmsKeyArn], default: None ) –

    The Amazon Resource Name (ARN) encryption key for the repository to be associated with the repository link.

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

    The tags for the repository to be associated with the repository link.

Raises:

Source code in docs_src/capo_codestar_connections/_services/code_starconnections.py
def create_repository_link(
    self,
    connection_arn: "capo_codestar_connections.types.connection_arn.ConnectionArn",
    owner_id: "capo_codestar_connections.types.owner_id.OwnerId",
    repository_name: "capo_codestar_connections.types.repository_name.RepositoryName",
    *,
    config_overrides: Optional[CodeStarconnectionsClientConfig] = None,
    encryption_key_arn: Optional[
        "capo_codestar_connections.types.kms_key_arn.KmsKeyArn"
    ] = None,
    tags: Optional["capo_codestar_connections.types.tag_list.TagList"] = None,
) -> "capo_codestar_connections.types.create_repository_link_output.CreateRepositoryLinkOutput":
    """<p>Creates a link to a specified external Git repository. A repository link allows Git sync to monitor and sync changes to files in a specified Git repository.</p>

    Args:
        connection_arn: <p>The Amazon Resource Name (ARN) of the connection to be associated with the repository link.</p>
        owner_id: <p>The owner ID for the repository associated with a specific sync configuration, such as the owner ID in GitHub.</p>
        repository_name: <p>The name of the repository to be associated with the repository link.</p>
        encryption_key_arn: <p>The Amazon Resource Name (ARN) encryption key for the repository to be associated with the repository link.</p>
        tags: <p>The tags for the repository to be associated with the repository link.</p>

    Raises:
        capo_codestar_connections.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_codestar_connections.errors.concurrent_modification_exception.ConcurrentModificationException: <p>Exception thrown as a result of concurrent modification to an application. For example, two individuals attempting to edit the same application at the same time. </p>
        capo_codestar_connections.errors.internal_server_exception.InternalServerException: <p>Received an internal server exception. Try again later.</p>
        capo_codestar_connections.errors.invalid_input_exception.InvalidInputException: <p>The input is not valid. Verify that the action is typed correctly.</p>
        capo_codestar_connections.errors.limit_exceeded_exception.LimitExceededException: <p>Exceeded the maximum limit for connections.</p>
        capo_codestar_connections.errors.resource_already_exists_exception.ResourceAlreadyExistsException: <p>Unable to create resource. Resource already exists.</p>
        capo_codestar_connections.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_codestar_connections.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_codestar_connections.types.create_repository_link_input.CreateRepositoryLinkInput]",
    ) -> OperationResponse[
        "capo_codestar_connections.types.create_repository_link_output.CreateRepositoryLinkOutput"
    ]:
        import capo_codestar_connections._operations.code_star_connections_20191201.create_repository_link

        output, http_response = (
            capo_codestar_connections._operations.code_star_connections_20191201.create_repository_link.create_repository_link(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateRepositoryLink")
    )
    input_: capo_codestar_connections.types.create_repository_link_input.CreateRepositoryLinkInput = {
        "connection_arn": connection_arn,
        "owner_id": owner_id,
        "repository_name": repository_name,
    }
    if encryption_key_arn is not None:
        input_["encryption_key_arn"] = encryption_key_arn
    if tags is not None:
        input_["tags"] = tags

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output