Gravity.GoogleMaps.TimeZonoeBuilder 1.0.0

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package Gravity.GoogleMaps.TimeZonoeBuilder --version 1.0.0
                    
NuGet\Install-Package Gravity.GoogleMaps.TimeZonoeBuilder -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Gravity.GoogleMaps.TimeZonoeBuilder" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Gravity.GoogleMaps.TimeZonoeBuilder" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Gravity.GoogleMaps.TimeZonoeBuilder" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Gravity.GoogleMaps.TimeZonoeBuilder --version 1.0.0
                    
#r "nuget: Gravity.GoogleMaps.TimeZonoeBuilder, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Gravity.GoogleMaps.TimeZonoeBuilder@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Gravity.GoogleMaps.TimeZonoeBuilder&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Gravity.GoogleMaps.TimeZonoeBuilder&version=1.0.0
                    
Install as a Cake Tool

🌐 Gravity.GoogleMaps.TimeZoneBuilder

Gravity.GoogleMaps.TimeZoneBuilder is a fully type-safe, fluent, and extensible .NET URL builder for the Google Time Zone API. It helps you generate correct and validated Time Zone API request URLs β€” with full IntelliSense, compile-time safety, and built-in validation for coordinates, timestamps, languages, and required parameters.


πŸš€ Features

  • βœ… Fully type-safe and fluent API
  • πŸ“ Strong validation for latitude/longitude bounds
  • ⏱️ Automatic handling of Unix timestamps from DateTimeOffset
  • 🌐 Optional language support with format validation
  • πŸ” API key validation (can be disabled for testing)
  • βš™οΈ Options to disable URL encoding or return only query parameters
  • πŸ§ͺ Fully unit-tested (100% coverage on builders)

πŸ“¦ Installation

dotnet add package Gravity.GoogleMaps.TimeZoneBuilder

πŸ“š Documentation

The builder supports all core parameters of the Time Zone API:

  • location β†’ latitude/longitude
  • timestamp β†’ DateTimeOffset, converted internally to Unix time
  • language (optional)
  • key β†’ required unless disabled in options

πŸ“Œ Refer to the official Google Time Zone API documentation for parameter semantics and output fields.


⚑ Quick Start

var url = new TimeZoneUrlBuilder()
    .AddLocation(48.8566, 2.3522)
    .AddTimeStamp(DateTimeOffset.UtcNow)
    .AddLanguage("fr")
    .AddKey("YOUR_API_KEY")
    .Build();

This will generate a fully validated Time Zone API request URL.


🧱 Fluent API

Every part of the URL is constructed through intuitive, discoverable methods:

.AddLocation(latitude: 40.6892, longitude: -74.0445)
.AddTimeStamp(DateTimeOffset.UtcNow)
.AddLanguage("en")
.AddKey("my-api-key")

βš™οΈ Advanced Options

The builder also supports configuration options through:

.WithOptions(new TimeZoneBuilderOptions
{
    DisableUrlEncoding = true,
    DisableApiKeyCheck = true,
    ReturnParametersOnly = false
});

Available options:

Option Description
DisableUrlEncoding Leaves commas and values unescaped (useful for debugging)
DisableApiKeyCheck Allows building URLs without .AddKey() (tests, mocks)
ReturnParametersOnly Returns only param=value… without the base host

πŸ§ͺ Test Coverage & Reliability

The builder is fully covered by unit tests:

  • βœ”οΈ Valid & invalid coordinates
  • βœ”οΈ Valid & invalid language codes
  • βœ”οΈ Timestamp conversion
  • βœ”οΈ Missing API key handling
  • βœ”οΈ Options overrides
  • βœ”οΈ URL encoding checks

Every scenario is validated both at build-time and runtime.


πŸ›‘οΈ License

MIT License


πŸ™Œ Credits

Made with ❀️ by GravityApps Developed & maintained by https://github.com/AntoninLolivier

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated