Identity Access Context Manager v1 API - Class ServicePerimeterName (2.5.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
Name Description
accessPolicyId string

The AccessPolicy ID. Must not be null or empty.

servicePerimeterId string

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
Type Description
string

IsKnownPattern

public bool IsKnownPattern { get; }

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

Property Value
Type Description
bool

ServicePerimeterId

public string ServicePerimeterId { get; }

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

Property Value
Type Description
string

Type

public ServicePerimeterName.ResourceNameType Type { get; }

The ServicePerimeterName.ResourceNameType of the contained resource name.

Property Value
Type Description
ServicePerimeterNameResourceNameType

UnparsedResource

public UnparsedResourceName UnparsedResource { get; }

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

Property Value
Type Description
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
Name Description
accessPolicyId string

The AccessPolicy ID. Must not be null or empty.

servicePerimeterId string

The ServicePerimeter ID. Must not be null or empty.

Returns
Type Description
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
Name Description
accessPolicyId string

The AccessPolicy ID. Must not be null or empty.

servicePerimeterId string

The ServicePerimeter ID. Must not be null or empty.

Returns
Type Description
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
Name Description
accessPolicyId string

The AccessPolicy ID. Must not be null or empty.

servicePerimeterId string

The ServicePerimeter ID. Must not be null or empty.

Returns
Type Description
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
Name Description
unparsedResourceName UnparsedResourceName

The unparsed resource name. Must not be null.

Returns
Type Description
ServicePerimeterName

A new instance of ServicePerimeterName containing the provided unparsedResourceName.

GetHashCode()

public override int GetHashCode()

Returns a hash code for this resource name.

Returns
Type Description
int
Overrides

Parse(string)

public static ServicePerimeterName Parse(string servicePerimeterName)

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

Parameter
Name Description
servicePerimeterName string

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

Returns
Type Description
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
Name Description
servicePerimeterName string

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

allowUnparsed bool

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
Type Description
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
Type Description
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
Name Description
servicePerimeterName string

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

result ServicePerimeterName

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

Returns
Type Description
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
Name Description
servicePerimeterName string

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

allowUnparsed bool

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.

result ServicePerimeterName

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

Returns
Type Description
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
Name Description
a ServicePerimeterName

The first resource name to compare, or null.

b ServicePerimeterName

The second resource name to compare, or null.

Returns
Type Description
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
Name Description
a ServicePerimeterName

The first resource name to compare, or null.

b ServicePerimeterName

The second resource name to compare, or null.

Returns
Type Description
bool

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