Documentation ¶
Overview ¶
Package pollen provides access to the Pollen API.
For product documentation, see: https://developers.google.com/maps/documentation/pollen
Library status ¶
These client libraries are officially supported by Google. However, this library is considered complete and is in maintenance mode. This means that we will address critical bugs and security issues but will not add any new features.
When possible, we recommend using our newer [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) that are still actively being worked and iterated on.
Creating a client ¶
Usage example:
import "google.golang.org/api/pollen/v1" ... ctx := context.Background() pollenService, err := pollen.NewService(ctx)
In this example, Google Application Default Credentials are used for authentication. For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
Other authentication options ¶
To use an API key for authentication (note: some APIs do not support API keys), use google.golang.org/api/option.WithAPIKey:
pollenService, err := pollen.NewService(ctx, option.WithAPIKey("AIza..."))
To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow, use google.golang.org/api/option.WithTokenSource:
config := &oauth2.Config{...} // ... token, err := config.Exchange(ctx, ...) pollenService, err := pollen.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
See google.golang.org/api/option.ClientOption for details on options.
Index ¶
- Constants
- type Color
- type Date
- type DayInfo
- type ForecastLookupCall
- func (c *ForecastLookupCall) Context(ctx context.Context) *ForecastLookupCall
- func (c *ForecastLookupCall) Days(days int64) *ForecastLookupCall
- func (c *ForecastLookupCall) Do(opts ...googleapi.CallOption) (*LookupForecastResponse, error)
- func (c *ForecastLookupCall) Fields(s ...googleapi.Field) *ForecastLookupCall
- func (c *ForecastLookupCall) Header() http.Header
- func (c *ForecastLookupCall) IfNoneMatch(entityTag string) *ForecastLookupCall
- func (c *ForecastLookupCall) LanguageCode(languageCode string) *ForecastLookupCall
- func (c *ForecastLookupCall) LocationLatitude(locationLatitude float64) *ForecastLookupCall
- func (c *ForecastLookupCall) LocationLongitude(locationLongitude float64) *ForecastLookupCall
- func (c *ForecastLookupCall) PageSize(pageSize int64) *ForecastLookupCall
- func (c *ForecastLookupCall) PageToken(pageToken string) *ForecastLookupCall
- func (c *ForecastLookupCall) Pages(ctx context.Context, f func(*LookupForecastResponse) error) error
- func (c *ForecastLookupCall) PlantsDescription(plantsDescription bool) *ForecastLookupCall
- type ForecastService
- type HttpBody
- type IndexInfo
- type LookupForecastResponse
- type MapTypesHeatmapTilesLookupHeatmapTileCall
- func (c *MapTypesHeatmapTilesLookupHeatmapTileCall) Context(ctx context.Context) *MapTypesHeatmapTilesLookupHeatmapTileCall
- func (c *MapTypesHeatmapTilesLookupHeatmapTileCall) Do(opts ...googleapi.CallOption) (*HttpBody, error)
- func (c *MapTypesHeatmapTilesLookupHeatmapTileCall) Fields(s ...googleapi.Field) *MapTypesHeatmapTilesLookupHeatmapTileCall
- func (c *MapTypesHeatmapTilesLookupHeatmapTileCall) Header() http.Header
- func (c *MapTypesHeatmapTilesLookupHeatmapTileCall) IfNoneMatch(entityTag string) *MapTypesHeatmapTilesLookupHeatmapTileCall
- type MapTypesHeatmapTilesService
- type MapTypesService
- type PlantDescription
- type PlantInfo
- type PollenTypeInfo
- type Service
Constants ¶
const ( // See, edit, configure, and delete your Google Cloud data and see the email // address for your Google Account. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" )
OAuth2 scopes used by this API.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Color ¶
type Color struct { // Alpha: The fraction of this color that should be applied to the pixel. That // is, the final pixel color is defined by the equation: `pixel color = alpha * // (this color) + (1.0 - alpha) * (background color)` This means that a value // of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a // completely transparent color. This uses a wrapper message rather than a // simple float scalar so that it is possible to distinguish between a default // value and the value being unset. If omitted, this color object is rendered // as a solid color (as if the alpha value had been explicitly given a value of // 1.0). Alpha float64 `json:"alpha,omitempty"` // Blue: The amount of blue in the color as a value in the interval [0, 1]. Blue float64 `json:"blue,omitempty"` // Green: The amount of green in the color as a value in the interval [0, 1]. Green float64 `json:"green,omitempty"` // Red: The amount of red in the color as a value in the interval [0, 1]. Red float64 `json:"red,omitempty"` // ForceSendFields is a list of field names (e.g. "Alpha") to unconditionally // include in API requests. By default, fields with empty or default values are // omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Alpha") to include in API // requests with the JSON null value. By default, fields with empty values are // omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
Color: Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to and from color representations in various languages over compactness. For example, the fields of this representation can be trivially provided to the constructor of `java.awt.Color` in Java; it can also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha` method in iOS; and, with just a little work, it can be easily formatted into a CSS `rgba()` string in JavaScript. This reference page doesn't have information about the absolute color space that should be used to interpret the RGB value—for example, sRGB, Adobe RGB, DCI-P3, and BT.2020. By default, applications should assume the sRGB color space. When color equality needs to be decided, implementations, unless documented otherwise, treat two colors as equal if all their red, green, blue, and alpha values each differ by at most `1e-5`. Example (Java): import com.google.type.Color; // ... public static java.awt.Color fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } public static Color toProto(java.awt.Color color) { float red = (float) color.getRed(); float green = (float) color.getGreen(); float blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .build()); } return resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float green = [protocolor green]; float blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) { return nil; } Color* result = [[Color alloc] init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha <= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; return result; } // ... Example (JavaScript): // ... var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if (!('alpha' in rgb_color)) { return rgbToCssColor(red, green, blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, blue].join(','); return ['rgba(', rgbParams, ',', alphaFrac, ')'].join(”); }; var rgbToCssColor = function(red, green, blue) { var rgbNumber = new Number((red << 16) | (green << 8) | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var resultBuilder = ['#']; for (var i = 0; i < missingZeros; i++) { resultBuilder.push('0'); } resultBuilder.push(hexString); return resultBuilder.join(”); }; // ...
func (Color) MarshalJSON ¶
func (*Color) UnmarshalJSON ¶
type Date ¶
type Date struct { // Day: Day of a month. Must be from 1 to 31 and valid for the year and month, // or 0 to specify a year by itself or a year and month where the day isn't // significant. Day int64 `json:"day,omitempty"` // Month: Month of a year. Must be from 1 to 12, or 0 to specify a year without // a month and day. Month int64 `json:"month,omitempty"` // Year: Year of the date. Must be from 1 to 9999, or 0 to specify a date // without a year. Year int64 `json:"year,omitempty"` // ForceSendFields is a list of field names (e.g. "Day") to unconditionally // include in API requests. By default, fields with empty or default values are // omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Day") to include in API requests // with the JSON null value. By default, fields with empty values are omitted // from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
Date: Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * A full date, with non-zero year, month, and day values. * A month and day, with a zero year (for example, an anniversary). * A year on its own, with a zero month and a zero day. * A year and month, with a zero day (for example, a credit card expiration date). Related types: * google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp
func (Date) MarshalJSON ¶
type DayInfo ¶
type DayInfo struct { // Date: The date in UTC at which the pollen forecast data is represented. Date *Date `json:"date,omitempty"` // PlantInfo: This list will include (up to) 15 pollen species affecting the // location specified in the request. PlantInfo []*PlantInfo `json:"plantInfo,omitempty"` // PollenTypeInfo: This list will include (up to) three pollen types (grass, // weed, tree) affecting the location specified in the request. PollenTypeInfo []*PollenTypeInfo `json:"pollenTypeInfo,omitempty"` // ForceSendFields is a list of field names (e.g. "Date") to unconditionally // include in API requests. By default, fields with empty or default values are // omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Date") to include in API requests // with the JSON null value. By default, fields with empty values are omitted // from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
DayInfo: This object contains the daily forecast information for each day requested.
func (DayInfo) MarshalJSON ¶
type ForecastLookupCall ¶
type ForecastLookupCall struct {
// contains filtered or unexported fields
}
func (*ForecastLookupCall) Context ¶
func (c *ForecastLookupCall) Context(ctx context.Context) *ForecastLookupCall
Context sets the context to be used in this call's Do method.
func (*ForecastLookupCall) Days ¶
func (c *ForecastLookupCall) Days(days int64) *ForecastLookupCall
Days sets the optional parameter "days": Required. A number that indicates how many forecast days to request (minimum value 1, maximum value is 5).
func (*ForecastLookupCall) Do ¶
func (c *ForecastLookupCall) Do(opts ...googleapi.CallOption) (*LookupForecastResponse, error)
Do executes the "pollen.forecast.lookup" call. Any non-2xx status code is an error. Response headers are in either *LookupForecastResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.
func (*ForecastLookupCall) Fields ¶
func (c *ForecastLookupCall) Fields(s ...googleapi.Field) *ForecastLookupCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*ForecastLookupCall) Header ¶
func (c *ForecastLookupCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
func (*ForecastLookupCall) IfNoneMatch ¶
func (c *ForecastLookupCall) IfNoneMatch(entityTag string) *ForecastLookupCall
IfNoneMatch sets an optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request.
func (*ForecastLookupCall) LanguageCode ¶
func (c *ForecastLookupCall) LanguageCode(languageCode string) *ForecastLookupCall
LanguageCode sets the optional parameter "languageCode": Allows the client to choose the language for the response. If data cannot be provided for that language the API uses the closest match. Allowed values rely on the IETF BCP-47 standard. Default value is "en".
func (*ForecastLookupCall) LocationLatitude ¶
func (c *ForecastLookupCall) LocationLatitude(locationLatitude float64) *ForecastLookupCall
LocationLatitude sets the optional parameter "location.latitude": The latitude in degrees. It must be in the range [-90.0, +90.0].
func (*ForecastLookupCall) LocationLongitude ¶
func (c *ForecastLookupCall) LocationLongitude(locationLongitude float64) *ForecastLookupCall
LocationLongitude sets the optional parameter "location.longitude": The longitude in degrees. It must be in the range [-180.0, +180.0].
func (*ForecastLookupCall) PageSize ¶
func (c *ForecastLookupCall) PageSize(pageSize int64) *ForecastLookupCall
PageSize sets the optional parameter "pageSize": The maximum number of daily info records to return per page. The default and max value is 5 (5 days of data).
func (*ForecastLookupCall) PageToken ¶
func (c *ForecastLookupCall) PageToken(pageToken string) *ForecastLookupCall
PageToken sets the optional parameter "pageToken": A page token received from a previous daily call. It is used to retrieve the subsequent page. Note that when providing a value for the page token all other request parameters provided must match the previous call that provided the page token.
func (*ForecastLookupCall) Pages ¶
func (c *ForecastLookupCall) Pages(ctx context.Context, f func(*LookupForecastResponse) error) error
Pages invokes f for each page of results. A non-nil error returned from f will halt the iteration. The provided context supersedes any context provided to the Context method.
func (*ForecastLookupCall) PlantsDescription ¶
func (c *ForecastLookupCall) PlantsDescription(plantsDescription bool) *ForecastLookupCall
PlantsDescription sets the optional parameter "plantsDescription": Contains general information about plants, including details on their seasonality, special shapes and colors, information about allergic cross-reactions, and plant photos.
type ForecastService ¶
type ForecastService struct {
// contains filtered or unexported fields
}
func NewForecastService ¶
func NewForecastService(s *Service) *ForecastService
func (*ForecastService) Lookup ¶
func (r *ForecastService) Lookup() *ForecastLookupCall
Lookup: Returns up to 5 days of daily pollen information in more than 65 countries, up to 1km resolution.
type HttpBody ¶
type HttpBody struct { // ContentType: The HTTP Content-Type header value specifying the content type // of the body. ContentType string `json:"contentType,omitempty"` // Data: The HTTP request/response body as raw binary. Data string `json:"data,omitempty"` // Extensions: Application specific response metadata. Must be set in the first // response for streaming APIs. Extensions []googleapi.RawMessage `json:"extensions,omitempty"` // ServerResponse contains the HTTP response code and headers from the server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "ContentType") to // unconditionally include in API requests. By default, fields with empty or // default values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "ContentType") to include in API // requests with the JSON null value. By default, fields with empty values are // omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
HttpBody: Message that represents an arbitrary HTTP body. It should only be used for payload formats that can't be represented as JSON, such as raw binary or an HTML page. This message can be used both in streaming and non-streaming API methods in the request as well as the response. It can be used as a top-level request field, which is convenient if one wants to extract parameters from either the URL or HTTP template into the request fields and also want access to the raw HTTP body. Example: message GetResourceRequest { // A unique request id. string request_id = 1; // The raw HTTP body is bound to this field. google.api.HttpBody http_body = 2; } service ResourceService { rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); rpc UpdateResource(google.api.HttpBody) returns (google.protobuf.Empty); } Example with streaming methods: service CaldavService { rpc GetCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); rpc UpdateCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); } Use of this type only changes how the request and response bodies are handled, all other features will continue to work unchanged.
func (HttpBody) MarshalJSON ¶
type IndexInfo ¶
type IndexInfo struct { // Category: Text classification of index numerical score interpretation. The // index consists of six categories: * 0: "None" * 1: "Very low" * 2: "Low" * // 3: "Moderate" * 4: "High" * 5: "Very high Category string `json:"category,omitempty"` // Code: The index's code. This field represents the index for programming // purposes by using snake cases instead of spaces. Example: "UPI". // // Possible values: // "INDEX_UNSPECIFIED" - Unspecified index. // "UPI" - Universal Pollen Index. Code string `json:"code,omitempty"` // Color: The color used to represent the Pollen Index numeric score. Color *Color `json:"color,omitempty"` // DisplayName: A human readable representation of the index name. Example: // "Universal Pollen Index". DisplayName string `json:"displayName,omitempty"` // IndexDescription: Textual explanation of current index level. IndexDescription string `json:"indexDescription,omitempty"` // Value: The index's numeric score. Numeric range is between 0 and 5. Value int64 `json:"value,omitempty"` // ForceSendFields is a list of field names (e.g. "Category") to // unconditionally include in API requests. By default, fields with empty or // default values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Category") to include in API // requests with the JSON null value. By default, fields with empty values are // omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
IndexInfo: This object contains data representing specific pollen index value, category and description.
func (IndexInfo) MarshalJSON ¶
type LookupForecastResponse ¶
type LookupForecastResponse struct { // DailyInfo: Required. This object contains the daily forecast information for // each day requested. DailyInfo []*DayInfo `json:"dailyInfo,omitempty"` // NextPageToken: Optional. The token to retrieve the next page. NextPageToken string `json:"nextPageToken,omitempty"` // RegionCode: The ISO_3166-1 alpha-2 code of the country/region corresponding // to the location provided in the request. This field might be omitted from // the response if the location provided in the request resides in a disputed // territory. RegionCode string `json:"regionCode,omitempty"` // ServerResponse contains the HTTP response code and headers from the server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "DailyInfo") to // unconditionally include in API requests. By default, fields with empty or // default values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "DailyInfo") to include in API // requests with the JSON null value. By default, fields with empty values are // omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
func (LookupForecastResponse) MarshalJSON ¶
func (s LookupForecastResponse) MarshalJSON() ([]byte, error)
type MapTypesHeatmapTilesLookupHeatmapTileCall ¶
type MapTypesHeatmapTilesLookupHeatmapTileCall struct {
// contains filtered or unexported fields
}
func (*MapTypesHeatmapTilesLookupHeatmapTileCall) Context ¶
func (c *MapTypesHeatmapTilesLookupHeatmapTileCall) Context(ctx context.Context) *MapTypesHeatmapTilesLookupHeatmapTileCall
Context sets the context to be used in this call's Do method.
func (*MapTypesHeatmapTilesLookupHeatmapTileCall) Do ¶
func (c *MapTypesHeatmapTilesLookupHeatmapTileCall) Do(opts ...googleapi.CallOption) (*HttpBody, error)
Do executes the "pollen.mapTypes.heatmapTiles.lookupHeatmapTile" call. Any non-2xx status code is an error. Response headers are in either *HttpBody.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.
func (*MapTypesHeatmapTilesLookupHeatmapTileCall) Fields ¶
func (c *MapTypesHeatmapTilesLookupHeatmapTileCall) Fields(s ...googleapi.Field) *MapTypesHeatmapTilesLookupHeatmapTileCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*MapTypesHeatmapTilesLookupHeatmapTileCall) Header ¶
func (c *MapTypesHeatmapTilesLookupHeatmapTileCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
func (*MapTypesHeatmapTilesLookupHeatmapTileCall) IfNoneMatch ¶
func (c *MapTypesHeatmapTilesLookupHeatmapTileCall) IfNoneMatch(entityTag string) *MapTypesHeatmapTilesLookupHeatmapTileCall
IfNoneMatch sets an optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request.
type MapTypesHeatmapTilesService ¶
type MapTypesHeatmapTilesService struct {
// contains filtered or unexported fields
}
func NewMapTypesHeatmapTilesService ¶
func NewMapTypesHeatmapTilesService(s *Service) *MapTypesHeatmapTilesService
func (*MapTypesHeatmapTilesService) LookupHeatmapTile ¶
func (r *MapTypesHeatmapTilesService) LookupHeatmapTile(mapType string, zoom int64, x int64, y int64) *MapTypesHeatmapTilesLookupHeatmapTileCall
LookupHeatmapTile: Returns a byte array containing the data of the tile PNG image.
- mapType: The type of the pollen heatmap. Defines the combination of pollen type and index that the map will graphically represent.
- x: Defines the east-west point in the requested tile.
- y: Defines the north-south point in the requested tile.
- zoom: The map's zoom level. Defines how large or small the contents of a map appear in a map view. * Zoom level 0 is the entire world in a single tile. * Zoom level 1 is the entire world in 4 tiles. * Zoom level 2 is the entire world in 16 tiles. * Zoom level 16 is the entire world in 65,536 tiles. Allowed values: 0-16.
type MapTypesService ¶
type MapTypesService struct { HeatmapTiles *MapTypesHeatmapTilesService // contains filtered or unexported fields }
func NewMapTypesService ¶
func NewMapTypesService(s *Service) *MapTypesService
type PlantDescription ¶
type PlantDescription struct { // CrossReaction: Textual description of pollen cross reaction plants. Example: // Alder, Hazel, Hornbeam, Beech, Willow, and Oak pollen. CrossReaction string `json:"crossReaction,omitempty"` // Family: A human readable representation of the plant family name. Example: // "Betulaceae (the Birch family)". Family string `json:"family,omitempty"` // Picture: Link to the picture of the plant. Picture string `json:"picture,omitempty"` // PictureCloseup: Link to a closeup picture of the plant. PictureCloseup string `json:"pictureCloseup,omitempty"` // Season: Textual list of explanations of seasons where the pollen is active. // Example: "Late winter, spring". Season string `json:"season,omitempty"` // SpecialColors: Textual description of the plants' colors of leaves, bark, // flowers or seeds that helps identify the plant. SpecialColors string `json:"specialColors,omitempty"` // SpecialShapes: Textual description of the plants' shapes of leaves, bark, // flowers or seeds that helps identify the plant. SpecialShapes string `json:"specialShapes,omitempty"` // Type: The plant's pollen type. For example: "GRASS". A list of all available // codes could be found here. // // Possible values: // "POLLEN_TYPE_UNSPECIFIED" - Unspecified plant type. // "GRASS" - Grass pollen type. // "TREE" - Tree pollen type. // "WEED" - Weed pollen type. Type string `json:"type,omitempty"` // ForceSendFields is a list of field names (e.g. "CrossReaction") to // unconditionally include in API requests. By default, fields with empty or // default values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "CrossReaction") to include in API // requests with the JSON null value. By default, fields with empty values are // omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
PlantDescription: Contains general information about plants, including details on their seasonality, special shapes and colors, information about allergic cross-reactions, and plant photos.
func (PlantDescription) MarshalJSON ¶
func (s PlantDescription) MarshalJSON() ([]byte, error)
type PlantInfo ¶
type PlantInfo struct { // Code: The plant code name. For example: "COTTONWOOD". A list of all // available codes could be found here. // // Possible values: // "PLANT_UNSPECIFIED" - Unspecified plant code. // "ALDER" - Alder is classified as a tree pollen type. // "ASH" - Ash is classified as a tree pollen type. // "BIRCH" - Birch is classified as a tree pollen type. // "COTTONWOOD" - Cottonwood is classified as a tree pollen type. // "ELM" - Elm is classified as a tree pollen type. // "MAPLE" - Maple is classified as a tree pollen type. // "OLIVE" - Olive is classified as a tree pollen type. // "JUNIPER" - Juniper is classified as a tree pollen type. // "OAK" - Oak is classified as a tree pollen type. // "PINE" - Pine is classified as a tree pollen type. // "CYPRESS_PINE" - Cypress pine is classified as a tree pollen type. // "HAZEL" - Hazel is classified as a tree pollen type. // "GRAMINALES" - Graminales is classified as a grass pollen type. // "RAGWEED" - Ragweed is classified as a weed pollen type. // "MUGWORT" - Mugwort is classified as a weed pollen type. Code string `json:"code,omitempty"` // DisplayName: A human readable representation of the plant name. Example: // “Cottonwood". DisplayName string `json:"displayName,omitempty"` // InSeason: Indication of either the plant is in season or not. InSeason bool `json:"inSeason,omitempty"` // IndexInfo: This object contains data representing specific pollen index // value, category and description. IndexInfo *IndexInfo `json:"indexInfo,omitempty"` // PlantDescription: Contains general information about plants, including // details on their seasonality, special shapes and colors, information about // allergic cross-reactions, and plant photos. PlantDescription *PlantDescription `json:"plantDescription,omitempty"` // ForceSendFields is a list of field names (e.g. "Code") to unconditionally // include in API requests. By default, fields with empty or default values are // omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Code") to include in API requests // with the JSON null value. By default, fields with empty values are omitted // from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
PlantInfo: This object contains the daily information on specific plant.
func (PlantInfo) MarshalJSON ¶
type PollenTypeInfo ¶
type PollenTypeInfo struct { // Code: The pollen type's code name. For example: "GRASS" // // Possible values: // "POLLEN_TYPE_UNSPECIFIED" - Unspecified plant type. // "GRASS" - Grass pollen type. // "TREE" - Tree pollen type. // "WEED" - Weed pollen type. Code string `json:"code,omitempty"` // DisplayName: A human readable representation of the pollen type name. // Example: "Grass" DisplayName string `json:"displayName,omitempty"` // HealthRecommendations: Textual list of explanations, related to health // insights based on the current pollen levels. HealthRecommendations []string `json:"healthRecommendations,omitempty"` // InSeason: Indication whether the plant is in season or not. InSeason bool `json:"inSeason,omitempty"` // IndexInfo: Contains the Universal Pollen Index (UPI) data for the pollen // type. IndexInfo *IndexInfo `json:"indexInfo,omitempty"` // ForceSendFields is a list of field names (e.g. "Code") to unconditionally // include in API requests. By default, fields with empty or default values are // omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Code") to include in API requests // with the JSON null value. By default, fields with empty values are omitted // from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
PollenTypeInfo: This object contains the pollen type index and health recommendation information on specific pollen type.
func (PollenTypeInfo) MarshalJSON ¶
func (s PollenTypeInfo) MarshalJSON() ([]byte, error)
type Service ¶
type Service struct { BasePath string // API endpoint base URL UserAgent string // optional additional User-Agent fragment Forecast *ForecastService MapTypes *MapTypesService // contains filtered or unexported fields }
func New
deprecated
New creates a new Service. It uses the provided http.Client for requests.
Deprecated: please use NewService instead. To provide a custom HTTP client, use option.WithHTTPClient. If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
func NewService ¶
NewService creates a new Service.