As of January 1, 2020 this library no longer supports Python 2 on the latest released version. Library versions released prior to that date will continue to be available. For more information please visit Python 2 support on Google Cloud.

Types for Google Cloud Source Context v1 API

class google.cloud.source_context_v1.types.AliasContext(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

An alias to a repo revision.

kind

The alias kind.

Type

google.cloud.source_context_v1.types.AliasContext.Kind

name

The alias name.

Type

str

class Kind(value)[source]

Bases: proto.enums.Enum

The type of an Alias.

Values:
ANY (0):

Do not use.

FIXED (1):

Git tag

MOVABLE (2):

Git branch

OTHER (4):

OTHER is used to specify non-standard aliases, those not of the kinds above. For example, if a Git repo has a ref named “refs/foo/bar”, it is considered to be of kind OTHER.

class google.cloud.source_context_v1.types.CloudRepoSourceContext(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

A CloudRepoSourceContext denotes a particular revision in a cloud repo (a repo hosted by the Google Cloud Platform).

This message has oneof fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. Setting any member of the oneof automatically clears all other members.

repo_id

The ID of the repo.

Type

google.cloud.source_context_v1.types.RepoId

revision_id

A revision ID.

This field is a member of oneof revision.

Type

str

alias_name

The name of an alias (branch, tag, etc.).

This field is a member of oneof revision.

Type

str

alias_context

An alias, which may be a branch or tag.

This field is a member of oneof revision.

Type

google.cloud.source_context_v1.types.AliasContext

class google.cloud.source_context_v1.types.CloudWorkspaceId(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

A CloudWorkspaceId is a unique identifier for a cloud workspace. A cloud workspace is a place associated with a repo where modified files can be stored before they are committed.

repo_id

The ID of the repo containing the workspace.

Type

google.cloud.source_context_v1.types.RepoId

name

The unique name of the workspace within the repo. This is the name chosen by the client in the Source API’s CreateWorkspace method.

Type

str

class google.cloud.source_context_v1.types.CloudWorkspaceSourceContext(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

A CloudWorkspaceSourceContext denotes a workspace at a particular snapshot.

workspace_id

The ID of the workspace.

Type

google.cloud.source_context_v1.types.CloudWorkspaceId

snapshot_id

The ID of the snapshot. An empty snapshot_id refers to the most recent snapshot.

Type

str

class google.cloud.source_context_v1.types.ExtendedSourceContext(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

An ExtendedSourceContext is a SourceContext combined with additional details describing the context.

context

Any source context.

Type

google.cloud.source_context_v1.types.SourceContext

labels

Labels with user defined metadata.

Type

MutableMapping[str, str]

class LabelsEntry(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Bases: proto.message.Message

class google.cloud.source_context_v1.types.GerritSourceContext(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

A SourceContext referring to a Gerrit project.

This message has oneof fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. Setting any member of the oneof automatically clears all other members.

host_uri

The URI of a running Gerrit instance.

Type

str

gerrit_project

The full project name within the host. Projects may be nested, so “project/subproject” is a valid project name. The “repo name” is hostURI/project.

Type

str

revision_id

A revision (commit) ID.

This field is a member of oneof revision.

Type

str

alias_name

The name of an alias (branch, tag, etc.).

This field is a member of oneof revision.

Type

str

alias_context

An alias, which may be a branch or tag.

This field is a member of oneof revision.

Type

google.cloud.source_context_v1.types.AliasContext

class google.cloud.source_context_v1.types.GitSourceContext(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

A GitSourceContext denotes a particular revision in a third party Git repository (e.g. GitHub).

url

Git repository URL.

Type

str

revision_id

Git commit hash. required.

Type

str

class google.cloud.source_context_v1.types.ProjectRepoId(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Selects a repo using a Google Cloud Platform project ID (e.g. winged-cargo-31) and a repo name within that project.

project_id

The ID of the project.

Type

str

repo_name

The name of the repo. Leave empty for the default repo.

Type

str

class google.cloud.source_context_v1.types.RepoId(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

A unique identifier for a cloud repo.

This message has oneof fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. Setting any member of the oneof automatically clears all other members.

project_repo_id

A combination of a project ID and a repo name.

This field is a member of oneof id.

Type

google.cloud.source_context_v1.types.ProjectRepoId

uid

A server-assigned, globally unique identifier.

This field is a member of oneof id.

Type

str

class google.cloud.source_context_v1.types.SourceContext(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

A SourceContext is a reference to a tree of files. A SourceContext together with a path point to a unique revision of a single file or directory.

This message has oneof fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. Setting any member of the oneof automatically clears all other members.

cloud_repo

A SourceContext referring to a revision in a cloud repo.

This field is a member of oneof context.

Type

google.cloud.source_context_v1.types.CloudRepoSourceContext

cloud_workspace

A SourceContext referring to a snapshot in a cloud workspace.

This field is a member of oneof context.

Type

google.cloud.source_context_v1.types.CloudWorkspaceSourceContext

gerrit

A SourceContext referring to a Gerrit project.

This field is a member of oneof context.

Type

google.cloud.source_context_v1.types.GerritSourceContext

git

A SourceContext referring to any third party Git repo (e.g. GitHub).

This field is a member of oneof context.

Type

google.cloud.source_context_v1.types.GitSourceContext