Google.Cloud.Diagnostics.Common - Class Project (5.1.0)

public static class Project

Reference documentation and code samples for the Google.Cloud.Diagnostics.Common class Project.

Operations for Cloud Console Projects.

Inheritance

object > Project

Namespace

GoogleCloudGoogle.Cloud.DiagnosticsCommon

Assembly

Google.Cloud.Diagnostics.Common.dll

Methods

GetAndCheckProjectId(string, MonitoredResource)

public static string GetAndCheckProjectId(string projectId, MonitoredResource monitoredResource = null)

Determines the correct project id from a string project id and a MonitoredResource. If the specified project id is not null, it is returned. Otherwise, if the project id of the MonitoredResource is not null, it is returned. It both are null, an InvalidOperationException is thrown.

Parameters
NameDescription
projectIdstring

The Google Cloud project ID. Can be null.

monitoredResourceMonitoredResource

Optional, The monitored resource. If unset the monitored resource will be auto detected.

Returns
TypeDescription
string

The Google Cloud project ID.

GetAndCheckServiceName(string, MonitoredResource)

public static string GetAndCheckServiceName(string serviceName, MonitoredResource monitoredResource = null)

Determines the correct service name from a string serviceName and a MonitoredResource. If the specified service name is not null, it is returned. Otherwise, if the service name of the MonitoredResource is not null, it is returned. It both are null, an InvalidOperationException is thrown.

Parameters
NameDescription
serviceNamestring

The service name. Can be null.

monitoredResourceMonitoredResource

Optional, The monitored resource. If unset the monitored resource will be auto detected.

Returns
TypeDescription
string

The service name that was passed in or detected.

GetAndCheckServiceVersion(string, MonitoredResource)

public static string GetAndCheckServiceVersion(string serviceVersion, MonitoredResource monitoredResource = null)

Determines the correct service version from a string serviceVersion and a MonitoredResource. If the specified service version is not null, it is returned. Otherwise, if the service version of the MonitoredResource provided or detected is not null, it is returned. It both are null, an InvalidOperationException is thrown.

Parameters
NameDescription
serviceVersionstring

The service version. Can be null.

monitoredResourceMonitoredResource

Optional, The monitored resource. If unset the monitored resource will be auto detected.

Returns
TypeDescription
string

The Google App Engine service version.

GetProjectId(string, MonitoredResource)

public static string GetProjectId(string projectId, MonitoredResource monitoredResource = null)

Determines the correct project ID from a string projectId and a MonitoredResource. If the specified project ID is not null, it is returned. Otherwise, if the project ID of the MonitoredResource is not null, it is returned. It both are null, null is returned.

Parameters
NameDescription
projectIdstring

The project ID. Can be null.

monitoredResourceMonitoredResource

Optional, The monitored resource. If unset the monitored resource will be auto detected.

Returns
TypeDescription
string

The Google Cloud project ID.

GetServiceName(string, MonitoredResource)

public static string GetServiceName(string serviceName, MonitoredResource monitoredResource = null)

Determines the correct service name from a string serviceName and a MonitoredResource. If the specified service name is not null, it is returned. Otherwise, if the service name of the MonitoredResource is not null, it is returned. It both are null, null is returned.

Parameters
NameDescription
serviceNamestring

The service name. Can be null.

monitoredResourceMonitoredResource

Optional, The monitored resource. If unset the monitored resource will be auto detected.

Returns
TypeDescription
string

The service name that was passed in or detected.

GetServiceVersion(string, MonitoredResource)

public static string GetServiceVersion(string serviceVersion, MonitoredResource monitoredResource = null)

Determines the correct service version from a string serviceVersion and a MonitoredResource. If the specified service version is not null, it is returned. Otherwise, if the service version of the MonitoredResource provided or detected is not null, it is returned. It both are null, null is resturned.

Parameters
NameDescription
serviceVersionstring

The service version. Can be null.

monitoredResourceMonitoredResource

Optional, The monitored resource. If unset the monitored resource will be auto detected.

Returns
TypeDescription
string

The service version that was passed in or detected.