| 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(''); }; // ...
|
| CredentialsClient | Defines the root interface for all clients that generate credentials
for calling Google APIs. All clients should implement this interface.
|
| 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
|
| DayInfo | This object contains the daily forecast information for each day requested.
|
| ForecastLookupOptions | Additional options for Pollen#forecastLookup.
|
| 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.
|
| IndexInfo | This object contains data representing specific pollen index value, category
and description.
|
| LookupForecastResponse | |
| PlantDescription | Contains general information about plants, including details on their
seasonality, special shapes and colors, information about allergic
cross-reactions, and plant photos.
|
| PlantInfo | This object contains the daily information on specific plant.
|
| PollenTypeInfo | This object contains the pollen type index and health recommendation
information on specific pollen type.
|