Google.Cloud.DevTools.Common - Class SourceContext (3.1.1)

public sealed class SourceContext : IMessage<SourceContext>, IMessage, IEquatable<SourceContext>, IDeepCloneable<SourceContext>

Reference documentation and code samples for the Google.Cloud.DevTools.Common class SourceContext.

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.

Inheritance

object > SourceContext

Namespace

Google.Cloud.DevTools.Source.V1

Assembly

Google.Cloud.DevTools.Common.dll

Constructors

SourceContext()

public SourceContext()

SourceContext(SourceContext)

public SourceContext(SourceContext other)
Parameter
NameDescription
otherSourceContext

Fields

GitRevisionIdLogLabel

public const string GitRevisionIdLogLabel = "git_revision_id"

Gets the custom log label of Stackdriver Logging entry to set Git revision id. When writing a Stackdriver Logging entry, the user should add this custom label, with a value of the git revision id for the source code. This enables Google Cloud Tools for Visual Studio to locate the source file revision of the log entry.

Field Value
TypeDescription
string

Properties

AppSourceContext

public static SourceContext AppSourceContext { get; }

Gets the SourceContext for the application.

Property Value
TypeDescription
SourceContext
Exceptions
TypeDescription
InvalidProtocolBufferException

The source context file is valid JSON, but is not valid as a SourceContext.

InvalidJsonException

The source context file is not valid JSON.

SecurityException

The application does not have permission to read the file.

UnauthorizedAccessException

The application is not authorized to access the file.

CloudRepo

public CloudRepoSourceContext CloudRepo { get; set; }

A SourceContext referring to a revision in a cloud repo.

Property Value
TypeDescription
CloudRepoSourceContext

CloudWorkspace

public CloudWorkspaceSourceContext CloudWorkspace { get; set; }

A SourceContext referring to a snapshot in a cloud workspace.

Property Value
TypeDescription
CloudWorkspaceSourceContext

ContextCase

public SourceContext.ContextOneofCase ContextCase { get; }
Property Value
TypeDescription
SourceContextContextOneofCase

Gerrit

public GerritSourceContext Gerrit { get; set; }

A SourceContext referring to a Gerrit project.

Property Value
TypeDescription
GerritSourceContext

Git

public GitSourceContext Git { get; set; }

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

Property Value
TypeDescription
GitSourceContext