Identity Access Context Manager v1 API - Class ServicePerimeterName (2.3.0)

public sealed class ServicePerimeterName : IResourceName, IEquatable<ServicePerimeterName>

Reference documentation and code samples for the Identity Access Context Manager v1 API class 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
bool

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
ServicePerimeterNameResourceNameType

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
int
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, bool)

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.

allowUnparsedbool

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
bool

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, bool, 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.

allowUnparsedbool

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
bool

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

operator ==(ServicePerimeterName, ServicePerimeterName)

public static bool operator ==(ServicePerimeterName a, ServicePerimeterName b)

Determines whether two specified resource names have the same value.

Parameters
NameDescription
aServicePerimeterName

The first resource name to compare, or null.

bServicePerimeterName

The second resource name to compare, or null.

Returns
TypeDescription
bool

true if the value of a is the same as the value of b; otherwise, false.

operator !=(ServicePerimeterName, ServicePerimeterName)

public static bool operator !=(ServicePerimeterName a, ServicePerimeterName b)

Determines whether two specified resource names have different values.

Parameters
NameDescription
aServicePerimeterName

The first resource name to compare, or null.

bServicePerimeterName

The second resource name to compare, or null.

Returns
TypeDescription
bool

true if the value of a is different from the value of b; otherwise, false.