Class RestoreName (1.0.0-beta01)

public sealed class RestoreName : IResourceName, IEquatable<RestoreName>

Resource name for the Restore resource.

Inheritance

Object > RestoreName

Namespace

Google.Cloud.GkeBackup.V1

Assembly

Google.Cloud.GkeBackup.V1.dll

Constructors

RestoreName(String, String, String, String)

public RestoreName(string projectId, string locationId, string restorePlanId, string restoreId)

Constructs a new instance of a RestoreName class from the component parts of pattern projects/{project}/locations/{location}/restorePlans/{restore_plan}/restores/{restore}

Parameters
NameDescription
projectIdString

The Project ID. Must not be null or empty.

locationIdString

The Location ID. Must not be null or empty.

restorePlanIdString

The RestorePlan ID. Must not be null or empty.

restoreIdString

The Restore ID. Must not be null or empty.

Properties

IsKnownPattern

public bool IsKnownPattern { get; }

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

Property Value
TypeDescription
Boolean

LocationId

public string LocationId { get; }

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

Property Value
TypeDescription
String

ProjectId

public string ProjectId { get; }

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

Property Value
TypeDescription
String

RestoreId

public string RestoreId { get; }

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

Property Value
TypeDescription
String

RestorePlanId

public string RestorePlanId { get; }

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

Property Value
TypeDescription
String

Type

public RestoreName.ResourceNameType Type { get; }

The RestoreName.ResourceNameType of the contained resource name.

Property Value
TypeDescription
RestoreName.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, String)

public static string Format(string projectId, string locationId, string restorePlanId, string restoreId)

Formats the IDs into the string representation of this RestoreName with pattern projects/{project}/locations/{location}/restorePlans/{restore_plan}/restores/{restore}.

Parameters
NameDescription
projectIdString

The Project ID. Must not be null or empty.

locationIdString

The Location ID. Must not be null or empty.

restorePlanIdString

The RestorePlan ID. Must not be null or empty.

restoreIdString

The Restore ID. Must not be null or empty.

Returns
TypeDescription
String

The string representation of this RestoreName with pattern projects/{project}/locations/{location}/restorePlans/{restore_plan}/restores/{restore}.

FormatProjectLocationRestorePlanRestore(String, String, String, String)

public static string FormatProjectLocationRestorePlanRestore(string projectId, string locationId, string restorePlanId, string restoreId)

Formats the IDs into the string representation of this RestoreName with pattern projects/{project}/locations/{location}/restorePlans/{restore_plan}/restores/{restore}.

Parameters
NameDescription
projectIdString

The Project ID. Must not be null or empty.

locationIdString

The Location ID. Must not be null or empty.

restorePlanIdString

The RestorePlan ID. Must not be null or empty.

restoreIdString

The Restore ID. Must not be null or empty.

Returns
TypeDescription
String

The string representation of this RestoreName with pattern projects/{project}/locations/{location}/restorePlans/{restore_plan}/restores/{restore}.

FromProjectLocationRestorePlanRestore(String, String, String, String)

public static RestoreName FromProjectLocationRestorePlanRestore(string projectId, string locationId, string restorePlanId, string restoreId)

Creates a RestoreName with the pattern projects/{project}/locations/{location}/restorePlans/{restore_plan}/restores/{restore}.

Parameters
NameDescription
projectIdString

The Project ID. Must not be null or empty.

locationIdString

The Location ID. Must not be null or empty.

restorePlanIdString

The RestorePlan ID. Must not be null or empty.

restoreIdString

The Restore ID. Must not be null or empty.

Returns
TypeDescription
RestoreName

A new instance of RestoreName constructed from the provided ids.

FromUnparsed(UnparsedResourceName)

public static RestoreName FromUnparsed(UnparsedResourceName unparsedResourceName)

Creates a RestoreName containing an unparsed resource name.

Parameter
NameDescription
unparsedResourceNameUnparsedResourceName

The unparsed resource name. Must not be null.

Returns
TypeDescription
RestoreName

A new instance of RestoreName 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 RestoreName Parse(string restoreName)

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

Parameter
NameDescription
restoreNameString

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

Returns
TypeDescription
RestoreName

The parsed RestoreName if successful.

Remarks

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

  • projects/{project}/locations/{location}/restorePlans/{restore_plan}/restores/{restore}

Parse(String, Boolean)

public static RestoreName Parse(string restoreName, bool allowUnparsed)

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

Parameters
NameDescription
restoreNameString

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
RestoreName

The parsed RestoreName if successful.

Remarks

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

  • projects/{project}/locations/{location}/restorePlans/{restore_plan}/restores/{restore}
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 RestoreName)

public static bool TryParse(string restoreName, out RestoreName result)

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

Parameters
NameDescription
restoreNameString

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

resultRestoreName

When this method returns, the parsed RestoreName, 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}/locations/{location}/restorePlans/{restore_plan}/restores/{restore}

TryParse(String, Boolean, out RestoreName)

public static bool TryParse(string restoreName, bool allowUnparsed, out RestoreName result)

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

Parameters
NameDescription
restoreNameString

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.

resultRestoreName

When this method returns, the parsed RestoreName, 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}/locations/{location}/restorePlans/{restore_plan}/restores/{restore}
Or may be in any format if allowUnparsed is true.

Operators

Equality(RestoreName, RestoreName)

public static bool operator ==(RestoreName a, RestoreName b)
Parameters
NameDescription
aRestoreName
bRestoreName
Returns
TypeDescription
Boolean

Inequality(RestoreName, RestoreName)

public static bool operator !=(RestoreName a, RestoreName b)
Parameters
NameDescription
aRestoreName
bRestoreName
Returns
TypeDescription
Boolean