ocm

package module
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

README

Ocm Go API Library

Go Reference

The Ocm Go library provides convenient access to the Ocm REST API from applications written in Go.

It is generated with Stainless.

API Reference: https://andreibesleaga.github.io/ocm-api-reference/api.html

MCP Server

Use the Ocm MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.

Add to Cursor Install in VS Code

Note: You may need to set environment variables in your MCP client.

Installation

import (
	"github.com/andreibesleaga/ocm-go" // imported as ocm
)

Or to pin the version:

go get -u 'github.com/andreibesleaga/ocm-go@v0.0.2'

Requirements

This library requires Go 1.22+.

Usage

The full API of this library can be found in api.md.

package main

import (
	"context"
	"fmt"

	"github.com/andreibesleaga/ocm-go"
	"github.com/andreibesleaga/ocm-go/option"
)

func main() {
	client := ocm.NewClient(
		option.WithAPIKey("My API Key"), // defaults to os.LookupEnv("OCM_API_KEY")
	)
	pois, err := client.Poi.List(context.TODO(), ocm.PoiListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", pois)
}

Request fields

The ocm library uses the omitzero semantics from the Go 1.24+ encoding/json release for request fields.

Required primitive fields (int64, string, etc.) feature the tag `api:"required"`. These fields are always serialized, even their zero values.

Optional primitive types are wrapped in a param.Opt[T]. These fields can be set with the provided constructors, ocm.String(string), ocm.Int(int64), etc.

Any param.Opt[T], map, slice, struct or string enum uses the tag `json:"...,omitzero"`. Its zero value is considered omitted.

The param.IsOmitted(any) function can confirm the presence of any omitzero field.

p := ocm.ExampleParams{
	ID:   "id_xxx",          // required property
	Name: ocm.String("..."), // optional property

	Point: ocm.Point{
		X: 0,          // required field will serialize as 0
		Y: ocm.Int(1), // optional field will serialize as 1
		// ... omitted non-required fields will not be serialized
	},

	Origin: ocm.Origin{}, // the zero value of [Origin] is considered omitted
}

To send null instead of a param.Opt[T], use param.Null[T](). To send null instead of a struct T, use param.NullStruct[T]().

p.Name = param.Null[string]()       // 'null' instead of string
p.Point = param.NullStruct[Point]() // 'null' instead of struct

param.IsNull(p.Name)  // true
param.IsNull(p.Point) // true

Request structs contain a .SetExtraFields(map[string]any) method which can send non-conforming fields in the request body. Extra fields overwrite any struct fields with a matching key. For security reasons, only use SetExtraFields with trusted data.

To send a custom value instead of a struct, use param.Override[T](value).

// In cases where the API specifies a given type,
// but you want to send something else, use [SetExtraFields]:
p.SetExtraFields(map[string]any{
	"x": 0.01, // send "x" as a float instead of int
})

// Send a number instead of an object
custom := param.Override[ocm.FooParams](12)
Request unions

Unions are represented as a struct with fields prefixed by "Of" for each of its variants, only one field can be non-zero. The non-zero field will be serialized.

Sub-properties of the union can be accessed via methods on the union struct. These methods return a mutable pointer to the underlying data, if present.

// Only one field can be non-zero, use param.IsOmitted() to check if a field is set
type AnimalUnionParam struct {
	OfCat *Cat `json:",omitzero,inline`
	OfDog *Dog `json:",omitzero,inline`
}

animal := AnimalUnionParam{
	OfCat: &Cat{
		Name: "Whiskers",
		Owner: PersonParam{
			Address: AddressParam{Street: "3333 Coyote Hill Rd", Zip: 0},
		},
	},
}

// Mutating a field
if address := animal.GetOwner().GetAddress(); address != nil {
	address.ZipCode = 94304
}
Response objects

All fields in response structs are ordinary value types (not pointers or wrappers). Response structs also include a special JSON field containing metadata about each property.

type Animal struct {
	Name   string `json:"name,nullable"`
	Owners int    `json:"owners"`
	Age    int    `json:"age"`
	JSON   struct {
		Name        respjson.Field
		Owner       respjson.Field
		Age         respjson.Field
		ExtraFields map[string]respjson.Field
	} `json:"-"`
}

To handle optional data, use the .Valid() method on the JSON field. .Valid() returns true if a field is not null, not present, or couldn't be marshaled.

If .Valid() is false, the corresponding field will simply be its zero value.

raw := `{"owners": 1, "name": null}`

var res Animal
json.Unmarshal([]byte(raw), &res)

// Accessing regular fields

res.Owners // 1
res.Name   // ""
res.Age    // 0

// Optional field checks

res.JSON.Owners.Valid() // true
res.JSON.Name.Valid()   // false
res.JSON.Age.Valid()    // false

// Raw JSON values

res.JSON.Owners.Raw()                  // "1"
res.JSON.Name.Raw() == "null"          // true
res.JSON.Name.Raw() == respjson.Null   // true
res.JSON.Age.Raw() == ""               // true
res.JSON.Age.Raw() == respjson.Omitted // true

These .JSON structs also include an ExtraFields map containing any properties in the json response that were not specified in the struct. This can be useful for API features not yet present in the SDK.

body := res.JSON.ExtraFields["my_unexpected_field"].Raw()
Response Unions

In responses, unions are represented by a flattened struct containing all possible fields from each of the object variants. To convert it to a variant use the .AsFooVariant() method or the .AsAny() method if present.

If a response value union contains primitive values, primitive fields will be alongside the properties but prefixed with Of and feature the tag json:"...,inline".

type AnimalUnion struct {
	// From variants [Dog], [Cat]
	Owner Person `json:"owner"`
	// From variant [Dog]
	DogBreed string `json:"dog_breed"`
	// From variant [Cat]
	CatBreed string `json:"cat_breed"`
	// ...

	JSON struct {
		Owner respjson.Field
		// ...
	} `json:"-"`
}

// If animal variant
if animal.Owner.Address.ZipCode == "" {
	panic("missing zip code")
}

// Switch on the variant
switch variant := animal.AsAny().(type) {
case Dog:
case Cat:
default:
	panic("unexpected type")
}
RequestOptions

This library uses the functional options pattern. Functions defined in the option package return a RequestOption, which is a closure that mutates a RequestConfig. These options can be supplied to the client or at individual requests. For example:

client := ocm.NewClient(
	// Adds a header to every request made by the client
	option.WithHeader("X-Some-Header", "custom_header_info"),
)

client.Poi.List(context.TODO(), ...,
	// Override the header
	option.WithHeader("X-Some-Header", "some_other_custom_header_info"),
	// Add an undocumented field to the request body, using sjson syntax
	option.WithJSONSet("some.json.path", map[string]string{"my": "object"}),
)

The request option option.WithDebugLog(nil) may be helpful while debugging.

See the full list of request options.

Pagination

This library provides some conveniences for working with paginated list endpoints.

You can use .ListAutoPaging() methods to iterate through items across all pages:

Or you can use simple .List() methods to fetch a single page and receive a standard response object with additional helper methods like .GetNextPage(), e.g.:

Errors

When the API returns a non-success status code, we return an error with type *ocm.Error. This contains the StatusCode, *http.Request, and *http.Response values of the request, as well as the JSON of the error body (much like other response objects in the SDK).

To handle errors, we recommend that you use the errors.As pattern:

_, err := client.Poi.List(context.TODO(), ocm.PoiListParams{})
if err != nil {
	var apierr *ocm.Error
	if errors.As(err, &apierr) {
		println(string(apierr.DumpRequest(true)))  // Prints the serialized HTTP request
		println(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response
	}
	panic(err.Error()) // GET "/poi": 400 Bad Request { ... }
}

When other errors occur, they are returned unwrapped; for example, if HTTP transport fails, you might receive *url.Error wrapping *net.OpError.

Timeouts

Requests do not time out by default; use context to configure a timeout for a request lifecycle.

Note that if a request is retried, the context timeout does not start over. To set a per-retry timeout, use option.WithRequestTimeout().

// This sets the timeout for the request, including all the retries.
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
defer cancel()
client.Poi.List(
	ctx,
	ocm.PoiListParams{},
	// This sets the per-retry timeout
	option.WithRequestTimeout(20*time.Second),
)
File uploads

Request parameters that correspond to file uploads in multipart requests are typed as io.Reader. The contents of the io.Reader will by default be sent as a multipart form part with the file name of "anonymous_file" and content-type of "application/octet-stream".

The file name and content-type can be customized by implementing Name() string or ContentType() string on the run-time type of io.Reader. Note that os.File implements Name() string, so a file returned by os.Open will be sent with the file name on disk.

We also provide a helper ocm.File(reader io.Reader, filename string, contentType string) which can be used to wrap any io.Reader with the appropriate file name and content type.

Retries

Certain errors will be automatically retried 2 times by default, with a short exponential backoff. We retry by default all connection errors, 408 Request Timeout, 409 Conflict, 429 Rate Limit, and >=500 Internal errors.

You can use the WithMaxRetries option to configure or disable this:

// Configure the default for all requests:
client := ocm.NewClient(
	option.WithMaxRetries(0), // default is 2
)

// Override per-request:
client.Poi.List(
	context.TODO(),
	ocm.PoiListParams{},
	option.WithMaxRetries(5),
)
Accessing raw response data (e.g. response headers)

You can access the raw HTTP response data by using the option.WithResponseInto() request option. This is useful when you need to examine response headers, status codes, or other details.

// Create a variable to store the HTTP response
var response *http.Response
pois, err := client.Poi.List(
	context.TODO(),
	ocm.PoiListParams{},
	option.WithResponseInto(&response),
)
if err != nil {
	// handle error
}
fmt.Printf("%+v\n", pois)

fmt.Printf("Status Code: %d\n", response.StatusCode)
fmt.Printf("Headers: %+#v\n", response.Header)
Making custom/undocumented requests

This library is typed for convenient access to the documented API. If you need to access undocumented endpoints, params, or response properties, the library can still be used.

Undocumented endpoints

To make requests to undocumented endpoints, you can use client.Get, client.Post, and other HTTP verbs. RequestOptions on the client, such as retries, will be respected when making these requests.

var (
    // params can be an io.Reader, a []byte, an encoding/json serializable object,
    // or a "…Params" struct defined in this library.
    params map[string]any

    // result can be an []byte, *http.Response, a encoding/json deserializable object,
    // or a model defined in this library.
    result *http.Response
)
err := client.Post(context.Background(), "/unspecified", params, &result)
if err != nil {
    …
}
Undocumented request params

To make requests using undocumented parameters, you may use either the option.WithQuerySet() or the option.WithJSONSet() methods.

params := FooNewParams{
    ID:   "id_xxxx",
    Data: FooNewParamsData{
        FirstName: ocm.String("John"),
    },
}
client.Foo.New(context.Background(), params, option.WithJSONSet("data.last_name", "Doe"))
Undocumented response properties

To access undocumented response properties, you may either access the raw JSON of the response as a string with result.JSON.RawJSON(), or get the raw JSON of a particular field on the result with result.JSON.Foo.Raw().

Any fields that are not present on the response struct will be saved and can be accessed by result.JSON.ExtraFields() which returns the extra fields as a map[string]Field.

Middleware

We provide option.WithMiddleware which applies the given middleware to requests.

func Logger(req *http.Request, next option.MiddlewareNext) (res *http.Response, err error) {
	// Before the request
	start := time.Now()
	LogReq(req)

	// Forward the request to the next handler
	res, err = next(req)

	// Handle stuff after the request
	end := time.Now()
	LogRes(res, err, start - end)

    return res, err
}

client := ocm.NewClient(
	option.WithMiddleware(Logger),
)

When multiple middlewares are provided as variadic arguments, the middlewares are applied left to right. If option.WithMiddleware is given multiple times, for example first in the client then the method, the middleware in the client will run first and the middleware given in the method will run next.

You may also replace the default http.Client with option.WithHTTPClient(client). Only one http client is accepted (this overwrites any previous client) and receives requests after any middleware has been applied.

Semantic versioning

This package generally follows SemVer conventions, though certain backwards-incompatible changes may be released as minor versions:

  1. Changes to library internals which are technically public but not intended or documented for external use. (Please open a GitHub issue to let us know if you are relying on such internals.)
  2. Changes that we do not expect to impact the vast majority of users in practice.

We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.

We are keen for your feedback; please open an issue with questions, bugs, or suggestions.

Contributing

See the contributing documentation.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(b bool) param.Opt[bool]

func BoolPtr

func BoolPtr(v bool) *bool

func DefaultClientOptions

func DefaultClientOptions() []option.RequestOption

DefaultClientOptions read from the environment (OCM_API_KEY, OCM_API_KEY, OCM_USERNAME, OCM_BASE_URL). This should be used to initialize new clients.

func File

func File(rdr io.Reader, filename string, contentType string) file

func Float

func Float(f float64) param.Opt[float64]

func FloatPtr

func FloatPtr(v float64) *float64

func Int

func Int(i int64) param.Opt[int64]

func IntPtr

func IntPtr(v int64) *int64

func Opt

func Opt[T comparable](v T) param.Opt[T]

func Ptr

func Ptr[T any](v T) *T

func String

func String(s string) param.Opt[string]

func StringPtr

func StringPtr(v string) *string

func Time

func Time(t time.Time) param.Opt[time.Time]

func TimePtr

func TimePtr(v time.Time) *time.Time

Types

type Client

type Client struct {
	Options       []option.RequestOption
	Poi           PoiService
	Referencedata ReferencedataService
	Profile       ProfileService
	Comment       CommentService
	Mediaitem     MediaitemService
	OpenAPI       OpenAPIService
}

Client creates a struct with services and top level methods that help with interacting with the ocm API. You should not instantiate this client directly, and instead use the NewClient method instead.

func NewClient

func NewClient(opts ...option.RequestOption) (r Client)

NewClient generates a new client with the default option read from the environment (OCM_API_KEY, OCM_API_KEY, OCM_USERNAME, OCM_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.

func (*Client) Delete

func (r *Client) Delete(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Execute

func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, opts ...option.RequestOption) error

Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.

If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.

The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned url.Values will be used as query strings to the url.

If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.

Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.

The response body will be deserialized into the res variable, depending on its type:

  • A pointer to a *http.Response is populated by the raw response.
  • A pointer to a byte array will be populated with the contents of the request body.
  • A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
  • A nil value will not read the response body.

For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.

func (*Client) Get

func (r *Client) Get(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Patch

func (r *Client) Patch(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Post

func (r *Client) Post(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Post makes a POST request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Put

func (r *Client) Put(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Put makes a PUT request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

type CommentService

type CommentService struct {
	Options []option.RequestOption
}

CommentService contains methods and other services that help with interacting with the ocm API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewCommentService method instead.

func NewCommentService

func NewCommentService(opts ...option.RequestOption) (r CommentService)

NewCommentService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*CommentService) Submit

Submit a user comment or checkin for a specific charging location

type CommentSubmitParams

type CommentSubmitParams struct {
	// This must be a valid POI ID
	ChargePointID int64 `json:"chargePointID" api:"required"`
	// Optional valid CheckStatusTypeID to indicate overall catgeory and
	// success/failure to use equipment e.g. 10 = Charged Successfully.
	CheckinStatusTypeID param.Opt[int64] `json:"checkinStatusTypeID,omitzero"`
	// This is an optional comment to describe the charging experience, may include
	// guidance for future users.
	Comment param.Opt[string] `json:"comment,omitzero"`
	// This must be a valid Comment Type ID as per UserCommentTypes found in Core
	// Reference Data. If left as null then General Comment will be used.
	CommentTypeID param.Opt[int64] `json:"commentTypeID,omitzero"`
	// Optional integer rating between 1 = Worst, 5 = Best.
	Rating param.Opt[int64] `json:"rating,omitzero"`
	// Optional website URL for related information
	RelatedURL param.Opt[string] `json:"relatedURL,omitzero"`
	// This is an optional name to associate with the submission, for authenticated
	// users their profile username is used.
	UserName param.Opt[string] `json:"userName,omitzero"`
	// contains filtered or unexported fields
}

func (CommentSubmitParams) MarshalJSON

func (r CommentSubmitParams) MarshalJSON() (data []byte, err error)

func (*CommentSubmitParams) UnmarshalJSON

func (r *CommentSubmitParams) UnmarshalJSON(data []byte) error

type CommentSubmitResponse

type CommentSubmitResponse struct {
	Description string `json:"description" api:"required"`
	Status      string `json:"status" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Description respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CommentSubmitResponse) RawJSON

func (r CommentSubmitResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*CommentSubmitResponse) UnmarshalJSON

func (r *CommentSubmitResponse) UnmarshalJSON(data []byte) error

type Country

type Country struct {
	// The Continentcode Schema
	ContinentCode string `json:"ContinentCode" api:"required"`
	// The Id Schema
	ID int64 `json:"ID" api:"required"`
	// The Isocode Schema
	ISOCode string `json:"ISOCode" api:"required"`
	// The Title Schema
	Title string `json:"Title"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ContinentCode respjson.Field
		ID            respjson.Field
		ISOCode       respjson.Field
		Title         respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Country details

func (Country) RawJSON

func (r Country) RawJSON() string

Returns the unmodified JSON received from the API

func (*Country) UnmarshalJSON

func (r *Country) UnmarshalJSON(data []byte) error

type Error

type Error = apierror.Error

type MediaitemNewParams

type MediaitemNewParams struct {
	// ID value for the OCM site (POI) this image relates to.
	ChargePointID int64 `json:"chargePointID" api:"required"`
	// BASE64 encoded data
	ImageDataBase64 string `json:"imageDataBase64" api:"required"`
	// Optional description of image or context
	Comment param.Opt[string] `json:"comment,omitzero"`
	// contains filtered or unexported fields
}

func (MediaitemNewParams) MarshalJSON

func (r MediaitemNewParams) MarshalJSON() (data []byte, err error)

func (*MediaitemNewParams) UnmarshalJSON

func (r *MediaitemNewParams) UnmarshalJSON(data []byte) error

type MediaitemNewResponse

type MediaitemNewResponse struct {
	// status code OK
	Status      string `json:"status" api:"required"`
	Description string `json:"description"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Status      respjson.Field
		Description respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MediaitemNewResponse) RawJSON

func (r MediaitemNewResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*MediaitemNewResponse) UnmarshalJSON

func (r *MediaitemNewResponse) UnmarshalJSON(data []byte) error

type MediaitemService

type MediaitemService struct {
	Options []option.RequestOption
}

MediaitemService contains methods and other services that help with interacting with the ocm API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewMediaitemService method instead.

func NewMediaitemService

func NewMediaitemService(opts ...option.RequestOption) (r MediaitemService)

NewMediaitemService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*MediaitemService) New

Submit a photo for a specific charging location

type OpenAPIGetResponse

type OpenAPIGetResponse = any

type OpenAPIService

type OpenAPIService struct {
	Options []option.RequestOption
}

OpenAPIService contains methods and other services that help with interacting with the ocm API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewOpenAPIService method instead.

func NewOpenAPIService

func NewOpenAPIService(opts ...option.RequestOption) (r OpenAPIService)

NewOpenAPIService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*OpenAPIService) Get

func (r *OpenAPIService) Get(ctx context.Context, opts ...option.RequestOption) (res *OpenAPIGetResponse, err error)

Retrieve the current OpenAPI format (YAML) definition for this API. This is useful for documentation tools, mocking, testing and client generation.

type PoiListParams

type PoiListParams struct {
	// Set to true to get a property names in camelCase format.
	Camelcase param.Opt[bool] `query:"camelcase,omitzero" json:"-"`
	// Exact match on a given OCM POI ID (comma separated list)
	Chargepointid param.Opt[string] `query:"chargepointid,omitzero" json:"-"`
	// String to identify your client application. Optional but recommended to
	// distinguish your client from other bots/crawlers
	Client param.Opt[string] `query:"client,omitzero" json:"-"`
	// Set to true to remove reference data objects from output (just returns IDs for
	// common reference data such as DataProvider etc).
	Compact param.Opt[bool] `query:"compact,omitzero" json:"-"`
	// 2-character ISO Country code to filter to one specific country
	Countrycode param.Opt[string] `query:"countrycode,omitzero" json:"-"`
	// Optionally filter results by a max distance from the given latitude/longitude
	Distance param.Opt[float64] `query:"distance,omitzero" json:"-"`
	// `miles` or `km` distance unit
	Distanceunit param.Opt[string] `query:"distanceunit,omitzero" json:"-"`
	// Filter to items with ID greater than given value
	Greaterthanid param.Opt[string] `query:"greaterthanid,omitzero" json:"-"`
	// If true, user comments and media items will be include in result set
	Includecomments param.Opt[bool] `query:"includecomments,omitzero" json:"-"`
	// Latitude for distance calculation and filtering
	Latitude param.Opt[int64] `query:"latitude,omitzero" json:"-"`
	// Longitude for distance calculation and filtering
	Longitude param.Opt[float64] `query:"longitude,omitzero" json:"-"`
	// Limit on max number of results returned
	Maxresults param.Opt[int64] `query:"maxresults,omitzero" json:"-"`
	// Filter to results modified after the given date
	Modifiedsince param.Opt[string] `query:"modifiedsince,omitzero" json:"-"`
	// Use opendata=true for only OCM provided ("Open") data.
	Opendata param.Opt[bool] `query:"opendata,omitzero" json:"-"`
	// Optional output format `json`,`geojson`,`xml`,`csv`, JSON is the default and
	// recommended as the highest fidelity.
	Output param.Opt[string] `query:"output,omitzero" json:"-"`
	// Filter results within a given Polygon. Specify an encoded polyline for the
	// polygon shape. Polygon will be automatically closed from the last point to the
	// first point.
	Polygon param.Opt[string] `query:"polygon,omitzero" json:"-"`
	// Filter results along an encoded polyline, use with distance param to increase
	// search distance along line. Polyline is expanded into a polygon to cover the
	// search distance.
	Polyline param.Opt[string] `query:"polyline,omitzero" json:"-"`
	// Default sort order is based on spatial index but you can optionally sort by
	// `modified_asc` for results in order of modification (oldest to newest), or
	// ` id_asc` for results in order of ID
	Sortby param.Opt[string] `query:"sortby,omitzero" json:"-"`
	// Set to false to get a smaller result set with null items removed.
	Verbose param.Opt[bool] `query:"verbose,omitzero" json:"-"`
	// Filter results to a given bounding box. specify top left and bottom right box
	// corners as: (lat,lng),(lat2,lng2)
	Boundingbox []any `query:"boundingbox,omitzero" json:"-"`
	// Exact match on a given connection type id (comma separated list)
	Connectiontypeid []any `query:"connectiontypeid,omitzero" json:"-"`
	// Exact match on a given numeric country id (comma separated list)
	Countryid []string `query:"countryid,omitzero" json:"-"`
	// Exact match on a given data provider id id (comma separated list).
	Dataproviderid []any `query:"dataproviderid,omitzero" json:"-"`
	// Exact match on a given charging level (1-3) id (comma separated list)
	Levelid []any `query:"levelid,omitzero" json:"-"`
	// Exact match on a given EVSE operator id (comma separated list)
	Operatorid []any `query:"operatorid,omitzero" json:"-"`
	// Exact match on a given status type id (comma separated list)
	Statustypeid []any `query:"statustypeid,omitzero" json:"-"`
	// Exact match on a given usage type id (comma separated list)
	Usagetypeid []any `query:"usagetypeid,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (PoiListParams) URLQuery

func (r PoiListParams) URLQuery() (v url.Values, err error)

URLQuery serializes PoiListParams's query parameters as `url.Values`.

type PoiListResponse

type PoiListResponse struct {
	// Geographic position for site and (nearest) address component information.
	AddressInfo PoiListResponseAddressInfo `json:"AddressInfo"`
	// List of equipment summary information for this site
	Connections []PoiListResponseConnection `json:"Connections"`
	// A Data Provider is the controller of the source data set used to construct the
	// details for this POI. Data has been transformed and interpreted from it's
	// original form. Each Data Provider provides data either by an explicit license or
	// agreement.
	DataProvider PoiListResponseDataProvider `json:"DataProvider"`
	// The reference ID for the Data Provider of this POI
	DataProviderID int64 `json:"DataProviderID"`
	// If present, this is the Data Providers own key for this POI within their source
	// data set
	DataProvidersReference string `json:"DataProvidersReference"`
	// A metric applied during imports to indicate a quality level based on available
	// information detail (5 == best). Largely unused currently.
	DataQualityLevel int64 `json:"DataQualityLevel"`
	// The date and time (UTC, ISO 8601) this POI was added to the Open Charge Map
	// database
	DateCreated time.Time `json:"DateCreated" format:"date-time"`
	// The date and time (UTC, ISO 8601) this POI was last confirmed according to the
	// data provider or a user. See DateLastVerified for a dynamically computed date
	// based on multiple signals.
	DateLastConfirmed time.Time `json:"DateLastConfirmed" format:"date-time"`
	// The date and time (UTC, ISO 8601) this POI or directly related child properties
	// were updated.
	DateLastStatusUpdate time.Time `json:"DateLastStatusUpdate" format:"date-time"`
	// A dynamically computed value, the date and time (UTC, ISO 8601) this POI was
	// last confirmed by a user edit or related user comment
	DateLastVerified time.Time `json:"DateLastVerified" format:"date-time"`
	// The date and time (UTC, ISO 8601) this POI is or was planned for commissioning.
	// In general planned POIs should not be presented to end users until confirmed
	// operational.
	DatePlanned time.Time `json:"DatePlanned" format:"date-time"`
	// General additional factual information for the POI. Users are discouraged from
	// using this field for opinions on site quality etc.
	GeneralComments string `json:"GeneralComments"`
	// The OCM reference ID for this POI (Point of Interest).
	ID int64 `json:"ID"`
	// A dynamically computed value indicating of any recently confirmation activity
	// has taken place for this site (positive check-ins etc)
	IsRecentlyVerified bool `json:"IsRecentlyVerified"`
	// A list of user submitted photos for this site
	MediaItems []PoiListResponseMediaItem `json:"MediaItems"`
	// Optional array of metadata values. Generally used to indicate data attribution
	// but is also intended for future use to indicate surrounding amenties, links or
	// foreign key values into other data sets.
	MetadataValues []any `json:"MetadataValues"`
	// The number of bays or discreet stations available overall at this site. This
	// indicates the limiting for number of simultaneous site users.
	NumberOfPoints int64 `json:"NumberOfPoints"`
	// The reference ID of the equipment network operator or owner
	OperatorID int64 `json:"OperatorID"`
	// An Operator is the public organisation which controls a network of charging
	// points.
	OperatorInfo PoiListResponseOperatorInfo `json:"OperatorInfo"`
	// The network operators own reference for this site (may be a site reference or a
	// single equipment reference)
	OperatorsReference string `json:"OperatorsReference"`
	// If present, this data in this POI supercedes information in another POI.
	// Generally not relevant to consumers.
	ParentChargePointID int64 `json:"ParentChargePointID"`
	// The Status Type of a site or equipment item indicates whether it is generally
	// operational.
	StatusType PoiListResponseStatusType `json:"StatusType"`
	// The overall operational status type reference ID for this POI (i.e. Operational
	// etc). 0 == Unknown
	StatusTypeID int64 `json:"StatusTypeID"`
	// Submission Status object, detailing the POI listing status
	SubmissionStatus PoiListResponseSubmissionStatus `json:"SubmissionStatus"`
	// The reference ID for the submission status type which applied to this POI.
	SubmissionStatusTypeID int64 `json:"SubmissionStatusTypeID"`
	// Free text description of likely usage costs associated with this site. Generally
	// relates to parking charges whether network operates this site as Free
	UsageCost string `json:"UsageCost"`
	// The Usage Type of a site indicates the general restrictions on usage.
	UsageType PoiListResponseUsageType `json:"UsageType"`
	// The reference ID for the site Usage Type, 0 == Unknown
	UsageTypeID int64 `json:"UsageTypeID"`
	// A list of user comments or check-ins for this site
	UserComments []PoiListResponseUserComment `json:"UserComments"`
	// A universally unique identifier used as surrogate key. ID and UUID must be
	// preserved when submitting POI update information.
	Uuid string `json:"UUID" format:"uuid"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AddressInfo            respjson.Field
		Connections            respjson.Field
		DataProvider           respjson.Field
		DataProviderID         respjson.Field
		DataProvidersReference respjson.Field
		DataQualityLevel       respjson.Field
		DateCreated            respjson.Field
		DateLastConfirmed      respjson.Field
		DateLastStatusUpdate   respjson.Field
		DateLastVerified       respjson.Field
		DatePlanned            respjson.Field
		GeneralComments        respjson.Field
		ID                     respjson.Field
		IsRecentlyVerified     respjson.Field
		MediaItems             respjson.Field
		MetadataValues         respjson.Field
		NumberOfPoints         respjson.Field
		OperatorID             respjson.Field
		OperatorInfo           respjson.Field
		OperatorsReference     respjson.Field
		ParentChargePointID    respjson.Field
		StatusType             respjson.Field
		StatusTypeID           respjson.Field
		SubmissionStatus       respjson.Field
		SubmissionStatusTypeID respjson.Field
		UsageCost              respjson.Field
		UsageType              respjson.Field
		UsageTypeID            respjson.Field
		UserComments           respjson.Field
		Uuid                   respjson.Field
		ExtraFields            map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A POI (Point of Interest), also referred to as a `Site` or `ChargePoint`, is the top-level set of information regarding a geographic site with one or more electric vehicle charging equipment present. The term `ChargePointID` is used to reference the unique ID for each POI, as called OCM ID. This reference appears in various UI elements in the format `OCM-12345` to distinguish the ID number as being a reference for a specific POI/site.

Note: If the API is called in verbose mode properties expanded properties are included in the results (e.g. UsageType, StatusType, DataProvider, OperatorInfo, SubmissionStatus). With the exception of the AddressInfo property, other object properties will not be populated in a compact result set and instead only the associated reference IDs will be set (e.g. UsageTypeID, DataProviderID etc)

func (PoiListResponse) RawJSON

func (r PoiListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*PoiListResponse) UnmarshalJSON

func (r *PoiListResponse) UnmarshalJSON(data []byte) error

type PoiListResponseAddressInfo

type PoiListResponseAddressInfo struct {
	// The reference ID for the Country
	CountryID int64 `json:"CountryID" api:"required"`
	// ID
	ID int64 `json:"ID" api:"required"`
	// Site latitude coordinate in decimal degrees
	Latitude float64 `json:"Latitude" api:"required"`
	// Site longitude coordinate in decimal degrees
	Longitude float64 `json:"Longitude" api:"required"`
	// Guidance for users to use or find the equipment
	AccessComments string `json:"AccessComments"`
	// First line of nearby street address
	AddressLine1 string `json:"AddressLine1"`
	// Second line of nearby street address
	AddressLine2 string `json:"AddressLine2"`
	// Primary contact email
	ContactEmail string `json:"ContactEmail"`
	// Primary contact number
	ContactTelephone1 string `json:"ContactTelephone1"`
	// Secondary contact number
	ContactTelephone2 string `json:"ContactTelephone2"`
	// Country details
	Country Country `json:"Country"`
	// Distance from search location, if search is around a point
	Distance float64 `json:"Distance"`
	// Unit used for distance, 1= Miles, 2 = KM
	DistanceUnit int64 `json:"DistanceUnit"`
	// Postal code or Zipcode
	Postcode string `json:"Postcode"`
	// Optional website for more information
	RelatedURL string `json:"RelatedURL"`
	// State or Province
	StateOrProvince string `json:"StateOrProvince"`
	// General title for this location to aid user
	Title string `json:"Title"`
	// Town or City
	Town string `json:"Town"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CountryID         respjson.Field
		ID                respjson.Field
		Latitude          respjson.Field
		Longitude         respjson.Field
		AccessComments    respjson.Field
		AddressLine1      respjson.Field
		AddressLine2      respjson.Field
		ContactEmail      respjson.Field
		ContactTelephone1 respjson.Field
		ContactTelephone2 respjson.Field
		Country           respjson.Field
		Distance          respjson.Field
		DistanceUnit      respjson.Field
		Postcode          respjson.Field
		RelatedURL        respjson.Field
		StateOrProvince   respjson.Field
		Title             respjson.Field
		Town              respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Geographic position for site and (nearest) address component information.

func (PoiListResponseAddressInfo) RawJSON

func (r PoiListResponseAddressInfo) RawJSON() string

Returns the unmodified JSON received from the API

func (*PoiListResponseAddressInfo) UnmarshalJSON

func (r *PoiListResponseAddressInfo) UnmarshalJSON(data []byte) error

type PoiListResponseConnection

type PoiListResponseConnection struct {
	// EVSE supply max current in Amps
	Amps     int64  `json:"Amps"`
	Comments string `json:"Comments"`
	// The type of end-user connection an EVSE supports.
	ConnectionType   PoiListResponseConnectionConnectionType `json:"ConnectionType"`
	ConnectionTypeID int64                                   `json:"ConnectionTypeID"`
	// Indicates the EVSE power supply type e.g. DC (Direct Current), AC (Single
	// Phase), AC (3 Phase).
	CurrentType PoiListResponseConnectionCurrentType `json:"CurrentType"`
	// The supply type reference ID (e.g. DC etc)
	CurrentTypeID int64 `json:"CurrentTypeID"`
	ID            int64 `json:"ID"`
	// A general category for equipment power capability. Deprecated for general use.
	// Currently computed automatically based on equipment power.
	Level PoiListResponseConnectionLevel `json:"Level"`
	// A general category for power capability. Depreceated in favour of documenting
	// specific equipment power in kW.
	//
	// Deprecated: deprecated
	LevelID int64 `json:"LevelID"`
	// Peak available power in kW
	PowerKw float64 `json:"PowerKW"`
	// Optional summary number of equipment items available with this specification
	Quantity int64 `json:"Quantity"`
	// Optional operators reference for this connection/port
	Reference string `json:"Reference"`
	// The Status Type of a site or equipment item indicates whether it is generally
	// operational.
	StatusType PoiListResponseConnectionStatusType `json:"StatusType"`
	// Status Type reference ID. 0 = Unknown
	StatusTypeID int64 `json:"StatusTypeID"`
	// EVSE supply voltage
	Voltage float64 `json:"Voltage"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Amps             respjson.Field
		Comments         respjson.Field
		ConnectionType   respjson.Field
		ConnectionTypeID respjson.Field
		CurrentType      respjson.Field
		CurrentTypeID    respjson.Field
		ID               respjson.Field
		Level            respjson.Field
		LevelID          respjson.Field
		PowerKw          respjson.Field
		Quantity         respjson.Field
		Reference        respjson.Field
		StatusType       respjson.Field
		StatusTypeID     respjson.Field
		Voltage          respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Details on the equipment type and power capability.

If calling the API in verbose mode related models are also included in the result (e.g. ConnectionType, Level, StatusType, CurrentType)

func (PoiListResponseConnection) RawJSON

func (r PoiListResponseConnection) RawJSON() string

Returns the unmodified JSON received from the API

func (*PoiListResponseConnection) UnmarshalJSON

func (r *PoiListResponseConnection) UnmarshalJSON(data []byte) error

type PoiListResponseConnectionConnectionType

type PoiListResponseConnectionConnectionType struct {
	// Formal (standard) name for this connection type
	FormalName string `json:"FormalName"`
	ID         int64  `json:"ID"`
	// If true, this is an discontinued but used connection type
	IsDiscontinued bool `json:"IsDiscontinued"`
	// If true, this is an obsolete connection type and is unlikely top be present in
	// modern infrastructure
	IsObsolete bool   `json:"IsObsolete"`
	Title      string `json:"Title"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		FormalName     respjson.Field
		ID             respjson.Field
		IsDiscontinued respjson.Field
		IsObsolete     respjson.Field
		Title          respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The type of end-user connection an EVSE supports.

func (PoiListResponseConnectionConnectionType) RawJSON

Returns the unmodified JSON received from the API

func (*PoiListResponseConnectionConnectionType) UnmarshalJSON

func (r *PoiListResponseConnectionConnectionType) UnmarshalJSON(data []byte) error

type PoiListResponseConnectionCurrentType

type PoiListResponseConnectionCurrentType struct {
	ID    int64  `json:"ID" api:"required"`
	Title string `json:"Title"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Title       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Indicates the EVSE power supply type e.g. DC (Direct Current), AC (Single Phase), AC (3 Phase).

func (PoiListResponseConnectionCurrentType) RawJSON

Returns the unmodified JSON received from the API

func (*PoiListResponseConnectionCurrentType) UnmarshalJSON

func (r *PoiListResponseConnectionCurrentType) UnmarshalJSON(data []byte) error

type PoiListResponseConnectionLevel

type PoiListResponseConnectionLevel struct {
	Comments string `json:"Comments" api:"required"`
	ID       int64  `json:"ID" api:"required"`
	// If true, this level is considered 'fast' charging, relative to other levels.
	IsFastChargeCapable bool   `json:"IsFastChargeCapable" api:"required"`
	Title               string `json:"Title"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Comments            respjson.Field
		ID                  respjson.Field
		IsFastChargeCapable respjson.Field
		Title               respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A general category for equipment power capability. Deprecated for general use. Currently computed automatically based on equipment power.

func (PoiListResponseConnectionLevel) RawJSON

Returns the unmodified JSON received from the API

func (*PoiListResponseConnectionLevel) UnmarshalJSON

func (r *PoiListResponseConnectionLevel) UnmarshalJSON(data []byte) error

type PoiListResponseConnectionStatusType

type PoiListResponseConnectionStatusType struct {
	ID               int64  `json:"ID" api:"required"`
	IsOperational    bool   `json:"IsOperational" api:"required"`
	IsUserSelectable bool   `json:"IsUserSelectable" api:"required"`
	Title            string `json:"Title"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID               respjson.Field
		IsOperational    respjson.Field
		IsUserSelectable respjson.Field
		Title            respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The Status Type of a site or equipment item indicates whether it is generally operational.

func (PoiListResponseConnectionStatusType) RawJSON

Returns the unmodified JSON received from the API

func (*PoiListResponseConnectionStatusType) UnmarshalJSON

func (r *PoiListResponseConnectionStatusType) UnmarshalJSON(data []byte) error

type PoiListResponseDataProvider

type PoiListResponseDataProvider struct {
	// The reference ID for this Data Provider
	ID int64 `json:"ID" api:"required"`
	// Currently not implemented. Indicates a potential editing restriction.
	IsRestrictedEdit bool `json:"IsRestrictedEdit" api:"required"`
	// General public comments with information about this Data Provider.
	Comments string `json:"Comments"`
	// Status object describing whether this data provider is currently enabled and the
	// type of source (manual entry, imported etc)
	DataProviderStatusType PoiListResponseDataProviderDataProviderStatusType `json:"DataProviderStatusType"`
	// Date and time (UTC) the last import was performed for this data provider (if an
	// import).
	DateLastImported time.Time `json:"DateLastImported" format:"date-time"`
	// If false, data may not be imported for this provider.
	IsApprovedImport bool `json:"IsApprovedImport"`
	// If true, data provider uses an Open Data license
	IsOpenDataLicensed bool `json:"IsOpenDataLicensed"`
	// Summary of the licensing which applies for this Data Provider. Each Data
	// Provider has one specific license or agreement. Usage of the data requires
	// acceptance of the given license.
	License string `json:"License"`
	// The Title for this Data Provider
	Title string `json:"Title"`
	// Website URL for this data provider
	WebsiteURL string `json:"WebsiteURL"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                     respjson.Field
		IsRestrictedEdit       respjson.Field
		Comments               respjson.Field
		DataProviderStatusType respjson.Field
		DateLastImported       respjson.Field
		IsApprovedImport       respjson.Field
		IsOpenDataLicensed     respjson.Field
		License                respjson.Field
		Title                  respjson.Field
		WebsiteURL             respjson.Field
		ExtraFields            map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A Data Provider is the controller of the source data set used to construct the details for this POI. Data has been transformed and interpreted from it's original form. Each Data Provider provides data either by an explicit license or agreement.

func (PoiListResponseDataProvider) RawJSON

func (r PoiListResponseDataProvider) RawJSON() string

Returns the unmodified JSON received from the API

func (*PoiListResponseDataProvider) UnmarshalJSON

func (r *PoiListResponseDataProvider) UnmarshalJSON(data []byte) error

type PoiListResponseDataProviderDataProviderStatusType

type PoiListResponseDataProviderDataProviderStatusType struct {
	// The reference ID for this provider status type
	ID int64 `json:"ID" api:"required"`
	// If false, results from this data provider are not currently enabled
	IsProviderEnabled bool `json:"IsProviderEnabled" api:"required"`
	// The Title of this status type
	Description string `json:"description"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                respjson.Field
		IsProviderEnabled respjson.Field
		Description       respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Status object describing whether this data provider is currently enabled and the type of source (manual entry, imported etc)

func (PoiListResponseDataProviderDataProviderStatusType) RawJSON

Returns the unmodified JSON received from the API

func (*PoiListResponseDataProviderDataProviderStatusType) UnmarshalJSON

type PoiListResponseMediaItem

type PoiListResponseMediaItem struct {
	ChargePointID      string `json:"ChargePointID"`
	Comment            string `json:"Comment"`
	DateCreated        string `json:"DateCreated"`
	ID                 string `json:"ID"`
	IsEnabled          bool   `json:"IsEnabled"`
	IsExternalResource bool   `json:"IsExternalResource"`
	IsFeaturedItem     bool   `json:"IsFeaturedItem"`
	IsVideo            bool   `json:"IsVideo"`
	ItemThumbnailURL   string `json:"ItemThumbnailURL"`
	ItemURL            string `json:"ItemURL"`
	// Short public summary profile for a specific Open Charge Map user
	User PoiListResponseMediaItemUser `json:"User"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ChargePointID      respjson.Field
		Comment            respjson.Field
		DateCreated        respjson.Field
		ID                 respjson.Field
		IsEnabled          respjson.Field
		IsExternalResource respjson.Field
		IsFeaturedItem     respjson.Field
		IsVideo            respjson.Field
		ItemThumbnailURL   respjson.Field
		ItemURL            respjson.Field
		User               respjson.Field
		ExtraFields        map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A user submitted media item related to a specific charge point or site. Currently always an image.

func (PoiListResponseMediaItem) RawJSON

func (r PoiListResponseMediaItem) RawJSON() string

Returns the unmodified JSON received from the API

func (*PoiListResponseMediaItem) UnmarshalJSON

func (r *PoiListResponseMediaItem) UnmarshalJSON(data []byte) error

type PoiListResponseMediaItemUser

type PoiListResponseMediaItemUser struct {
	ID               int64  `json:"ID"`
	ProfileImageURL  string `json:"ProfileImageURL"`
	ReputationPoints int64  `json:"ReputationPoints"`
	Username         string `json:"Username"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID               respjson.Field
		ProfileImageURL  respjson.Field
		ReputationPoints respjson.Field
		Username         respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Short public summary profile for a specific Open Charge Map user

func (PoiListResponseMediaItemUser) RawJSON

Returns the unmodified JSON received from the API

func (*PoiListResponseMediaItemUser) UnmarshalJSON

func (r *PoiListResponseMediaItemUser) UnmarshalJSON(data []byte) error

type PoiListResponseOperatorInfo

type PoiListResponseOperatorInfo struct {
	// Id
	ID int64 `json:"ID" api:"required"`
	// Geographic position for site and (nearest) address component information.
	AddressInfo  PoiListResponseOperatorInfoAddressInfo `json:"AddressInfo"`
	BookingURL   string                                 `json:"BookingURL"`
	Comments     string                                 `json:"Comments"`
	ContactEmail string                                 `json:"ContactEmail"`
	// Used to send automated notification to network operator if a user submits a
	// fault report comment/check-in
	FaultReportEmail string `json:"FaultReportEmail"`
	// If true, this operator represents a private individual
	//
	// Deprecated: deprecated
	IsPrivateIndividual bool `json:"IsPrivateIndividual"`
	// If true, this network restricts community edits for OCM data
	IsRestrictedEdit bool `json:"IsRestrictedEdit"`
	// Primary contact number for network users
	PhonePrimaryContact string `json:"PhonePrimaryContact"`
	// Secondary contact number
	PhoneSecondaryContact string `json:"PhoneSecondaryContact"`
	// Title
	Title string `json:"Title"`
	// Website for more information about this network
	WebsiteURL string `json:"WebsiteURL"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                    respjson.Field
		AddressInfo           respjson.Field
		BookingURL            respjson.Field
		Comments              respjson.Field
		ContactEmail          respjson.Field
		FaultReportEmail      respjson.Field
		IsPrivateIndividual   respjson.Field
		IsRestrictedEdit      respjson.Field
		PhonePrimaryContact   respjson.Field
		PhoneSecondaryContact respjson.Field
		Title                 respjson.Field
		WebsiteURL            respjson.Field
		ExtraFields           map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

An Operator is the public organisation which controls a network of charging points.

func (PoiListResponseOperatorInfo) RawJSON

func (r PoiListResponseOperatorInfo) RawJSON() string

Returns the unmodified JSON received from the API

func (*PoiListResponseOperatorInfo) UnmarshalJSON

func (r *PoiListResponseOperatorInfo) UnmarshalJSON(data []byte) error

type PoiListResponseOperatorInfoAddressInfo

type PoiListResponseOperatorInfoAddressInfo struct {
	// The reference ID for the Country
	CountryID int64 `json:"CountryID" api:"required"`
	// ID
	ID int64 `json:"ID" api:"required"`
	// Site latitude coordinate in decimal degrees
	Latitude float64 `json:"Latitude" api:"required"`
	// Site longitude coordinate in decimal degrees
	Longitude float64 `json:"Longitude" api:"required"`
	// Guidance for users to use or find the equipment
	AccessComments string `json:"AccessComments"`
	// First line of nearby street address
	AddressLine1 string `json:"AddressLine1"`
	// Second line of nearby street address
	AddressLine2 string `json:"AddressLine2"`
	// Primary contact email
	ContactEmail string `json:"ContactEmail"`
	// Primary contact number
	ContactTelephone1 string `json:"ContactTelephone1"`
	// Secondary contact number
	ContactTelephone2 string `json:"ContactTelephone2"`
	// Country details
	Country Country `json:"Country"`
	// Distance from search location, if search is around a point
	Distance float64 `json:"Distance"`
	// Unit used for distance, 1= Miles, 2 = KM
	DistanceUnit int64 `json:"DistanceUnit"`
	// Postal code or Zipcode
	Postcode string `json:"Postcode"`
	// Optional website for more information
	RelatedURL string `json:"RelatedURL"`
	// State or Province
	StateOrProvince string `json:"StateOrProvince"`
	// General title for this location to aid user
	Title string `json:"Title"`
	// Town or City
	Town string `json:"Town"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CountryID         respjson.Field
		ID                respjson.Field
		Latitude          respjson.Field
		Longitude         respjson.Field
		AccessComments    respjson.Field
		AddressLine1      respjson.Field
		AddressLine2      respjson.Field
		ContactEmail      respjson.Field
		ContactTelephone1 respjson.Field
		ContactTelephone2 respjson.Field
		Country           respjson.Field
		Distance          respjson.Field
		DistanceUnit      respjson.Field
		Postcode          respjson.Field
		RelatedURL        respjson.Field
		StateOrProvince   respjson.Field
		Title             respjson.Field
		Town              respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Geographic position for site and (nearest) address component information.

func (PoiListResponseOperatorInfoAddressInfo) RawJSON

Returns the unmodified JSON received from the API

func (*PoiListResponseOperatorInfoAddressInfo) UnmarshalJSON

func (r *PoiListResponseOperatorInfoAddressInfo) UnmarshalJSON(data []byte) error

type PoiListResponseStatusType

type PoiListResponseStatusType struct {
	ID               int64  `json:"ID" api:"required"`
	IsOperational    bool   `json:"IsOperational" api:"required"`
	IsUserSelectable bool   `json:"IsUserSelectable" api:"required"`
	Title            string `json:"Title"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID               respjson.Field
		IsOperational    respjson.Field
		IsUserSelectable respjson.Field
		Title            respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The Status Type of a site or equipment item indicates whether it is generally operational.

func (PoiListResponseStatusType) RawJSON

func (r PoiListResponseStatusType) RawJSON() string

Returns the unmodified JSON received from the API

func (*PoiListResponseStatusType) UnmarshalJSON

func (r *PoiListResponseStatusType) UnmarshalJSON(data []byte) error

type PoiListResponseSubmissionStatus

type PoiListResponseSubmissionStatus struct {
	// Submission Status Type reference ID
	ID int64 `json:"ID" api:"required"`
	// If true, POI listing is live (not draft or de-listed)
	IsLive bool   `json:"IsLive" api:"required"`
	Title  string `json:"Title"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		IsLive      respjson.Field
		Title       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Submission Status object, detailing the POI listing status

func (PoiListResponseSubmissionStatus) RawJSON

Returns the unmodified JSON received from the API

func (*PoiListResponseSubmissionStatus) UnmarshalJSON

func (r *PoiListResponseSubmissionStatus) UnmarshalJSON(data []byte) error

type PoiListResponseUsageType

type PoiListResponseUsageType struct {
	ID int64 `json:"ID" api:"required"`
	// If true this usage required a physical access key
	//
	// Deprecated: deprecated
	IsAccessKeyRequired bool `json:"IsAccessKeyRequired" api:"required"`
	// If true, this usage type requires registration or membership with a service.
	IsMembershipRequired bool `json:"IsMembershipRequired" api:"required"`
	// If true, usage requires paying at location
	IsPayAtLocation bool   `json:"IsPayAtLocation" api:"required"`
	Title           string `json:"Title"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                   respjson.Field
		IsAccessKeyRequired  respjson.Field
		IsMembershipRequired respjson.Field
		IsPayAtLocation      respjson.Field
		Title                respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The Usage Type of a site indicates the general restrictions on usage.

func (PoiListResponseUsageType) RawJSON

func (r PoiListResponseUsageType) RawJSON() string

Returns the unmodified JSON received from the API

func (*PoiListResponseUsageType) UnmarshalJSON

func (r *PoiListResponseUsageType) UnmarshalJSON(data []byte) error

type PoiListResponseUserComment

type PoiListResponseUserComment struct {
	ChargePointID int64 `json:"ChargePointID"`
	// Classification for the users comment or experience using a specific charging
	// location.
	CheckinStatusType   PoiListResponseUserCommentCheckinStatusType `json:"CheckinStatusType"`
	CheckinStatusTypeID int64                                       `json:"CheckinStatusTypeID"`
	Comment             string                                      `json:"Comment"`
	// Category for a user comment, e.g. General Comment, Fault Report (Notice To Users
	// And Operator)
	CommentType   PoiListResponseUserCommentCommentType `json:"CommentType"`
	CommentTypeID int64                                 `json:"CommentTypeID"`
	DateCreated   time.Time                             `json:"DateCreated" format:"date-time"`
	ID            string                                `json:"ID"`
	RelatedURL    string                                `json:"RelatedURL"`
	// Short public summary profile for a specific Open Charge Map user
	User     PoiListResponseUserCommentUser `json:"User"`
	UserName string                         `json:"UserName"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ChargePointID       respjson.Field
		CheckinStatusType   respjson.Field
		CheckinStatusTypeID respjson.Field
		Comment             respjson.Field
		CommentType         respjson.Field
		CommentTypeID       respjson.Field
		DateCreated         respjson.Field
		ID                  respjson.Field
		RelatedURL          respjson.Field
		User                respjson.Field
		UserName            respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A user comment or check-in for a specific charging point (POI/Site)

func (PoiListResponseUserComment) RawJSON

func (r PoiListResponseUserComment) RawJSON() string

Returns the unmodified JSON received from the API

func (*PoiListResponseUserComment) UnmarshalJSON

func (r *PoiListResponseUserComment) UnmarshalJSON(data []byte) error

type PoiListResponseUserCommentCheckinStatusType

type PoiListResponseUserCommentCheckinStatusType struct {
	ID int64 `json:"ID" api:"required"`
	// If true, checkin or comment was provided by an automated system.
	IsAutomatedCheckin bool `json:"IsAutomatedCheckin" api:"required"`
	// If true, this type of checkin/comment is considered positive.
	IsPositive bool   `json:"IsPositive"`
	Title      string `json:"Title"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                 respjson.Field
		IsAutomatedCheckin respjson.Field
		IsPositive         respjson.Field
		Title              respjson.Field
		ExtraFields        map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Classification for the users comment or experience using a specific charging location.

func (PoiListResponseUserCommentCheckinStatusType) RawJSON

Returns the unmodified JSON received from the API

func (*PoiListResponseUserCommentCheckinStatusType) UnmarshalJSON

func (r *PoiListResponseUserCommentCheckinStatusType) UnmarshalJSON(data []byte) error

type PoiListResponseUserCommentCommentType

type PoiListResponseUserCommentCommentType struct {
	ID    int64  `json:"ID"`
	Title string `json:"Title"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Title       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Category for a user comment, e.g. General Comment, Fault Report (Notice To Users And Operator)

func (PoiListResponseUserCommentCommentType) RawJSON

Returns the unmodified JSON received from the API

func (*PoiListResponseUserCommentCommentType) UnmarshalJSON

func (r *PoiListResponseUserCommentCommentType) UnmarshalJSON(data []byte) error

type PoiListResponseUserCommentUser

type PoiListResponseUserCommentUser struct {
	ID               int64  `json:"ID"`
	ProfileImageURL  string `json:"ProfileImageURL"`
	ReputationPoints int64  `json:"ReputationPoints"`
	Username         string `json:"Username"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID               respjson.Field
		ProfileImageURL  respjson.Field
		ReputationPoints respjson.Field
		Username         respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Short public summary profile for a specific Open Charge Map user

func (PoiListResponseUserCommentUser) RawJSON

Returns the unmodified JSON received from the API

func (*PoiListResponseUserCommentUser) UnmarshalJSON

func (r *PoiListResponseUserCommentUser) UnmarshalJSON(data []byte) error

type PoiService

type PoiService struct {
	Options []option.RequestOption
}

PoiService contains methods and other services that help with interacting with the ocm API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPoiService method instead.

func NewPoiService

func NewPoiService(opts ...option.RequestOption) (r PoiService)

NewPoiService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*PoiService) List

func (r *PoiService) List(ctx context.Context, query PoiListParams, opts ...option.RequestOption) (res *[]PoiListResponse, err error)

Used to fetch a list of POIs (sites) within a geographic boundary or near a specific latitude/longitude. This is the primary method for most applications and services to consume data from Open Charge Map.

type ProfileAuthenticateParams

type ProfileAuthenticateParams struct {
	Emailaddress param.Opt[string] `json:"emailaddress,omitzero"`
	Password     param.Opt[string] `json:"password,omitzero"`
	// contains filtered or unexported fields
}

func (ProfileAuthenticateParams) MarshalJSON

func (r ProfileAuthenticateParams) MarshalJSON() (data []byte, err error)

func (*ProfileAuthenticateParams) UnmarshalJSON

func (r *ProfileAuthenticateParams) UnmarshalJSON(data []byte) error

type ProfileAuthenticateResponse

type ProfileAuthenticateResponse struct {
	Data     ProfileAuthenticateResponseData     `json:"Data" api:"required"`
	Metadata ProfileAuthenticateResponseMetadata `json:"Metadata" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Metadata    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ProfileAuthenticateResponse) RawJSON

func (r ProfileAuthenticateResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProfileAuthenticateResponse) UnmarshalJSON

func (r *ProfileAuthenticateResponse) UnmarshalJSON(data []byte) error

type ProfileAuthenticateResponseData

type ProfileAuthenticateResponseData struct {
	// JWT Bearer Token to use in subsequent authenticated requests
	AccessToken string `json:"access_token" api:"required"`
	// Full user profile, including non-public fields such as Email Address
	UserProfile ProfileAuthenticateResponseDataUserProfile `json:"UserProfile" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AccessToken respjson.Field
		UserProfile respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ProfileAuthenticateResponseData) RawJSON

Returns the unmodified JSON received from the API

func (*ProfileAuthenticateResponseData) UnmarshalJSON

func (r *ProfileAuthenticateResponseData) UnmarshalJSON(data []byte) error

type ProfileAuthenticateResponseDataUserProfile

type ProfileAuthenticateResponseDataUserProfile struct {
	DateCreated      string  `json:"DateCreated" api:"required"`
	ID               float64 `json:"ID" api:"required"`
	IsProfilePublic  bool    `json:"IsProfilePublic" api:"required"`
	Username         string  `json:"Username" api:"required"`
	DateLastLogin    string  `json:"DateLastLogin"`
	EmailAddress     string  `json:"EmailAddress"`
	Latitude         float64 `json:"Latitude"`
	Location         string  `json:"Location"`
	Longitude        float64 `json:"Longitude"`
	Permissions      string  `json:"Permissions"`
	Profile          string  `json:"Profile"`
	ProfileImageURL  string  `json:"ProfileImageURL"`
	ReputationPoints float64 `json:"ReputationPoints"`
	WebsiteURL       string  `json:"WebsiteURL"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		DateCreated      respjson.Field
		ID               respjson.Field
		IsProfilePublic  respjson.Field
		Username         respjson.Field
		DateLastLogin    respjson.Field
		EmailAddress     respjson.Field
		Latitude         respjson.Field
		Location         respjson.Field
		Longitude        respjson.Field
		Permissions      respjson.Field
		Profile          respjson.Field
		ProfileImageURL  respjson.Field
		ReputationPoints respjson.Field
		WebsiteURL       respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Full user profile, including non-public fields such as Email Address

func (ProfileAuthenticateResponseDataUserProfile) RawJSON

Returns the unmodified JSON received from the API

func (*ProfileAuthenticateResponseDataUserProfile) UnmarshalJSON

func (r *ProfileAuthenticateResponseDataUserProfile) UnmarshalJSON(data []byte) error

type ProfileAuthenticateResponseMetadata

type ProfileAuthenticateResponseMetadata struct {
	StatusCode int64 `json:"StatusCode" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		StatusCode  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ProfileAuthenticateResponseMetadata) RawJSON

Returns the unmodified JSON received from the API

func (*ProfileAuthenticateResponseMetadata) UnmarshalJSON

func (r *ProfileAuthenticateResponseMetadata) UnmarshalJSON(data []byte) error

type ProfileService

type ProfileService struct {
	Options []option.RequestOption
}

ProfileService contains methods and other services that help with interacting with the ocm API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewProfileService method instead.

func NewProfileService

func NewProfileService(opts ...option.RequestOption) (r ProfileService)

NewProfileService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ProfileService) Authenticate

Perform user authentication, returning a model which includes the users profile and a JWT auth token to re-use in subsequent requests.

type ReferencedataGetParams

type ReferencedataGetParams struct {
	// Optional filter on countryid, exact match on a given numeric country id (comma
	// separated list)
	Countryid []any `query:"countryid,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (ReferencedataGetParams) URLQuery

func (r ReferencedataGetParams) URLQuery() (v url.Values, err error)

URLQuery serializes ReferencedataGetParams's query parameters as `url.Values`.

type ReferencedataGetResponse

type ReferencedataGetResponse struct {
	ChargerTypes          []ReferencedataGetResponseChargerType          `json:"ChargerTypes"`
	CheckinStatusTypes    []ReferencedataGetResponseCheckinStatusType    `json:"CheckinStatusTypes"`
	ConnectionTypes       []ReferencedataGetResponseConnectionType       `json:"ConnectionTypes"`
	Countries             []Country                                      `json:"Countries"`
	CurrentTypes          []ReferencedataGetResponseCurrentType          `json:"CurrentTypes"`
	DataProviders         []ReferencedataGetResponseDataProvider         `json:"DataProviders"`
	DataTypes             any                                            `json:"DataTypes"`
	MetadataGroups        string                                         `json:"MetadataGroups"`
	Operators             []ReferencedataGetResponseOperator             `json:"Operators"`
	StatusTypes           []ReferencedataGetResponseStatusType           `json:"StatusTypes"`
	SubmissionStatusTypes []ReferencedataGetResponseSubmissionStatusType `json:"SubmissionStatusTypes"`
	UsageTypes            []ReferencedataGetResponseUsageType            `json:"UsageTypes"`
	UserCommentTypes      []ReferencedataGetResponseUserCommentType      `json:"UserCommentTypes"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ChargerTypes          respjson.Field
		CheckinStatusTypes    respjson.Field
		ConnectionTypes       respjson.Field
		Countries             respjson.Field
		CurrentTypes          respjson.Field
		DataProviders         respjson.Field
		DataTypes             respjson.Field
		MetadataGroups        respjson.Field
		Operators             respjson.Field
		StatusTypes           respjson.Field
		SubmissionStatusTypes respjson.Field
		UsageTypes            respjson.Field
		UserCommentTypes      respjson.Field
		ExtraFields           map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Set of core reference data used for other API results and UI

func (ReferencedataGetResponse) RawJSON

func (r ReferencedataGetResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ReferencedataGetResponse) UnmarshalJSON

func (r *ReferencedataGetResponse) UnmarshalJSON(data []byte) error

type ReferencedataGetResponseChargerType

type ReferencedataGetResponseChargerType struct {
	Comments string `json:"Comments" api:"required"`
	ID       int64  `json:"ID" api:"required"`
	// If true, this level is considered 'fast' charging, relative to other levels.
	IsFastChargeCapable bool   `json:"IsFastChargeCapable" api:"required"`
	Title               string `json:"Title"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Comments            respjson.Field
		ID                  respjson.Field
		IsFastChargeCapable respjson.Field
		Title               respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A general category for equipment power capability. Deprecated for general use. Currently computed automatically based on equipment power.

func (ReferencedataGetResponseChargerType) RawJSON

Returns the unmodified JSON received from the API

func (*ReferencedataGetResponseChargerType) UnmarshalJSON

func (r *ReferencedataGetResponseChargerType) UnmarshalJSON(data []byte) error

type ReferencedataGetResponseCheckinStatusType

type ReferencedataGetResponseCheckinStatusType struct {
	ID int64 `json:"ID" api:"required"`
	// If true, checkin or comment was provided by an automated system.
	IsAutomatedCheckin bool `json:"IsAutomatedCheckin" api:"required"`
	// If true, this type of checkin/comment is considered positive.
	IsPositive bool   `json:"IsPositive"`
	Title      string `json:"Title"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                 respjson.Field
		IsAutomatedCheckin respjson.Field
		IsPositive         respjson.Field
		Title              respjson.Field
		ExtraFields        map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Classification for the users comment or experience using a specific charging location.

func (ReferencedataGetResponseCheckinStatusType) RawJSON

Returns the unmodified JSON received from the API

func (*ReferencedataGetResponseCheckinStatusType) UnmarshalJSON

func (r *ReferencedataGetResponseCheckinStatusType) UnmarshalJSON(data []byte) error

type ReferencedataGetResponseConnectionType

type ReferencedataGetResponseConnectionType struct {
	// Formal (standard) name for this connection type
	FormalName string `json:"FormalName"`
	ID         int64  `json:"ID"`
	// If true, this is an discontinued but used connection type
	IsDiscontinued bool `json:"IsDiscontinued"`
	// If true, this is an obsolete connection type and is unlikely top be present in
	// modern infrastructure
	IsObsolete bool   `json:"IsObsolete"`
	Title      string `json:"Title"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		FormalName     respjson.Field
		ID             respjson.Field
		IsDiscontinued respjson.Field
		IsObsolete     respjson.Field
		Title          respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The type of end-user connection an EVSE supports.

func (ReferencedataGetResponseConnectionType) RawJSON

Returns the unmodified JSON received from the API

func (*ReferencedataGetResponseConnectionType) UnmarshalJSON

func (r *ReferencedataGetResponseConnectionType) UnmarshalJSON(data []byte) error

type ReferencedataGetResponseCurrentType

type ReferencedataGetResponseCurrentType struct {
	ID    int64  `json:"ID" api:"required"`
	Title string `json:"Title"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Title       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Indicates the EVSE power supply type e.g. DC (Direct Current), AC (Single Phase), AC (3 Phase).

func (ReferencedataGetResponseCurrentType) RawJSON

Returns the unmodified JSON received from the API

func (*ReferencedataGetResponseCurrentType) UnmarshalJSON

func (r *ReferencedataGetResponseCurrentType) UnmarshalJSON(data []byte) error

type ReferencedataGetResponseDataProvider

type ReferencedataGetResponseDataProvider struct {
	// The reference ID for this Data Provider
	ID int64 `json:"ID" api:"required"`
	// Currently not implemented. Indicates a potential editing restriction.
	IsRestrictedEdit bool `json:"IsRestrictedEdit" api:"required"`
	// General public comments with information about this Data Provider.
	Comments string `json:"Comments"`
	// Status object describing whether this data provider is currently enabled and the
	// type of source (manual entry, imported etc)
	DataProviderStatusType ReferencedataGetResponseDataProviderDataProviderStatusType `json:"DataProviderStatusType"`
	// Date and time (UTC) the last import was performed for this data provider (if an
	// import).
	DateLastImported time.Time `json:"DateLastImported" format:"date-time"`
	// If false, data may not be imported for this provider.
	IsApprovedImport bool `json:"IsApprovedImport"`
	// If true, data provider uses an Open Data license
	IsOpenDataLicensed bool `json:"IsOpenDataLicensed"`
	// Summary of the licensing which applies for this Data Provider. Each Data
	// Provider has one specific license or agreement. Usage of the data requires
	// acceptance of the given license.
	License string `json:"License"`
	// The Title for this Data Provider
	Title string `json:"Title"`
	// Website URL for this data provider
	WebsiteURL string `json:"WebsiteURL"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                     respjson.Field
		IsRestrictedEdit       respjson.Field
		Comments               respjson.Field
		DataProviderStatusType respjson.Field
		DateLastImported       respjson.Field
		IsApprovedImport       respjson.Field
		IsOpenDataLicensed     respjson.Field
		License                respjson.Field
		Title                  respjson.Field
		WebsiteURL             respjson.Field
		ExtraFields            map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A Data Provider is the controller of the source data set used to construct the details for this POI. Data has been transformed and interpreted from it's original form. Each Data Provider provides data either by an explicit license or agreement.

func (ReferencedataGetResponseDataProvider) RawJSON

Returns the unmodified JSON received from the API

func (*ReferencedataGetResponseDataProvider) UnmarshalJSON

func (r *ReferencedataGetResponseDataProvider) UnmarshalJSON(data []byte) error

type ReferencedataGetResponseDataProviderDataProviderStatusType

type ReferencedataGetResponseDataProviderDataProviderStatusType struct {
	// The reference ID for this provider status type
	ID int64 `json:"ID" api:"required"`
	// If false, results from this data provider are not currently enabled
	IsProviderEnabled bool `json:"IsProviderEnabled" api:"required"`
	// The Title of this status type
	Description string `json:"description"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                respjson.Field
		IsProviderEnabled respjson.Field
		Description       respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Status object describing whether this data provider is currently enabled and the type of source (manual entry, imported etc)

func (ReferencedataGetResponseDataProviderDataProviderStatusType) RawJSON

Returns the unmodified JSON received from the API

func (*ReferencedataGetResponseDataProviderDataProviderStatusType) UnmarshalJSON

type ReferencedataGetResponseOperator

type ReferencedataGetResponseOperator struct {
	// Id
	ID int64 `json:"ID" api:"required"`
	// Geographic position for site and (nearest) address component information.
	AddressInfo  ReferencedataGetResponseOperatorAddressInfo `json:"AddressInfo"`
	BookingURL   string                                      `json:"BookingURL"`
	Comments     string                                      `json:"Comments"`
	ContactEmail string                                      `json:"ContactEmail"`
	// Used to send automated notification to network operator if a user submits a
	// fault report comment/check-in
	FaultReportEmail string `json:"FaultReportEmail"`
	// If true, this operator represents a private individual
	//
	// Deprecated: deprecated
	IsPrivateIndividual bool `json:"IsPrivateIndividual"`
	// If true, this network restricts community edits for OCM data
	IsRestrictedEdit bool `json:"IsRestrictedEdit"`
	// Primary contact number for network users
	PhonePrimaryContact string `json:"PhonePrimaryContact"`
	// Secondary contact number
	PhoneSecondaryContact string `json:"PhoneSecondaryContact"`
	// Title
	Title string `json:"Title"`
	// Website for more information about this network
	WebsiteURL string `json:"WebsiteURL"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                    respjson.Field
		AddressInfo           respjson.Field
		BookingURL            respjson.Field
		Comments              respjson.Field
		ContactEmail          respjson.Field
		FaultReportEmail      respjson.Field
		IsPrivateIndividual   respjson.Field
		IsRestrictedEdit      respjson.Field
		PhonePrimaryContact   respjson.Field
		PhoneSecondaryContact respjson.Field
		Title                 respjson.Field
		WebsiteURL            respjson.Field
		ExtraFields           map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

An Operator is the public organisation which controls a network of charging points.

func (ReferencedataGetResponseOperator) RawJSON

Returns the unmodified JSON received from the API

func (*ReferencedataGetResponseOperator) UnmarshalJSON

func (r *ReferencedataGetResponseOperator) UnmarshalJSON(data []byte) error

type ReferencedataGetResponseOperatorAddressInfo

type ReferencedataGetResponseOperatorAddressInfo struct {
	// The reference ID for the Country
	CountryID int64 `json:"CountryID" api:"required"`
	// ID
	ID int64 `json:"ID" api:"required"`
	// Site latitude coordinate in decimal degrees
	Latitude float64 `json:"Latitude" api:"required"`
	// Site longitude coordinate in decimal degrees
	Longitude float64 `json:"Longitude" api:"required"`
	// Guidance for users to use or find the equipment
	AccessComments string `json:"AccessComments"`
	// First line of nearby street address
	AddressLine1 string `json:"AddressLine1"`
	// Second line of nearby street address
	AddressLine2 string `json:"AddressLine2"`
	// Primary contact email
	ContactEmail string `json:"ContactEmail"`
	// Primary contact number
	ContactTelephone1 string `json:"ContactTelephone1"`
	// Secondary contact number
	ContactTelephone2 string `json:"ContactTelephone2"`
	// Country details
	Country Country `json:"Country"`
	// Distance from search location, if search is around a point
	Distance float64 `json:"Distance"`
	// Unit used for distance, 1= Miles, 2 = KM
	DistanceUnit int64 `json:"DistanceUnit"`
	// Postal code or Zipcode
	Postcode string `json:"Postcode"`
	// Optional website for more information
	RelatedURL string `json:"RelatedURL"`
	// State or Province
	StateOrProvince string `json:"StateOrProvince"`
	// General title for this location to aid user
	Title string `json:"Title"`
	// Town or City
	Town string `json:"Town"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CountryID         respjson.Field
		ID                respjson.Field
		Latitude          respjson.Field
		Longitude         respjson.Field
		AccessComments    respjson.Field
		AddressLine1      respjson.Field
		AddressLine2      respjson.Field
		ContactEmail      respjson.Field
		ContactTelephone1 respjson.Field
		ContactTelephone2 respjson.Field
		Country           respjson.Field
		Distance          respjson.Field
		DistanceUnit      respjson.Field
		Postcode          respjson.Field
		RelatedURL        respjson.Field
		StateOrProvince   respjson.Field
		Title             respjson.Field
		Town              respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Geographic position for site and (nearest) address component information.

func (ReferencedataGetResponseOperatorAddressInfo) RawJSON

Returns the unmodified JSON received from the API

func (*ReferencedataGetResponseOperatorAddressInfo) UnmarshalJSON

func (r *ReferencedataGetResponseOperatorAddressInfo) UnmarshalJSON(data []byte) error

type ReferencedataGetResponseStatusType

type ReferencedataGetResponseStatusType struct {
	ID               int64  `json:"ID" api:"required"`
	IsOperational    bool   `json:"IsOperational" api:"required"`
	IsUserSelectable bool   `json:"IsUserSelectable" api:"required"`
	Title            string `json:"Title"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID               respjson.Field
		IsOperational    respjson.Field
		IsUserSelectable respjson.Field
		Title            respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The Status Type of a site or equipment item indicates whether it is generally operational.

func (ReferencedataGetResponseStatusType) RawJSON

Returns the unmodified JSON received from the API

func (*ReferencedataGetResponseStatusType) UnmarshalJSON

func (r *ReferencedataGetResponseStatusType) UnmarshalJSON(data []byte) error

type ReferencedataGetResponseSubmissionStatusType

type ReferencedataGetResponseSubmissionStatusType struct {
	// Submission Status Type reference ID
	ID int64 `json:"ID" api:"required"`
	// If true, POI listing is live (not draft or de-listed)
	IsLive bool   `json:"IsLive" api:"required"`
	Title  string `json:"Title"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		IsLive      respjson.Field
		Title       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Submission Status object, detailing the POI listing status

func (ReferencedataGetResponseSubmissionStatusType) RawJSON

Returns the unmodified JSON received from the API

func (*ReferencedataGetResponseSubmissionStatusType) UnmarshalJSON

func (r *ReferencedataGetResponseSubmissionStatusType) UnmarshalJSON(data []byte) error

type ReferencedataGetResponseUsageType

type ReferencedataGetResponseUsageType struct {
	ID int64 `json:"ID" api:"required"`
	// If true this usage required a physical access key
	//
	// Deprecated: deprecated
	IsAccessKeyRequired bool `json:"IsAccessKeyRequired" api:"required"`
	// If true, this usage type requires registration or membership with a service.
	IsMembershipRequired bool `json:"IsMembershipRequired" api:"required"`
	// If true, usage requires paying at location
	IsPayAtLocation bool   `json:"IsPayAtLocation" api:"required"`
	Title           string `json:"Title"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                   respjson.Field
		IsAccessKeyRequired  respjson.Field
		IsMembershipRequired respjson.Field
		IsPayAtLocation      respjson.Field
		Title                respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The Usage Type of a site indicates the general restrictions on usage.

func (ReferencedataGetResponseUsageType) RawJSON

Returns the unmodified JSON received from the API

func (*ReferencedataGetResponseUsageType) UnmarshalJSON

func (r *ReferencedataGetResponseUsageType) UnmarshalJSON(data []byte) error

type ReferencedataGetResponseUserCommentType

type ReferencedataGetResponseUserCommentType struct {
	ID    int64  `json:"ID"`
	Title string `json:"Title"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Title       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Category for a user comment, e.g. General Comment, Fault Report (Notice To Users And Operator)

func (ReferencedataGetResponseUserCommentType) RawJSON

Returns the unmodified JSON received from the API

func (*ReferencedataGetResponseUserCommentType) UnmarshalJSON

func (r *ReferencedataGetResponseUserCommentType) UnmarshalJSON(data []byte) error

type ReferencedataService

type ReferencedataService struct {
	Options []option.RequestOption
}

ReferencedataService contains methods and other services that help with interacting with the ocm API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewReferencedataService method instead.

func NewReferencedataService

func NewReferencedataService(opts ...option.RequestOption) (r ReferencedataService)

NewReferencedataService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ReferencedataService) Get

Returns the core reference data used for looking up IDs such as Connection Types, Operators, Countries etc.

This information is useful for UIs such as editing systems or for fetching results in the lighter non-verbose mode, then hydrating POI results back into complex objects.

Directories

Path Synopsis
encoding/json
Package json implements encoding and decoding of JSON as defined in RFC 7159.
Package json implements encoding and decoding of JSON as defined in RFC 7159.
encoding/json/shims
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package.
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package.
packages
shared

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL