示例#1
0
        internal static LocationOptionsResponse DeserializeLocationOptionsResponse(JsonElement element)
        {
            Optional <LocationOptions> locationOptions = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("locationOptions"))
                {
                    locationOptions = LocationOptions.DeserializeLocationOptions(property.Value);
                    continue;
                }
            }
            return(new LocationOptionsResponse(locationOptions.Value));
        }
        internal static LocationOptionsResponse DeserializeLocationOptionsResponse(JsonElement element)
        {
            Optional <LocationOptions> locationOptions = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("locationOptions"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    locationOptions = LocationOptions.DeserializeLocationOptions(property.Value);
                    continue;
                }
            }
            return(new LocationOptionsResponse(locationOptions.Value));
        }
示例#3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LocationOptionsResponse"/> class.
 /// </summary>
 /// <param name="locationOptions"> Represents a location options. </param>
 /// <returns>A new <see cref="LocationOptionsResponse"/> instance for mocking.</returns>
 public static LocationOptionsResponse LocationOptionsResponse(LocationOptions locationOptions)
 => new LocationOptionsResponse(locationOptions);