Google Cloud Asset Inventory v1 API - Class FeedName (3.9.0)

public sealed class FeedName : IResourceName, IEquatable<FeedName>

Reference documentation and code samples for the Google Cloud Asset Inventory v1 API class FeedName.

Resource name for the Feed resource.

Inheritance

object > FeedName

Namespace

Google.Cloud.Asset.V1

Assembly

Google.Cloud.Asset.V1.dll

Constructors

FeedName(string, string)

public FeedName(string projectId, string feedId)

Constructs a new instance of a FeedName class from the component parts of pattern projects/{project}/feeds/{feed}

Parameters
NameDescription
projectIdstring

The Project ID. Must not be null or empty.

feedIdstring

The Feed ID. Must not be null or empty.

Properties

FeedId

public string FeedId { get; }

The Feed ID. May be null, depending on which resource name is contained by this instance.

Property Value
TypeDescription
string

FolderId

public string FolderId { get; }

The Folder ID. May be null, depending on which resource name is contained by this instance.

Property Value
TypeDescription
string

IsKnownPattern

public bool IsKnownPattern { get; }

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

Property Value
TypeDescription
bool

OrganizationId

public string OrganizationId { get; }

The Organization ID. May be null, depending on which resource name is contained by this instance.

Property Value
TypeDescription
string

ProjectId

public string ProjectId { get; }

The Project ID. May be null, depending on which resource name is contained by this instance.

Property Value
TypeDescription
string

Type

public FeedName.ResourceNameType Type { get; }

The FeedName.ResourceNameType of the contained resource name.

Property Value
TypeDescription
FeedNameResourceNameType

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 projectId, string feedId)

Formats the IDs into the string representation of this FeedName with pattern projects/{project}/feeds/{feed}.

Parameters
NameDescription
projectIdstring

The Project ID. Must not be null or empty.

feedIdstring

The Feed ID. Must not be null or empty.

Returns
TypeDescription
string

The string representation of this FeedName with pattern projects/{project}/feeds/{feed} .

FormatFolderFeed(string, string)

public static string FormatFolderFeed(string folderId, string feedId)

Formats the IDs into the string representation of this FeedName with pattern folders/{folder}/feeds/{feed}.

Parameters
NameDescription
folderIdstring

The Folder ID. Must not be null or empty.

feedIdstring

The Feed ID. Must not be null or empty.

Returns
TypeDescription
string

The string representation of this FeedName with pattern folders/{folder}/feeds/{feed}.

FormatOrganizationFeed(string, string)

public static string FormatOrganizationFeed(string organizationId, string feedId)

Formats the IDs into the string representation of this FeedName with pattern organizations/{organization}/feeds/{feed}.

Parameters
NameDescription
organizationIdstring

The Organization ID. Must not be null or empty.

feedIdstring

The Feed ID. Must not be null or empty.

Returns
TypeDescription
string

The string representation of this FeedName with pattern organizations/{organization}/feeds/{feed}.

FormatProjectFeed(string, string)

public static string FormatProjectFeed(string projectId, string feedId)

Formats the IDs into the string representation of this FeedName with pattern projects/{project}/feeds/{feed}.

Parameters
NameDescription
projectIdstring

The Project ID. Must not be null or empty.

feedIdstring

The Feed ID. Must not be null or empty.

Returns
TypeDescription
string

The string representation of this FeedName with pattern projects/{project}/feeds/{feed} .

FromFolderFeed(string, string)

public static FeedName FromFolderFeed(string folderId, string feedId)

Creates a FeedName with the pattern folders/{folder}/feeds/{feed}.

Parameters
NameDescription
folderIdstring

The Folder ID. Must not be null or empty.

feedIdstring

The Feed ID. Must not be null or empty.

Returns
TypeDescription
FeedName

A new instance of FeedName constructed from the provided ids.

FromOrganizationFeed(string, string)

public static FeedName FromOrganizationFeed(string organizationId, string feedId)

Creates a FeedName with the pattern organizations/{organization}/feeds/{feed}.

Parameters
NameDescription
organizationIdstring

The Organization ID. Must not be null or empty.

feedIdstring

The Feed ID. Must not be null or empty.

Returns
TypeDescription
FeedName

A new instance of FeedName constructed from the provided ids.

FromProjectFeed(string, string)

public static FeedName FromProjectFeed(string projectId, string feedId)

Creates a FeedName with the pattern projects/{project}/feeds/{feed}.

Parameters
NameDescription
projectIdstring

The Project ID. Must not be null or empty.

feedIdstring

The Feed ID. Must not be null or empty.

Returns
TypeDescription
FeedName

A new instance of FeedName constructed from the provided ids.

FromUnparsed(UnparsedResourceName)

public static FeedName FromUnparsed(UnparsedResourceName unparsedResourceName)

Creates a FeedName containing an unparsed resource name.

Parameter
NameDescription
unparsedResourceNameUnparsedResourceName

The unparsed resource name. Must not be null.

Returns
TypeDescription
FeedName

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

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

Parameter
NameDescription
feedNamestring

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

Returns
TypeDescription
FeedName

The parsed FeedName if successful.

Remarks

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

  • projects/{project}/feeds/{feed}
  • folders/{folder}/feeds/{feed}
  • organizations/{organization}/feeds/{feed}

Parse(string, bool)

public static FeedName Parse(string feedName, bool allowUnparsed)

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

Parameters
NameDescription
feedNamestring

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
FeedName

The parsed FeedName if successful.

Remarks

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

  • projects/{project}/feeds/{feed}
  • folders/{folder}/feeds/{feed}
  • organizations/{organization}/feeds/{feed}
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 FeedName)

public static bool TryParse(string feedName, out FeedName result)

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

Parameters
NameDescription
feedNamestring

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

resultFeedName

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

  • projects/{project}/feeds/{feed}
  • folders/{folder}/feeds/{feed}
  • organizations/{organization}/feeds/{feed}

TryParse(string, bool, out FeedName)

public static bool TryParse(string feedName, bool allowUnparsed, out FeedName result)

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

Parameters
NameDescription
feedNamestring

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.

resultFeedName

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

  • projects/{project}/feeds/{feed}
  • folders/{folder}/feeds/{feed}
  • organizations/{organization}/feeds/{feed}
Or may be in any format if allowUnparsed is true.

Operators

operator ==(FeedName, FeedName)

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

Determines whether two specified resource names have the same value.

Parameters
NameDescription
aFeedName

The first resource name to compare, or null.

bFeedName

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 !=(FeedName, FeedName)

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

Determines whether two specified resource names have different values.

Parameters
NameDescription
aFeedName

The first resource name to compare, or null.

bFeedName

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.