Class DeveloperConnectClient (0.1.1)

DeveloperConnectClient(*, credentials: typing.Optional[google.auth.credentials.Credentials] = None, transport: typing.Optional[typing.Union[str, google.cloud.developerconnect_v1.services.developer_connect.transports.base.DeveloperConnectTransport, typing.Callable[[...], google.cloud.developerconnect_v1.services.developer_connect.transports.base.DeveloperConnectTransport]]] = None, client_options: typing.Optional[typing.Union[google.api_core.client_options.ClientOptions, dict]] = None, client_info: google.api_core.gapic_v1.client_info.ClientInfo = <google.api_core.gapic_v1.client_info.ClientInfo object>)

Service describing handlers for resources

Properties

api_endpoint

Return the API endpoint used by the client instance.

Returns
Type Description
str The API endpoint used by the client instance.

transport

Returns the transport used by the client instance.

Returns
Type Description
DeveloperConnectTransport The transport used by the client instance.

universe_domain

Return the universe domain used by the client instance.

Returns
Type Description
str The universe domain used by the client instance.

Methods

DeveloperConnectClient

DeveloperConnectClient(*, credentials: typing.Optional[google.auth.credentials.Credentials] = None, transport: typing.Optional[typing.Union[str, google.cloud.developerconnect_v1.services.developer_connect.transports.base.DeveloperConnectTransport, typing.Callable[[...], google.cloud.developerconnect_v1.services.developer_connect.transports.base.DeveloperConnectTransport]]] = None, client_options: typing.Optional[typing.Union[google.api_core.client_options.ClientOptions, dict]] = None, client_info: google.api_core.gapic_v1.client_info.ClientInfo = <google.api_core.gapic_v1.client_info.ClientInfo object>)

Instantiates the developer connect client.

Parameters
Name Description
credentials Optional[google.auth.credentials.Credentials]

The authorization credentials to attach to requests. These credentials identify the application to the service; if none are specified, the client will attempt to ascertain the credentials from the environment.

transport Optional[Union[str,DeveloperConnectTransport,Callable[..., DeveloperConnectTransport]]]

The transport to use, or a Callable that constructs and returns a new transport. If a Callable is given, it will be called with the same set of initialization arguments as used in the DeveloperConnectTransport constructor. If set to None, a transport is chosen automatically.

client_options Optional[Union[google.api_core.client_options.ClientOptions, dict]]

Custom options for the client. 1. The api_endpoint property can be used to override the default endpoint provided by the client when transport is not explicitly provided. Only if this property is not set and transport was not explicitly provided, the endpoint is determined by the GOOGLE_API_USE_MTLS_ENDPOINT environment variable, which have one of the following values: "always" (always use the default mTLS endpoint), "never" (always use the default regular endpoint) and "auto" (auto-switch to the default mTLS endpoint if client certificate is present; this is the default value). 2. If the GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is "true", then the client_cert_source property can be used to provide a client certificate for mTLS transport. If not provided, the default SSL client certificate will be used if present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is "false" or not set, no client certificate will be used. 3. The universe_domain property can be used to override the default "googleapis.com" universe. Note that the api_endpoint property still takes precedence; and universe_domain is currently not supported for mTLS.

client_info google.api_core.gapic_v1.client_info.ClientInfo

The client info used to send a user-agent string along with API requests. If None, then default info will be used. Generally, you only need to set this if you're developing your own client library.

Exceptions
Type Description
google.auth.exceptions.MutualTLSChannelError If mutual TLS transport creation failed for any reason.

__exit__

__exit__(type, value, traceback)

Releases underlying transport's resources.

cancel_operation

cancel_operation(
    request: typing.Optional[
        google.longrunning.operations_pb2.CancelOperationRequest
    ] = None,
    *,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> None

Starts asynchronous cancellation on a long-running operation.

The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED.

Parameters
Name Description
request .operations_pb2.CancelOperationRequest

The request object. Request message for CancelOperation method.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

common_billing_account_path

common_billing_account_path(billing_account: str) -> str

Returns a fully-qualified billing_account string.

common_folder_path

common_folder_path(folder: str) -> str

Returns a fully-qualified folder string.

common_location_path

common_location_path(project: str, location: str) -> str

Returns a fully-qualified location string.

common_organization_path

common_organization_path(organization: str) -> str

Returns a fully-qualified organization string.

common_project_path

common_project_path(project: str) -> str

Returns a fully-qualified project string.

connection_path

connection_path(project: str, location: str, connection: str) -> str

Returns a fully-qualified connection string.

create_connection

create_connection(
    request: typing.Optional[
        typing.Union[
            google.cloud.developerconnect_v1.types.developer_connect.CreateConnectionRequest,
            dict,
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    connection: typing.Optional[
        google.cloud.developerconnect_v1.types.developer_connect.Connection
    ] = None,
    connection_id: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation.Operation

Creates a new Connection in a given project and location.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import developerconnect_v1

def sample_create_connection():
    # Create a client
    client = developerconnect_v1.DeveloperConnectClient()

    # Initialize request argument(s)
    connection = developerconnect_v1.Connection()
    connection.github_config.github_app = "FIREBASE"

    request = developerconnect_v1.CreateConnectionRequest(
        parent="parent_value",
        connection_id="connection_id_value",
        connection=connection,
    )

    # Make the request
    operation = client.create_connection(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)
Parameters
Name Description
request Union[google.cloud.developerconnect_v1.types.CreateConnectionRequest, dict]

The request object. Message for creating a Connection

parent str

Required. Value for parent. This corresponds to the parent field on the request instance; if request is provided, this should not be set.

connection google.cloud.developerconnect_v1.types.Connection

Required. The resource being created This corresponds to the connection field on the request instance; if request is provided, this should not be set.

connection_id str

Required. Id of the requesting object If auto-generating Id server-side, remove this field and connection_id from the method_signature of Create RPC This corresponds to the connection_id field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.api_core.operation.Operation An object representing a long-running operation. The result type for the operation will be Connection Message describing Connection object
create_git_repository_link(
    request: typing.Optional[
        typing.Union[
            google.cloud.developerconnect_v1.types.developer_connect.CreateGitRepositoryLinkRequest,
            dict,
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    git_repository_link: typing.Optional[
        google.cloud.developerconnect_v1.types.developer_connect.GitRepositoryLink
    ] = None,
    git_repository_link_id: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation.Operation

Creates a GitRepositoryLink. Upon linking a Git Repository, Developer Connect will configure the Git Repository to send webhook events to Developer Connect. Connections that use Firebase GitHub Application will have events forwarded to the Firebase service. All other Connections will have events forwarded to Cloud Build.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import developerconnect_v1

def sample_create_git_repository_link():
    # Create a client
    client = developerconnect_v1.DeveloperConnectClient()

    # Initialize request argument(s)
    git_repository_link = developerconnect_v1.GitRepositoryLink()
    git_repository_link.clone_uri = "clone_uri_value"

    request = developerconnect_v1.CreateGitRepositoryLinkRequest(
        parent="parent_value",
        git_repository_link=git_repository_link,
        git_repository_link_id="git_repository_link_id_value",
    )

    # Make the request
    operation = client.create_git_repository_link(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)
Parameters
Name Description
request Union[google.cloud.developerconnect_v1.types.CreateGitRepositoryLinkRequest, dict]

The request object. Message for creating a GitRepositoryLink

parent str

Required. Value for parent. This corresponds to the parent field on the request instance; if request is provided, this should not be set.

git_repository_link google.cloud.developerconnect_v1.types.GitRepositoryLink

Required. The resource being created This corresponds to the git_repository_link field on the request instance; if request is provided, this should not be set.

git_repository_link_id str

Required. The ID to use for the repository, which will become the final component of the repository's resource name. This ID should be unique in the connection. Allows alphanumeric characters and any of -._%!$&'()*+,;=@. This corresponds to the git_repository_link_id field on the request instance; if request` is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.api_core.operation.Operation An object representing a long-running operation. The result type for the operation will be GitRepositoryLink Message describing the GitRepositoryLink object

delete_connection

delete_connection(
    request: typing.Optional[
        typing.Union[
            google.cloud.developerconnect_v1.types.developer_connect.DeleteConnectionRequest,
            dict,
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation.Operation

Deletes a single Connection.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import developerconnect_v1

def sample_delete_connection():
    # Create a client
    client = developerconnect_v1.DeveloperConnectClient()

    # Initialize request argument(s)
    request = developerconnect_v1.DeleteConnectionRequest(
        name="name_value",
    )

    # Make the request
    operation = client.delete_connection(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)
Parameters
Name Description
request Union[google.cloud.developerconnect_v1.types.DeleteConnectionRequest, dict]

The request object. Message for deleting a Connection

name str

Required. Name of the resource This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.api_core.operation.Operation An object representing a long-running operation. The result type for the operation will be google.protobuf.empty_pb2.Empty A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
delete_git_repository_link(
    request: typing.Optional[
        typing.Union[
            google.cloud.developerconnect_v1.types.developer_connect.DeleteGitRepositoryLinkRequest,
            dict,
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation.Operation

Deletes a single GitRepositoryLink.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import developerconnect_v1

def sample_delete_git_repository_link():
    # Create a client
    client = developerconnect_v1.DeveloperConnectClient()

    # Initialize request argument(s)
    request = developerconnect_v1.DeleteGitRepositoryLinkRequest(
        name="name_value",
    )

    # Make the request
    operation = client.delete_git_repository_link(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)
Parameters
Name Description
request Union[google.cloud.developerconnect_v1.types.DeleteGitRepositoryLinkRequest, dict]

The request object. Message for deleting a GitRepositoryLink

name str

Required. Name of the resource This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.api_core.operation.Operation An object representing a long-running operation. The result type for the operation will be google.protobuf.empty_pb2.Empty A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }

delete_operation

delete_operation(
    request: typing.Optional[
        google.longrunning.operations_pb2.DeleteOperationRequest
    ] = None,
    *,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> None

Deletes a long-running operation.

This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED.

Parameters
Name Description
request .operations_pb2.DeleteOperationRequest

The request object. Request message for DeleteOperation method.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

fetch_git_hub_installations

fetch_git_hub_installations(
    request: typing.Optional[
        typing.Union[
            google.cloud.developerconnect_v1.types.developer_connect.FetchGitHubInstallationsRequest,
            dict,
        ]
    ] = None,
    *,
    connection: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> (
    google.cloud.developerconnect_v1.types.developer_connect.FetchGitHubInstallationsResponse
)

FetchGitHubInstallations returns the list of GitHub Installations that are available to be added to a Connection. For github.com, only installations accessible to the authorizer token are returned. For GitHub Enterprise, all installations are returned.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import developerconnect_v1

def sample_fetch_git_hub_installations():
    # Create a client
    client = developerconnect_v1.DeveloperConnectClient()

    # Initialize request argument(s)
    request = developerconnect_v1.FetchGitHubInstallationsRequest(
        connection="connection_value",
    )

    # Make the request
    response = client.fetch_git_hub_installations(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Union[google.cloud.developerconnect_v1.types.FetchGitHubInstallationsRequest, dict]

The request object. Request for fetching github installations.

connection str

Required. The resource name of the connection in the format projects//locations//connections/*. This corresponds to the connection field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.cloud.developerconnect_v1.types.FetchGitHubInstallationsResponse Response of fetching github installations.

fetch_git_refs

fetch_git_refs(
    request: typing.Optional[
        typing.Union[
            google.cloud.developerconnect_v1.types.developer_connect.FetchGitRefsRequest,
            dict,
        ]
    ] = None,
    *,
    git_repository_link: typing.Optional[str] = None,
    ref_type: typing.Optional[
        google.cloud.developerconnect_v1.types.developer_connect.FetchGitRefsRequest.RefType
    ] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> (
    google.cloud.developerconnect_v1.services.developer_connect.pagers.FetchGitRefsPager
)

Fetch the list of branches or tags for a given repository.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import developerconnect_v1

def sample_fetch_git_refs():
    # Create a client
    client = developerconnect_v1.DeveloperConnectClient()

    # Initialize request argument(s)
    request = developerconnect_v1.FetchGitRefsRequest(
        git_repository_link="git_repository_link_value",
        ref_type="BRANCH",
    )

    # Make the request
    page_result = client.fetch_git_refs(request=request)

    # Handle the response
    for response in page_result:
        print(response)
Parameters
Name Description
request Union[google.cloud.developerconnect_v1.types.FetchGitRefsRequest, dict]

The request object. Request for fetching git refs.

git_repository_link str

Required. The resource name of GitRepositoryLink in the format projects//locations//connections//gitRepositoryLinks/. This corresponds to the git_repository_link field on the request instance; if request is provided, this should not be set.

ref_type google.cloud.developerconnect_v1.types.FetchGitRefsRequest.RefType

Required. Type of refs to fetch. This corresponds to the ref_type field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.cloud.developerconnect_v1.services.developer_connect.pagers.FetchGitRefsPager Response for fetching git refs. Iterating over this object will yield results and resolve additional pages automatically.

fetch_linkable_git_repositories

fetch_linkable_git_repositories(
    request: typing.Optional[
        typing.Union[
            google.cloud.developerconnect_v1.types.developer_connect.FetchLinkableGitRepositoriesRequest,
            dict,
        ]
    ] = None,
    *,
    connection: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> (
    google.cloud.developerconnect_v1.services.developer_connect.pagers.FetchLinkableGitRepositoriesPager
)

FetchLinkableGitRepositories returns a list of git repositories from an SCM that are available to be added to a Connection.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import developerconnect_v1

def sample_fetch_linkable_git_repositories():
    # Create a client
    client = developerconnect_v1.DeveloperConnectClient()

    # Initialize request argument(s)
    request = developerconnect_v1.FetchLinkableGitRepositoriesRequest(
        connection="connection_value",
    )

    # Make the request
    page_result = client.fetch_linkable_git_repositories(request=request)

    # Handle the response
    for response in page_result:
        print(response)
Parameters
Name Description
request Union[google.cloud.developerconnect_v1.types.FetchLinkableGitRepositoriesRequest, dict]

The request object. Request message for FetchLinkableGitRepositoriesRequest.

connection str

Required. The name of the Connection. Format: projects//locations//connections/*. This corresponds to the connection field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.cloud.developerconnect_v1.services.developer_connect.pagers.FetchLinkableGitRepositoriesPager Response message for FetchLinkableGitRepositories. Iterating over this object will yield results and resolve additional pages automatically.

fetch_read_token

fetch_read_token(
    request: typing.Optional[
        typing.Union[
            google.cloud.developerconnect_v1.types.developer_connect.FetchReadTokenRequest,
            dict,
        ]
    ] = None,
    *,
    git_repository_link: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.developerconnect_v1.types.developer_connect.FetchReadTokenResponse

Fetches read token of a given gitRepositoryLink.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import developerconnect_v1

def sample_fetch_read_token():
    # Create a client
    client = developerconnect_v1.DeveloperConnectClient()

    # Initialize request argument(s)
    request = developerconnect_v1.FetchReadTokenRequest(
        git_repository_link="git_repository_link_value",
    )

    # Make the request
    response = client.fetch_read_token(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Union[google.cloud.developerconnect_v1.types.FetchReadTokenRequest, dict]

The request object. Message for fetching SCM read token.

git_repository_link str

Required. The resource name of the gitRepositoryLink in the format projects//locations//connections//gitRepositoryLinks/. This corresponds to the git_repository_link field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.cloud.developerconnect_v1.types.FetchReadTokenResponse Message for responding to get read token.

fetch_read_write_token

fetch_read_write_token(
    request: typing.Optional[
        typing.Union[
            google.cloud.developerconnect_v1.types.developer_connect.FetchReadWriteTokenRequest,
            dict,
        ]
    ] = None,
    *,
    git_repository_link: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> (
    google.cloud.developerconnect_v1.types.developer_connect.FetchReadWriteTokenResponse
)

Fetches read/write token of a given gitRepositoryLink.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import developerconnect_v1

def sample_fetch_read_write_token():
    # Create a client
    client = developerconnect_v1.DeveloperConnectClient()

    # Initialize request argument(s)
    request = developerconnect_v1.FetchReadWriteTokenRequest(
        git_repository_link="git_repository_link_value",
    )

    # Make the request
    response = client.fetch_read_write_token(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Union[google.cloud.developerconnect_v1.types.FetchReadWriteTokenRequest, dict]

The request object. Message for fetching SCM read/write token.

git_repository_link str

Required. The resource name of the gitRepositoryLink in the format projects//locations//connections//gitRepositoryLinks/. This corresponds to the git_repository_link field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.cloud.developerconnect_v1.types.FetchReadWriteTokenResponse Message for responding to get read/write token.

from_service_account_file

from_service_account_file(filename: str, *args, **kwargs)

Creates an instance of this client using the provided credentials file.

Parameter
Name Description
filename str

The path to the service account private key json file.

Returns
Type Description
DeveloperConnectClient The constructed client.

from_service_account_info

from_service_account_info(info: dict, *args, **kwargs)

Creates an instance of this client using the provided credentials info.

Parameter
Name Description
info dict

The service account private key info.

Returns
Type Description
DeveloperConnectClient The constructed client.

from_service_account_json

from_service_account_json(filename: str, *args, **kwargs)

Creates an instance of this client using the provided credentials file.

Parameter
Name Description
filename str

The path to the service account private key json file.

Returns
Type Description
DeveloperConnectClient The constructed client.

get_connection

get_connection(
    request: typing.Optional[
        typing.Union[
            google.cloud.developerconnect_v1.types.developer_connect.GetConnectionRequest,
            dict,
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.developerconnect_v1.types.developer_connect.Connection

Gets details of a single Connection.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import developerconnect_v1

def sample_get_connection():
    # Create a client
    client = developerconnect_v1.DeveloperConnectClient()

    # Initialize request argument(s)
    request = developerconnect_v1.GetConnectionRequest(
        name="name_value",
    )

    # Make the request
    response = client.get_connection(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Union[google.cloud.developerconnect_v1.types.GetConnectionRequest, dict]

The request object. Message for getting a Connection

name str

Required. Name of the resource This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.cloud.developerconnect_v1.types.Connection Message describing Connection object
get_git_repository_link(
    request: typing.Optional[
        typing.Union[
            google.cloud.developerconnect_v1.types.developer_connect.GetGitRepositoryLinkRequest,
            dict,
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.developerconnect_v1.types.developer_connect.GitRepositoryLink

Gets details of a single GitRepositoryLink.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import developerconnect_v1

def sample_get_git_repository_link():
    # Create a client
    client = developerconnect_v1.DeveloperConnectClient()

    # Initialize request argument(s)
    request = developerconnect_v1.GetGitRepositoryLinkRequest(
        name="name_value",
    )

    # Make the request
    response = client.get_git_repository_link(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Union[google.cloud.developerconnect_v1.types.GetGitRepositoryLinkRequest, dict]

The request object. Message for getting a GitRepositoryLink

name str

Required. Name of the resource This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.cloud.developerconnect_v1.types.GitRepositoryLink Message describing the GitRepositoryLink object

get_location

get_location(
    request: typing.Optional[
        google.cloud.location.locations_pb2.GetLocationRequest
    ] = None,
    *,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.location.locations_pb2.Location

Gets information about a location.

Parameters
Name Description
request .location_pb2.GetLocationRequest

The request object. Request message for GetLocation method.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
.location_pb2.Location Location object.

get_mtls_endpoint_and_cert_source

get_mtls_endpoint_and_cert_source(
    client_options: typing.Optional[
        google.api_core.client_options.ClientOptions
    ] = None,
)

Deprecated. Return the API endpoint and client cert source for mutual TLS.

The client cert source is determined in the following order: (1) if GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is not "true", the client cert source is None. (2) if client_options.client_cert_source is provided, use the provided one; if the default client cert source exists, use the default one; otherwise the client cert source is None.

The API endpoint is determined in the following order: (1) if client_options.api_endpoint if provided, use the provided one. (2) if GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is "always", use the default mTLS endpoint; if the environment variable is "never", use the default API endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise use the default API endpoint.

More details can be found at https://google.aip.dev/auth/4114.

Parameter
Name Description
client_options google.api_core.client_options.ClientOptions

Custom options for the client. Only the api_endpoint and client_cert_source properties may be used in this method.

Exceptions
Type Description
google.auth.exceptions.MutualTLSChannelError If any errors happen.
Returns
Type Description
Tuple[str, Callable[[], Tuple[bytes, bytes]]] returns the API endpoint and the client cert source to use.

get_operation

get_operation(
    request: typing.Optional[
        google.longrunning.operations_pb2.GetOperationRequest
    ] = None,
    *,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.longrunning.operations_pb2.Operation

Gets the latest state of a long-running operation.

Parameters
Name Description
request .operations_pb2.GetOperationRequest

The request object. Request message for GetOperation method.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
.operations_pb2.Operation An Operation object.
git_repository_link_path(
    project: str, location: str, connection: str, git_repository_link: str
) -> str

Returns a fully-qualified git_repository_link string.

list_connections

list_connections(
    request: typing.Optional[
        typing.Union[
            google.cloud.developerconnect_v1.types.developer_connect.ListConnectionsRequest,
            dict,
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> (
    google.cloud.developerconnect_v1.services.developer_connect.pagers.ListConnectionsPager
)

Lists Connections in a given project and location.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import developerconnect_v1

def sample_list_connections():
    # Create a client
    client = developerconnect_v1.DeveloperConnectClient()

    # Initialize request argument(s)
    request = developerconnect_v1.ListConnectionsRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_connections(request=request)

    # Handle the response
    for response in page_result:
        print(response)
Parameters
Name Description
request Union[google.cloud.developerconnect_v1.types.ListConnectionsRequest, dict]

The request object. Message for requesting list of Connections

parent str

Required. Parent value for ListConnectionsRequest This corresponds to the parent field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.cloud.developerconnect_v1.services.developer_connect.pagers.ListConnectionsPager Message for response to listing Connections Iterating over this object will yield results and resolve additional pages automatically.
list_git_repository_links(
    request: typing.Optional[
        typing.Union[
            google.cloud.developerconnect_v1.types.developer_connect.ListGitRepositoryLinksRequest,
            dict,
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> (
    google.cloud.developerconnect_v1.services.developer_connect.pagers.ListGitRepositoryLinksPager
)

Lists GitRepositoryLinks in a given project, location, and connection.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import developerconnect_v1

def sample_list_git_repository_links():
    # Create a client
    client = developerconnect_v1.DeveloperConnectClient()

    # Initialize request argument(s)
    request = developerconnect_v1.ListGitRepositoryLinksRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_git_repository_links(request=request)

    # Handle the response
    for response in page_result:
        print(response)
Parameters
Name Description
request Union[google.cloud.developerconnect_v1.types.ListGitRepositoryLinksRequest, dict]

The request object. Message for requesting a list of GitRepositoryLinks

parent str

Required. Parent value for ListGitRepositoryLinksRequest This corresponds to the parent field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.cloud.developerconnect_v1.services.developer_connect.pagers.ListGitRepositoryLinksPager Message for response to listing GitRepositoryLinks Iterating over this object will yield results and resolve additional pages automatically.

list_locations

list_locations(
    request: typing.Optional[
        google.cloud.location.locations_pb2.ListLocationsRequest
    ] = None,
    *,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.location.locations_pb2.ListLocationsResponse

Lists information about the supported locations for this service.

Parameters
Name Description
request .location_pb2.ListLocationsRequest

The request object. Request message for ListLocations method.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
.location_pb2.ListLocationsResponse Response message for ListLocations method.

list_operations

list_operations(
    request: typing.Optional[
        google.longrunning.operations_pb2.ListOperationsRequest
    ] = None,
    *,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.longrunning.operations_pb2.ListOperationsResponse

Lists operations that match the specified filter in the request.

Parameters
Name Description
request .operations_pb2.ListOperationsRequest

The request object. Request message for ListOperations method.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
.operations_pb2.ListOperationsResponse Response message for ListOperations method.

parse_common_billing_account_path

parse_common_billing_account_path(path: str) -> typing.Dict[str, str]

Parse a billing_account path into its component segments.

parse_common_folder_path

parse_common_folder_path(path: str) -> typing.Dict[str, str]

Parse a folder path into its component segments.

parse_common_location_path

parse_common_location_path(path: str) -> typing.Dict[str, str]

Parse a location path into its component segments.

parse_common_organization_path

parse_common_organization_path(path: str) -> typing.Dict[str, str]

Parse a organization path into its component segments.

parse_common_project_path

parse_common_project_path(path: str) -> typing.Dict[str, str]

Parse a project path into its component segments.

parse_connection_path

parse_connection_path(path: str) -> typing.Dict[str, str]

Parses a connection path into its component segments.

parse_git_repository_link_path(path: str) -> typing.Dict[str, str]

Parses a git_repository_link path into its component segments.

parse_secret_version_path

parse_secret_version_path(path: str) -> typing.Dict[str, str]

Parses a secret_version path into its component segments.

secret_version_path

secret_version_path(project: str, secret: str, secret_version: str) -> str

Returns a fully-qualified secret_version string.

update_connection

update_connection(
    request: typing.Optional[
        typing.Union[
            google.cloud.developerconnect_v1.types.developer_connect.UpdateConnectionRequest,
            dict,
        ]
    ] = None,
    *,
    connection: typing.Optional[
        google.cloud.developerconnect_v1.types.developer_connect.Connection
    ] = None,
    update_mask: typing.Optional[google.protobuf.field_mask_pb2.FieldMask] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary.Retry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation.Operation

Updates the parameters of a single Connection.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import developerconnect_v1

def sample_update_connection():
    # Create a client
    client = developerconnect_v1.DeveloperConnectClient()

    # Initialize request argument(s)
    connection = developerconnect_v1.Connection()
    connection.github_config.github_app = "FIREBASE"

    request = developerconnect_v1.UpdateConnectionRequest(
        connection=connection,
    )

    # Make the request
    operation = client.update_connection(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)
Parameters
Name Description
request Union[google.cloud.developerconnect_v1.types.UpdateConnectionRequest, dict]

The request object. Message for updating a Connection

connection google.cloud.developerconnect_v1.types.Connection

Required. The resource being updated This corresponds to the connection field on the request instance; if request is provided, this should not be set.

update_mask google.protobuf.field_mask_pb2.FieldMask

Required. Field mask is used to specify the fields to be overwritten in the Connection resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten. This corresponds to the update_mask field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.api_core.operation.Operation An object representing a long-running operation. The result type for the operation will be Connection Message describing Connection object