public sealed class OccurrenceName : IResourceName, IEquatable<OccurrenceName>Reference documentation and code samples for the Grafeas v1 API class OccurrenceName.
Resource name for the Occurrence resource.
Namespace
Grafeas.V1Assembly
Grafeas.V1.dll
Constructors
OccurrenceName(string, string)
public OccurrenceName(string projectId, string occurrenceId)Constructs a new instance of a OccurrenceName class from the component parts of pattern
projects/{project}/occurrences/{occurrence}
| Parameters | |
|---|---|
| Name | Description |
projectId |
stringThe |
occurrenceId |
stringThe |
Properties
IsKnownPattern
public bool IsKnownPattern { get; }Whether this instance contains a resource name with a known pattern.
| Property Value | |
|---|---|
| Type | Description |
bool |
|
OccurrenceId
public string OccurrenceId { get; }The Occurrence 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 OccurrenceName.ResourceNameType Type { get; }The OccurrenceName.ResourceNameType of the contained resource name.
| Property Value | |
|---|---|
| Type | Description |
OccurrenceNameResourceNameType |
|
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 projectId, string occurrenceId)Formats the IDs into the string representation of this OccurrenceName with pattern
projects/{project}/occurrences/{occurrence}.
| Parameters | |
|---|---|
| Name | Description |
projectId |
stringThe |
occurrenceId |
stringThe |
| Returns | |
|---|---|
| Type | Description |
string |
The string representation of this OccurrenceName with pattern
|
FormatProjectOccurrence(string, string)
public static string FormatProjectOccurrence(string projectId, string occurrenceId)Formats the IDs into the string representation of this OccurrenceName with pattern
projects/{project}/occurrences/{occurrence}.
| Parameters | |
|---|---|
| Name | Description |
projectId |
stringThe |
occurrenceId |
stringThe |
| Returns | |
|---|---|
| Type | Description |
string |
The string representation of this OccurrenceName with pattern
|
FromProjectOccurrence(string, string)
public static OccurrenceName FromProjectOccurrence(string projectId, string occurrenceId)Creates a OccurrenceName with the pattern projects/{project}/occurrences/{occurrence}.
| Parameters | |
|---|---|
| Name | Description |
projectId |
stringThe |
occurrenceId |
stringThe |
| Returns | |
|---|---|
| Type | Description |
OccurrenceName |
A new instance of OccurrenceName constructed from the provided ids. |
FromUnparsed(UnparsedResourceName)
public static OccurrenceName FromUnparsed(UnparsedResourceName unparsedResourceName)Creates a OccurrenceName containing an unparsed resource name.
| Parameter | |
|---|---|
| Name | Description |
unparsedResourceName |
UnparsedResourceNameThe unparsed resource name. Must not be |
| Returns | |
|---|---|
| Type | Description |
OccurrenceName |
A new instance of OccurrenceName containing the provided
|
GetHashCode()
public override int GetHashCode()Returns a hash code for this resource name.
| Returns | |
|---|---|
| Type | Description |
int |
|
Parse(string)
public static OccurrenceName Parse(string occurrenceName)Parses the given resource name string into a new OccurrenceName instance.
| Parameter | |
|---|---|
| Name | Description |
occurrenceName |
stringThe resource name in string form. Must not be |
| Returns | |
|---|---|
| Type | Description |
OccurrenceName |
The parsed OccurrenceName if successful. |
To parse successfully, the resource name must be formatted as one of the following:
projects/{project}/occurrences/{occurrence}
Parse(string, bool)
public static OccurrenceName Parse(string occurrenceName, bool allowUnparsed)Parses the given resource name string into a new OccurrenceName instance; optionally allowing an unparseable resource name.
| Parameters | |
|---|---|
| Name | Description |
occurrenceName |
stringThe resource name in string form. Must not be |
allowUnparsed |
boolIf |
| Returns | |
|---|---|
| Type | Description |
OccurrenceName |
The parsed OccurrenceName if successful. |
To parse successfully, the resource name must be formatted as one of the following:
projects/{project}/occurrences/{occurrence}
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 OccurrenceName)
public static bool TryParse(string occurrenceName, out OccurrenceName result)Tries to parse the given resource name string into a new OccurrenceName instance.
| Parameters | |
|---|---|
| Name | Description |
occurrenceName |
stringThe resource name in string form. Must not be |
result |
OccurrenceNameWhen this method returns, the parsed OccurrenceName, or |
| Returns | |
|---|---|
| Type | Description |
bool |
|
To parse successfully, the resource name must be formatted as one of the following:
projects/{project}/occurrences/{occurrence}
TryParse(string, bool, out OccurrenceName)
public static bool TryParse(string occurrenceName, bool allowUnparsed, out OccurrenceName result)Tries to parse the given resource name string into a new OccurrenceName instance; optionally allowing an unparseable resource name.
| Parameters | |
|---|---|
| Name | Description |
occurrenceName |
stringThe resource name in string form. Must not be |
allowUnparsed |
boolIf |
result |
OccurrenceNameWhen this method returns, the parsed OccurrenceName, or |
| Returns | |
|---|---|
| Type | Description |
bool |
|
To parse successfully, the resource name must be formatted as one of the following:
projects/{project}/occurrences/{occurrence}
allowUnparsed is true.
Operators
operator ==(OccurrenceName, OccurrenceName)
public static bool operator ==(OccurrenceName a, OccurrenceName b)Determines whether two specified resource names have the same value.
| Parameters | |
|---|---|
| Name | Description |
a |
OccurrenceNameThe first resource name to compare, or null. |
b |
OccurrenceNameThe second resource name to compare, or null. |
| Returns | |
|---|---|
| Type | Description |
bool |
true if the value of |
operator !=(OccurrenceName, OccurrenceName)
public static bool operator !=(OccurrenceName a, OccurrenceName b)Determines whether two specified resource names have different values.
| Parameters | |
|---|---|
| Name | Description |
a |
OccurrenceNameThe first resource name to compare, or null. |
b |
OccurrenceNameThe second resource name to compare, or null. |
| Returns | |
|---|---|
| Type | Description |
bool |
true if the value of |