Class Project (5.0.0)

public static class Project

Operations for Cloud Console Projects.

Inheritance

Object > Project

Namespace

Google.Cloud.Diagnostics.Common

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.