Struct CreateAddressRequest
- Namespace
- Vonage.Voice.Emergency.CreateAddress
- Assembly
- Vonage.dll
[Builder(new string[] { })]
public readonly struct CreateAddressRequest : IVonageRequest
- Implements
- Inherited Members
Properties
City
Sets the city of the address.
[JsonPropertyName("city")]
[JsonConverter(typeof(MaybeJsonConverter<string>))]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public Maybe<string> City { get; }
Property Value
Examples
.WithCity("San Francisco")
Country
Sets the two-character country code in ISO 3166-1 alpha-2 format (e.g., "US", "GB"). Must be exactly 2 characters.
[JsonPropertyName("country")]
[JsonConverter(typeof(MaybeJsonConverter<string>))]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public Maybe<string> Country { get; }
Property Value
Examples
.WithCountry("US")
FirstAddressLine
Sets the first line of the street address.
[JsonPropertyName("address_line1")]
[JsonConverter(typeof(MaybeJsonConverter<string>))]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public Maybe<string> FirstAddressLine { get; }
Property Value
Examples
.WithFirstAddressLine("123 Main Street")
Location
Sets whether the address is a business or residential location.
[JsonPropertyName("address_location_type")]
[JsonConverter(typeof(MaybeJsonConverter<Address.AddressLocationType>))]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public Maybe<Address.AddressLocationType> Location { get; }
Property Value
Examples
.WithLocation(Address.AddressLocationType.Business)
Name
Sets a friendly name to identify the address (2-32 characters, e.g., "Office HQ").
[JsonPropertyName("address_name")]
[JsonConverter(typeof(MaybeJsonConverter<string>))]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public Maybe<string> Name { get; }
Property Value
Examples
.WithName("Office HQ")
PostalCode
Sets the postal or ZIP code of the address.
[JsonPropertyName("postal_code")]
[JsonConverter(typeof(MaybeJsonConverter<string>))]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public Maybe<string> PostalCode { get; }
Property Value
Examples
.WithPostalCode("94105")
Region
Sets the state, province, or region of the address.
[JsonPropertyName("region")]
[JsonConverter(typeof(MaybeJsonConverter<string>))]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public Maybe<string> Region { get; }
Property Value
Examples
.WithRegion("CA")
SecondAddressLine
Sets the second line of the street address (e.g., suite or apartment number).
[JsonPropertyName("address_line2")]
[JsonConverter(typeof(MaybeJsonConverter<string>))]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public Maybe<string> SecondAddressLine { get; }
Property Value
Examples
.WithSecondAddressLine("Suite 400")
Type
The address type. Always "emergency".
[JsonPropertyName("type")]
public string Type { get; }
Property Value
Methods
Build()
public static IBuilderForOptional Build()
Returns
BuildRequestMessage()
Converts the request to a HttpRequest.
public HttpRequestMessage BuildRequestMessage()
Returns
- HttpRequestMessage
The Http request.