Class ServicePerimeterName (2.0.0)

public sealed class ServicePerimeterName : IResourceName, IEquatable<ServicePerimeterName>

Resource name for the ServicePerimeter resource.

Inheritance

Object > ServicePerimeterName

Namespace

Google.Identity.AccessContextManager.V1

Assembly

Google.Identity.AccessContextManager.V1.dll

Constructors

ServicePerimeterName(String, String)

public ServicePerimeterName(string accessPolicyId, string servicePerimeterId)

Constructs a new instance of a ServicePerimeterName class from the component parts of pattern accessPolicies/{access_policy}/servicePerimeters/{service_perimeter}

Parameters
NameDescription
accessPolicyIdString

The AccessPolicy ID. Must not be null or empty.

servicePerimeterIdString

The ServicePerimeter ID. Must not be null or empty.

Properties

AccessPolicyId

public string AccessPolicyId { get; }

The AccessPolicy 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

ServicePerimeterId

public string ServicePerimeterId { get; }

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

Property Value
TypeDescription
String

Type

public ServicePerimeterName.ResourceNameType Type { get; }

The ServicePerimeterName.ResourceNameType of the contained resource name.

Property Value
TypeDescription
ServicePerimeterName.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)

public static string Format(string accessPolicyId, string servicePerimeterId)

Formats the IDs into the string representation of this ServicePerimeterName with pattern accessPolicies/{access_policy}/servicePerimeters/{service_perimeter}.

Parameters
NameDescription
accessPolicyIdString

The AccessPolicy ID. Must not be null or empty.

servicePerimeterIdString

The ServicePerimeter ID. Must not be null or empty.

Returns
TypeDescription
String

The string representation of this ServicePerimeterName with pattern accessPolicies/{access_policy}/servicePerimeters/{service_perimeter}.

FormatAccessPolicyServicePerimeter(String, String)

public static string FormatAccessPolicyServicePerimeter(string accessPolicyId, string servicePerimeterId)

Formats the IDs into the string representation of this ServicePerimeterName with pattern accessPolicies/{access_policy}/servicePerimeters/{service_perimeter}.

Parameters
NameDescription
accessPolicyIdString

The AccessPolicy ID. Must not be null or empty.

servicePerimeterIdString

The ServicePerimeter ID. Must not be null or empty.

Returns
TypeDescription
String

The string representation of this ServicePerimeterName with pattern accessPolicies/{access_policy}/servicePerimeters/{service_perimeter}.

FromAccessPolicyServicePerimeter(String, String)

public static ServicePerimeterName FromAccessPolicyServicePerimeter(string accessPolicyId, string servicePerimeterId)

Creates a ServicePerimeterName with the pattern accessPolicies/{access_policy}/servicePerimeters/{service_perimeter}.

Parameters
NameDescription
accessPolicyIdString

The AccessPolicy ID. Must not be null or empty.

servicePerimeterIdString

The ServicePerimeter ID. Must not be null or empty.

Returns
TypeDescription
ServicePerimeterName

A new instance of ServicePerimeterName constructed from the provided ids.

FromUnparsed(UnparsedResourceName)

public static ServicePerimeterName FromUnparsed(UnparsedResourceName unparsedResourceName)

Creates a ServicePerimeterName containing an unparsed resource name.

Parameter
NameDescription
unparsedResourceNameUnparsedResourceName

The unparsed resource name. Must not be null.

Returns
TypeDescription
ServicePerimeterName

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

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

Parameter
NameDescription
servicePerimeterNameString

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

Returns
TypeDescription
ServicePerimeterName

The parsed ServicePerimeterName if successful.

Remarks

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

  • accessPolicies/{access_policy}/servicePerimeters/{service_perimeter}

Parse(String, Boolean)

public static ServicePerimeterName Parse(string servicePerimeterName, bool allowUnparsed)

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

Parameters
NameDescription
servicePerimeterNameString

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
ServicePerimeterName

The parsed ServicePerimeterName if successful.

Remarks

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

  • accessPolicies/{access_policy}/servicePerimeters/{service_perimeter}
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 ServicePerimeterName)

public static bool TryParse(string servicePerimeterName, out ServicePerimeterName result)

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

Parameters
NameDescription
servicePerimeterNameString

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

resultServicePerimeterName

When this method returns, the parsed ServicePerimeterName, 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:

  • accessPolicies/{access_policy}/servicePerimeters/{service_perimeter}

TryParse(String, Boolean, out ServicePerimeterName)

public static bool TryParse(string servicePerimeterName, bool allowUnparsed, out ServicePerimeterName result)

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

Parameters
NameDescription
servicePerimeterNameString

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.

resultServicePerimeterName

When this method returns, the parsed ServicePerimeterName, 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:

  • accessPolicies/{access_policy}/servicePerimeters/{service_perimeter}
Or may be in any format if allowUnparsed is true.

Operators

Equality(ServicePerimeterName, ServicePerimeterName)

public static bool operator ==(ServicePerimeterName a, ServicePerimeterName b)
Parameters
NameDescription
aServicePerimeterName
bServicePerimeterName
Returns
TypeDescription
Boolean

Inequality(ServicePerimeterName, ServicePerimeterName)

public static bool operator !=(ServicePerimeterName a, ServicePerimeterName b)
Parameters
NameDescription
aServicePerimeterName
bServicePerimeterName
Returns
TypeDescription
Boolean