Struct ContentLocation
Structure representing a logical location of a content item on a Tableau site. For example, for workbooks this represents the project path and the workbook name.
Inherited Members
Namespace: Tableau.Migration
Assembly: Tableau.Migration.dll
Syntax
public readonly record struct ContentLocation : IEquatable<ContentLocation>, IComparable<ContentLocation>
Constructors
ContentLocation(params IEnumerable<string>)
Creates a new ContentLocation value.
Declaration
public ContentLocation(params IEnumerable<string> segments)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<string> | segments | The location path segments. |
ContentLocation(ImmutableArray<string>, string)
Structure representing a logical location of a content item on a Tableau site. For example, for workbooks this represents the project path and the workbook name.
Declaration
public ContentLocation(ImmutableArray<string> PathSegments, string PathSeparator = "/")
Parameters
| Type | Name | Description |
|---|---|---|
| ImmutableArray<string> | PathSegments | Gets the individual segments of the location path. |
| string | PathSeparator | Gets the separator to use between segments in the location path. |
ContentLocation(string, IEnumerable<string>)
Creates a new ContentLocation value.
Declaration
public ContentLocation(string pathSeparator, IEnumerable<string> segments)
Parameters
| Type | Name | Description |
|---|---|---|
| string | pathSeparator | The separator between path segments to use. |
| IEnumerable<string> | segments | The location path segments. |
ContentLocation(params string[])
Creates a new ContentLocation value.
Declaration
public ContentLocation(params string[] segments)
Parameters
| Type | Name | Description |
|---|---|---|
| string[] | segments | The location path segments. |
ContentLocation(ContentLocation, string)
Creates a new ContentLocation value.
Declaration
public ContentLocation(ContentLocation parent, string name)
Parameters
| Type | Name | Description |
|---|---|---|
| ContentLocation | parent | The parent location to use as a base path. |
| string | name | The item name to use as the last path segment. |
Properties
IsEmpty
Gets whether this location reprents an empty path.
Declaration
public bool IsEmpty { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Name
Gets the non-pathed name of the location.
Declaration
public string Name { get; }
Property Value
| Type | Description |
|---|---|
| string |
Path
Gets the full path of the location.
Declaration
public string Path { get; }
Property Value
| Type | Description |
|---|---|
| string |
PathSegments
Gets the individual segments of the location path.
Declaration
public ImmutableArray<string> PathSegments { get; init; }
Property Value
| Type | Description |
|---|---|
| ImmutableArray<string> |
PathSeparator
Gets the separator to use between segments in the location path.
Declaration
public string PathSeparator { get; init; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
Append(string)
Creates a new ContentLocation with a new path segment appended.
Declaration
public ContentLocation Append(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The name to append to the path. |
Returns
| Type | Description |
|---|---|
| ContentLocation | The new ContentLocation with the appended path. |
CompareTo(ContentLocation)
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
Declaration
public int CompareTo(ContentLocation other)
Parameters
| Type | Name | Description |
|---|---|---|
| ContentLocation | other | An object to compare with this instance. |
Returns
| Type | Description |
|---|---|
| int | A value that indicates the relative order of the objects being compared. The return value has these meanings: Value – Meaning Less than zero – This instance precedes other in the sort order. Zero – This instance occurs in the same position in the sort order as other. Greater than zero – This instance follows other in the sort order. |
Equals(ContentLocation)
Indicates whether this value and a specified value are equal.
Declaration
public bool Equals(ContentLocation other)
Parameters
| Type | Name | Description |
|---|---|---|
| ContentLocation | other | The value to compare the current value. |
Returns
| Type | Description |
|---|---|
| bool | true if |
ForContentType(Type, params IEnumerable<string>)
Creates a new ContentLocation with the appropriate path separator for the content type.
Declaration
public static ContentLocation ForContentType(Type contentType, params IEnumerable<string> pathSegments)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | contentType | The content type to create the location for. |
| IEnumerable<string> | pathSegments | The location path segments. |
Returns
| Type | Description |
|---|---|
| ContentLocation |
ForContentType<TContent>(params IEnumerable<string>)
Creates a new ContentLocation with the appropriate path separator for the content type.
Declaration
public static ContentLocation ForContentType<TContent>(params IEnumerable<string> pathSegments)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<string> | pathSegments | The location path segments. |
Returns
| Type | Description |
|---|---|
| ContentLocation |
Type Parameters
| Name | Description |
|---|---|
| TContent | The content type to create the location for. |
ForUsername(string, string)
Creates a new ContentLocation value with the standard user/group name separator.
Declaration
public static ContentLocation ForUsername(string domain, string username)
Parameters
| Type | Name | Description |
|---|---|---|
| string | domain | The user/group domain. |
| string | username | The user/group name. |
Returns
| Type | Description |
|---|---|
| ContentLocation | The newly created ContentLocation. |
FromPath(string, string)
Creates a new ContentLocation value from a string.
Declaration
public static ContentLocation FromPath(string contentLocationPath, string pathSeparator = "/")
Parameters
| Type | Name | Description |
|---|---|---|
| string | contentLocationPath | The full path of the location. |
| string | pathSeparator | The separator to use between segments in the location path. |
Returns
| Type | Description |
|---|---|
| ContentLocation | The newly created ContentLocation. |
GetHashCode()
Returns the hash code for this value.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | A 32-bit signed integer hash code. |
Overrides
Parent()
Creates a new ContentLocation with the last path segment removed.
Declaration
public ContentLocation Parent()
Returns
| Type | Description |
|---|---|
| ContentLocation | The new ContentLocation with the parent path. |
Rename(string)
Creates a new ContentLocation with the last path segment replaced.
Declaration
public ContentLocation Rename(string newName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | newName | The new name to replace the last path segment with. |
Returns
| Type | Description |
|---|---|
| ContentLocation | The renamed ContentLocation. |
ToString()
Returns the string representation of the value.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | The string representation. |