Table of Contents

Struct R2LocationHint

Namespace
Cloudflare.NET.Accounts.Models
Assembly
Cloudflare.NET.dll

Represents a location hint for R2 bucket placement.

Location hints provide a suggestion for the geographic region where the bucket's data should be stored. Cloudflare will attempt to honor this hint, but data may be placed in a nearby region if the specified location is unavailable.

[JsonConverter(typeof(ExtensibleEnumConverter<R2LocationHint>))]
public readonly struct R2LocationHint : IExtensibleEnum<R2LocationHint>, IEquatable<R2LocationHint>
Implements
Inherited Members

Examples

// Using a known location with IntelliSense
var location = R2LocationHint.EastNorthAmerica;

// Using implicit conversion from string
R2LocationHint customLocation = "new-region";

// Comparison
if (bucket.LocationHint == R2LocationHint.WestEurope) { ... }

Remarks

This is an extensible enum that provides IntelliSense for known values while allowing custom values for new regions that may be added to the Cloudflare API in the future.

Use the static properties for known regions (e.g., EastNorthAmerica) or create custom values using the constructor or implicit string conversion.

Constructors

R2LocationHint(string)

Creates a new R2LocationHint with the specified value.

public R2LocationHint(string value)

Parameters

value string

The string value representing the location hint.

Exceptions

ArgumentNullException

Thrown when value is null.

Properties

AsiaPacific

Asia-Pacific region.

public static R2LocationHint AsiaPacific { get; }

Property Value

R2LocationHint

Remarks

Suitable for users primarily in Asian countries, including East Asia, Southeast Asia, and South Asia.

EastEurope

Eastern Europe region.

public static R2LocationHint EastEurope { get; }

Property Value

R2LocationHint

Remarks

Suitable for users primarily in Eastern European countries.

EastNorthAmerica

Eastern North America region.

public static R2LocationHint EastNorthAmerica { get; }

Property Value

R2LocationHint

Remarks

Suitable for users primarily in the eastern United States or eastern Canada.

Oceania

Oceania region.

public static R2LocationHint Oceania { get; }

Property Value

R2LocationHint

Remarks

Suitable for users primarily in Australia, New Zealand, and Pacific Island nations.

Value

Gets the underlying string value of this location hint.

public string Value { get; }

Property Value

string

WestEurope

Western Europe region.

public static R2LocationHint WestEurope { get; }

Property Value

R2LocationHint

Remarks

Suitable for users primarily in Western European countries.

WestNorthAmerica

Western North America region.

public static R2LocationHint WestNorthAmerica { get; }

Property Value

R2LocationHint

Remarks

Suitable for users primarily in the western United States, Canada, or Mexico.

Methods

Create(string)

Creates a new instance of the extensible enum from the specified string value.

public static R2LocationHint Create(string value)

Parameters

value string

The string value to wrap.

Returns

R2LocationHint

A new instance of R2LocationHint containing the specified value.

Equals(R2LocationHint)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(R2LocationHint other)

Parameters

other R2LocationHint

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.

Operators

operator ==(R2LocationHint, R2LocationHint)

Determines whether two R2LocationHint values are equal.

public static bool operator ==(R2LocationHint left, R2LocationHint right)

Parameters

left R2LocationHint
right R2LocationHint

Returns

bool

implicit operator string(R2LocationHint)

Implicitly converts an R2LocationHint to its string value.

public static implicit operator string(R2LocationHint location)

Parameters

location R2LocationHint

The location hint to convert.

Returns

string

implicit operator R2LocationHint(string)

Implicitly converts a string to an R2LocationHint.

public static implicit operator R2LocationHint(string value)

Parameters

value string

The string value to convert.

Returns

R2LocationHint

operator !=(R2LocationHint, R2LocationHint)

Determines whether two R2LocationHint values are not equal.

public static bool operator !=(R2LocationHint left, R2LocationHint right)

Parameters

left R2LocationHint
right R2LocationHint

Returns

bool

See Also