Class BackupName (3.10.0)

public sealed class BackupName : IResourceName, IEquatable<BackupName>

Resource name for the Backup resource.

Inheritance

Object > BackupName

Namespace

Google.Cloud.Spanner.Admin.Database.V1

Assembly

Google.Cloud.Spanner.Admin.Database.V1.dll

Constructors

BackupName(String, String, String)

public BackupName(string projectId, string instanceId, string backupId)

Constructs a new instance of a BackupName class from the component parts of pattern projects/{project}/instances/{instance}/backups/{backup}

Parameters
NameDescription
projectIdString

The Project ID. Must not be null or empty.

instanceIdString

The Instance ID. Must not be null or empty.

backupIdString

The Backup ID. Must not be null or empty.

Properties

BackupId

public string BackupId { get; }

The Backup ID. Will not be null, unless this instance contains an unparsed resource name.

Property Value
TypeDescription
String

InstanceId

public string InstanceId { get; }

The Instance ID. Will not be null, unless this instance contains an unparsed resource name.

Property Value
TypeDescription
String

IsKnownPattern

public bool IsKnownPattern { get; }

Whether this instance contains a resource name with a known pattern.

Property Value
TypeDescription
Boolean

ProjectId

public string ProjectId { get; }

The Project ID. Will not be null, unless this instance contains an unparsed resource name.

Property Value
TypeDescription
String

Type

public BackupName.ResourceNameType Type { get; }

The BackupName.ResourceNameType of the contained resource name.

Property Value
TypeDescription
BackupName.ResourceNameType

UnparsedResource

public UnparsedResourceName UnparsedResource { get; }

The contained UnparsedResourceName. Only non-null if this instance contains an unparsed resource name.

Property Value
TypeDescription
UnparsedResourceName

Methods

Format(String, String, String)

public static string Format(string projectId, string instanceId, string backupId)

Formats the IDs into the string representation of this BackupName with pattern projects/{project}/instances/{instance}/backups/{backup}.

Parameters
NameDescription
projectIdString

The Project ID. Must not be null or empty.

instanceIdString

The Instance ID. Must not be null or empty.

backupIdString

The Backup ID. Must not be null or empty.

Returns
TypeDescription
String

The string representation of this BackupName with pattern projects/{project}/instances/{instance}/backups/{backup}.

FormatProjectInstanceBackup(String, String, String)

public static string FormatProjectInstanceBackup(string projectId, string instanceId, string backupId)

Formats the IDs into the string representation of this BackupName with pattern projects/{project}/instances/{instance}/backups/{backup}.

Parameters
NameDescription
projectIdString

The Project ID. Must not be null or empty.

instanceIdString

The Instance ID. Must not be null or empty.

backupIdString

The Backup ID. Must not be null or empty.

Returns
TypeDescription
String

The string representation of this BackupName with pattern projects/{project}/instances/{instance}/backups/{backup}.

FromProjectInstanceBackup(String, String, String)

public static BackupName FromProjectInstanceBackup(string projectId, string instanceId, string backupId)

Creates a BackupName with the pattern projects/{project}/instances/{instance}/backups/{backup}.

Parameters
NameDescription
projectIdString

The Project ID. Must not be null or empty.

instanceIdString

The Instance ID. Must not be null or empty.

backupIdString

The Backup ID. Must not be null or empty.

Returns
TypeDescription
BackupName

A new instance of BackupName constructed from the provided ids.

FromUnparsed(UnparsedResourceName)

public static BackupName FromUnparsed(UnparsedResourceName unparsedResourceName)

Creates a BackupName containing an unparsed resource name.

Parameter
NameDescription
unparsedResourceNameUnparsedResourceName

The unparsed resource name. Must not be null.

Returns
TypeDescription
BackupName

A new instance of BackupName containing the provided unparsedResourceName.

GetHashCode()

public override int GetHashCode()

Returns a hash code for this resource name.

Returns
TypeDescription
Int32
Overrides

Parse(String)

public static BackupName Parse(string backupName)

Parses the given resource name string into a new BackupName instance.

Parameter
NameDescription
backupNameString

The resource name in string form. Must not be null.

Returns
TypeDescription
BackupName

The parsed BackupName if successful.

Remarks

To parse successfully, the resource name must be formatted as one of the following:

  • projects/{project}/instances/{instance}/backups/{backup}

Parse(String, Boolean)

public static BackupName Parse(string backupName, bool allowUnparsed)

Parses the given resource name string into a new BackupName instance; optionally allowing an unparseable resource name.

Parameters
NameDescription
backupNameString

The resource name in string form. Must not be null.

allowUnparsedBoolean

If true will successfully store an unparseable resource name into the UnparsedResource property; otherwise will throw an ArgumentException if an unparseable resource name is specified.

Returns
TypeDescription
BackupName

The parsed BackupName if successful.

Remarks

To parse successfully, the resource name must be formatted as one of the following:

  • projects/{project}/instances/{instance}/backups/{backup}
Or may be in any format if allowUnparsed is true.

ToString()

public override string ToString()

The string representation of the resource name.

Returns
TypeDescription
String

The string representation of the resource name.

Overrides

TryParse(String, out BackupName)

public static bool TryParse(string backupName, out BackupName result)

Tries to parse the given resource name string into a new BackupName instance.

Parameters
NameDescription
backupNameString

The resource name in string form. Must not be null.

resultBackupName

When this method returns, the parsed BackupName, or null if parsing failed.

Returns
TypeDescription
Boolean

true if the name was parsed successfully; false otherwise.

Remarks

To parse successfully, the resource name must be formatted as one of the following:

  • projects/{project}/instances/{instance}/backups/{backup}

TryParse(String, Boolean, out BackupName)

public static bool TryParse(string backupName, bool allowUnparsed, out BackupName result)

Tries to parse the given resource name string into a new BackupName instance; optionally allowing an unparseable resource name.

Parameters
NameDescription
backupNameString

The resource name in string form. Must not be null.

allowUnparsedBoolean

If true will successfully store an unparseable resource name into the UnparsedResource property; otherwise will throw an ArgumentException if an unparseable resource name is specified.

resultBackupName

When this method returns, the parsed BackupName, or null if parsing failed.

Returns
TypeDescription
Boolean

true if the name was parsed successfully; false otherwise.

Remarks

To parse successfully, the resource name must be formatted as one of the following:

  • projects/{project}/instances/{instance}/backups/{backup}
Or may be in any format if allowUnparsed is true.

Operators

Equality(BackupName, BackupName)

public static bool operator ==(BackupName a, BackupName b)
Parameters
NameDescription
aBackupName
bBackupName
Returns
TypeDescription
Boolean

Inequality(BackupName, BackupName)

public static bool operator !=(BackupName a, BackupName b)
Parameters
NameDescription
aBackupName
bBackupName
Returns
TypeDescription
Boolean