C# Class Google.Api.Gax.ResourceName

Class for representing and working with resource names.

A resource name is represented by a PathTemplate, an assignment of resource IDs to parameters in the template, and an optional service name. This class allows the service name and resource IDs to be modified, but only within the same template.

显示文件 Open project: googleapis/gax-dotnet Class Usage Examples

Public Methods

Method Description
Clone ( ) : ResourceName

Creates a clone of this resource name, which is then independent of the original.

ResourceName ( PathTemplate template ) : System

Creates a resource name with the given template and resource IDs. The resource IDs are cloned, so later changes to resourceIds are ignored. This constructor does not populate the ServiceName property, but that can be set after construction.

ToString ( ) : string

Returns a string representation of this resource name, expanding the template parameters with the resource IDs and prepending the service name (if present).

this ( int index ) : string

Gets or sets the identifier for the specified parameter index.

this ( string parameterName ) : string

Gets or sets the identifier for the specified parameter name.

Private Methods

Method Description
CreateWithShallowCopy ( PathTemplate template, string serviceName, string resourceIds ) : ResourceName
GetParameterIndex ( string parameterName ) : int
ResourceName ( PathTemplate template, string serviceName, string resourceIds, bool ignored ) : System

Private constructor used by internal code to avoid repeated cloning and validation.

Method Details

Clone() public method

Creates a clone of this resource name, which is then independent of the original.
public Clone ( ) : ResourceName
return ResourceName

ResourceName() public method

Creates a resource name with the given template and resource IDs. The resource IDs are cloned, so later changes to resourceIds are ignored. This constructor does not populate the ServiceName property, but that can be set after construction.
public ResourceName ( PathTemplate template ) : System
template PathTemplate The template for the new resource name. Must not be null.
return System

ToString() public method

Returns a string representation of this resource name, expanding the template parameters with the resource IDs and prepending the service name (if present).
public ToString ( ) : string
return string

this() public method

Gets or sets the identifier for the specified parameter index.
public this ( int index ) : string
index int The index of the parameter value to retrieve.
return string

this() public method

Gets or sets the identifier for the specified parameter name.
public this ( string parameterName ) : string
parameterName string The name of the parameter value to retrieve.
return string