public sealed class ApiName : IResourceName, IEquatable<ApiName>
Reference documentation and code samples for the Apigee Registry v1 API class ApiName.
Resource name for the Api
resource.
Namespace
Google.Cloud.ApigeeRegistry.V1Assembly
Google.Cloud.ApigeeRegistry.V1.dll
Constructors
ApiName(String, String, String)
public ApiName(string projectId, string locationId, string apiId)
Constructs a new instance of a ApiName class from the component parts of pattern
projects/{project}/locations/{location}/apis/{api}
Parameters | |
---|---|
Name | Description |
projectId | String The |
locationId | String The |
apiId | String The |
Properties
ApiId
public string ApiId { get; }
The Api
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 |
Boolean |
LocationId
public string LocationId { get; }
The Location
ID. Will not be null
, unless this instance contains an unparsed resource name.
Property Value | |
---|---|
Type | Description |
String |
ProjectId
public string ProjectId { get; }
The Project
ID. Will not be null
, unless this instance contains an unparsed resource name.
Property Value | |
---|---|
Type | Description |
String |
Type
public ApiName.ResourceNameType Type { get; }
The ApiName.ResourceNameType of the contained resource name.
Property Value | |
---|---|
Type | Description |
ApiName.ResourceNameType |
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, String)
public static string Format(string projectId, string locationId, string apiId)
Formats the IDs into the string representation of this ApiName with pattern
projects/{project}/locations/{location}/apis/{api}
.
Parameters | |
---|---|
Name | Description |
projectId | String The |
locationId | String The |
apiId | String The |
Returns | |
---|---|
Type | Description |
String | The string representation of this ApiName with pattern
|
FormatProjectLocationApi(String, String, String)
public static string FormatProjectLocationApi(string projectId, string locationId, string apiId)
Formats the IDs into the string representation of this ApiName with pattern
projects/{project}/locations/{location}/apis/{api}
.
Parameters | |
---|---|
Name | Description |
projectId | String The |
locationId | String The |
apiId | String The |
Returns | |
---|---|
Type | Description |
String | The string representation of this ApiName with pattern
|
FromProjectLocationApi(String, String, String)
public static ApiName FromProjectLocationApi(string projectId, string locationId, string apiId)
Creates a ApiName with the pattern projects/{project}/locations/{location}/apis/{api}
.
Parameters | |
---|---|
Name | Description |
projectId | String The |
locationId | String The |
apiId | String The |
Returns | |
---|---|
Type | Description |
ApiName | A new instance of ApiName constructed from the provided ids. |
FromUnparsed(UnparsedResourceName)
public static ApiName FromUnparsed(UnparsedResourceName unparsedResourceName)
Creates a ApiName containing an unparsed resource name.
Parameter | |
---|---|
Name | Description |
unparsedResourceName | UnparsedResourceName The unparsed resource name. Must not be |
Returns | |
---|---|
Type | Description |
ApiName | A new instance of ApiName containing the provided |
GetHashCode()
public override int GetHashCode()
Returns a hash code for this resource name.
Returns | |
---|---|
Type | Description |
Int32 |
Parse(String)
public static ApiName Parse(string apiName)
Parses the given resource name string into a new ApiName instance.
Parameter | |
---|---|
Name | Description |
apiName | String The resource name in string form. Must not be |
Returns | |
---|---|
Type | Description |
ApiName | The parsed ApiName if successful. |
To parse successfully, the resource name must be formatted as one of the following:
projects/{project}/locations/{location}/apis/{api}
Parse(String, Boolean)
public static ApiName Parse(string apiName, bool allowUnparsed)
Parses the given resource name string into a new ApiName instance; optionally allowing an unparseable resource name.
Parameters | |
---|---|
Name | Description |
apiName | String The resource name in string form. Must not be |
allowUnparsed | Boolean If |
Returns | |
---|---|
Type | Description |
ApiName | The parsed ApiName if successful. |
To parse successfully, the resource name must be formatted as one of the following:
projects/{project}/locations/{location}/apis/{api}
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. |
TryParse(String, out ApiName)
public static bool TryParse(string apiName, out ApiName result)
Tries to parse the given resource name string into a new ApiName instance.
Parameters | |
---|---|
Name | Description |
apiName | String The resource name in string form. Must not be |
result | ApiName When this method returns, the parsed ApiName, or |
Returns | |
---|---|
Type | Description |
Boolean |
|
To parse successfully, the resource name must be formatted as one of the following:
projects/{project}/locations/{location}/apis/{api}
TryParse(String, Boolean, out ApiName)
public static bool TryParse(string apiName, bool allowUnparsed, out ApiName result)
Tries to parse the given resource name string into a new ApiName instance; optionally allowing an unparseable resource name.
Parameters | |
---|---|
Name | Description |
apiName | String The resource name in string form. Must not be |
allowUnparsed | Boolean If |
result | ApiName When this method returns, the parsed ApiName, or |
Returns | |
---|---|
Type | Description |
Boolean |
|
To parse successfully, the resource name must be formatted as one of the following:
projects/{project}/locations/{location}/apis/{api}
allowUnparsed
is true
.
Operators
Equality(ApiName, ApiName)
public static bool operator ==(ApiName a, ApiName b)
Parameters | |
---|---|
Name | Description |
a | ApiName |
b | ApiName |
Returns | |
---|---|
Type | Description |
Boolean |
Inequality(ApiName, ApiName)
public static bool operator !=(ApiName a, ApiName b)
Parameters | |
---|---|
Name | Description |
a | ApiName |
b | ApiName |
Returns | |
---|---|
Type | Description |
Boolean |