mirror of
https://github.com/rclone/rclone.git
synced 2025-08-18 09:30:03 +02:00
Switch to using the dep tool and update all the dependencies
This commit is contained in:
1018
vendor/google.golang.org/api/google-api-go-generator/testdata/any.json
generated
vendored
Normal file
1018
vendor/google.golang.org/api/google-api-go-generator/testdata/any.json
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
3152
vendor/google.golang.org/api/google-api-go-generator/testdata/any.want
generated
vendored
Normal file
3152
vendor/google.golang.org/api/google-api-go-generator/testdata/any.want
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
49
vendor/google.golang.org/api/google-api-go-generator/testdata/arrayofarray-1.json
generated
vendored
Normal file
49
vendor/google.golang.org/api/google-api-go-generator/testdata/arrayofarray-1.json
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"kind": "discovery#restDescription",
|
||||
"etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/3m5rB86FE5KuW1K3jAl88AxCreg\"",
|
||||
"discoveryVersion": "v1",
|
||||
"id": "arrayofarray:v1",
|
||||
"name": "arrayofarray",
|
||||
"version": "v1",
|
||||
"title": "Example API",
|
||||
"description": "The Example API demonstrates an array of arrays.",
|
||||
"ownerDomain": "google.com",
|
||||
"ownerName": "Google",
|
||||
"protocol": "rest",
|
||||
"schemas": {
|
||||
"GeoJsonMultiPolygon": {
|
||||
"id": "GeoJsonMultiPolygon",
|
||||
"type": "object",
|
||||
"description": "Multi Polygon",
|
||||
"properties": {
|
||||
"coordinates": {
|
||||
"type": "array",
|
||||
"description": "Coordinate arrays.",
|
||||
"items": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"description": "Identifies this object as a multi-polygon.",
|
||||
"enum": [
|
||||
"MultiPolygon"
|
||||
],
|
||||
"enumDescriptions": [
|
||||
""
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
99
vendor/google.golang.org/api/google-api-go-generator/testdata/arrayofarray-1.want
generated
vendored
Normal file
99
vendor/google.golang.org/api/google-api-go-generator/testdata/arrayofarray-1.want
generated
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
// Package arrayofarray provides access to the Example API.
|
||||
//
|
||||
// Usage example:
|
||||
//
|
||||
// import "google.golang.org/api/arrayofarray/v1"
|
||||
// ...
|
||||
// arrayofarrayService, err := arrayofarray.New(oauthHttpClient)
|
||||
package arrayofarray // import "google.golang.org/api/arrayofarray/v1"
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
context "golang.org/x/net/context"
|
||||
ctxhttp "golang.org/x/net/context/ctxhttp"
|
||||
gensupport "google.golang.org/api/gensupport"
|
||||
googleapi "google.golang.org/api/googleapi"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Always reference these packages, just in case the auto-generated code
|
||||
// below doesn't.
|
||||
var _ = bytes.NewBuffer
|
||||
var _ = strconv.Itoa
|
||||
var _ = fmt.Sprintf
|
||||
var _ = json.NewDecoder
|
||||
var _ = io.Copy
|
||||
var _ = url.Parse
|
||||
var _ = gensupport.MarshalJSON
|
||||
var _ = googleapi.Version
|
||||
var _ = errors.New
|
||||
var _ = strings.Replace
|
||||
var _ = context.Canceled
|
||||
var _ = ctxhttp.Do
|
||||
|
||||
const apiId = "arrayofarray:v1"
|
||||
const apiName = "arrayofarray"
|
||||
const apiVersion = "v1"
|
||||
const basePath = "https://www.googleapis.com/discovery/v1/apis"
|
||||
|
||||
func New(client *http.Client) (*Service, error) {
|
||||
if client == nil {
|
||||
return nil, errors.New("client is nil")
|
||||
}
|
||||
s := &Service{client: client, BasePath: basePath}
|
||||
return s, nil
|
||||
}
|
||||
|
||||
type Service struct {
|
||||
client *http.Client
|
||||
BasePath string // API endpoint base URL
|
||||
UserAgent string // optional additional User-Agent fragment
|
||||
}
|
||||
|
||||
func (s *Service) userAgent() string {
|
||||
if s.UserAgent == "" {
|
||||
return googleapi.UserAgent
|
||||
}
|
||||
return googleapi.UserAgent + " " + s.UserAgent
|
||||
}
|
||||
|
||||
// GeoJsonMultiPolygon: Multi Polygon
|
||||
type GeoJsonMultiPolygon struct {
|
||||
// Coordinates: Coordinate arrays.
|
||||
Coordinates [][][][]float64 `json:"coordinates,omitempty"`
|
||||
|
||||
// Type: Identifies this object as a multi-polygon.
|
||||
//
|
||||
// Possible values:
|
||||
// "MultiPolygon"
|
||||
Type string `json:"type,omitempty"`
|
||||
|
||||
// ForceSendFields is a list of field names (e.g. "Coordinates") to
|
||||
// unconditionally include in API requests. By default, fields with
|
||||
// empty values are omitted from API requests. However, any non-pointer,
|
||||
// non-interface field appearing in ForceSendFields will be sent to the
|
||||
// server regardless of whether the field is empty or not. This may be
|
||||
// used to include empty fields in Patch requests.
|
||||
ForceSendFields []string `json:"-"`
|
||||
|
||||
// NullFields is a list of field names (e.g. "Coordinates") to include
|
||||
// in API requests with the JSON null value. By default, fields with
|
||||
// empty values are omitted from API requests. However, any field with
|
||||
// an empty value appearing in NullFields will be sent to the server as
|
||||
// null. It is an error if a field in this list has a non-empty value.
|
||||
// This may be used to include null fields in Patch requests.
|
||||
NullFields []string `json:"-"`
|
||||
}
|
||||
|
||||
func (s *GeoJsonMultiPolygon) MarshalJSON() ([]byte, error) {
|
||||
type noMethod GeoJsonMultiPolygon
|
||||
raw := noMethod(*s)
|
||||
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
|
||||
}
|
191
vendor/google.golang.org/api/google-api-go-generator/testdata/arrayofenum.json
generated
vendored
Normal file
191
vendor/google.golang.org/api/google-api-go-generator/testdata/arrayofenum.json
generated
vendored
Normal file
@@ -0,0 +1,191 @@
|
||||
{
|
||||
"kind": "discovery#restDescription",
|
||||
"etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/3m5rB86FE5KuW1K3jAl88AxCreg\"",
|
||||
"discoveryVersion": "v1",
|
||||
"id": "arrayofenum:v1",
|
||||
"name": "arrayofenum",
|
||||
"version": "v1",
|
||||
"title": "Example API",
|
||||
"description": "The Example API demonstrates an array of enums.",
|
||||
"ownerDomain": "google.com",
|
||||
"ownerName": "Google",
|
||||
"protocol": "rest",
|
||||
"schemas": {
|
||||
"Container": {
|
||||
"id": "Container",
|
||||
"type": "object",
|
||||
"description": "Represents a Google Tag Manager Container.",
|
||||
"properties": {
|
||||
"accountId": {
|
||||
"type": "string",
|
||||
"description": "GTM Account ID."
|
||||
},
|
||||
"containerId": {
|
||||
"type": "string",
|
||||
"description": "This is a long description that has URLs in it that shouldn't break. https://sites.google.com/a/google.com/adx-integration/Home/engineering/binary-releases/rtb-api-release https://cs.corp.google.com/#piper///depot/google3/contentads/adx/tools/rtb_api/adxrtb.py"
|
||||
},
|
||||
"domainName": {
|
||||
"type": "array",
|
||||
"description": "Optional list of domain names associated with the Container.",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"enabledBuiltInVariable": {
|
||||
"type": "array",
|
||||
"description": "List of enabled built-in variables. Valid values include: pageUrl, pageHostname, pagePath, referrer, event, clickElement, clickClasses, clickId, clickTarget, clickUrl, clickText, formElement, formClasses, formId, formTarget, formUrl, formText, errorMessage, errorUrl, errorLine, newHistoryFragment, oldHistoryFragment, newHistoryState, oldHistoryState, historySource, containerVersion, debugMode, randomNumber, containerId.",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"advertiserId",
|
||||
"advertisingTrackingEnabled",
|
||||
"appId",
|
||||
"appName",
|
||||
"appVersionCode",
|
||||
"appVersionName",
|
||||
"clickClasses",
|
||||
"clickElement",
|
||||
"clickId",
|
||||
"clickTarget",
|
||||
"clickText",
|
||||
"clickUrl",
|
||||
"containerId",
|
||||
"containerVersion",
|
||||
"debugMode",
|
||||
"deviceName",
|
||||
"errorLine",
|
||||
"errorMessage",
|
||||
"errorUrl",
|
||||
"event",
|
||||
"formClasses",
|
||||
"formElement",
|
||||
"formId",
|
||||
"formTarget",
|
||||
"formText",
|
||||
"formUrl",
|
||||
"historySource",
|
||||
"language",
|
||||
"newHistoryFragment",
|
||||
"newHistoryState",
|
||||
"oldHistoryFragment",
|
||||
"oldHistoryState",
|
||||
"osVersion",
|
||||
"pageHostname",
|
||||
"pagePath",
|
||||
"pageUrl",
|
||||
"platform",
|
||||
"randomNumber",
|
||||
"referrer",
|
||||
"resolution",
|
||||
"sdkVersion"
|
||||
],
|
||||
"enumDescriptions": [
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
""
|
||||
]
|
||||
}
|
||||
},
|
||||
"fingerprint": {
|
||||
"type": "string",
|
||||
"description": "The fingerprint of the GTM Container as computed at storage time. This value is recomputed whenever the account is modified."
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "Container display name.",
|
||||
"annotations": {
|
||||
"required": [
|
||||
"tagmanager.accounts.containers.create"
|
||||
]
|
||||
}
|
||||
},
|
||||
"notes": {
|
||||
"type": "string",
|
||||
"description": "Container Notes."
|
||||
},
|
||||
"publicId": {
|
||||
"type": "string",
|
||||
"description": "Container Public ID."
|
||||
},
|
||||
"timeZoneCountryId": {
|
||||
"type": "string",
|
||||
"description": "Container Country ID.",
|
||||
"annotations": {
|
||||
"required": [
|
||||
"tagmanager.accounts.containers.create"
|
||||
]
|
||||
}
|
||||
},
|
||||
"timeZoneId": {
|
||||
"type": "string",
|
||||
"description": "Container Time Zone ID.",
|
||||
"annotations": {
|
||||
"required": [
|
||||
"tagmanager.accounts.containers.create"
|
||||
]
|
||||
}
|
||||
},
|
||||
"usageContext": {
|
||||
"type": "array",
|
||||
"description": "List of Usage Contexts for the Container. Valid values include: web, android, ios.",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"android",
|
||||
"ios",
|
||||
"web"
|
||||
],
|
||||
"enumDescriptions": [
|
||||
"",
|
||||
"",
|
||||
""
|
||||
]
|
||||
},
|
||||
"annotations": {
|
||||
"required": [
|
||||
"tagmanager.accounts.containers.create"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
184
vendor/google.golang.org/api/google-api-go-generator/testdata/arrayofenum.want
generated
vendored
Normal file
184
vendor/google.golang.org/api/google-api-go-generator/testdata/arrayofenum.want
generated
vendored
Normal file
@@ -0,0 +1,184 @@
|
||||
// Package arrayofenum provides access to the Example API.
|
||||
//
|
||||
// Usage example:
|
||||
//
|
||||
// import "google.golang.org/api/arrayofenum/v1"
|
||||
// ...
|
||||
// arrayofenumService, err := arrayofenum.New(oauthHttpClient)
|
||||
package arrayofenum // import "google.golang.org/api/arrayofenum/v1"
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
context "golang.org/x/net/context"
|
||||
ctxhttp "golang.org/x/net/context/ctxhttp"
|
||||
gensupport "google.golang.org/api/gensupport"
|
||||
googleapi "google.golang.org/api/googleapi"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Always reference these packages, just in case the auto-generated code
|
||||
// below doesn't.
|
||||
var _ = bytes.NewBuffer
|
||||
var _ = strconv.Itoa
|
||||
var _ = fmt.Sprintf
|
||||
var _ = json.NewDecoder
|
||||
var _ = io.Copy
|
||||
var _ = url.Parse
|
||||
var _ = gensupport.MarshalJSON
|
||||
var _ = googleapi.Version
|
||||
var _ = errors.New
|
||||
var _ = strings.Replace
|
||||
var _ = context.Canceled
|
||||
var _ = ctxhttp.Do
|
||||
|
||||
const apiId = "arrayofenum:v1"
|
||||
const apiName = "arrayofenum"
|
||||
const apiVersion = "v1"
|
||||
const basePath = "https://www.googleapis.com/discovery/v1/apis"
|
||||
|
||||
func New(client *http.Client) (*Service, error) {
|
||||
if client == nil {
|
||||
return nil, errors.New("client is nil")
|
||||
}
|
||||
s := &Service{client: client, BasePath: basePath}
|
||||
return s, nil
|
||||
}
|
||||
|
||||
type Service struct {
|
||||
client *http.Client
|
||||
BasePath string // API endpoint base URL
|
||||
UserAgent string // optional additional User-Agent fragment
|
||||
}
|
||||
|
||||
func (s *Service) userAgent() string {
|
||||
if s.UserAgent == "" {
|
||||
return googleapi.UserAgent
|
||||
}
|
||||
return googleapi.UserAgent + " " + s.UserAgent
|
||||
}
|
||||
|
||||
// Container: Represents a Google Tag Manager Container.
|
||||
type Container struct {
|
||||
// AccountId: GTM Account ID.
|
||||
AccountId string `json:"accountId,omitempty"`
|
||||
|
||||
// ContainerId: This is a long description that has URLs in it that
|
||||
// shouldn't break.
|
||||
// https://sites.google.com/a/google.com/adx-integration/Home/engineering/binary-releases/rtb-api-release
|
||||
// https://cs.corp.google.com/#piper///depot/google3/contentads/adx/tools/rtb_api/adxrtb.py
|
||||
ContainerId string `json:"containerId,omitempty"`
|
||||
|
||||
// DomainName: Optional list of domain names associated with the
|
||||
// Container.
|
||||
DomainName []string `json:"domainName,omitempty"`
|
||||
|
||||
// EnabledBuiltInVariable: List of enabled built-in variables. Valid
|
||||
// values include: pageUrl, pageHostname, pagePath, referrer, event,
|
||||
// clickElement, clickClasses, clickId, clickTarget, clickUrl,
|
||||
// clickText, formElement, formClasses, formId, formTarget, formUrl,
|
||||
// formText, errorMessage, errorUrl, errorLine, newHistoryFragment,
|
||||
// oldHistoryFragment, newHistoryState, oldHistoryState, historySource,
|
||||
// containerVersion, debugMode, randomNumber, containerId.
|
||||
//
|
||||
// Possible values:
|
||||
// "advertiserId"
|
||||
// "advertisingTrackingEnabled"
|
||||
// "appId"
|
||||
// "appName"
|
||||
// "appVersionCode"
|
||||
// "appVersionName"
|
||||
// "clickClasses"
|
||||
// "clickElement"
|
||||
// "clickId"
|
||||
// "clickTarget"
|
||||
// "clickText"
|
||||
// "clickUrl"
|
||||
// "containerId"
|
||||
// "containerVersion"
|
||||
// "debugMode"
|
||||
// "deviceName"
|
||||
// "errorLine"
|
||||
// "errorMessage"
|
||||
// "errorUrl"
|
||||
// "event"
|
||||
// "formClasses"
|
||||
// "formElement"
|
||||
// "formId"
|
||||
// "formTarget"
|
||||
// "formText"
|
||||
// "formUrl"
|
||||
// "historySource"
|
||||
// "language"
|
||||
// "newHistoryFragment"
|
||||
// "newHistoryState"
|
||||
// "oldHistoryFragment"
|
||||
// "oldHistoryState"
|
||||
// "osVersion"
|
||||
// "pageHostname"
|
||||
// "pagePath"
|
||||
// "pageUrl"
|
||||
// "platform"
|
||||
// "randomNumber"
|
||||
// "referrer"
|
||||
// "resolution"
|
||||
// "sdkVersion"
|
||||
EnabledBuiltInVariable []string `json:"enabledBuiltInVariable,omitempty"`
|
||||
|
||||
// Fingerprint: The fingerprint of the GTM Container as computed at
|
||||
// storage time. This value is recomputed whenever the account is
|
||||
// modified.
|
||||
Fingerprint string `json:"fingerprint,omitempty"`
|
||||
|
||||
// Name: Container display name.
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// Notes: Container Notes.
|
||||
Notes string `json:"notes,omitempty"`
|
||||
|
||||
// PublicId: Container Public ID.
|
||||
PublicId string `json:"publicId,omitempty"`
|
||||
|
||||
// TimeZoneCountryId: Container Country ID.
|
||||
TimeZoneCountryId string `json:"timeZoneCountryId,omitempty"`
|
||||
|
||||
// TimeZoneId: Container Time Zone ID.
|
||||
TimeZoneId string `json:"timeZoneId,omitempty"`
|
||||
|
||||
// UsageContext: List of Usage Contexts for the Container. Valid values
|
||||
// include: web, android, ios.
|
||||
//
|
||||
// Possible values:
|
||||
// "android"
|
||||
// "ios"
|
||||
// "web"
|
||||
UsageContext []string `json:"usageContext,omitempty"`
|
||||
|
||||
// ForceSendFields is a list of field names (e.g. "AccountId") to
|
||||
// unconditionally include in API requests. By default, fields with
|
||||
// empty values are omitted from API requests. However, any non-pointer,
|
||||
// non-interface field appearing in ForceSendFields will be sent to the
|
||||
// server regardless of whether the field is empty or not. This may be
|
||||
// used to include empty fields in Patch requests.
|
||||
ForceSendFields []string `json:"-"`
|
||||
|
||||
// NullFields is a list of field names (e.g. "AccountId") to include in
|
||||
// API requests with the JSON null value. By default, fields with empty
|
||||
// values are omitted from API requests. However, any field with an
|
||||
// empty value appearing in NullFields will be sent to the server as
|
||||
// null. It is an error if a field in this list has a non-empty value.
|
||||
// This may be used to include null fields in Patch requests.
|
||||
NullFields []string `json:"-"`
|
||||
}
|
||||
|
||||
func (s *Container) MarshalJSON() ([]byte, error) {
|
||||
type noMethod Container
|
||||
raw := noMethod(*s)
|
||||
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
|
||||
}
|
36
vendor/google.golang.org/api/google-api-go-generator/testdata/arrayofmapofobjects.json
generated
vendored
Normal file
36
vendor/google.golang.org/api/google-api-go-generator/testdata/arrayofmapofobjects.json
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"kind": "discovery#restDescription",
|
||||
"etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/3m5rB86FE5KuW1K3jAl88AxCreg\"",
|
||||
"discoveryVersion": "v1",
|
||||
"id": "arrayofmapofstrings:v1",
|
||||
"name": "arrayofmapofstrings",
|
||||
"version": "v1",
|
||||
"title": "Example API",
|
||||
"description": "The Example API demonstrates an array of arrays.",
|
||||
"ownerDomain": "google.com",
|
||||
"ownerName": "Google",
|
||||
"protocol": "rest",
|
||||
"schemas": {
|
||||
"Analyze": {
|
||||
"id": "Analyze",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"errors": {
|
||||
"type": "array",
|
||||
"description": "List of errors with the data.",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"$ref": "Property",
|
||||
"description": "Error level followed by a detailed error message."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"Property": {
|
||||
"id": "Property",
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
95
vendor/google.golang.org/api/google-api-go-generator/testdata/arrayofmapofobjects.want
generated
vendored
Normal file
95
vendor/google.golang.org/api/google-api-go-generator/testdata/arrayofmapofobjects.want
generated
vendored
Normal file
@@ -0,0 +1,95 @@
|
||||
// Package arrayofmapofstrings provides access to the Example API.
|
||||
//
|
||||
// Usage example:
|
||||
//
|
||||
// import "google.golang.org/api/arrayofmapofstrings/v1"
|
||||
// ...
|
||||
// arrayofmapofstringsService, err := arrayofmapofstrings.New(oauthHttpClient)
|
||||
package arrayofmapofstrings // import "google.golang.org/api/arrayofmapofstrings/v1"
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
context "golang.org/x/net/context"
|
||||
ctxhttp "golang.org/x/net/context/ctxhttp"
|
||||
gensupport "google.golang.org/api/gensupport"
|
||||
googleapi "google.golang.org/api/googleapi"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Always reference these packages, just in case the auto-generated code
|
||||
// below doesn't.
|
||||
var _ = bytes.NewBuffer
|
||||
var _ = strconv.Itoa
|
||||
var _ = fmt.Sprintf
|
||||
var _ = json.NewDecoder
|
||||
var _ = io.Copy
|
||||
var _ = url.Parse
|
||||
var _ = gensupport.MarshalJSON
|
||||
var _ = googleapi.Version
|
||||
var _ = errors.New
|
||||
var _ = strings.Replace
|
||||
var _ = context.Canceled
|
||||
var _ = ctxhttp.Do
|
||||
|
||||
const apiId = "arrayofmapofstrings:v1"
|
||||
const apiName = "arrayofmapofstrings"
|
||||
const apiVersion = "v1"
|
||||
const basePath = "https://www.googleapis.com/discovery/v1/apis"
|
||||
|
||||
func New(client *http.Client) (*Service, error) {
|
||||
if client == nil {
|
||||
return nil, errors.New("client is nil")
|
||||
}
|
||||
s := &Service{client: client, BasePath: basePath}
|
||||
return s, nil
|
||||
}
|
||||
|
||||
type Service struct {
|
||||
client *http.Client
|
||||
BasePath string // API endpoint base URL
|
||||
UserAgent string // optional additional User-Agent fragment
|
||||
}
|
||||
|
||||
func (s *Service) userAgent() string {
|
||||
if s.UserAgent == "" {
|
||||
return googleapi.UserAgent
|
||||
}
|
||||
return googleapi.UserAgent + " " + s.UserAgent
|
||||
}
|
||||
|
||||
type Analyze struct {
|
||||
// Errors: List of errors with the data.
|
||||
Errors []map[string]Property `json:"errors,omitempty"`
|
||||
|
||||
// ForceSendFields is a list of field names (e.g. "Errors") to
|
||||
// unconditionally include in API requests. By default, fields with
|
||||
// empty values are omitted from API requests. However, any non-pointer,
|
||||
// non-interface field appearing in ForceSendFields will be sent to the
|
||||
// server regardless of whether the field is empty or not. This may be
|
||||
// used to include empty fields in Patch requests.
|
||||
ForceSendFields []string `json:"-"`
|
||||
|
||||
// NullFields is a list of field names (e.g. "Errors") to include in API
|
||||
// requests with the JSON null value. By default, fields with empty
|
||||
// values are omitted from API requests. However, any field with an
|
||||
// empty value appearing in NullFields will be sent to the server as
|
||||
// null. It is an error if a field in this list has a non-empty value.
|
||||
// This may be used to include null fields in Patch requests.
|
||||
NullFields []string `json:"-"`
|
||||
}
|
||||
|
||||
func (s *Analyze) MarshalJSON() ([]byte, error) {
|
||||
type noMethod Analyze
|
||||
raw := noMethod(*s)
|
||||
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
|
||||
}
|
||||
|
||||
type Property struct {
|
||||
}
|
32
vendor/google.golang.org/api/google-api-go-generator/testdata/arrayofmapofstrings.json
generated
vendored
Normal file
32
vendor/google.golang.org/api/google-api-go-generator/testdata/arrayofmapofstrings.json
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"kind": "discovery#restDescription",
|
||||
"etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/3m5rB86FE5KuW1K3jAl88AxCreg\"",
|
||||
"discoveryVersion": "v1",
|
||||
"id": "arrayofmapofstrings:v1",
|
||||
"name": "arrayofmapofstrings",
|
||||
"version": "v1",
|
||||
"title": "Example API",
|
||||
"description": "The Example API demonstrates an array of arrays.",
|
||||
"ownerDomain": "google.com",
|
||||
"ownerName": "Google",
|
||||
"protocol": "rest",
|
||||
"schemas": {
|
||||
"Analyze": {
|
||||
"id": "Analyze",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"errors": {
|
||||
"type": "array",
|
||||
"description": "List of errors with the data.",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string",
|
||||
"description": "Error level followed by a detailed error message."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
92
vendor/google.golang.org/api/google-api-go-generator/testdata/arrayofmapofstrings.want
generated
vendored
Normal file
92
vendor/google.golang.org/api/google-api-go-generator/testdata/arrayofmapofstrings.want
generated
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
// Package arrayofmapofstrings provides access to the Example API.
|
||||
//
|
||||
// Usage example:
|
||||
//
|
||||
// import "google.golang.org/api/arrayofmapofstrings/v1"
|
||||
// ...
|
||||
// arrayofmapofstringsService, err := arrayofmapofstrings.New(oauthHttpClient)
|
||||
package arrayofmapofstrings // import "google.golang.org/api/arrayofmapofstrings/v1"
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
context "golang.org/x/net/context"
|
||||
ctxhttp "golang.org/x/net/context/ctxhttp"
|
||||
gensupport "google.golang.org/api/gensupport"
|
||||
googleapi "google.golang.org/api/googleapi"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Always reference these packages, just in case the auto-generated code
|
||||
// below doesn't.
|
||||
var _ = bytes.NewBuffer
|
||||
var _ = strconv.Itoa
|
||||
var _ = fmt.Sprintf
|
||||
var _ = json.NewDecoder
|
||||
var _ = io.Copy
|
||||
var _ = url.Parse
|
||||
var _ = gensupport.MarshalJSON
|
||||
var _ = googleapi.Version
|
||||
var _ = errors.New
|
||||
var _ = strings.Replace
|
||||
var _ = context.Canceled
|
||||
var _ = ctxhttp.Do
|
||||
|
||||
const apiId = "arrayofmapofstrings:v1"
|
||||
const apiName = "arrayofmapofstrings"
|
||||
const apiVersion = "v1"
|
||||
const basePath = "https://www.googleapis.com/discovery/v1/apis"
|
||||
|
||||
func New(client *http.Client) (*Service, error) {
|
||||
if client == nil {
|
||||
return nil, errors.New("client is nil")
|
||||
}
|
||||
s := &Service{client: client, BasePath: basePath}
|
||||
return s, nil
|
||||
}
|
||||
|
||||
type Service struct {
|
||||
client *http.Client
|
||||
BasePath string // API endpoint base URL
|
||||
UserAgent string // optional additional User-Agent fragment
|
||||
}
|
||||
|
||||
func (s *Service) userAgent() string {
|
||||
if s.UserAgent == "" {
|
||||
return googleapi.UserAgent
|
||||
}
|
||||
return googleapi.UserAgent + " " + s.UserAgent
|
||||
}
|
||||
|
||||
type Analyze struct {
|
||||
// Errors: List of errors with the data.
|
||||
Errors []map[string]string `json:"errors,omitempty"`
|
||||
|
||||
// ForceSendFields is a list of field names (e.g. "Errors") to
|
||||
// unconditionally include in API requests. By default, fields with
|
||||
// empty values are omitted from API requests. However, any non-pointer,
|
||||
// non-interface field appearing in ForceSendFields will be sent to the
|
||||
// server regardless of whether the field is empty or not. This may be
|
||||
// used to include empty fields in Patch requests.
|
||||
ForceSendFields []string `json:"-"`
|
||||
|
||||
// NullFields is a list of field names (e.g. "Errors") to include in API
|
||||
// requests with the JSON null value. By default, fields with empty
|
||||
// values are omitted from API requests. However, any field with an
|
||||
// empty value appearing in NullFields will be sent to the server as
|
||||
// null. It is an error if a field in this list has a non-empty value.
|
||||
// This may be used to include null fields in Patch requests.
|
||||
NullFields []string `json:"-"`
|
||||
}
|
||||
|
||||
func (s *Analyze) MarshalJSON() ([]byte, error) {
|
||||
type noMethod Analyze
|
||||
raw := noMethod(*s)
|
||||
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
|
||||
}
|
2199
vendor/google.golang.org/api/google-api-go-generator/testdata/blogger-3.json
generated
vendored
Normal file
2199
vendor/google.golang.org/api/google-api-go-generator/testdata/blogger-3.json
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
6736
vendor/google.golang.org/api/google-api-go-generator/testdata/blogger-3.want
generated
vendored
Normal file
6736
vendor/google.golang.org/api/google-api-go-generator/testdata/blogger-3.want
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
33
vendor/google.golang.org/api/google-api-go-generator/testdata/floats.json
generated
vendored
Normal file
33
vendor/google.golang.org/api/google-api-go-generator/testdata/floats.json
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"kind": "discovery#restDescription",
|
||||
"discoveryVersion": "v1",
|
||||
"id": "X:v1",
|
||||
"name": "X",
|
||||
"version": "v1",
|
||||
"title": "X",
|
||||
"documentationLink": "https://cloud.google.com/appengine/docs/admin-api/",
|
||||
"baseUrl": "https://appengine.googleapis.com/",
|
||||
"basePath": "",
|
||||
"rootUrl": "https://appengine.googleapis.com/",
|
||||
"servicePath": "",
|
||||
"batchPath": "batch",
|
||||
"schemas": {
|
||||
"Utilization": {
|
||||
"id": "Utilization",
|
||||
"type": "object",
|
||||
"description": "CPU utilization policy.",
|
||||
"properties": {
|
||||
"target": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"count": {
|
||||
"type": "integer"
|
||||
},
|
||||
"average": {
|
||||
"type": "number"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
114
vendor/google.golang.org/api/google-api-go-generator/testdata/floats.want
generated
vendored
Normal file
114
vendor/google.golang.org/api/google-api-go-generator/testdata/floats.want
generated
vendored
Normal file
@@ -0,0 +1,114 @@
|
||||
// Package x provides access to the X.
|
||||
//
|
||||
// See https://cloud.google.com/appengine/docs/admin-api/
|
||||
//
|
||||
// Usage example:
|
||||
//
|
||||
// import "google.golang.org/api/x/v1"
|
||||
// ...
|
||||
// xService, err := x.New(oauthHttpClient)
|
||||
package x // import "google.golang.org/api/x/v1"
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
context "golang.org/x/net/context"
|
||||
ctxhttp "golang.org/x/net/context/ctxhttp"
|
||||
gensupport "google.golang.org/api/gensupport"
|
||||
googleapi "google.golang.org/api/googleapi"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Always reference these packages, just in case the auto-generated code
|
||||
// below doesn't.
|
||||
var _ = bytes.NewBuffer
|
||||
var _ = strconv.Itoa
|
||||
var _ = fmt.Sprintf
|
||||
var _ = json.NewDecoder
|
||||
var _ = io.Copy
|
||||
var _ = url.Parse
|
||||
var _ = gensupport.MarshalJSON
|
||||
var _ = googleapi.Version
|
||||
var _ = errors.New
|
||||
var _ = strings.Replace
|
||||
var _ = context.Canceled
|
||||
var _ = ctxhttp.Do
|
||||
|
||||
const apiId = "X:v1"
|
||||
const apiName = "X"
|
||||
const apiVersion = "v1"
|
||||
const basePath = "https://appengine.googleapis.com/"
|
||||
|
||||
func New(client *http.Client) (*Service, error) {
|
||||
if client == nil {
|
||||
return nil, errors.New("client is nil")
|
||||
}
|
||||
s := &Service{client: client, BasePath: basePath}
|
||||
return s, nil
|
||||
}
|
||||
|
||||
type Service struct {
|
||||
client *http.Client
|
||||
BasePath string // API endpoint base URL
|
||||
UserAgent string // optional additional User-Agent fragment
|
||||
}
|
||||
|
||||
func (s *Service) userAgent() string {
|
||||
if s.UserAgent == "" {
|
||||
return googleapi.UserAgent
|
||||
}
|
||||
return googleapi.UserAgent + " " + s.UserAgent
|
||||
}
|
||||
|
||||
// Utilization: CPU utilization policy.
|
||||
type Utilization struct {
|
||||
Average float64 `json:"average,omitempty"`
|
||||
|
||||
Count int64 `json:"count,omitempty"`
|
||||
|
||||
Target float64 `json:"target,omitempty"`
|
||||
|
||||
// ForceSendFields is a list of field names (e.g. "Average") to
|
||||
// unconditionally include in API requests. By default, fields with
|
||||
// empty values are omitted from API requests. However, any non-pointer,
|
||||
// non-interface field appearing in ForceSendFields will be sent to the
|
||||
// server regardless of whether the field is empty or not. This may be
|
||||
// used to include empty fields in Patch requests.
|
||||
ForceSendFields []string `json:"-"`
|
||||
|
||||
// NullFields is a list of field names (e.g. "Average") to include in
|
||||
// API requests with the JSON null value. By default, fields with empty
|
||||
// values are omitted from API requests. However, any field with an
|
||||
// empty value appearing in NullFields will be sent to the server as
|
||||
// null. It is an error if a field in this list has a non-empty value.
|
||||
// This may be used to include null fields in Patch requests.
|
||||
NullFields []string `json:"-"`
|
||||
}
|
||||
|
||||
func (s *Utilization) MarshalJSON() ([]byte, error) {
|
||||
type noMethod Utilization
|
||||
raw := noMethod(*s)
|
||||
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
|
||||
}
|
||||
|
||||
func (s *Utilization) UnmarshalJSON(data []byte) error {
|
||||
type noMethod Utilization
|
||||
var s1 struct {
|
||||
Average gensupport.JSONFloat64 `json:"average"`
|
||||
Target gensupport.JSONFloat64 `json:"target"`
|
||||
*noMethod
|
||||
}
|
||||
s1.noMethod = (*noMethod)(s)
|
||||
if err := json.Unmarshal(data, &s1); err != nil {
|
||||
return err
|
||||
}
|
||||
s.Average = float64(s1.Average)
|
||||
s.Target = float64(s1.Target)
|
||||
return nil
|
||||
}
|
89
vendor/google.golang.org/api/google-api-go-generator/testdata/getwithoutbody.json
generated
vendored
Normal file
89
vendor/google.golang.org/api/google-api-go-generator/testdata/getwithoutbody.json
generated
vendored
Normal file
@@ -0,0 +1,89 @@
|
||||
{
|
||||
"kind": "discovery#restDescription",
|
||||
"etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/3m5rB86FE5KuW1K3jAl88AxCreg\"",
|
||||
"discoveryVersion": "v1",
|
||||
"id": "getwithoutbody:v1",
|
||||
"name": "getwithoutbody",
|
||||
"version": "v1",
|
||||
"title": "Example API",
|
||||
"description": "The Example API demonstrates a GET with a request.",
|
||||
"ownerDomain": "google.com",
|
||||
"ownerName": "Google",
|
||||
"protocol": "rest",
|
||||
"schemas": {
|
||||
"ListMetricRequest": {
|
||||
"id": "ListMetricRequest",
|
||||
"type": "object",
|
||||
"description": "The request of getwithoutbody.metricDescriptors.list.",
|
||||
"properties": {
|
||||
"kind": {
|
||||
"type": "string",
|
||||
"description": "Identifies what kind of resource this is. Value: the fixed string \"getwithoutbody#listMetricRequest\".",
|
||||
"default": "getwithoutbody#listMetricRequest"
|
||||
}
|
||||
}
|
||||
},
|
||||
"ListMetricResponse": {
|
||||
"id": "ListMetricResponse",
|
||||
"type": "object",
|
||||
"description": "The response of getwithoutbody.metricDescriptors.list.",
|
||||
"properties": {
|
||||
"kind": {
|
||||
"type": "string",
|
||||
"description": "Identifies what kind of resource this is. Value: the fixed string \"getwithoutbody#listMetricResponse\".",
|
||||
"default": "getwithoutbody#listMetricResponse"
|
||||
},
|
||||
"nextPageToken": {
|
||||
"type": "string",
|
||||
"description": "Pagination token. If present, indicates that additional results are available for retrieval. To access the results past the pagination limit, set this value to the pageToken query parameter."
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"resources": {
|
||||
"metricDescriptors": {
|
||||
"methods": {
|
||||
"list": {
|
||||
"id": "getwithoutbody.metricDescriptors.list",
|
||||
"path": "{project}/metricDescriptors",
|
||||
"httpMethod": "GET",
|
||||
"description": "List all of the available metric descriptors. Large number of metric descriptors will be paginated, use the nextPageToken returned in the response to request subsequent pages of results by setting the pageToken query parameter to the value of the nextPageToken.",
|
||||
"parameters": {
|
||||
"count": {
|
||||
"type": "integer",
|
||||
"description": "Maximum number of metric descriptors per page. Used for pagination. If not specified, count = 100.",
|
||||
"default": "100",
|
||||
"format": "int32",
|
||||
"minimum": "1",
|
||||
"maximum": "1000",
|
||||
"location": "query"
|
||||
},
|
||||
"pageToken": {
|
||||
"type": "string",
|
||||
"description": "The pagination token, which is used to page through large result sets. Set this value to the value of the nextPageToken to retrieve the next page of results.",
|
||||
"location": "query"
|
||||
},
|
||||
"project": {
|
||||
"type": "string",
|
||||
"description": "The project id. The value can be the numeric project ID or string-based project name.",
|
||||
"required": true,
|
||||
"location": "path"
|
||||
}
|
||||
},
|
||||
"parameterOrder": [
|
||||
"project"
|
||||
],
|
||||
"request": {
|
||||
"$ref": "ListMetricRequest"
|
||||
},
|
||||
"response": {
|
||||
"$ref": "ListMetricResponse"
|
||||
},
|
||||
"scopes": [
|
||||
"https://www.googleapis.com/auth/getwithoutbody.readonly"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
344
vendor/google.golang.org/api/google-api-go-generator/testdata/getwithoutbody.want
generated
vendored
Normal file
344
vendor/google.golang.org/api/google-api-go-generator/testdata/getwithoutbody.want
generated
vendored
Normal file
@@ -0,0 +1,344 @@
|
||||
// Package getwithoutbody provides access to the Example API.
|
||||
//
|
||||
// Usage example:
|
||||
//
|
||||
// import "google.golang.org/api/getwithoutbody/v1"
|
||||
// ...
|
||||
// getwithoutbodyService, err := getwithoutbody.New(oauthHttpClient)
|
||||
package getwithoutbody // import "google.golang.org/api/getwithoutbody/v1"
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
context "golang.org/x/net/context"
|
||||
ctxhttp "golang.org/x/net/context/ctxhttp"
|
||||
gensupport "google.golang.org/api/gensupport"
|
||||
googleapi "google.golang.org/api/googleapi"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Always reference these packages, just in case the auto-generated code
|
||||
// below doesn't.
|
||||
var _ = bytes.NewBuffer
|
||||
var _ = strconv.Itoa
|
||||
var _ = fmt.Sprintf
|
||||
var _ = json.NewDecoder
|
||||
var _ = io.Copy
|
||||
var _ = url.Parse
|
||||
var _ = gensupport.MarshalJSON
|
||||
var _ = googleapi.Version
|
||||
var _ = errors.New
|
||||
var _ = strings.Replace
|
||||
var _ = context.Canceled
|
||||
var _ = ctxhttp.Do
|
||||
|
||||
const apiId = "getwithoutbody:v1"
|
||||
const apiName = "getwithoutbody"
|
||||
const apiVersion = "v1"
|
||||
const basePath = "https://www.googleapis.com/discovery/v1/apis"
|
||||
|
||||
func New(client *http.Client) (*Service, error) {
|
||||
if client == nil {
|
||||
return nil, errors.New("client is nil")
|
||||
}
|
||||
s := &Service{client: client, BasePath: basePath}
|
||||
s.MetricDescriptors = NewMetricDescriptorsService(s)
|
||||
return s, nil
|
||||
}
|
||||
|
||||
type Service struct {
|
||||
client *http.Client
|
||||
BasePath string // API endpoint base URL
|
||||
UserAgent string // optional additional User-Agent fragment
|
||||
|
||||
MetricDescriptors *MetricDescriptorsService
|
||||
}
|
||||
|
||||
func (s *Service) userAgent() string {
|
||||
if s.UserAgent == "" {
|
||||
return googleapi.UserAgent
|
||||
}
|
||||
return googleapi.UserAgent + " " + s.UserAgent
|
||||
}
|
||||
|
||||
func NewMetricDescriptorsService(s *Service) *MetricDescriptorsService {
|
||||
rs := &MetricDescriptorsService{s: s}
|
||||
return rs
|
||||
}
|
||||
|
||||
type MetricDescriptorsService struct {
|
||||
s *Service
|
||||
}
|
||||
|
||||
// ListMetricRequest: The request of
|
||||
// getwithoutbody.metricDescriptors.list.
|
||||
type ListMetricRequest struct {
|
||||
// Kind: Identifies what kind of resource this is. Value: the fixed
|
||||
// string "getwithoutbody#listMetricRequest".
|
||||
Kind string `json:"kind,omitempty"`
|
||||
|
||||
// ForceSendFields is a list of field names (e.g. "Kind") to
|
||||
// unconditionally include in API requests. By default, fields with
|
||||
// empty values are omitted from API requests. However, any non-pointer,
|
||||
// non-interface field appearing in ForceSendFields will be sent to the
|
||||
// server regardless of whether the field is empty or not. This may be
|
||||
// used to include empty fields in Patch requests.
|
||||
ForceSendFields []string `json:"-"`
|
||||
|
||||
// NullFields is a list of field names (e.g. "Kind") to include in API
|
||||
// requests with the JSON null value. By default, fields with empty
|
||||
// values are omitted from API requests. However, any field with an
|
||||
// empty value appearing in NullFields will be sent to the server as
|
||||
// null. It is an error if a field in this list has a non-empty value.
|
||||
// This may be used to include null fields in Patch requests.
|
||||
NullFields []string `json:"-"`
|
||||
}
|
||||
|
||||
func (s *ListMetricRequest) MarshalJSON() ([]byte, error) {
|
||||
type noMethod ListMetricRequest
|
||||
raw := noMethod(*s)
|
||||
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
|
||||
}
|
||||
|
||||
// ListMetricResponse: The response of
|
||||
// getwithoutbody.metricDescriptors.list.
|
||||
type ListMetricResponse struct {
|
||||
// Kind: Identifies what kind of resource this is. Value: the fixed
|
||||
// string "getwithoutbody#listMetricResponse".
|
||||
Kind string `json:"kind,omitempty"`
|
||||
|
||||
// NextPageToken: Pagination token. If present, indicates that
|
||||
// additional results are available for retrieval. To access the results
|
||||
// past the pagination limit, set this value to the pageToken query
|
||||
// parameter.
|
||||
NextPageToken string `json:"nextPageToken,omitempty"`
|
||||
|
||||
// ServerResponse contains the HTTP response code and headers from the
|
||||
// server.
|
||||
googleapi.ServerResponse `json:"-"`
|
||||
|
||||
// ForceSendFields is a list of field names (e.g. "Kind") to
|
||||
// unconditionally include in API requests. By default, fields with
|
||||
// empty values are omitted from API requests. However, any non-pointer,
|
||||
// non-interface field appearing in ForceSendFields will be sent to the
|
||||
// server regardless of whether the field is empty or not. This may be
|
||||
// used to include empty fields in Patch requests.
|
||||
ForceSendFields []string `json:"-"`
|
||||
|
||||
// NullFields is a list of field names (e.g. "Kind") to include in API
|
||||
// requests with the JSON null value. By default, fields with empty
|
||||
// values are omitted from API requests. However, any field with an
|
||||
// empty value appearing in NullFields will be sent to the server as
|
||||
// null. It is an error if a field in this list has a non-empty value.
|
||||
// This may be used to include null fields in Patch requests.
|
||||
NullFields []string `json:"-"`
|
||||
}
|
||||
|
||||
func (s *ListMetricResponse) MarshalJSON() ([]byte, error) {
|
||||
type noMethod ListMetricResponse
|
||||
raw := noMethod(*s)
|
||||
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
|
||||
}
|
||||
|
||||
// method id "getwithoutbody.metricDescriptors.list":
|
||||
|
||||
type MetricDescriptorsListCall struct {
|
||||
s *Service
|
||||
project string
|
||||
listmetricrequest *ListMetricRequest
|
||||
urlParams_ gensupport.URLParams
|
||||
ifNoneMatch_ string
|
||||
ctx_ context.Context
|
||||
header_ http.Header
|
||||
}
|
||||
|
||||
// List: List all of the available metric descriptors. Large number of
|
||||
// metric descriptors will be paginated, use the nextPageToken returned
|
||||
// in the response to request subsequent pages of results by setting the
|
||||
// pageToken query parameter to the value of the nextPageToken.
|
||||
func (r *MetricDescriptorsService) List(project string, listmetricrequest *ListMetricRequest) *MetricDescriptorsListCall {
|
||||
c := &MetricDescriptorsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
|
||||
c.project = project
|
||||
c.listmetricrequest = listmetricrequest
|
||||
return c
|
||||
}
|
||||
|
||||
// Count sets the optional parameter "count": Maximum number of metric
|
||||
// descriptors per page. Used for pagination. If not specified, count =
|
||||
// 100.
|
||||
func (c *MetricDescriptorsListCall) Count(count int64) *MetricDescriptorsListCall {
|
||||
c.urlParams_.Set("count", fmt.Sprint(count))
|
||||
return c
|
||||
}
|
||||
|
||||
// PageToken sets the optional parameter "pageToken": The pagination
|
||||
// token, which is used to page through large result sets. Set this
|
||||
// value to the value of the nextPageToken to retrieve the next page of
|
||||
// results.
|
||||
func (c *MetricDescriptorsListCall) PageToken(pageToken string) *MetricDescriptorsListCall {
|
||||
c.urlParams_.Set("pageToken", pageToken)
|
||||
return c
|
||||
}
|
||||
|
||||
// Fields allows partial responses to be retrieved. See
|
||||
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
|
||||
// for more information.
|
||||
func (c *MetricDescriptorsListCall) Fields(s ...googleapi.Field) *MetricDescriptorsListCall {
|
||||
c.urlParams_.Set("fields", googleapi.CombineFields(s))
|
||||
return c
|
||||
}
|
||||
|
||||
// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response
|
||||
// error from Do is the result of In-None-Match.
|
||||
func (c *MetricDescriptorsListCall) IfNoneMatch(entityTag string) *MetricDescriptorsListCall {
|
||||
c.ifNoneMatch_ = entityTag
|
||||
return c
|
||||
}
|
||||
|
||||
// Context sets the context to be used in this call's Do method. Any
|
||||
// pending HTTP request will be aborted if the provided context is
|
||||
// canceled.
|
||||
func (c *MetricDescriptorsListCall) Context(ctx context.Context) *MetricDescriptorsListCall {
|
||||
c.ctx_ = ctx
|
||||
return c
|
||||
}
|
||||
|
||||
// Header returns an http.Header that can be modified by the caller to
|
||||
// add HTTP headers to the request.
|
||||
func (c *MetricDescriptorsListCall) Header() http.Header {
|
||||
if c.header_ == nil {
|
||||
c.header_ = make(http.Header)
|
||||
}
|
||||
return c.header_
|
||||
}
|
||||
|
||||
func (c *MetricDescriptorsListCall) doRequest(alt string) (*http.Response, error) {
|
||||
reqHeaders := make(http.Header)
|
||||
for k, v := range c.header_ {
|
||||
reqHeaders[k] = v
|
||||
}
|
||||
reqHeaders.Set("User-Agent", c.s.userAgent())
|
||||
if c.ifNoneMatch_ != "" {
|
||||
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
|
||||
}
|
||||
var body io.Reader = nil
|
||||
c.urlParams_.Set("alt", alt)
|
||||
urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/metricDescriptors")
|
||||
urls += "?" + c.urlParams_.Encode()
|
||||
req, _ := http.NewRequest("GET", urls, body)
|
||||
req.Header = reqHeaders
|
||||
googleapi.Expand(req.URL, map[string]string{
|
||||
"project": c.project,
|
||||
})
|
||||
return gensupport.SendRequest(c.ctx_, c.s.client, req)
|
||||
}
|
||||
|
||||
// Do executes the "getwithoutbody.metricDescriptors.list" call.
|
||||
// Exactly one of *ListMetricResponse or error will be non-nil. Any
|
||||
// non-2xx status code is an error. Response headers are in either
|
||||
// *ListMetricResponse.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 (c *MetricDescriptorsListCall) Do(opts ...googleapi.CallOption) (*ListMetricResponse, error) {
|
||||
gensupport.SetOptions(c.urlParams_, opts...)
|
||||
res, err := c.doRequest("json")
|
||||
if res != nil && res.StatusCode == http.StatusNotModified {
|
||||
if res.Body != nil {
|
||||
res.Body.Close()
|
||||
}
|
||||
return nil, &googleapi.Error{
|
||||
Code: res.StatusCode,
|
||||
Header: res.Header,
|
||||
}
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer googleapi.CloseBody(res)
|
||||
if err := googleapi.CheckResponse(res); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ret := &ListMetricResponse{
|
||||
ServerResponse: googleapi.ServerResponse{
|
||||
Header: res.Header,
|
||||
HTTPStatusCode: res.StatusCode,
|
||||
},
|
||||
}
|
||||
target := &ret
|
||||
if err := json.NewDecoder(res.Body).Decode(target); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return ret, nil
|
||||
// {
|
||||
// "description": "List all of the available metric descriptors. Large number of metric descriptors will be paginated, use the nextPageToken returned in the response to request subsequent pages of results by setting the pageToken query parameter to the value of the nextPageToken.",
|
||||
// "httpMethod": "GET",
|
||||
// "id": "getwithoutbody.metricDescriptors.list",
|
||||
// "parameterOrder": [
|
||||
// "project"
|
||||
// ],
|
||||
// "parameters": {
|
||||
// "count": {
|
||||
// "default": "100",
|
||||
// "description": "Maximum number of metric descriptors per page. Used for pagination. If not specified, count = 100.",
|
||||
// "format": "int32",
|
||||
// "location": "query",
|
||||
// "maximum": "1000",
|
||||
// "minimum": "1",
|
||||
// "type": "integer"
|
||||
// },
|
||||
// "pageToken": {
|
||||
// "description": "The pagination token, which is used to page through large result sets. Set this value to the value of the nextPageToken to retrieve the next page of results.",
|
||||
// "location": "query",
|
||||
// "type": "string"
|
||||
// },
|
||||
// "project": {
|
||||
// "description": "The project id. The value can be the numeric project ID or string-based project name.",
|
||||
// "location": "path",
|
||||
// "required": true,
|
||||
// "type": "string"
|
||||
// }
|
||||
// },
|
||||
// "path": "{project}/metricDescriptors",
|
||||
// "request": {
|
||||
// "$ref": "ListMetricRequest"
|
||||
// },
|
||||
// "response": {
|
||||
// "$ref": "ListMetricResponse"
|
||||
// },
|
||||
// "scopes": [
|
||||
// "https://www.googleapis.com/auth/getwithoutbody.readonly"
|
||||
// ]
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
// 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 (c *MetricDescriptorsListCall) Pages(ctx context.Context, f func(*ListMetricResponse) error) error {
|
||||
c.ctx_ = ctx
|
||||
defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
|
||||
for {
|
||||
x, err := c.Do()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := f(x); err != nil {
|
||||
return err
|
||||
}
|
||||
if x.NextPageToken == "" {
|
||||
return nil
|
||||
}
|
||||
c.PageToken(x.NextPageToken)
|
||||
}
|
||||
}
|
51
vendor/google.golang.org/api/google-api-go-generator/testdata/mapofany.json
generated
vendored
Normal file
51
vendor/google.golang.org/api/google-api-go-generator/testdata/mapofany.json
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"kind": "discovery#restDescription",
|
||||
"etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/3m5rB86FE5KuW1K3jAl88AxCreg\"",
|
||||
"discoveryVersion": "v1",
|
||||
"id": "mapofany:v1",
|
||||
"name": "mapofany",
|
||||
"version": "v1",
|
||||
"title": "Example API",
|
||||
"description": "The Example API demonstrates an associative array.",
|
||||
"ownerDomain": "google.com",
|
||||
"ownerName": "Google",
|
||||
"protocol": "rest",
|
||||
"schemas": {
|
||||
"TableDataInsertAllRequest": {
|
||||
"id": "TableDataInsertAllRequest",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"kind": {
|
||||
"type": "string",
|
||||
"description": "The resource type of the response.",
|
||||
"default": "bigquery#tableDataInsertAllRequest"
|
||||
},
|
||||
"rows": {
|
||||
"type": "array",
|
||||
"description": "The rows to insert.",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"json": {
|
||||
"$ref": "JsonObject",
|
||||
"description": "[Required] A JSON object that contains a row of data. The object's properties and values must match the destination table's schema."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"JsonObject": {
|
||||
"id": "JsonObject",
|
||||
"type": "object",
|
||||
"description": "Represents a single JSON object.",
|
||||
"additionalProperties": {
|
||||
"$ref": "JsonValue"
|
||||
}
|
||||
},
|
||||
"JsonValue": {
|
||||
"id": "JsonValue",
|
||||
"type": "any"
|
||||
}
|
||||
}
|
||||
}
|
126
vendor/google.golang.org/api/google-api-go-generator/testdata/mapofany.want
generated
vendored
Normal file
126
vendor/google.golang.org/api/google-api-go-generator/testdata/mapofany.want
generated
vendored
Normal file
@@ -0,0 +1,126 @@
|
||||
// Package mapofany provides access to the Example API.
|
||||
//
|
||||
// Usage example:
|
||||
//
|
||||
// import "google.golang.org/api/mapofany/v1"
|
||||
// ...
|
||||
// mapofanyService, err := mapofany.New(oauthHttpClient)
|
||||
package mapofany // import "google.golang.org/api/mapofany/v1"
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
context "golang.org/x/net/context"
|
||||
ctxhttp "golang.org/x/net/context/ctxhttp"
|
||||
gensupport "google.golang.org/api/gensupport"
|
||||
googleapi "google.golang.org/api/googleapi"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Always reference these packages, just in case the auto-generated code
|
||||
// below doesn't.
|
||||
var _ = bytes.NewBuffer
|
||||
var _ = strconv.Itoa
|
||||
var _ = fmt.Sprintf
|
||||
var _ = json.NewDecoder
|
||||
var _ = io.Copy
|
||||
var _ = url.Parse
|
||||
var _ = gensupport.MarshalJSON
|
||||
var _ = googleapi.Version
|
||||
var _ = errors.New
|
||||
var _ = strings.Replace
|
||||
var _ = context.Canceled
|
||||
var _ = ctxhttp.Do
|
||||
|
||||
const apiId = "mapofany:v1"
|
||||
const apiName = "mapofany"
|
||||
const apiVersion = "v1"
|
||||
const basePath = "https://www.googleapis.com/discovery/v1/apis"
|
||||
|
||||
func New(client *http.Client) (*Service, error) {
|
||||
if client == nil {
|
||||
return nil, errors.New("client is nil")
|
||||
}
|
||||
s := &Service{client: client, BasePath: basePath}
|
||||
return s, nil
|
||||
}
|
||||
|
||||
type Service struct {
|
||||
client *http.Client
|
||||
BasePath string // API endpoint base URL
|
||||
UserAgent string // optional additional User-Agent fragment
|
||||
}
|
||||
|
||||
func (s *Service) userAgent() string {
|
||||
if s.UserAgent == "" {
|
||||
return googleapi.UserAgent
|
||||
}
|
||||
return googleapi.UserAgent + " " + s.UserAgent
|
||||
}
|
||||
|
||||
type JsonValue interface{}
|
||||
|
||||
type TableDataInsertAllRequest struct {
|
||||
// Kind: The resource type of the response.
|
||||
Kind string `json:"kind,omitempty"`
|
||||
|
||||
// Rows: The rows to insert.
|
||||
Rows []*TableDataInsertAllRequestRows `json:"rows,omitempty"`
|
||||
|
||||
// ForceSendFields is a list of field names (e.g. "Kind") to
|
||||
// unconditionally include in API requests. By default, fields with
|
||||
// empty values are omitted from API requests. However, any non-pointer,
|
||||
// non-interface field appearing in ForceSendFields will be sent to the
|
||||
// server regardless of whether the field is empty or not. This may be
|
||||
// used to include empty fields in Patch requests.
|
||||
ForceSendFields []string `json:"-"`
|
||||
|
||||
// NullFields is a list of field names (e.g. "Kind") to include in API
|
||||
// requests with the JSON null value. By default, fields with empty
|
||||
// values are omitted from API requests. However, any field with an
|
||||
// empty value appearing in NullFields will be sent to the server as
|
||||
// null. It is an error if a field in this list has a non-empty value.
|
||||
// This may be used to include null fields in Patch requests.
|
||||
NullFields []string `json:"-"`
|
||||
}
|
||||
|
||||
func (s *TableDataInsertAllRequest) MarshalJSON() ([]byte, error) {
|
||||
type noMethod TableDataInsertAllRequest
|
||||
raw := noMethod(*s)
|
||||
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
|
||||
}
|
||||
|
||||
type TableDataInsertAllRequestRows struct {
|
||||
// Json: [Required] A JSON object that contains a row of data. The
|
||||
// object's properties and values must match the destination table's
|
||||
// schema.
|
||||
Json map[string]JsonValue `json:"json,omitempty"`
|
||||
|
||||
// ForceSendFields is a list of field names (e.g. "Json") to
|
||||
// unconditionally include in API requests. By default, fields with
|
||||
// empty values are omitted from API requests. However, any non-pointer,
|
||||
// non-interface field appearing in ForceSendFields will be sent to the
|
||||
// server regardless of whether the field is empty or not. This may be
|
||||
// used to include empty fields in Patch requests.
|
||||
ForceSendFields []string `json:"-"`
|
||||
|
||||
// NullFields is a list of field names (e.g. "Json") to include in API
|
||||
// requests with the JSON null value. By default, fields with empty
|
||||
// values are omitted from API requests. However, any field with an
|
||||
// empty value appearing in NullFields will be sent to the server as
|
||||
// null. It is an error if a field in this list has a non-empty value.
|
||||
// This may be used to include null fields in Patch requests.
|
||||
NullFields []string `json:"-"`
|
||||
}
|
||||
|
||||
func (s *TableDataInsertAllRequestRows) MarshalJSON() ([]byte, error) {
|
||||
type noMethod TableDataInsertAllRequestRows
|
||||
raw := noMethod(*s)
|
||||
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
|
||||
}
|
76
vendor/google.golang.org/api/google-api-go-generator/testdata/mapofarrayofobjects.json
generated
vendored
Normal file
76
vendor/google.golang.org/api/google-api-go-generator/testdata/mapofarrayofobjects.json
generated
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
{
|
||||
"kind": "discovery#restDescription",
|
||||
"etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/3m5rB86FE5KuW1K3jAl88AxCreg\"",
|
||||
"discoveryVersion": "v1",
|
||||
"id": "additionalprops:v1",
|
||||
"name": "additionalprops",
|
||||
"version": "v1",
|
||||
"title": "Example API",
|
||||
"description": "The Example API demonstrates an associative array.",
|
||||
"ownerDomain": "google.com",
|
||||
"ownerName": "Google",
|
||||
"protocol": "rest",
|
||||
"schemas": {
|
||||
"TimeseriesDescriptor": {
|
||||
"id": "TimeseriesDescriptor",
|
||||
"type": "object",
|
||||
"description": "The descriptions of a time series.",
|
||||
"properties": {
|
||||
"labels": {
|
||||
"type": "object",
|
||||
"description": "The set of key-value pairs that describe this time series, including target-specific labels and metric-specific labels.",
|
||||
"additionalProperties": {
|
||||
"type": "string",
|
||||
"description": "The label's name."
|
||||
}
|
||||
},
|
||||
"metric": {
|
||||
"type": "string",
|
||||
"description": "The name of the metric."
|
||||
},
|
||||
"project": {
|
||||
"type": "string",
|
||||
"description": "The project ID to which this time series belongs."
|
||||
},
|
||||
"tags": {
|
||||
"type": "object",
|
||||
"description": "A map of additional information.",
|
||||
"additionalProperties": {
|
||||
"type": "array",
|
||||
"description": "A string which maps to an array of values.",
|
||||
"items": {
|
||||
"$ref": "Property"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"GetMapResponse": {
|
||||
"id": "GetMapResponse",
|
||||
"type": "object",
|
||||
"description": "Response of getting a map.",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"Property": {
|
||||
"id": "Property",
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"resources": {
|
||||
"atlas": {
|
||||
"methods": {
|
||||
"getMap": {
|
||||
"id": "mapofstrings.getMap",
|
||||
"path": "map",
|
||||
"httpMethod": "GET",
|
||||
"description": "Get a map.",
|
||||
"response": {
|
||||
"$ref": "GetMapResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
216
vendor/google.golang.org/api/google-api-go-generator/testdata/mapofarrayofobjects.want
generated
vendored
Normal file
216
vendor/google.golang.org/api/google-api-go-generator/testdata/mapofarrayofobjects.want
generated
vendored
Normal file
@@ -0,0 +1,216 @@
|
||||
// Package additionalprops provides access to the Example API.
|
||||
//
|
||||
// Usage example:
|
||||
//
|
||||
// import "google.golang.org/api/additionalprops/v1"
|
||||
// ...
|
||||
// additionalpropsService, err := additionalprops.New(oauthHttpClient)
|
||||
package additionalprops // import "google.golang.org/api/additionalprops/v1"
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
context "golang.org/x/net/context"
|
||||
ctxhttp "golang.org/x/net/context/ctxhttp"
|
||||
gensupport "google.golang.org/api/gensupport"
|
||||
googleapi "google.golang.org/api/googleapi"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Always reference these packages, just in case the auto-generated code
|
||||
// below doesn't.
|
||||
var _ = bytes.NewBuffer
|
||||
var _ = strconv.Itoa
|
||||
var _ = fmt.Sprintf
|
||||
var _ = json.NewDecoder
|
||||
var _ = io.Copy
|
||||
var _ = url.Parse
|
||||
var _ = gensupport.MarshalJSON
|
||||
var _ = googleapi.Version
|
||||
var _ = errors.New
|
||||
var _ = strings.Replace
|
||||
var _ = context.Canceled
|
||||
var _ = ctxhttp.Do
|
||||
|
||||
const apiId = "additionalprops:v1"
|
||||
const apiName = "additionalprops"
|
||||
const apiVersion = "v1"
|
||||
const basePath = "https://www.googleapis.com/discovery/v1/apis"
|
||||
|
||||
func New(client *http.Client) (*Service, error) {
|
||||
if client == nil {
|
||||
return nil, errors.New("client is nil")
|
||||
}
|
||||
s := &Service{client: client, BasePath: basePath}
|
||||
s.Atlas = NewAtlasService(s)
|
||||
return s, nil
|
||||
}
|
||||
|
||||
type Service struct {
|
||||
client *http.Client
|
||||
BasePath string // API endpoint base URL
|
||||
UserAgent string // optional additional User-Agent fragment
|
||||
|
||||
Atlas *AtlasService
|
||||
}
|
||||
|
||||
func (s *Service) userAgent() string {
|
||||
if s.UserAgent == "" {
|
||||
return googleapi.UserAgent
|
||||
}
|
||||
return googleapi.UserAgent + " " + s.UserAgent
|
||||
}
|
||||
|
||||
func NewAtlasService(s *Service) *AtlasService {
|
||||
rs := &AtlasService{s: s}
|
||||
return rs
|
||||
}
|
||||
|
||||
type AtlasService struct {
|
||||
s *Service
|
||||
}
|
||||
|
||||
type Property struct {
|
||||
}
|
||||
|
||||
// TimeseriesDescriptor: The descriptions of a time series.
|
||||
type TimeseriesDescriptor struct {
|
||||
// Labels: The set of key-value pairs that describe this time series,
|
||||
// including target-specific labels and metric-specific labels.
|
||||
Labels map[string]string `json:"labels,omitempty"`
|
||||
|
||||
// Metric: The name of the metric.
|
||||
Metric string `json:"metric,omitempty"`
|
||||
|
||||
// Project: The project ID to which this time series belongs.
|
||||
Project string `json:"project,omitempty"`
|
||||
|
||||
// Tags: A map of additional information.
|
||||
Tags map[string][]Property `json:"tags,omitempty"`
|
||||
|
||||
// ForceSendFields is a list of field names (e.g. "Labels") to
|
||||
// unconditionally include in API requests. By default, fields with
|
||||
// empty values are omitted from API requests. However, any non-pointer,
|
||||
// non-interface field appearing in ForceSendFields will be sent to the
|
||||
// server regardless of whether the field is empty or not. This may be
|
||||
// used to include empty fields in Patch requests.
|
||||
ForceSendFields []string `json:"-"`
|
||||
|
||||
// NullFields is a list of field names (e.g. "Labels") to include in API
|
||||
// requests with the JSON null value. By default, fields with empty
|
||||
// values are omitted from API requests. However, any field with an
|
||||
// empty value appearing in NullFields will be sent to the server as
|
||||
// null. It is an error if a field in this list has a non-empty value.
|
||||
// This may be used to include null fields in Patch requests.
|
||||
NullFields []string `json:"-"`
|
||||
}
|
||||
|
||||
func (s *TimeseriesDescriptor) MarshalJSON() ([]byte, error) {
|
||||
type noMethod TimeseriesDescriptor
|
||||
raw := noMethod(*s)
|
||||
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
|
||||
}
|
||||
|
||||
// method id "mapofstrings.getMap":
|
||||
|
||||
type AtlasGetMapCall struct {
|
||||
s *Service
|
||||
urlParams_ gensupport.URLParams
|
||||
ifNoneMatch_ string
|
||||
ctx_ context.Context
|
||||
header_ http.Header
|
||||
}
|
||||
|
||||
// GetMap: Get a map.
|
||||
func (r *AtlasService) GetMap() *AtlasGetMapCall {
|
||||
c := &AtlasGetMapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
|
||||
return c
|
||||
}
|
||||
|
||||
// Fields allows partial responses to be retrieved. See
|
||||
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
|
||||
// for more information.
|
||||
func (c *AtlasGetMapCall) Fields(s ...googleapi.Field) *AtlasGetMapCall {
|
||||
c.urlParams_.Set("fields", googleapi.CombineFields(s))
|
||||
return c
|
||||
}
|
||||
|
||||
// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response
|
||||
// error from Do is the result of In-None-Match.
|
||||
func (c *AtlasGetMapCall) IfNoneMatch(entityTag string) *AtlasGetMapCall {
|
||||
c.ifNoneMatch_ = entityTag
|
||||
return c
|
||||
}
|
||||
|
||||
// Context sets the context to be used in this call's Do method. Any
|
||||
// pending HTTP request will be aborted if the provided context is
|
||||
// canceled.
|
||||
func (c *AtlasGetMapCall) Context(ctx context.Context) *AtlasGetMapCall {
|
||||
c.ctx_ = ctx
|
||||
return c
|
||||
}
|
||||
|
||||
// Header returns an http.Header that can be modified by the caller to
|
||||
// add HTTP headers to the request.
|
||||
func (c *AtlasGetMapCall) Header() http.Header {
|
||||
if c.header_ == nil {
|
||||
c.header_ = make(http.Header)
|
||||
}
|
||||
return c.header_
|
||||
}
|
||||
|
||||
func (c *AtlasGetMapCall) doRequest(alt string) (*http.Response, error) {
|
||||
reqHeaders := make(http.Header)
|
||||
for k, v := range c.header_ {
|
||||
reqHeaders[k] = v
|
||||
}
|
||||
reqHeaders.Set("User-Agent", c.s.userAgent())
|
||||
if c.ifNoneMatch_ != "" {
|
||||
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
|
||||
}
|
||||
var body io.Reader = nil
|
||||
c.urlParams_.Set("alt", alt)
|
||||
urls := googleapi.ResolveRelative(c.s.BasePath, "map")
|
||||
urls += "?" + c.urlParams_.Encode()
|
||||
req, _ := http.NewRequest("GET", urls, body)
|
||||
req.Header = reqHeaders
|
||||
return gensupport.SendRequest(c.ctx_, c.s.client, req)
|
||||
}
|
||||
|
||||
// Do executes the "mapofstrings.getMap" call.
|
||||
func (c *AtlasGetMapCall) Do(opts ...googleapi.CallOption) (map[string]string, error) {
|
||||
gensupport.SetOptions(c.urlParams_, opts...)
|
||||
res, err := c.doRequest("json")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer googleapi.CloseBody(res)
|
||||
if err := googleapi.CheckResponse(res); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var ret map[string]string
|
||||
target := &ret
|
||||
if err := json.NewDecoder(res.Body).Decode(target); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return ret, nil
|
||||
// {
|
||||
// "description": "Get a map.",
|
||||
// "httpMethod": "GET",
|
||||
// "id": "mapofstrings.getMap",
|
||||
// "path": "map",
|
||||
// "response": {
|
||||
// "$ref": "GetMapResponse"
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
34
vendor/google.golang.org/api/google-api-go-generator/testdata/mapofint64strings.json
generated
vendored
Normal file
34
vendor/google.golang.org/api/google-api-go-generator/testdata/mapofint64strings.json
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"kind": "discovery#restDescription",
|
||||
"discoveryVersion": "v1",
|
||||
"id": "androidbuildinternal:v1",
|
||||
"name": "androidbuildinternal",
|
||||
"version": "v1",
|
||||
"description": "proper handling of a map of int64s in string format",
|
||||
"protocol": "rest",
|
||||
"schemas": {
|
||||
"TestResultSummaryToolGroupTestSuite": {
|
||||
"id": "TestResultSummaryToolGroupTestSuite",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"passed": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"passedTestTags": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string",
|
||||
"format": "int64"
|
||||
}
|
||||
},
|
||||
"testTags": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string",
|
||||
"format": "int64"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
95
vendor/google.golang.org/api/google-api-go-generator/testdata/mapofint64strings.want
generated
vendored
Normal file
95
vendor/google.golang.org/api/google-api-go-generator/testdata/mapofint64strings.want
generated
vendored
Normal file
@@ -0,0 +1,95 @@
|
||||
// Package androidbuildinternal provides access to the .
|
||||
//
|
||||
// Usage example:
|
||||
//
|
||||
// import "google.golang.org/api/androidbuildinternal/v1"
|
||||
// ...
|
||||
// androidbuildinternalService, err := androidbuildinternal.New(oauthHttpClient)
|
||||
package androidbuildinternal // import "google.golang.org/api/androidbuildinternal/v1"
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
context "golang.org/x/net/context"
|
||||
ctxhttp "golang.org/x/net/context/ctxhttp"
|
||||
gensupport "google.golang.org/api/gensupport"
|
||||
googleapi "google.golang.org/api/googleapi"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Always reference these packages, just in case the auto-generated code
|
||||
// below doesn't.
|
||||
var _ = bytes.NewBuffer
|
||||
var _ = strconv.Itoa
|
||||
var _ = fmt.Sprintf
|
||||
var _ = json.NewDecoder
|
||||
var _ = io.Copy
|
||||
var _ = url.Parse
|
||||
var _ = gensupport.MarshalJSON
|
||||
var _ = googleapi.Version
|
||||
var _ = errors.New
|
||||
var _ = strings.Replace
|
||||
var _ = context.Canceled
|
||||
var _ = ctxhttp.Do
|
||||
|
||||
const apiId = "androidbuildinternal:v1"
|
||||
const apiName = "androidbuildinternal"
|
||||
const apiVersion = "v1"
|
||||
const basePath = "https://www.googleapis.com/discovery/v1/apis"
|
||||
|
||||
func New(client *http.Client) (*Service, error) {
|
||||
if client == nil {
|
||||
return nil, errors.New("client is nil")
|
||||
}
|
||||
s := &Service{client: client, BasePath: basePath}
|
||||
return s, nil
|
||||
}
|
||||
|
||||
type Service struct {
|
||||
client *http.Client
|
||||
BasePath string // API endpoint base URL
|
||||
UserAgent string // optional additional User-Agent fragment
|
||||
}
|
||||
|
||||
func (s *Service) userAgent() string {
|
||||
if s.UserAgent == "" {
|
||||
return googleapi.UserAgent
|
||||
}
|
||||
return googleapi.UserAgent + " " + s.UserAgent
|
||||
}
|
||||
|
||||
type TestResultSummaryToolGroupTestSuite struct {
|
||||
Passed bool `json:"passed,omitempty"`
|
||||
|
||||
PassedTestTags map[string]string `json:"passedTestTags,omitempty"`
|
||||
|
||||
TestTags map[string]string `json:"testTags,omitempty"`
|
||||
|
||||
// ForceSendFields is a list of field names (e.g. "Passed") to
|
||||
// unconditionally include in API requests. By default, fields with
|
||||
// empty values are omitted from API requests. However, any non-pointer,
|
||||
// non-interface field appearing in ForceSendFields will be sent to the
|
||||
// server regardless of whether the field is empty or not. This may be
|
||||
// used to include empty fields in Patch requests.
|
||||
ForceSendFields []string `json:"-"`
|
||||
|
||||
// NullFields is a list of field names (e.g. "Passed") to include in API
|
||||
// requests with the JSON null value. By default, fields with empty
|
||||
// values are omitted from API requests. However, any field with an
|
||||
// empty value appearing in NullFields will be sent to the server as
|
||||
// null. It is an error if a field in this list has a non-empty value.
|
||||
// This may be used to include null fields in Patch requests.
|
||||
NullFields []string `json:"-"`
|
||||
}
|
||||
|
||||
func (s *TestResultSummaryToolGroupTestSuite) MarshalJSON() ([]byte, error) {
|
||||
type noMethod TestResultSummaryToolGroupTestSuite
|
||||
raw := noMethod(*s)
|
||||
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
|
||||
}
|
35
vendor/google.golang.org/api/google-api-go-generator/testdata/mapofobjects.json
generated
vendored
Normal file
35
vendor/google.golang.org/api/google-api-go-generator/testdata/mapofobjects.json
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"kind": "discovery#restDescription",
|
||||
"etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/3m5rB86FE5KuW1K3jAl88AxCreg\"",
|
||||
"discoveryVersion": "v1",
|
||||
"id": "additionalpropsobjs:v1",
|
||||
"name": "additionalpropsobjs",
|
||||
"version": "v1",
|
||||
"title": "Example API",
|
||||
"description": "The Example API demonstrates an associative array.",
|
||||
"ownerDomain": "google.com",
|
||||
"ownerName": "Google",
|
||||
"protocol": "rest",
|
||||
"schemas": {
|
||||
"Entity": {
|
||||
"id": "Entity",
|
||||
"type": "object",
|
||||
"externalTypeName": "apphosting.client.datastoreservice.proto.Entity",
|
||||
"properties": {
|
||||
"properties": {
|
||||
"type": "object",
|
||||
"description": "The entity's properties.",
|
||||
"additionalProperties": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "The name of the property. Properties with names matching regex \"__.*__\" are reserved. A reserved property name is forbidden in certain documented contexts. The name cannot be \"\"."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
121
vendor/google.golang.org/api/google-api-go-generator/testdata/mapofobjects.want
generated
vendored
Normal file
121
vendor/google.golang.org/api/google-api-go-generator/testdata/mapofobjects.want
generated
vendored
Normal file
@@ -0,0 +1,121 @@
|
||||
// Package additionalpropsobjs provides access to the Example API.
|
||||
//
|
||||
// Usage example:
|
||||
//
|
||||
// import "google.golang.org/api/additionalpropsobjs/v1"
|
||||
// ...
|
||||
// additionalpropsobjsService, err := additionalpropsobjs.New(oauthHttpClient)
|
||||
package additionalpropsobjs // import "google.golang.org/api/additionalpropsobjs/v1"
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
context "golang.org/x/net/context"
|
||||
ctxhttp "golang.org/x/net/context/ctxhttp"
|
||||
gensupport "google.golang.org/api/gensupport"
|
||||
googleapi "google.golang.org/api/googleapi"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Always reference these packages, just in case the auto-generated code
|
||||
// below doesn't.
|
||||
var _ = bytes.NewBuffer
|
||||
var _ = strconv.Itoa
|
||||
var _ = fmt.Sprintf
|
||||
var _ = json.NewDecoder
|
||||
var _ = io.Copy
|
||||
var _ = url.Parse
|
||||
var _ = gensupport.MarshalJSON
|
||||
var _ = googleapi.Version
|
||||
var _ = errors.New
|
||||
var _ = strings.Replace
|
||||
var _ = context.Canceled
|
||||
var _ = ctxhttp.Do
|
||||
|
||||
const apiId = "additionalpropsobjs:v1"
|
||||
const apiName = "additionalpropsobjs"
|
||||
const apiVersion = "v1"
|
||||
const basePath = "https://www.googleapis.com/discovery/v1/apis"
|
||||
|
||||
func New(client *http.Client) (*Service, error) {
|
||||
if client == nil {
|
||||
return nil, errors.New("client is nil")
|
||||
}
|
||||
s := &Service{client: client, BasePath: basePath}
|
||||
return s, nil
|
||||
}
|
||||
|
||||
type Service struct {
|
||||
client *http.Client
|
||||
BasePath string // API endpoint base URL
|
||||
UserAgent string // optional additional User-Agent fragment
|
||||
}
|
||||
|
||||
func (s *Service) userAgent() string {
|
||||
if s.UserAgent == "" {
|
||||
return googleapi.UserAgent
|
||||
}
|
||||
return googleapi.UserAgent + " " + s.UserAgent
|
||||
}
|
||||
|
||||
type Entity struct {
|
||||
// Properties: The entity's properties.
|
||||
Properties map[string]EntityProperties `json:"properties,omitempty"`
|
||||
|
||||
// ForceSendFields is a list of field names (e.g. "Properties") to
|
||||
// unconditionally include in API requests. By default, fields with
|
||||
// empty values are omitted from API requests. However, any non-pointer,
|
||||
// non-interface field appearing in ForceSendFields will be sent to the
|
||||
// server regardless of whether the field is empty or not. This may be
|
||||
// used to include empty fields in Patch requests.
|
||||
ForceSendFields []string `json:"-"`
|
||||
|
||||
// NullFields is a list of field names (e.g. "Properties") to include in
|
||||
// API requests with the JSON null value. By default, fields with empty
|
||||
// values are omitted from API requests. However, any field with an
|
||||
// empty value appearing in NullFields will be sent to the server as
|
||||
// null. It is an error if a field in this list has a non-empty value.
|
||||
// This may be used to include null fields in Patch requests.
|
||||
NullFields []string `json:"-"`
|
||||
}
|
||||
|
||||
func (s *Entity) MarshalJSON() ([]byte, error) {
|
||||
type noMethod Entity
|
||||
raw := noMethod(*s)
|
||||
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
|
||||
}
|
||||
|
||||
type EntityProperties struct {
|
||||
// Name: The name of the property. Properties with names matching regex
|
||||
// "__.*__" are reserved. A reserved property name is forbidden in
|
||||
// certain documented contexts. The name cannot be "".
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// ForceSendFields is a list of field names (e.g. "Name") to
|
||||
// unconditionally include in API requests. By default, fields with
|
||||
// empty values are omitted from API requests. However, any non-pointer,
|
||||
// non-interface field appearing in ForceSendFields will be sent to the
|
||||
// server regardless of whether the field is empty or not. This may be
|
||||
// used to include empty fields in Patch requests.
|
||||
ForceSendFields []string `json:"-"`
|
||||
|
||||
// NullFields is a list of field names (e.g. "Name") to include in API
|
||||
// requests with the JSON null value. By default, fields with empty
|
||||
// values are omitted from API requests. However, any field with an
|
||||
// empty value appearing in NullFields will be sent to the server as
|
||||
// null. It is an error if a field in this list has a non-empty value.
|
||||
// This may be used to include null fields in Patch requests.
|
||||
NullFields []string `json:"-"`
|
||||
}
|
||||
|
||||
func (s *EntityProperties) MarshalJSON() ([]byte, error) {
|
||||
type noMethod EntityProperties
|
||||
raw := noMethod(*s)
|
||||
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
|
||||
}
|
72
vendor/google.golang.org/api/google-api-go-generator/testdata/mapofstrings-1.json
generated
vendored
Normal file
72
vendor/google.golang.org/api/google-api-go-generator/testdata/mapofstrings-1.json
generated
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
{
|
||||
"kind": "discovery#restDescription",
|
||||
"etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/3m5rB86FE5KuW1K3jAl88AxCreg\"",
|
||||
"discoveryVersion": "v1",
|
||||
"id": "additionalprops:v1",
|
||||
"name": "additionalprops",
|
||||
"version": "v1",
|
||||
"title": "Example API",
|
||||
"description": "The Example API demonstrates an associative array.",
|
||||
"ownerDomain": "google.com",
|
||||
"ownerName": "Google",
|
||||
"protocol": "rest",
|
||||
"schemas": {
|
||||
"TimeseriesDescriptor": {
|
||||
"id": "TimeseriesDescriptor",
|
||||
"type": "object",
|
||||
"description": "The descriptions of a time series.",
|
||||
"properties": {
|
||||
"labels": {
|
||||
"type": "object",
|
||||
"description": "The set of key-value pairs that describe this time series, including target-specific labels and metric-specific labels.",
|
||||
"additionalProperties": {
|
||||
"type": "string",
|
||||
"description": "The label's name."
|
||||
}
|
||||
},
|
||||
"metric": {
|
||||
"type": "string",
|
||||
"description": "The name of the metric."
|
||||
},
|
||||
"project": {
|
||||
"type": "string",
|
||||
"description": "The project ID to which this time series belongs."
|
||||
},
|
||||
"tags": {
|
||||
"type": "object",
|
||||
"description": "A map of additional information.",
|
||||
"additionalProperties": {
|
||||
"type": "array",
|
||||
"description": "A string which maps to an array of values.",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"GetMapResponse": {
|
||||
"id": "GetMapResponse",
|
||||
"type": "object",
|
||||
"description": "Response of getting a map.",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"resources": {
|
||||
"atlas": {
|
||||
"methods": {
|
||||
"getMap": {
|
||||
"id": "mapofstrings.getMap",
|
||||
"path": "map",
|
||||
"httpMethod": "GET",
|
||||
"description": "Get a map.",
|
||||
"response": {
|
||||
"$ref": "GetMapResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
213
vendor/google.golang.org/api/google-api-go-generator/testdata/mapofstrings-1.want
generated
vendored
Normal file
213
vendor/google.golang.org/api/google-api-go-generator/testdata/mapofstrings-1.want
generated
vendored
Normal file
@@ -0,0 +1,213 @@
|
||||
// Package additionalprops provides access to the Example API.
|
||||
//
|
||||
// Usage example:
|
||||
//
|
||||
// import "google.golang.org/api/additionalprops/v1"
|
||||
// ...
|
||||
// additionalpropsService, err := additionalprops.New(oauthHttpClient)
|
||||
package additionalprops // import "google.golang.org/api/additionalprops/v1"
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
context "golang.org/x/net/context"
|
||||
ctxhttp "golang.org/x/net/context/ctxhttp"
|
||||
gensupport "google.golang.org/api/gensupport"
|
||||
googleapi "google.golang.org/api/googleapi"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Always reference these packages, just in case the auto-generated code
|
||||
// below doesn't.
|
||||
var _ = bytes.NewBuffer
|
||||
var _ = strconv.Itoa
|
||||
var _ = fmt.Sprintf
|
||||
var _ = json.NewDecoder
|
||||
var _ = io.Copy
|
||||
var _ = url.Parse
|
||||
var _ = gensupport.MarshalJSON
|
||||
var _ = googleapi.Version
|
||||
var _ = errors.New
|
||||
var _ = strings.Replace
|
||||
var _ = context.Canceled
|
||||
var _ = ctxhttp.Do
|
||||
|
||||
const apiId = "additionalprops:v1"
|
||||
const apiName = "additionalprops"
|
||||
const apiVersion = "v1"
|
||||
const basePath = "https://www.googleapis.com/discovery/v1/apis"
|
||||
|
||||
func New(client *http.Client) (*Service, error) {
|
||||
if client == nil {
|
||||
return nil, errors.New("client is nil")
|
||||
}
|
||||
s := &Service{client: client, BasePath: basePath}
|
||||
s.Atlas = NewAtlasService(s)
|
||||
return s, nil
|
||||
}
|
||||
|
||||
type Service struct {
|
||||
client *http.Client
|
||||
BasePath string // API endpoint base URL
|
||||
UserAgent string // optional additional User-Agent fragment
|
||||
|
||||
Atlas *AtlasService
|
||||
}
|
||||
|
||||
func (s *Service) userAgent() string {
|
||||
if s.UserAgent == "" {
|
||||
return googleapi.UserAgent
|
||||
}
|
||||
return googleapi.UserAgent + " " + s.UserAgent
|
||||
}
|
||||
|
||||
func NewAtlasService(s *Service) *AtlasService {
|
||||
rs := &AtlasService{s: s}
|
||||
return rs
|
||||
}
|
||||
|
||||
type AtlasService struct {
|
||||
s *Service
|
||||
}
|
||||
|
||||
// TimeseriesDescriptor: The descriptions of a time series.
|
||||
type TimeseriesDescriptor struct {
|
||||
// Labels: The set of key-value pairs that describe this time series,
|
||||
// including target-specific labels and metric-specific labels.
|
||||
Labels map[string]string `json:"labels,omitempty"`
|
||||
|
||||
// Metric: The name of the metric.
|
||||
Metric string `json:"metric,omitempty"`
|
||||
|
||||
// Project: The project ID to which this time series belongs.
|
||||
Project string `json:"project,omitempty"`
|
||||
|
||||
// Tags: A map of additional information.
|
||||
Tags map[string][]string `json:"tags,omitempty"`
|
||||
|
||||
// ForceSendFields is a list of field names (e.g. "Labels") to
|
||||
// unconditionally include in API requests. By default, fields with
|
||||
// empty values are omitted from API requests. However, any non-pointer,
|
||||
// non-interface field appearing in ForceSendFields will be sent to the
|
||||
// server regardless of whether the field is empty or not. This may be
|
||||
// used to include empty fields in Patch requests.
|
||||
ForceSendFields []string `json:"-"`
|
||||
|
||||
// NullFields is a list of field names (e.g. "Labels") to include in API
|
||||
// requests with the JSON null value. By default, fields with empty
|
||||
// values are omitted from API requests. However, any field with an
|
||||
// empty value appearing in NullFields will be sent to the server as
|
||||
// null. It is an error if a field in this list has a non-empty value.
|
||||
// This may be used to include null fields in Patch requests.
|
||||
NullFields []string `json:"-"`
|
||||
}
|
||||
|
||||
func (s *TimeseriesDescriptor) MarshalJSON() ([]byte, error) {
|
||||
type noMethod TimeseriesDescriptor
|
||||
raw := noMethod(*s)
|
||||
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
|
||||
}
|
||||
|
||||
// method id "mapofstrings.getMap":
|
||||
|
||||
type AtlasGetMapCall struct {
|
||||
s *Service
|
||||
urlParams_ gensupport.URLParams
|
||||
ifNoneMatch_ string
|
||||
ctx_ context.Context
|
||||
header_ http.Header
|
||||
}
|
||||
|
||||
// GetMap: Get a map.
|
||||
func (r *AtlasService) GetMap() *AtlasGetMapCall {
|
||||
c := &AtlasGetMapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
|
||||
return c
|
||||
}
|
||||
|
||||
// Fields allows partial responses to be retrieved. See
|
||||
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
|
||||
// for more information.
|
||||
func (c *AtlasGetMapCall) Fields(s ...googleapi.Field) *AtlasGetMapCall {
|
||||
c.urlParams_.Set("fields", googleapi.CombineFields(s))
|
||||
return c
|
||||
}
|
||||
|
||||
// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response
|
||||
// error from Do is the result of In-None-Match.
|
||||
func (c *AtlasGetMapCall) IfNoneMatch(entityTag string) *AtlasGetMapCall {
|
||||
c.ifNoneMatch_ = entityTag
|
||||
return c
|
||||
}
|
||||
|
||||
// Context sets the context to be used in this call's Do method. Any
|
||||
// pending HTTP request will be aborted if the provided context is
|
||||
// canceled.
|
||||
func (c *AtlasGetMapCall) Context(ctx context.Context) *AtlasGetMapCall {
|
||||
c.ctx_ = ctx
|
||||
return c
|
||||
}
|
||||
|
||||
// Header returns an http.Header that can be modified by the caller to
|
||||
// add HTTP headers to the request.
|
||||
func (c *AtlasGetMapCall) Header() http.Header {
|
||||
if c.header_ == nil {
|
||||
c.header_ = make(http.Header)
|
||||
}
|
||||
return c.header_
|
||||
}
|
||||
|
||||
func (c *AtlasGetMapCall) doRequest(alt string) (*http.Response, error) {
|
||||
reqHeaders := make(http.Header)
|
||||
for k, v := range c.header_ {
|
||||
reqHeaders[k] = v
|
||||
}
|
||||
reqHeaders.Set("User-Agent", c.s.userAgent())
|
||||
if c.ifNoneMatch_ != "" {
|
||||
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
|
||||
}
|
||||
var body io.Reader = nil
|
||||
c.urlParams_.Set("alt", alt)
|
||||
urls := googleapi.ResolveRelative(c.s.BasePath, "map")
|
||||
urls += "?" + c.urlParams_.Encode()
|
||||
req, _ := http.NewRequest("GET", urls, body)
|
||||
req.Header = reqHeaders
|
||||
return gensupport.SendRequest(c.ctx_, c.s.client, req)
|
||||
}
|
||||
|
||||
// Do executes the "mapofstrings.getMap" call.
|
||||
func (c *AtlasGetMapCall) Do(opts ...googleapi.CallOption) (map[string]string, error) {
|
||||
gensupport.SetOptions(c.urlParams_, opts...)
|
||||
res, err := c.doRequest("json")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer googleapi.CloseBody(res)
|
||||
if err := googleapi.CheckResponse(res); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var ret map[string]string
|
||||
target := &ret
|
||||
if err := json.NewDecoder(res.Body).Decode(target); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return ret, nil
|
||||
// {
|
||||
// "description": "Get a map.",
|
||||
// "httpMethod": "GET",
|
||||
// "id": "mapofstrings.getMap",
|
||||
// "path": "map",
|
||||
// "response": {
|
||||
// "$ref": "GetMapResponse"
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
149
vendor/google.golang.org/api/google-api-go-generator/testdata/paging.json
generated
vendored
Normal file
149
vendor/google.golang.org/api/google-api-go-generator/testdata/paging.json
generated
vendored
Normal file
@@ -0,0 +1,149 @@
|
||||
{
|
||||
"id": "cloudresourcemanager:v1",
|
||||
"name": "cloudresourcemanager",
|
||||
"canonicalName": "Cloud Resource Manager",
|
||||
"version": "v1",
|
||||
"revision": "20160927",
|
||||
"title": "Google Cloud Resource Manager API",
|
||||
"documentationLink": "https://cloud.google.com/resource-manager",
|
||||
"protocol": "rest",
|
||||
"baseUrl": "https://cloudresourcemanager.googleapis.com/",
|
||||
"basePath": "",
|
||||
"rootUrl": "https://cloudresourcemanager.googleapis.com/",
|
||||
"servicePath": "",
|
||||
"schemas": {
|
||||
"Operation": {
|
||||
"id": "Operation",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"SearchOrganizationsRequest": {
|
||||
"id": "SearchOrganizationsRequest",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"pageSize": {
|
||||
"type": "integer",
|
||||
"description": "The maximum number of Organizations to return in the response. This field is optional.",
|
||||
"format": "int32"
|
||||
},
|
||||
"pageToken": {
|
||||
"type": "string"
|
||||
},
|
||||
"filter": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"SearchOrganizationsResponse": {
|
||||
"id": "SearchOrganizationsResponse",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"organizations": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "Organization"
|
||||
}
|
||||
},
|
||||
"nextPageToken": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Organization": {
|
||||
"id": "Organization",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Project": {
|
||||
"id": "Project",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"projectId": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"ListProjectsResponse": {
|
||||
"id": "ListProjectsResponse",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"projects": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "Project"
|
||||
}
|
||||
},
|
||||
"nextPageToken": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"resources": {
|
||||
"projects": {
|
||||
"methods": {
|
||||
"yes1": {
|
||||
"id": "cloudresourcemanager.organizations.search",
|
||||
"path": "v1/organizations:search",
|
||||
"httpMethod": "POST",
|
||||
"request": {
|
||||
"$ref": "SearchOrganizationsRequest"
|
||||
},
|
||||
"response": {
|
||||
"$ref": "SearchOrganizationsResponse"
|
||||
}
|
||||
},
|
||||
"yes2": {
|
||||
"id": "cloudresourcemanager.projects.list",
|
||||
"path": "v1/projects",
|
||||
"httpMethod": "GET",
|
||||
"parameters": {
|
||||
"pageToken": {
|
||||
"type": "string",
|
||||
"location": "query"
|
||||
},
|
||||
"pageSize": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"location": "query"
|
||||
},
|
||||
"filter": {
|
||||
"type": "string",
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"$ref": "ListProjectsResponse"
|
||||
}
|
||||
},
|
||||
"no": {
|
||||
"id": "cloudresourcemanager.operations.get",
|
||||
"path": "v1/{+name}",
|
||||
"httpMethod": "GET",
|
||||
"parameters": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"pattern": "^operations/.*$",
|
||||
"location": "path"
|
||||
}
|
||||
},
|
||||
"parameterOrder": [
|
||||
"name"
|
||||
],
|
||||
"response": {
|
||||
"$ref": "Operation"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
94
vendor/google.golang.org/api/google-api-go-generator/testdata/param-rename.json
generated
vendored
Normal file
94
vendor/google.golang.org/api/google-api-go-generator/testdata/param-rename.json
generated
vendored
Normal file
@@ -0,0 +1,94 @@
|
||||
{
|
||||
"kind": "discovery#restDescription",
|
||||
"etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/3m5rB86FE5KuW1K3jAl88AxCreg\"",
|
||||
"discoveryVersion": "v1",
|
||||
"id": "paramrename:v1",
|
||||
"name": "paramrename",
|
||||
"version": "v1",
|
||||
"title": "Example API",
|
||||
"description": "The Example API demonstrates parameter renaming.",
|
||||
"ownerDomain": "google.com",
|
||||
"ownerName": "Google",
|
||||
"protocol": "rest",
|
||||
"schemas": {
|
||||
"Event": {
|
||||
"id": "Event",
|
||||
"type": "string"
|
||||
},
|
||||
"ResultTable": {
|
||||
"id": "ResultTable",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"resources": {
|
||||
"events": {
|
||||
"methods": {
|
||||
"move": {
|
||||
"id": "calendar.events.move",
|
||||
"path": "calendars/{calendarId}/events/{eventId}/move",
|
||||
"httpMethod": "POST",
|
||||
"description": "Moves an event to another calendar, i.e. changes an event's organizer.",
|
||||
"parameters": {
|
||||
"destination": {
|
||||
"type": "string",
|
||||
"description": "Calendar identifier of the target calendar where the event is to be moved to.",
|
||||
"required": true,
|
||||
"location": "query"
|
||||
},
|
||||
"source-param": {
|
||||
"type": "string",
|
||||
"description": "Some parameter.",
|
||||
"required": false,
|
||||
"location": "query"
|
||||
},
|
||||
"right-string": {
|
||||
"type": "string",
|
||||
"description": "Yet another parameter.",
|
||||
"required": true,
|
||||
"location": "path"
|
||||
}
|
||||
},
|
||||
"parameterOrder": [
|
||||
"destination",
|
||||
"right-string"
|
||||
],
|
||||
"response": {
|
||||
"$ref": "Event"
|
||||
},
|
||||
"scopes": [
|
||||
"https://www.googleapis.com/auth/calendar"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"reports": {
|
||||
"methods": {
|
||||
"query": {
|
||||
"id": "youtubeAnalytics.reports.query",
|
||||
"path": "reports",
|
||||
"httpMethod": "GET",
|
||||
"description": "Retrieve your YouTube Analytics reports.",
|
||||
"parameters": {
|
||||
"start-date": {
|
||||
"type": "string",
|
||||
"description": "The start date for fetching YouTube Analytics data. The value should be in YYYY-MM-DD format.",
|
||||
"required": true,
|
||||
"pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}",
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
"parameterOrder": [
|
||||
"start-date"
|
||||
],
|
||||
"response": {
|
||||
"$ref": "ResultTable"
|
||||
},
|
||||
"scopes": [
|
||||
"https://www.googleapis.com/auth/yt-analytics-monetary.readonly",
|
||||
"https://www.googleapis.com/auth/yt-analytics.readonly"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
373
vendor/google.golang.org/api/google-api-go-generator/testdata/param-rename.want
generated
vendored
Normal file
373
vendor/google.golang.org/api/google-api-go-generator/testdata/param-rename.want
generated
vendored
Normal file
@@ -0,0 +1,373 @@
|
||||
// Package paramrename provides access to the Example API.
|
||||
//
|
||||
// Usage example:
|
||||
//
|
||||
// import "google.golang.org/api/paramrename/v1"
|
||||
// ...
|
||||
// paramrenameService, err := paramrename.New(oauthHttpClient)
|
||||
package paramrename // import "google.golang.org/api/paramrename/v1"
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
context "golang.org/x/net/context"
|
||||
ctxhttp "golang.org/x/net/context/ctxhttp"
|
||||
gensupport "google.golang.org/api/gensupport"
|
||||
googleapi "google.golang.org/api/googleapi"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Always reference these packages, just in case the auto-generated code
|
||||
// below doesn't.
|
||||
var _ = bytes.NewBuffer
|
||||
var _ = strconv.Itoa
|
||||
var _ = fmt.Sprintf
|
||||
var _ = json.NewDecoder
|
||||
var _ = io.Copy
|
||||
var _ = url.Parse
|
||||
var _ = gensupport.MarshalJSON
|
||||
var _ = googleapi.Version
|
||||
var _ = errors.New
|
||||
var _ = strings.Replace
|
||||
var _ = context.Canceled
|
||||
var _ = ctxhttp.Do
|
||||
|
||||
const apiId = "paramrename:v1"
|
||||
const apiName = "paramrename"
|
||||
const apiVersion = "v1"
|
||||
const basePath = "https://www.googleapis.com/discovery/v1/apis"
|
||||
|
||||
func New(client *http.Client) (*Service, error) {
|
||||
if client == nil {
|
||||
return nil, errors.New("client is nil")
|
||||
}
|
||||
s := &Service{client: client, BasePath: basePath}
|
||||
s.Events = NewEventsService(s)
|
||||
s.Reports = NewReportsService(s)
|
||||
return s, nil
|
||||
}
|
||||
|
||||
type Service struct {
|
||||
client *http.Client
|
||||
BasePath string // API endpoint base URL
|
||||
UserAgent string // optional additional User-Agent fragment
|
||||
|
||||
Events *EventsService
|
||||
|
||||
Reports *ReportsService
|
||||
}
|
||||
|
||||
func (s *Service) userAgent() string {
|
||||
if s.UserAgent == "" {
|
||||
return googleapi.UserAgent
|
||||
}
|
||||
return googleapi.UserAgent + " " + s.UserAgent
|
||||
}
|
||||
|
||||
func NewEventsService(s *Service) *EventsService {
|
||||
rs := &EventsService{s: s}
|
||||
return rs
|
||||
}
|
||||
|
||||
type EventsService struct {
|
||||
s *Service
|
||||
}
|
||||
|
||||
func NewReportsService(s *Service) *ReportsService {
|
||||
rs := &ReportsService{s: s}
|
||||
return rs
|
||||
}
|
||||
|
||||
type ReportsService struct {
|
||||
s *Service
|
||||
}
|
||||
|
||||
type Event string
|
||||
|
||||
type ResultTable string
|
||||
|
||||
// method id "calendar.events.move":
|
||||
|
||||
type EventsMoveCall struct {
|
||||
s *Service
|
||||
rightString string
|
||||
urlParams_ gensupport.URLParams
|
||||
ctx_ context.Context
|
||||
header_ http.Header
|
||||
}
|
||||
|
||||
// Move: Moves an event to another calendar, i.e. changes an event's
|
||||
// organizer.
|
||||
func (r *EventsService) Move(destinationid string, rightString string) *EventsMoveCall {
|
||||
c := &EventsMoveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
|
||||
c.urlParams_.Set("destination", destinationid)
|
||||
c.rightString = rightString
|
||||
return c
|
||||
}
|
||||
|
||||
// SourceParam sets the optional parameter "source-param": Some
|
||||
// parameter.
|
||||
func (c *EventsMoveCall) SourceParam(sourceParam string) *EventsMoveCall {
|
||||
c.urlParams_.Set("source-param", sourceParam)
|
||||
return c
|
||||
}
|
||||
|
||||
// Fields allows partial responses to be retrieved. See
|
||||
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
|
||||
// for more information.
|
||||
func (c *EventsMoveCall) Fields(s ...googleapi.Field) *EventsMoveCall {
|
||||
c.urlParams_.Set("fields", googleapi.CombineFields(s))
|
||||
return c
|
||||
}
|
||||
|
||||
// Context sets the context to be used in this call's Do method. Any
|
||||
// pending HTTP request will be aborted if the provided context is
|
||||
// canceled.
|
||||
func (c *EventsMoveCall) Context(ctx context.Context) *EventsMoveCall {
|
||||
c.ctx_ = ctx
|
||||
return c
|
||||
}
|
||||
|
||||
// Header returns an http.Header that can be modified by the caller to
|
||||
// add HTTP headers to the request.
|
||||
func (c *EventsMoveCall) Header() http.Header {
|
||||
if c.header_ == nil {
|
||||
c.header_ = make(http.Header)
|
||||
}
|
||||
return c.header_
|
||||
}
|
||||
|
||||
func (c *EventsMoveCall) doRequest(alt string) (*http.Response, error) {
|
||||
reqHeaders := make(http.Header)
|
||||
for k, v := range c.header_ {
|
||||
reqHeaders[k] = v
|
||||
}
|
||||
reqHeaders.Set("User-Agent", c.s.userAgent())
|
||||
var body io.Reader = nil
|
||||
c.urlParams_.Set("alt", alt)
|
||||
urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events/{eventId}/move")
|
||||
urls += "?" + c.urlParams_.Encode()
|
||||
req, _ := http.NewRequest("POST", urls, body)
|
||||
req.Header = reqHeaders
|
||||
googleapi.Expand(req.URL, map[string]string{
|
||||
"right-string": c.rightString,
|
||||
})
|
||||
return gensupport.SendRequest(c.ctx_, c.s.client, req)
|
||||
}
|
||||
|
||||
// Do executes the "calendar.events.move" call.
|
||||
// Exactly one of *Event or error will be non-nil. Any non-2xx status
|
||||
// code is an error. Response headers are in either
|
||||
// *Event.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 (c *EventsMoveCall) Do(opts ...googleapi.CallOption) (*Event, error) {
|
||||
gensupport.SetOptions(c.urlParams_, opts...)
|
||||
res, err := c.doRequest("json")
|
||||
if res != nil && res.StatusCode == http.StatusNotModified {
|
||||
if res.Body != nil {
|
||||
res.Body.Close()
|
||||
}
|
||||
return nil, &googleapi.Error{
|
||||
Code: res.StatusCode,
|
||||
Header: res.Header,
|
||||
}
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer googleapi.CloseBody(res)
|
||||
if err := googleapi.CheckResponse(res); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ret := &Event{
|
||||
ServerResponse: googleapi.ServerResponse{
|
||||
Header: res.Header,
|
||||
HTTPStatusCode: res.StatusCode,
|
||||
},
|
||||
}
|
||||
target := &ret
|
||||
if err := json.NewDecoder(res.Body).Decode(target); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return ret, nil
|
||||
// {
|
||||
// "description": "Moves an event to another calendar, i.e. changes an event's organizer.",
|
||||
// "httpMethod": "POST",
|
||||
// "id": "calendar.events.move",
|
||||
// "parameterOrder": [
|
||||
// "destination",
|
||||
// "right-string"
|
||||
// ],
|
||||
// "parameters": {
|
||||
// "destination": {
|
||||
// "description": "Calendar identifier of the target calendar where the event is to be moved to.",
|
||||
// "location": "query",
|
||||
// "required": true,
|
||||
// "type": "string"
|
||||
// },
|
||||
// "right-string": {
|
||||
// "description": "Yet another parameter.",
|
||||
// "location": "path",
|
||||
// "required": true,
|
||||
// "type": "string"
|
||||
// },
|
||||
// "source-param": {
|
||||
// "description": "Some parameter.",
|
||||
// "location": "query",
|
||||
// "required": false,
|
||||
// "type": "string"
|
||||
// }
|
||||
// },
|
||||
// "path": "calendars/{calendarId}/events/{eventId}/move",
|
||||
// "response": {
|
||||
// "$ref": "Event"
|
||||
// },
|
||||
// "scopes": [
|
||||
// "https://www.googleapis.com/auth/calendar"
|
||||
// ]
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
// method id "youtubeAnalytics.reports.query":
|
||||
|
||||
type ReportsQueryCall struct {
|
||||
s *Service
|
||||
urlParams_ gensupport.URLParams
|
||||
ifNoneMatch_ string
|
||||
ctx_ context.Context
|
||||
header_ http.Header
|
||||
}
|
||||
|
||||
// Query: Retrieve your YouTube Analytics reports.
|
||||
func (r *ReportsService) Query(startDate string) *ReportsQueryCall {
|
||||
c := &ReportsQueryCall{s: r.s, urlParams_: make(gensupport.URLParams)}
|
||||
c.urlParams_.Set("start-date", startDate)
|
||||
return c
|
||||
}
|
||||
|
||||
// Fields allows partial responses to be retrieved. See
|
||||
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
|
||||
// for more information.
|
||||
func (c *ReportsQueryCall) Fields(s ...googleapi.Field) *ReportsQueryCall {
|
||||
c.urlParams_.Set("fields", googleapi.CombineFields(s))
|
||||
return c
|
||||
}
|
||||
|
||||
// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response
|
||||
// error from Do is the result of In-None-Match.
|
||||
func (c *ReportsQueryCall) IfNoneMatch(entityTag string) *ReportsQueryCall {
|
||||
c.ifNoneMatch_ = entityTag
|
||||
return c
|
||||
}
|
||||
|
||||
// Context sets the context to be used in this call's Do method. Any
|
||||
// pending HTTP request will be aborted if the provided context is
|
||||
// canceled.
|
||||
func (c *ReportsQueryCall) Context(ctx context.Context) *ReportsQueryCall {
|
||||
c.ctx_ = ctx
|
||||
return c
|
||||
}
|
||||
|
||||
// Header returns an http.Header that can be modified by the caller to
|
||||
// add HTTP headers to the request.
|
||||
func (c *ReportsQueryCall) Header() http.Header {
|
||||
if c.header_ == nil {
|
||||
c.header_ = make(http.Header)
|
||||
}
|
||||
return c.header_
|
||||
}
|
||||
|
||||
func (c *ReportsQueryCall) doRequest(alt string) (*http.Response, error) {
|
||||
reqHeaders := make(http.Header)
|
||||
for k, v := range c.header_ {
|
||||
reqHeaders[k] = v
|
||||
}
|
||||
reqHeaders.Set("User-Agent", c.s.userAgent())
|
||||
if c.ifNoneMatch_ != "" {
|
||||
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
|
||||
}
|
||||
var body io.Reader = nil
|
||||
c.urlParams_.Set("alt", alt)
|
||||
urls := googleapi.ResolveRelative(c.s.BasePath, "reports")
|
||||
urls += "?" + c.urlParams_.Encode()
|
||||
req, _ := http.NewRequest("GET", urls, body)
|
||||
req.Header = reqHeaders
|
||||
return gensupport.SendRequest(c.ctx_, c.s.client, req)
|
||||
}
|
||||
|
||||
// Do executes the "youtubeAnalytics.reports.query" call.
|
||||
// Exactly one of *ResultTable or error will be non-nil. Any non-2xx
|
||||
// status code is an error. Response headers are in either
|
||||
// *ResultTable.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 (c *ReportsQueryCall) Do(opts ...googleapi.CallOption) (*ResultTable, error) {
|
||||
gensupport.SetOptions(c.urlParams_, opts...)
|
||||
res, err := c.doRequest("json")
|
||||
if res != nil && res.StatusCode == http.StatusNotModified {
|
||||
if res.Body != nil {
|
||||
res.Body.Close()
|
||||
}
|
||||
return nil, &googleapi.Error{
|
||||
Code: res.StatusCode,
|
||||
Header: res.Header,
|
||||
}
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer googleapi.CloseBody(res)
|
||||
if err := googleapi.CheckResponse(res); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ret := &ResultTable{
|
||||
ServerResponse: googleapi.ServerResponse{
|
||||
Header: res.Header,
|
||||
HTTPStatusCode: res.StatusCode,
|
||||
},
|
||||
}
|
||||
target := &ret
|
||||
if err := json.NewDecoder(res.Body).Decode(target); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return ret, nil
|
||||
// {
|
||||
// "description": "Retrieve your YouTube Analytics reports.",
|
||||
// "httpMethod": "GET",
|
||||
// "id": "youtubeAnalytics.reports.query",
|
||||
// "parameterOrder": [
|
||||
// "start-date"
|
||||
// ],
|
||||
// "parameters": {
|
||||
// "start-date": {
|
||||
// "description": "The start date for fetching YouTube Analytics data. The value should be in YYYY-MM-DD format.",
|
||||
// "location": "query",
|
||||
// "pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}",
|
||||
// "required": true,
|
||||
// "type": "string"
|
||||
// }
|
||||
// },
|
||||
// "path": "reports",
|
||||
// "response": {
|
||||
// "$ref": "ResultTable"
|
||||
// },
|
||||
// "scopes": [
|
||||
// "https://www.googleapis.com/auth/yt-analytics-monetary.readonly",
|
||||
// "https://www.googleapis.com/auth/yt-analytics.readonly"
|
||||
// ]
|
||||
// }
|
||||
|
||||
}
|
94
vendor/google.golang.org/api/google-api-go-generator/testdata/quotednum.json
generated
vendored
Normal file
94
vendor/google.golang.org/api/google-api-go-generator/testdata/quotednum.json
generated
vendored
Normal file
@@ -0,0 +1,94 @@
|
||||
{
|
||||
"kind": "discovery#restDescription",
|
||||
"etag": "\"DGgqtFnjgu83tuwvvVNNUhOiHWk/1UCG4CqfTBrxPN0MRjUm7GaLJ7Y\"",
|
||||
"discoveryVersion": "v1",
|
||||
"id": "adexchangebuyer:v1.1",
|
||||
"name": "adexchangebuyer",
|
||||
"version": "v1.1",
|
||||
"title": "Ad Exchange Buyer API",
|
||||
"description": "Lets you manage your Ad Exchange Buyer account.",
|
||||
"ownerDomain": "google.com",
|
||||
"ownerName": "Google",
|
||||
"icons": {
|
||||
"x16": "http://www.google.com/images/icons/product/doubleclick-16.gif",
|
||||
"x32": "http://www.google.com/images/icons/product/doubleclick-32.gif"
|
||||
},
|
||||
"documentationLink": "https://developers.google.com/ad-exchange/buyer-rest",
|
||||
"protocol": "rest",
|
||||
"baseUrl": "https://www.googleapis.com/adexchangebuyer/v1.1/",
|
||||
"basePath": "/adexchangebuyer/v1.1/",
|
||||
"rootUrl": "https://www.googleapis.com/",
|
||||
"servicePath": "adexchangebuyer/v1.1/",
|
||||
"batchPath": "batch",
|
||||
"parameters": {
|
||||
"alt": {
|
||||
"type": "string",
|
||||
"description": "Data format for the response.",
|
||||
"default": "json",
|
||||
"enum": [
|
||||
"json"
|
||||
],
|
||||
"enumDescriptions": [
|
||||
"Responses with Content-Type of application/json"
|
||||
],
|
||||
"location": "query"
|
||||
},
|
||||
"fields": {
|
||||
"type": "string",
|
||||
"description": "Selector specifying which fields to include in a partial response.",
|
||||
"location": "query"
|
||||
},
|
||||
"key": {
|
||||
"type": "string",
|
||||
"description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
|
||||
"location": "query"
|
||||
},
|
||||
"oauth_token": {
|
||||
"type": "string",
|
||||
"description": "OAuth 2.0 token for the current user.",
|
||||
"location": "query"
|
||||
},
|
||||
"prettyPrint": {
|
||||
"type": "boolean",
|
||||
"description": "Returns response with indentations and line breaks.",
|
||||
"default": "true",
|
||||
"location": "query"
|
||||
},
|
||||
"quotaUser": {
|
||||
"type": "string",
|
||||
"description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.",
|
||||
"location": "query"
|
||||
},
|
||||
"userIp": {
|
||||
"type": "string",
|
||||
"description": "IP address of the site where the request originates. Use this if you want to enforce per-user limits.",
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
"auth": {
|
||||
"oauth2": {
|
||||
"scopes": {
|
||||
"https://www.googleapis.com/auth/adexchange.buyer": {
|
||||
"description": "Manage your Ad Exchange buyer account configuration"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"schemas": {
|
||||
"Creative": {
|
||||
"id": "Creative",
|
||||
"type": "object",
|
||||
"description": "A creative and its classification data.",
|
||||
"properties": {
|
||||
"advertiserId": {
|
||||
"type": "array",
|
||||
"description": "Detected advertiser id, if any. Read-only. This field should not be set in requests.",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"format": "int64"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
102
vendor/google.golang.org/api/google-api-go-generator/testdata/quotednum.want
generated
vendored
Normal file
102
vendor/google.golang.org/api/google-api-go-generator/testdata/quotednum.want
generated
vendored
Normal file
@@ -0,0 +1,102 @@
|
||||
// Package adexchangebuyer provides access to the Ad Exchange Buyer API.
|
||||
//
|
||||
// See https://developers.google.com/ad-exchange/buyer-rest
|
||||
//
|
||||
// Usage example:
|
||||
//
|
||||
// import "google.golang.org/api/adexchangebuyer/v1.1"
|
||||
// ...
|
||||
// adexchangebuyerService, err := adexchangebuyer.New(oauthHttpClient)
|
||||
package adexchangebuyer // import "google.golang.org/api/adexchangebuyer/v1.1"
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
context "golang.org/x/net/context"
|
||||
ctxhttp "golang.org/x/net/context/ctxhttp"
|
||||
gensupport "google.golang.org/api/gensupport"
|
||||
googleapi "google.golang.org/api/googleapi"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Always reference these packages, just in case the auto-generated code
|
||||
// below doesn't.
|
||||
var _ = bytes.NewBuffer
|
||||
var _ = strconv.Itoa
|
||||
var _ = fmt.Sprintf
|
||||
var _ = json.NewDecoder
|
||||
var _ = io.Copy
|
||||
var _ = url.Parse
|
||||
var _ = gensupport.MarshalJSON
|
||||
var _ = googleapi.Version
|
||||
var _ = errors.New
|
||||
var _ = strings.Replace
|
||||
var _ = context.Canceled
|
||||
var _ = ctxhttp.Do
|
||||
|
||||
const apiId = "adexchangebuyer:v1.1"
|
||||
const apiName = "adexchangebuyer"
|
||||
const apiVersion = "v1.1"
|
||||
const basePath = "https://www.googleapis.com/adexchangebuyer/v1.1/"
|
||||
|
||||
// OAuth2 scopes used by this API.
|
||||
const (
|
||||
// Manage your Ad Exchange buyer account configuration
|
||||
AdexchangeBuyerScope = "https://www.googleapis.com/auth/adexchange.buyer"
|
||||
)
|
||||
|
||||
func New(client *http.Client) (*Service, error) {
|
||||
if client == nil {
|
||||
return nil, errors.New("client is nil")
|
||||
}
|
||||
s := &Service{client: client, BasePath: basePath}
|
||||
return s, nil
|
||||
}
|
||||
|
||||
type Service struct {
|
||||
client *http.Client
|
||||
BasePath string // API endpoint base URL
|
||||
UserAgent string // optional additional User-Agent fragment
|
||||
}
|
||||
|
||||
func (s *Service) userAgent() string {
|
||||
if s.UserAgent == "" {
|
||||
return googleapi.UserAgent
|
||||
}
|
||||
return googleapi.UserAgent + " " + s.UserAgent
|
||||
}
|
||||
|
||||
// Creative: A creative and its classification data.
|
||||
type Creative struct {
|
||||
// AdvertiserId: Detected advertiser id, if any. Read-only. This field
|
||||
// should not be set in requests.
|
||||
AdvertiserId googleapi.Int64s `json:"advertiserId,omitempty"`
|
||||
|
||||
// ForceSendFields is a list of field names (e.g. "AdvertiserId") to
|
||||
// unconditionally include in API requests. By default, fields with
|
||||
// empty values are omitted from API requests. However, any non-pointer,
|
||||
// non-interface field appearing in ForceSendFields will be sent to the
|
||||
// server regardless of whether the field is empty or not. This may be
|
||||
// used to include empty fields in Patch requests.
|
||||
ForceSendFields []string `json:"-"`
|
||||
|
||||
// NullFields is a list of field names (e.g. "AdvertiserId") to include
|
||||
// in API requests with the JSON null value. By default, fields with
|
||||
// empty values are omitted from API requests. However, any field with
|
||||
// an empty value appearing in NullFields will be sent to the server as
|
||||
// null. It is an error if a field in this list has a non-empty value.
|
||||
// This may be used to include null fields in Patch requests.
|
||||
NullFields []string `json:"-"`
|
||||
}
|
||||
|
||||
func (s *Creative) MarshalJSON() ([]byte, error) {
|
||||
type noMethod Creative
|
||||
raw := noMethod(*s)
|
||||
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
|
||||
}
|
65
vendor/google.golang.org/api/google-api-go-generator/testdata/repeated.json
generated
vendored
Normal file
65
vendor/google.golang.org/api/google-api-go-generator/testdata/repeated.json
generated
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
{
|
||||
"kind": "discovery#restDescription",
|
||||
"etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/3m5rB86FE5KuW1K3jAl88AxCreg\"",
|
||||
"discoveryVersion": "v1",
|
||||
"id": "repeated:v1",
|
||||
"name": "repeated",
|
||||
"version": "v1",
|
||||
"title": "Example API",
|
||||
"description": "The Example API demonstrates repeated fields.",
|
||||
"ownerDomain": "google.com",
|
||||
"ownerName": "Google",
|
||||
"protocol": "rest",
|
||||
"schemas": {
|
||||
},
|
||||
"resources": {
|
||||
"accounts": {
|
||||
"resources": {
|
||||
"reports": {
|
||||
"methods": {
|
||||
"generate": {
|
||||
"id": "adsense.accounts.reports.generate",
|
||||
"path": "accounts/{accountId}/reports",
|
||||
"httpMethod": "GET",
|
||||
"description": "Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format specify \"alt=csv\" as a query parameter.",
|
||||
"parameters": {
|
||||
"accountId": {
|
||||
"type": "string",
|
||||
"description": "Account upon which to report.",
|
||||
"required": true,
|
||||
"location": "path"
|
||||
},
|
||||
"currency": {
|
||||
"type": "string",
|
||||
"description": "Optional currency to use when reporting on monetary metrics. Defaults to the account's currency if not set.",
|
||||
"pattern": "[a-zA-Z]+",
|
||||
"location": "query"
|
||||
},
|
||||
"ids": {
|
||||
"type": "string",
|
||||
"description": "Select only user profiles with these IDs.",
|
||||
"format": "int64",
|
||||
"repeated": true,
|
||||
"location": "query"
|
||||
},
|
||||
"dimension": {
|
||||
"type": "string",
|
||||
"description": "Dimensions to base the report on.",
|
||||
"pattern": "[a-zA-Z_]+",
|
||||
"repeated": true,
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
"parameterOrder": [
|
||||
"ids",
|
||||
"currency",
|
||||
"accountId",
|
||||
"dimension"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
253
vendor/google.golang.org/api/google-api-go-generator/testdata/repeated.want
generated
vendored
Normal file
253
vendor/google.golang.org/api/google-api-go-generator/testdata/repeated.want
generated
vendored
Normal file
@@ -0,0 +1,253 @@
|
||||
// Package repeated provides access to the Example API.
|
||||
//
|
||||
// Usage example:
|
||||
//
|
||||
// import "google.golang.org/api/repeated/v1"
|
||||
// ...
|
||||
// repeatedService, err := repeated.New(oauthHttpClient)
|
||||
package repeated // import "google.golang.org/api/repeated/v1"
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
context "golang.org/x/net/context"
|
||||
ctxhttp "golang.org/x/net/context/ctxhttp"
|
||||
gensupport "google.golang.org/api/gensupport"
|
||||
googleapi "google.golang.org/api/googleapi"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Always reference these packages, just in case the auto-generated code
|
||||
// below doesn't.
|
||||
var _ = bytes.NewBuffer
|
||||
var _ = strconv.Itoa
|
||||
var _ = fmt.Sprintf
|
||||
var _ = json.NewDecoder
|
||||
var _ = io.Copy
|
||||
var _ = url.Parse
|
||||
var _ = gensupport.MarshalJSON
|
||||
var _ = googleapi.Version
|
||||
var _ = errors.New
|
||||
var _ = strings.Replace
|
||||
var _ = context.Canceled
|
||||
var _ = ctxhttp.Do
|
||||
|
||||
const apiId = "repeated:v1"
|
||||
const apiName = "repeated"
|
||||
const apiVersion = "v1"
|
||||
const basePath = "https://www.googleapis.com/discovery/v1/apis"
|
||||
|
||||
func New(client *http.Client) (*Service, error) {
|
||||
if client == nil {
|
||||
return nil, errors.New("client is nil")
|
||||
}
|
||||
s := &Service{client: client, BasePath: basePath}
|
||||
s.Accounts = NewAccountsService(s)
|
||||
return s, nil
|
||||
}
|
||||
|
||||
type Service struct {
|
||||
client *http.Client
|
||||
BasePath string // API endpoint base URL
|
||||
UserAgent string // optional additional User-Agent fragment
|
||||
|
||||
Accounts *AccountsService
|
||||
}
|
||||
|
||||
func (s *Service) userAgent() string {
|
||||
if s.UserAgent == "" {
|
||||
return googleapi.UserAgent
|
||||
}
|
||||
return googleapi.UserAgent + " " + s.UserAgent
|
||||
}
|
||||
|
||||
func NewAccountsService(s *Service) *AccountsService {
|
||||
rs := &AccountsService{s: s}
|
||||
rs.Reports = NewAccountsReportsService(s)
|
||||
return rs
|
||||
}
|
||||
|
||||
type AccountsService struct {
|
||||
s *Service
|
||||
|
||||
Reports *AccountsReportsService
|
||||
}
|
||||
|
||||
func NewAccountsReportsService(s *Service) *AccountsReportsService {
|
||||
rs := &AccountsReportsService{s: s}
|
||||
return rs
|
||||
}
|
||||
|
||||
type AccountsReportsService struct {
|
||||
s *Service
|
||||
}
|
||||
|
||||
// method id "adsense.accounts.reports.generate":
|
||||
|
||||
type AccountsReportsGenerateCall struct {
|
||||
s *Service
|
||||
accountId string
|
||||
urlParams_ gensupport.URLParams
|
||||
ifNoneMatch_ string
|
||||
ctx_ context.Context
|
||||
header_ http.Header
|
||||
}
|
||||
|
||||
// Generate: Generate an AdSense report based on the report request sent
|
||||
// in the query parameters. Returns the result as JSON; to retrieve
|
||||
// output in CSV format specify "alt=csv" as a query parameter.
|
||||
func (r *AccountsReportsService) Generate(ids []int64, currency string, accountId string, dimension []string) *AccountsReportsGenerateCall {
|
||||
c := &AccountsReportsGenerateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
|
||||
var ids_ []string
|
||||
for _, v := range ids {
|
||||
ids_ = append(ids_, fmt.Sprint(v))
|
||||
}
|
||||
c.urlParams_.SetMulti("ids", ids_)
|
||||
c.urlParams_.Set("currency", currency)
|
||||
c.accountId = accountId
|
||||
c.urlParams_.SetMulti("dimension", append([]string{}, dimension...))
|
||||
return c
|
||||
}
|
||||
|
||||
// Currency sets the optional parameter "currency": Optional currency to
|
||||
// use when reporting on monetary metrics. Defaults to the account's
|
||||
// currency if not set.
|
||||
func (c *AccountsReportsGenerateCall) Currency(currency string) *AccountsReportsGenerateCall {
|
||||
c.urlParams_.Set("currency", currency)
|
||||
return c
|
||||
}
|
||||
|
||||
// Dimension sets the optional parameter "dimension": Dimensions to base
|
||||
// the report on.
|
||||
func (c *AccountsReportsGenerateCall) Dimension(dimension ...string) *AccountsReportsGenerateCall {
|
||||
c.urlParams_.SetMulti("dimension", append([]string{}, dimension...))
|
||||
return c
|
||||
}
|
||||
|
||||
// Ids sets the optional parameter "ids": Select only user profiles with
|
||||
// these IDs.
|
||||
func (c *AccountsReportsGenerateCall) Ids(ids ...int64) *AccountsReportsGenerateCall {
|
||||
var ids_ []string
|
||||
for _, v := range ids {
|
||||
ids_ = append(ids_, fmt.Sprint(v))
|
||||
}
|
||||
c.urlParams_.SetMulti("ids", ids_)
|
||||
return c
|
||||
}
|
||||
|
||||
// Fields allows partial responses to be retrieved. See
|
||||
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
|
||||
// for more information.
|
||||
func (c *AccountsReportsGenerateCall) Fields(s ...googleapi.Field) *AccountsReportsGenerateCall {
|
||||
c.urlParams_.Set("fields", googleapi.CombineFields(s))
|
||||
return c
|
||||
}
|
||||
|
||||
// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response
|
||||
// error from Do is the result of In-None-Match.
|
||||
func (c *AccountsReportsGenerateCall) IfNoneMatch(entityTag string) *AccountsReportsGenerateCall {
|
||||
c.ifNoneMatch_ = entityTag
|
||||
return c
|
||||
}
|
||||
|
||||
// Context sets the context to be used in this call's Do method. Any
|
||||
// pending HTTP request will be aborted if the provided context is
|
||||
// canceled.
|
||||
func (c *AccountsReportsGenerateCall) Context(ctx context.Context) *AccountsReportsGenerateCall {
|
||||
c.ctx_ = ctx
|
||||
return c
|
||||
}
|
||||
|
||||
// Header returns an http.Header that can be modified by the caller to
|
||||
// add HTTP headers to the request.
|
||||
func (c *AccountsReportsGenerateCall) Header() http.Header {
|
||||
if c.header_ == nil {
|
||||
c.header_ = make(http.Header)
|
||||
}
|
||||
return c.header_
|
||||
}
|
||||
|
||||
func (c *AccountsReportsGenerateCall) doRequest(alt string) (*http.Response, error) {
|
||||
reqHeaders := make(http.Header)
|
||||
for k, v := range c.header_ {
|
||||
reqHeaders[k] = v
|
||||
}
|
||||
reqHeaders.Set("User-Agent", c.s.userAgent())
|
||||
if c.ifNoneMatch_ != "" {
|
||||
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
|
||||
}
|
||||
var body io.Reader = nil
|
||||
c.urlParams_.Set("alt", alt)
|
||||
urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/reports")
|
||||
urls += "?" + c.urlParams_.Encode()
|
||||
req, _ := http.NewRequest("GET", urls, body)
|
||||
req.Header = reqHeaders
|
||||
googleapi.Expand(req.URL, map[string]string{
|
||||
"accountId": c.accountId,
|
||||
})
|
||||
return gensupport.SendRequest(c.ctx_, c.s.client, req)
|
||||
}
|
||||
|
||||
// Do executes the "adsense.accounts.reports.generate" call.
|
||||
func (c *AccountsReportsGenerateCall) Do(opts ...googleapi.CallOption) error {
|
||||
gensupport.SetOptions(c.urlParams_, opts...)
|
||||
res, err := c.doRequest("json")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer googleapi.CloseBody(res)
|
||||
if err := googleapi.CheckResponse(res); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
// {
|
||||
// "description": "Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format specify \"alt=csv\" as a query parameter.",
|
||||
// "httpMethod": "GET",
|
||||
// "id": "adsense.accounts.reports.generate",
|
||||
// "parameterOrder": [
|
||||
// "ids",
|
||||
// "currency",
|
||||
// "accountId",
|
||||
// "dimension"
|
||||
// ],
|
||||
// "parameters": {
|
||||
// "accountId": {
|
||||
// "description": "Account upon which to report.",
|
||||
// "location": "path",
|
||||
// "required": true,
|
||||
// "type": "string"
|
||||
// },
|
||||
// "currency": {
|
||||
// "description": "Optional currency to use when reporting on monetary metrics. Defaults to the account's currency if not set.",
|
||||
// "location": "query",
|
||||
// "pattern": "[a-zA-Z]+",
|
||||
// "type": "string"
|
||||
// },
|
||||
// "dimension": {
|
||||
// "description": "Dimensions to base the report on.",
|
||||
// "location": "query",
|
||||
// "pattern": "[a-zA-Z_]+",
|
||||
// "repeated": true,
|
||||
// "type": "string"
|
||||
// },
|
||||
// "ids": {
|
||||
// "description": "Select only user profiles with these IDs.",
|
||||
// "format": "int64",
|
||||
// "location": "query",
|
||||
// "repeated": true,
|
||||
// "type": "string"
|
||||
// }
|
||||
// },
|
||||
// "path": "accounts/{accountId}/reports"
|
||||
// }
|
||||
|
||||
}
|
2041
vendor/google.golang.org/api/google-api-go-generator/testdata/resource-named-service.json
generated
vendored
Normal file
2041
vendor/google.golang.org/api/google-api-go-generator/testdata/resource-named-service.json
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
5283
vendor/google.golang.org/api/google-api-go-generator/testdata/resource-named-service.want
generated
vendored
Normal file
5283
vendor/google.golang.org/api/google-api-go-generator/testdata/resource-named-service.want
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
158
vendor/google.golang.org/api/google-api-go-generator/testdata/unfortunatedefaults.json
generated
vendored
Normal file
158
vendor/google.golang.org/api/google-api-go-generator/testdata/unfortunatedefaults.json
generated
vendored
Normal file
@@ -0,0 +1,158 @@
|
||||
{
|
||||
"kind": "discovery#restDescription",
|
||||
"etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/3m5rB86FE5KuW1K3jAl88AxCreg\"",
|
||||
"discoveryVersion": "v1",
|
||||
"id": "wrapnewlines:v1",
|
||||
"name": "wrapnewlines",
|
||||
"version": "v1",
|
||||
"title": "Example API",
|
||||
"description": "The Example API demonstrates wrapping of descriptions containing newlines.",
|
||||
"ownerDomain": "google.com",
|
||||
"ownerName": "Google",
|
||||
"protocol": "rest",
|
||||
"schemas": {
|
||||
"Thing": {
|
||||
"id": "Thing",
|
||||
"type": "object",
|
||||
"description": "don't care",
|
||||
"properties": {
|
||||
"bool_empty_default_a":{
|
||||
"type": "boolean",
|
||||
"description": "\nNonempty default: no\nUnfortunate default: no",
|
||||
"default": "false"
|
||||
},
|
||||
"bool_empty_default_b":{
|
||||
"type": "boolean",
|
||||
"description": "\nNonempty default: no\nUnfortunate default: no"
|
||||
},
|
||||
"bool_nonempty_default":{
|
||||
"type": "boolean",
|
||||
"description": "\nNonempty default: yes\nUnfortunate default: yes",
|
||||
"default": "true"
|
||||
},
|
||||
"string_nonempty_default_doesnt_accept_empty": {
|
||||
"type": "string",
|
||||
"description": "\nNonempty default: yes\nAccepts empty value: no\nUnfortunate default: no",
|
||||
"default": "nonempty"
|
||||
},
|
||||
"string_nonempty_default_enum_accepts_empty": {
|
||||
"type": "string",
|
||||
"description": "\nNonempty default: yes\nAccepts empty value: yes (enum)\nUnfortunate default: yes",
|
||||
"default": "nonempty",
|
||||
"enum": [
|
||||
"",
|
||||
"nonempty",
|
||||
"aaa"
|
||||
],
|
||||
"enumDescriptions": [
|
||||
"",
|
||||
""
|
||||
]
|
||||
},
|
||||
"string_nonempty_default_enum_doesnt_accept_empty": {
|
||||
"type": "string",
|
||||
"description": "\nNonempty default: yes\nAccepts empty value: no (enum)\nUnfortunate default: no",
|
||||
"default": "nonempty",
|
||||
"enum": [
|
||||
"nonempty",
|
||||
"aaa"
|
||||
],
|
||||
"enumDescriptions": [
|
||||
""
|
||||
]
|
||||
},
|
||||
"string_nonempty_default_pattern_accepts_empty": {
|
||||
"type": "string",
|
||||
"description": "\nNonempty default: yes\nAccepts empty value: yes (pattern)\nUnfortunate default: yes",
|
||||
"default": "nonempty",
|
||||
"pattern": ".?"
|
||||
},
|
||||
"string_nonempty_default_pattern_doesnt_accept_empty": {
|
||||
"type": "string",
|
||||
"description": "\nNonempty default: yes\nAccepts empty value: no (pattern)\nUnfortunate default: no",
|
||||
"default": "nonempty",
|
||||
"pattern": "."
|
||||
},
|
||||
"string_empty_default_doesnt_accept_empty": {
|
||||
"type": "string",
|
||||
"description": "\nNonempty default: no\nAccepts empty value: no\nUnfortunate default: no",
|
||||
"default": ""
|
||||
},
|
||||
"string_empty_default_enum_accepts_empty": {
|
||||
"type": "string",
|
||||
"description": "\nNonempty default: no\nAccepts empty value: yes (enum)\nUnfortunate default: no",
|
||||
"default": "",
|
||||
"enum": [
|
||||
"",
|
||||
"value"
|
||||
],
|
||||
"enumDescriptions": [
|
||||
"",
|
||||
""
|
||||
]
|
||||
},
|
||||
"string_empty_default_enum_doesnt_accept_empty": {
|
||||
"type": "string",
|
||||
"description": "\nNonempty default: no\nAccepts empty value: no (enum)\nUnfortunate default: no",
|
||||
"default": "",
|
||||
"enum": [
|
||||
"value"
|
||||
],
|
||||
"enumDescriptions": [
|
||||
""
|
||||
]
|
||||
},
|
||||
"string_empty_default_pattern_accepts_empty": {
|
||||
"type": "string",
|
||||
"description": "\nNonempty default: no\nAccepts empty value: yes (pattern)\nUnfortunate default: no",
|
||||
"default": "",
|
||||
"pattern": ".?"
|
||||
},
|
||||
"string_empty_default_pattern_doesnt_accept_empty": {
|
||||
"type": "string",
|
||||
"description": "\nNonempty default: no\nAccepts empty value: no (pattern)\nUnfortunate default: no",
|
||||
"default": "",
|
||||
"pattern": "."
|
||||
},
|
||||
"numeric_empty_default_a":{
|
||||
"type": "string",
|
||||
"format": "int64",
|
||||
"description": "\nNonempty default: no\nUnfortunate default: no",
|
||||
"default": ""
|
||||
},
|
||||
"numeric_empty_default_b":{
|
||||
"type": "string",
|
||||
"format": "int64",
|
||||
"description": "\nNonempty default: no\nUnfortunate default: no"
|
||||
},
|
||||
"numeric_empty_default_c":{
|
||||
"type": "string",
|
||||
"format": "int64",
|
||||
"description": "\nNonempty default: no\nUnfortunate default: no",
|
||||
"default": "0"
|
||||
},
|
||||
"numeric_empty_default_d":{
|
||||
"type": "number",
|
||||
"description": "\nNonempty default: no\nUnfortunate default: no",
|
||||
"default": "0.0"
|
||||
},
|
||||
"numeric_empty_default_e":{
|
||||
"type": "number",
|
||||
"description": "\nNonempty default: no\nUnfortunate default: no",
|
||||
"default": "-0.0"
|
||||
},
|
||||
"numeric_nonempty_default_a":{
|
||||
"type": "string",
|
||||
"format": "int64",
|
||||
"description": "\nNonempty default: yes\nUnfortunate default: yes\nstring encoded, so will not be represented as pointer.",
|
||||
"default": "1"
|
||||
},
|
||||
"numeric_nonempty_default_b":{
|
||||
"type": "number",
|
||||
"description": "\nNonempty default: yes\nUnfortunate default: yes",
|
||||
"default": "0.001"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
246
vendor/google.golang.org/api/google-api-go-generator/testdata/unfortunatedefaults.want
generated
vendored
Normal file
246
vendor/google.golang.org/api/google-api-go-generator/testdata/unfortunatedefaults.want
generated
vendored
Normal file
@@ -0,0 +1,246 @@
|
||||
// Package wrapnewlines provides access to the Example API.
|
||||
//
|
||||
// Usage example:
|
||||
//
|
||||
// import "google.golang.org/api/wrapnewlines/v1"
|
||||
// ...
|
||||
// wrapnewlinesService, err := wrapnewlines.New(oauthHttpClient)
|
||||
package wrapnewlines // import "google.golang.org/api/wrapnewlines/v1"
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
context "golang.org/x/net/context"
|
||||
ctxhttp "golang.org/x/net/context/ctxhttp"
|
||||
gensupport "google.golang.org/api/gensupport"
|
||||
googleapi "google.golang.org/api/googleapi"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Always reference these packages, just in case the auto-generated code
|
||||
// below doesn't.
|
||||
var _ = bytes.NewBuffer
|
||||
var _ = strconv.Itoa
|
||||
var _ = fmt.Sprintf
|
||||
var _ = json.NewDecoder
|
||||
var _ = io.Copy
|
||||
var _ = url.Parse
|
||||
var _ = gensupport.MarshalJSON
|
||||
var _ = googleapi.Version
|
||||
var _ = errors.New
|
||||
var _ = strings.Replace
|
||||
var _ = context.Canceled
|
||||
var _ = ctxhttp.Do
|
||||
|
||||
const apiId = "wrapnewlines:v1"
|
||||
const apiName = "wrapnewlines"
|
||||
const apiVersion = "v1"
|
||||
const basePath = "https://www.googleapis.com/discovery/v1/apis"
|
||||
|
||||
func New(client *http.Client) (*Service, error) {
|
||||
if client == nil {
|
||||
return nil, errors.New("client is nil")
|
||||
}
|
||||
s := &Service{client: client, BasePath: basePath}
|
||||
return s, nil
|
||||
}
|
||||
|
||||
type Service struct {
|
||||
client *http.Client
|
||||
BasePath string // API endpoint base URL
|
||||
UserAgent string // optional additional User-Agent fragment
|
||||
}
|
||||
|
||||
func (s *Service) userAgent() string {
|
||||
if s.UserAgent == "" {
|
||||
return googleapi.UserAgent
|
||||
}
|
||||
return googleapi.UserAgent + " " + s.UserAgent
|
||||
}
|
||||
|
||||
// Thing: don't care
|
||||
type Thing struct {
|
||||
// BoolEmptyDefaultA:
|
||||
// Nonempty default: no
|
||||
// Unfortunate default: no
|
||||
BoolEmptyDefaultA bool `json:"bool_empty_default_a,omitempty"`
|
||||
|
||||
// BoolEmptyDefaultB:
|
||||
// Nonempty default: no
|
||||
// Unfortunate default: no
|
||||
BoolEmptyDefaultB bool `json:"bool_empty_default_b,omitempty"`
|
||||
|
||||
// BoolNonemptyDefault:
|
||||
// Nonempty default: yes
|
||||
// Unfortunate default: yes
|
||||
//
|
||||
// Default: true
|
||||
BoolNonemptyDefault *bool `json:"bool_nonempty_default,omitempty"`
|
||||
|
||||
// NumericEmptyDefaultA:
|
||||
// Nonempty default: no
|
||||
// Unfortunate default: no
|
||||
NumericEmptyDefaultA int64 `json:"numeric_empty_default_a,omitempty,string"`
|
||||
|
||||
// NumericEmptyDefaultB:
|
||||
// Nonempty default: no
|
||||
// Unfortunate default: no
|
||||
NumericEmptyDefaultB int64 `json:"numeric_empty_default_b,omitempty,string"`
|
||||
|
||||
// NumericEmptyDefaultC:
|
||||
// Nonempty default: no
|
||||
// Unfortunate default: no
|
||||
NumericEmptyDefaultC int64 `json:"numeric_empty_default_c,omitempty,string"`
|
||||
|
||||
// NumericEmptyDefaultD:
|
||||
// Nonempty default: no
|
||||
// Unfortunate default: no
|
||||
NumericEmptyDefaultD float64 `json:"numeric_empty_default_d,omitempty"`
|
||||
|
||||
// NumericEmptyDefaultE:
|
||||
// Nonempty default: no
|
||||
// Unfortunate default: no
|
||||
NumericEmptyDefaultE float64 `json:"numeric_empty_default_e,omitempty"`
|
||||
|
||||
// NumericNonemptyDefaultA:
|
||||
// Nonempty default: yes
|
||||
// Unfortunate default: yes
|
||||
// string encoded, so will not be represented as pointer.
|
||||
//
|
||||
// Default: 1
|
||||
NumericNonemptyDefaultA *int64 `json:"numeric_nonempty_default_a,omitempty,string"`
|
||||
|
||||
// NumericNonemptyDefaultB:
|
||||
// Nonempty default: yes
|
||||
// Unfortunate default: yes
|
||||
//
|
||||
// Default: 0.001
|
||||
NumericNonemptyDefaultB *float64 `json:"numeric_nonempty_default_b,omitempty"`
|
||||
|
||||
// StringEmptyDefaultDoesntAcceptEmpty:
|
||||
// Nonempty default: no
|
||||
// Accepts empty value: no
|
||||
// Unfortunate default: no
|
||||
StringEmptyDefaultDoesntAcceptEmpty string `json:"string_empty_default_doesnt_accept_empty,omitempty"`
|
||||
|
||||
// StringEmptyDefaultEnumAcceptsEmpty:
|
||||
// Nonempty default: no
|
||||
// Accepts empty value: yes (enum)
|
||||
// Unfortunate default: no
|
||||
//
|
||||
// Possible values:
|
||||
// "" (default)
|
||||
// "value"
|
||||
StringEmptyDefaultEnumAcceptsEmpty string `json:"string_empty_default_enum_accepts_empty,omitempty"`
|
||||
|
||||
// StringEmptyDefaultEnumDoesntAcceptEmpty:
|
||||
// Nonempty default: no
|
||||
// Accepts empty value: no (enum)
|
||||
// Unfortunate default: no
|
||||
//
|
||||
// Possible values:
|
||||
// "value"
|
||||
StringEmptyDefaultEnumDoesntAcceptEmpty string `json:"string_empty_default_enum_doesnt_accept_empty,omitempty"`
|
||||
|
||||
// StringEmptyDefaultPatternAcceptsEmpty:
|
||||
// Nonempty default: no
|
||||
// Accepts empty value: yes (pattern)
|
||||
// Unfortunate default: no
|
||||
StringEmptyDefaultPatternAcceptsEmpty string `json:"string_empty_default_pattern_accepts_empty,omitempty"`
|
||||
|
||||
// StringEmptyDefaultPatternDoesntAcceptEmpty:
|
||||
// Nonempty default: no
|
||||
// Accepts empty value: no (pattern)
|
||||
// Unfortunate default: no
|
||||
StringEmptyDefaultPatternDoesntAcceptEmpty string `json:"string_empty_default_pattern_doesnt_accept_empty,omitempty"`
|
||||
|
||||
// StringNonemptyDefaultDoesntAcceptEmpty:
|
||||
// Nonempty default: yes
|
||||
// Accepts empty value: no
|
||||
// Unfortunate default: no
|
||||
StringNonemptyDefaultDoesntAcceptEmpty string `json:"string_nonempty_default_doesnt_accept_empty,omitempty"`
|
||||
|
||||
// StringNonemptyDefaultEnumAcceptsEmpty:
|
||||
// Nonempty default: yes
|
||||
// Accepts empty value: yes (enum)
|
||||
// Unfortunate default: yes
|
||||
//
|
||||
// Possible values:
|
||||
// ""
|
||||
// "nonempty" (default)
|
||||
// "aaa"
|
||||
StringNonemptyDefaultEnumAcceptsEmpty *string `json:"string_nonempty_default_enum_accepts_empty,omitempty"`
|
||||
|
||||
// StringNonemptyDefaultEnumDoesntAcceptEmpty:
|
||||
// Nonempty default: yes
|
||||
// Accepts empty value: no (enum)
|
||||
// Unfortunate default: no
|
||||
//
|
||||
// Possible values:
|
||||
// "nonempty" (default)
|
||||
// "aaa"
|
||||
StringNonemptyDefaultEnumDoesntAcceptEmpty string `json:"string_nonempty_default_enum_doesnt_accept_empty,omitempty"`
|
||||
|
||||
// StringNonemptyDefaultPatternAcceptsEmpty:
|
||||
// Nonempty default: yes
|
||||
// Accepts empty value: yes (pattern)
|
||||
// Unfortunate default: yes
|
||||
//
|
||||
// Default: nonempty
|
||||
StringNonemptyDefaultPatternAcceptsEmpty *string `json:"string_nonempty_default_pattern_accepts_empty,omitempty"`
|
||||
|
||||
// StringNonemptyDefaultPatternDoesntAcceptEmpty:
|
||||
// Nonempty default: yes
|
||||
// Accepts empty value: no (pattern)
|
||||
// Unfortunate default: no
|
||||
StringNonemptyDefaultPatternDoesntAcceptEmpty string `json:"string_nonempty_default_pattern_doesnt_accept_empty,omitempty"`
|
||||
|
||||
// ForceSendFields is a list of field names (e.g. "BoolEmptyDefaultA")
|
||||
// to unconditionally include in API requests. By default, fields with
|
||||
// empty values are omitted from API requests. However, any non-pointer,
|
||||
// non-interface field appearing in ForceSendFields will be sent to the
|
||||
// server regardless of whether the field is empty or not. This may be
|
||||
// used to include empty fields in Patch requests.
|
||||
ForceSendFields []string `json:"-"`
|
||||
|
||||
// NullFields is a list of field names (e.g. "BoolEmptyDefaultA") to
|
||||
// include in API requests with the JSON null value. By default, fields
|
||||
// with empty values are omitted from API requests. However, any field
|
||||
// with an empty value appearing in NullFields will be sent to the
|
||||
// server as null. It is an error if a field in this list has a
|
||||
// non-empty value. This may be used to include null fields in Patch
|
||||
// requests.
|
||||
NullFields []string `json:"-"`
|
||||
}
|
||||
|
||||
func (s *Thing) MarshalJSON() ([]byte, error) {
|
||||
type noMethod Thing
|
||||
raw := noMethod(*s)
|
||||
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
|
||||
}
|
||||
|
||||
func (s *Thing) UnmarshalJSON(data []byte) error {
|
||||
type noMethod Thing
|
||||
var s1 struct {
|
||||
NumericEmptyDefaultD gensupport.JSONFloat64 `json:"numeric_empty_default_d"`
|
||||
NumericEmptyDefaultE gensupport.JSONFloat64 `json:"numeric_empty_default_e"`
|
||||
NumericNonemptyDefaultB *gensupport.JSONFloat64 `json:"numeric_nonempty_default_b"`
|
||||
*noMethod
|
||||
}
|
||||
s1.noMethod = (*noMethod)(s)
|
||||
if err := json.Unmarshal(data, &s1); err != nil {
|
||||
return err
|
||||
}
|
||||
s.NumericEmptyDefaultD = float64(s1.NumericEmptyDefaultD)
|
||||
s.NumericEmptyDefaultE = float64(s1.NumericEmptyDefaultE)
|
||||
if s1.NumericNonemptyDefaultB != nil {
|
||||
s.NumericNonemptyDefaultB = (*float64)(s1.NumericNonemptyDefaultB)
|
||||
}
|
||||
return nil
|
||||
}
|
418
vendor/google.golang.org/api/google-api-go-generator/testdata/variants.json
generated
vendored
Normal file
418
vendor/google.golang.org/api/google-api-go-generator/testdata/variants.json
generated
vendored
Normal file
@@ -0,0 +1,418 @@
|
||||
{
|
||||
"kind": "discovery#restDescription",
|
||||
"etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/3m5rB86FE5KuW1K3jAl88AxCreg\"",
|
||||
"discoveryVersion": "v1",
|
||||
"id": "additionalpropsobjs:v1",
|
||||
"name": "additionalpropsobjs",
|
||||
"version": "v1",
|
||||
"title": "Example API",
|
||||
"description": "The Example API demonstrates an associative array.",
|
||||
"ownerDomain": "google.com",
|
||||
"ownerName": "Google",
|
||||
"protocol": "rest",
|
||||
"schemas": {
|
||||
"GeoJsonGeometry": {
|
||||
"id": "GeoJsonGeometry",
|
||||
"type": "object",
|
||||
"variant": {
|
||||
"discriminant": "type",
|
||||
"map": [
|
||||
{
|
||||
"type_value": "GeometryCollection",
|
||||
"$ref": "GeoJsonGeometryCollection"
|
||||
},
|
||||
{
|
||||
"type_value": "LineString",
|
||||
"$ref": "GeoJsonLineString"
|
||||
},
|
||||
{
|
||||
"type_value": "MultiLineString",
|
||||
"$ref": "GeoJsonMultiLineString"
|
||||
},
|
||||
{
|
||||
"type_value": "MultiPoint",
|
||||
"$ref": "GeoJsonMultiPoint"
|
||||
},
|
||||
{
|
||||
"type_value": "MultiPolygon",
|
||||
"$ref": "GeoJsonMultiPolygon"
|
||||
},
|
||||
{
|
||||
"type_value": "Point",
|
||||
"$ref": "GeoJsonPoint"
|
||||
},
|
||||
{
|
||||
"type_value": "Polygon",
|
||||
"$ref": "GeoJsonPolygon"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"GeoJsonGeometryCollection": {
|
||||
"id": "GeoJsonGeometryCollection",
|
||||
"type": "object",
|
||||
"description": "A heterogenous collection of GeoJsonGeometry objects.",
|
||||
"properties": {
|
||||
"geometries": {
|
||||
"type": "array",
|
||||
"description": "An array of geometry objects. There must be at least 2 different types of geometries in the array.",
|
||||
"items": {
|
||||
"$ref": "GeoJsonGeometry"
|
||||
}
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"description": "Identifies this object as a GeoJsonGeometryCollection.",
|
||||
"enum": [
|
||||
"GeometryCollection"
|
||||
],
|
||||
"enumDescriptions": [
|
||||
""
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"GeoJsonLineString": {
|
||||
"id": "GeoJsonLineString",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"coordinates": {
|
||||
"type": "array",
|
||||
"description": "An array of two or more positions, representing a line.",
|
||||
"items": {
|
||||
"$ref": "GeoJsonPosition"
|
||||
}
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"description": "Identifies this object as a GeoJsonLineString.",
|
||||
"enum": [
|
||||
"LineString"
|
||||
],
|
||||
"enumDescriptions": [
|
||||
""
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"GeoJsonMultiLineString": {
|
||||
"id": "GeoJsonMultiLineString",
|
||||
"type": "object",
|
||||
"description": "Multi Line String",
|
||||
"properties": {
|
||||
"coordinates": {
|
||||
"type": "array",
|
||||
"description": "An array of at least two GeoJsonLineString coordinate arrays.",
|
||||
"items": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "GeoJsonPosition"
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"description": "Identifies this object as a GeoJsonMultiLineString.",
|
||||
"enum": [
|
||||
"MultiLineString"
|
||||
],
|
||||
"enumDescriptions": [
|
||||
""
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"GeoJsonMultiPoint": {
|
||||
"id": "GeoJsonMultiPoint",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"coordinates": {
|
||||
"type": "array",
|
||||
"description": "An array of at least two GeoJsonPoint coordinate arrays.",
|
||||
"items": {
|
||||
"$ref": "GeoJsonPosition"
|
||||
}
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"description": "Identifies this object as a GeoJsonMultiPoint.",
|
||||
"enum": [
|
||||
"MultiPoint"
|
||||
],
|
||||
"enumDescriptions": [
|
||||
""
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"GeoJsonMultiPolygon": {
|
||||
"id": "GeoJsonMultiPolygon",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"coordinates": {
|
||||
"type": "array",
|
||||
"description": "An array of at least two GeoJsonPolygon coordinate arrays.",
|
||||
"items": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "GeoJsonPosition"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"description": "Identifies this object as a GeoJsonMultiPolygon.",
|
||||
"enum": [
|
||||
"MultiPolygon"
|
||||
],
|
||||
"enumDescriptions": [
|
||||
""
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"GeoJsonPoint": {
|
||||
"id": "GeoJsonPoint",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"coordinates": {
|
||||
"$ref": "GeoJsonPosition",
|
||||
"description": "A single GeoJsonPosition, specifying the location of the point."
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"description": "Identifies this object as a GeoJsonPoint.",
|
||||
"enum": [
|
||||
"Point"
|
||||
],
|
||||
"enumDescriptions": [
|
||||
""
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"GeoJsonPolygon": {
|
||||
"id": "GeoJsonPolygon",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"coordinates": {
|
||||
"type": "array",
|
||||
"description": "An array of LinearRings, each of which is an array of four or more GeoJsonPositions. The first and last coordinates in each LinearRing must be the same. For polygons with multiple rings, the first LinearRing is the external ring, with subsequent rings being interior rings (i.e. hole). All LinearRings must contain GeoJsonPositions in counter-clockwise order.",
|
||||
"items": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "GeoJsonPosition"
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"description": "Identifies this object as a GeoJsonPolygon.",
|
||||
"enum": [
|
||||
"Polygon"
|
||||
],
|
||||
"enumDescriptions": [
|
||||
""
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"GeoJsonPosition": {
|
||||
"id": "GeoJsonPosition",
|
||||
"type": "array",
|
||||
"description": "A position represents a geographical position as an array containing a longitude and a latitude, and optionally an altitude, in that order. All Geometry objects make use of positions to represent geometries as nested arrays. The structure of the array is governed by the type of the geometry.",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
}
|
||||
},
|
||||
"MapFolder": {
|
||||
"id": "MapFolder",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"contents": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "MapItem"
|
||||
}
|
||||
},
|
||||
"defaultViewport": {
|
||||
"type": "array",
|
||||
"description": "An array of four numbers (west, south, east, north) which defines the rectangular bounding box of the default viewport. The numbers represent latitude and longitude in decimal degrees.",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
}
|
||||
},
|
||||
"expandable": {
|
||||
"type": "boolean",
|
||||
"description": "The expandability setting of this MapFolder. If true, the folder can be expanded."
|
||||
},
|
||||
"key": {
|
||||
"type": "string",
|
||||
"description": "A user defined alias for this MapFolder, specific to this Map."
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "The name of this MapFolder.",
|
||||
"annotations": {
|
||||
"required": [
|
||||
"mapsengine.maps.create",
|
||||
"mapsengine.maps.patch"
|
||||
]
|
||||
}
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"description": "Identifies this object as a MapFolder.",
|
||||
"enum": [
|
||||
"folder"
|
||||
],
|
||||
"enumDescriptions": [
|
||||
""
|
||||
],
|
||||
"annotations": {
|
||||
"required": [
|
||||
"mapsengine.maps.create",
|
||||
"mapsengine.maps.patch"
|
||||
]
|
||||
}
|
||||
},
|
||||
"visibility": {
|
||||
"type": "string",
|
||||
"description": "The visibility setting of this MapFolder. One of \"defaultOn\" or \"defaultOff\"."
|
||||
}
|
||||
}
|
||||
},
|
||||
"MapItem": {
|
||||
"id": "MapItem",
|
||||
"type": "object",
|
||||
"variant": {
|
||||
"discriminant": "type",
|
||||
"map": [
|
||||
{
|
||||
"type_value": "folder",
|
||||
"$ref": "MapFolder"
|
||||
},
|
||||
{
|
||||
"type_value": "kmlLink",
|
||||
"$ref": "MapKmlLink"
|
||||
},
|
||||
{
|
||||
"type_value": "layer",
|
||||
"$ref": "MapLayer"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"MapKmlLink": {
|
||||
"id": "MapKmlLink",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"defaultViewport": {
|
||||
"type": "array",
|
||||
"description": "An array of four numbers (west, south, east, north) which defines the rectangular bounding box of the default viewport. The numbers represent latitude and longitude in decimal degrees.",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
}
|
||||
},
|
||||
"kmlUrl": {
|
||||
"type": "string",
|
||||
"description": "The URL to the KML file represented by this MapKmlLink.",
|
||||
"annotations": {
|
||||
"required": [
|
||||
"mapsengine.maps.create",
|
||||
"mapsengine.maps.patch"
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "The name of this MapKmlLink.",
|
||||
"annotations": {
|
||||
"required": [
|
||||
"mapsengine.maps.create",
|
||||
"mapsengine.maps.patch"
|
||||
]
|
||||
}
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"description": "Identifies this object as a MapKmlLink.",
|
||||
"enum": [
|
||||
"kmlLink"
|
||||
],
|
||||
"enumDescriptions": [
|
||||
""
|
||||
],
|
||||
"annotations": {
|
||||
"required": [
|
||||
"mapsengine.maps.create",
|
||||
"mapsengine.maps.patch"
|
||||
]
|
||||
}
|
||||
},
|
||||
"visibility": {
|
||||
"type": "string",
|
||||
"description": "The visibility setting of this MapKmlLink. One of \"defaultOn\" or \"defaultOff\"."
|
||||
}
|
||||
}
|
||||
},
|
||||
"MapLayer": {
|
||||
"id": "MapLayer",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"defaultViewport": {
|
||||
"type": "array",
|
||||
"description": "An array of four numbers (west, south, east, north) which defines the rectangular bounding box of the default viewport. The numbers represent latitude and longitude in decimal degrees.",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "string",
|
||||
"description": "The ID of this MapLayer. This ID can be used to request more details about the layer.",
|
||||
"annotations": {
|
||||
"required": [
|
||||
"mapsengine.maps.create",
|
||||
"mapsengine.maps.patch"
|
||||
]
|
||||
}
|
||||
},
|
||||
"key": {
|
||||
"type": "string",
|
||||
"description": "A user defined alias for this MapLayer, specific to this Map."
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "The name of this MapLayer."
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"description": "Identifies this object as a MapLayer.",
|
||||
"enum": [
|
||||
"layer"
|
||||
],
|
||||
"enumDescriptions": [
|
||||
""
|
||||
],
|
||||
"annotations": {
|
||||
"required": [
|
||||
"mapsengine.maps.create",
|
||||
"mapsengine.maps.patch"
|
||||
]
|
||||
}
|
||||
},
|
||||
"visibility": {
|
||||
"type": "string",
|
||||
"description": "The visibility setting of this MapLayer. One of \"defaultOn\" or \"defaultOff\"."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
547
vendor/google.golang.org/api/google-api-go-generator/testdata/variants.want
generated
vendored
Normal file
547
vendor/google.golang.org/api/google-api-go-generator/testdata/variants.want
generated
vendored
Normal file
@@ -0,0 +1,547 @@
|
||||
// Package additionalpropsobjs provides access to the Example API.
|
||||
//
|
||||
// Usage example:
|
||||
//
|
||||
// import "google.golang.org/api/additionalpropsobjs/v1"
|
||||
// ...
|
||||
// additionalpropsobjsService, err := additionalpropsobjs.New(oauthHttpClient)
|
||||
package additionalpropsobjs // import "google.golang.org/api/additionalpropsobjs/v1"
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
context "golang.org/x/net/context"
|
||||
ctxhttp "golang.org/x/net/context/ctxhttp"
|
||||
gensupport "google.golang.org/api/gensupport"
|
||||
googleapi "google.golang.org/api/googleapi"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Always reference these packages, just in case the auto-generated code
|
||||
// below doesn't.
|
||||
var _ = bytes.NewBuffer
|
||||
var _ = strconv.Itoa
|
||||
var _ = fmt.Sprintf
|
||||
var _ = json.NewDecoder
|
||||
var _ = io.Copy
|
||||
var _ = url.Parse
|
||||
var _ = gensupport.MarshalJSON
|
||||
var _ = googleapi.Version
|
||||
var _ = errors.New
|
||||
var _ = strings.Replace
|
||||
var _ = context.Canceled
|
||||
var _ = ctxhttp.Do
|
||||
|
||||
const apiId = "additionalpropsobjs:v1"
|
||||
const apiName = "additionalpropsobjs"
|
||||
const apiVersion = "v1"
|
||||
const basePath = "https://www.googleapis.com/discovery/v1/apis"
|
||||
|
||||
func New(client *http.Client) (*Service, error) {
|
||||
if client == nil {
|
||||
return nil, errors.New("client is nil")
|
||||
}
|
||||
s := &Service{client: client, BasePath: basePath}
|
||||
return s, nil
|
||||
}
|
||||
|
||||
type Service struct {
|
||||
client *http.Client
|
||||
BasePath string // API endpoint base URL
|
||||
UserAgent string // optional additional User-Agent fragment
|
||||
}
|
||||
|
||||
func (s *Service) userAgent() string {
|
||||
if s.UserAgent == "" {
|
||||
return googleapi.UserAgent
|
||||
}
|
||||
return googleapi.UserAgent + " " + s.UserAgent
|
||||
}
|
||||
|
||||
type GeoJsonGeometry map[string]interface{}
|
||||
|
||||
func (t GeoJsonGeometry) Type() string {
|
||||
return googleapi.VariantType(t)
|
||||
}
|
||||
|
||||
func (t GeoJsonGeometry) GeometryCollection() (r GeoJsonGeometryCollection, ok bool) {
|
||||
if t.Type() != "GeometryCollection" {
|
||||
return r, false
|
||||
}
|
||||
ok = googleapi.ConvertVariant(map[string]interface{}(t), &r)
|
||||
return r, ok
|
||||
}
|
||||
|
||||
func (t GeoJsonGeometry) LineString() (r GeoJsonLineString, ok bool) {
|
||||
if t.Type() != "LineString" {
|
||||
return r, false
|
||||
}
|
||||
ok = googleapi.ConvertVariant(map[string]interface{}(t), &r)
|
||||
return r, ok
|
||||
}
|
||||
|
||||
func (t GeoJsonGeometry) MultiLineString() (r GeoJsonMultiLineString, ok bool) {
|
||||
if t.Type() != "MultiLineString" {
|
||||
return r, false
|
||||
}
|
||||
ok = googleapi.ConvertVariant(map[string]interface{}(t), &r)
|
||||
return r, ok
|
||||
}
|
||||
|
||||
func (t GeoJsonGeometry) MultiPoint() (r GeoJsonMultiPoint, ok bool) {
|
||||
if t.Type() != "MultiPoint" {
|
||||
return r, false
|
||||
}
|
||||
ok = googleapi.ConvertVariant(map[string]interface{}(t), &r)
|
||||
return r, ok
|
||||
}
|
||||
|
||||
func (t GeoJsonGeometry) MultiPolygon() (r GeoJsonMultiPolygon, ok bool) {
|
||||
if t.Type() != "MultiPolygon" {
|
||||
return r, false
|
||||
}
|
||||
ok = googleapi.ConvertVariant(map[string]interface{}(t), &r)
|
||||
return r, ok
|
||||
}
|
||||
|
||||
func (t GeoJsonGeometry) Point() (r GeoJsonPoint, ok bool) {
|
||||
if t.Type() != "Point" {
|
||||
return r, false
|
||||
}
|
||||
ok = googleapi.ConvertVariant(map[string]interface{}(t), &r)
|
||||
return r, ok
|
||||
}
|
||||
|
||||
func (t GeoJsonGeometry) Polygon() (r GeoJsonPolygon, ok bool) {
|
||||
if t.Type() != "Polygon" {
|
||||
return r, false
|
||||
}
|
||||
ok = googleapi.ConvertVariant(map[string]interface{}(t), &r)
|
||||
return r, ok
|
||||
}
|
||||
|
||||
// GeoJsonGeometryCollection: A heterogenous collection of
|
||||
// GeoJsonGeometry objects.
|
||||
type GeoJsonGeometryCollection struct {
|
||||
// Geometries: An array of geometry objects. There must be at least 2
|
||||
// different types of geometries in the array.
|
||||
Geometries []GeoJsonGeometry `json:"geometries,omitempty"`
|
||||
|
||||
// Type: Identifies this object as a GeoJsonGeometryCollection.
|
||||
//
|
||||
// Possible values:
|
||||
// "GeometryCollection"
|
||||
Type string `json:"type,omitempty"`
|
||||
|
||||
// ForceSendFields is a list of field names (e.g. "Geometries") to
|
||||
// unconditionally include in API requests. By default, fields with
|
||||
// empty values are omitted from API requests. However, any non-pointer,
|
||||
// non-interface field appearing in ForceSendFields will be sent to the
|
||||
// server regardless of whether the field is empty or not. This may be
|
||||
// used to include empty fields in Patch requests.
|
||||
ForceSendFields []string `json:"-"`
|
||||
|
||||
// NullFields is a list of field names (e.g. "Geometries") to include in
|
||||
// API requests with the JSON null value. By default, fields with empty
|
||||
// values are omitted from API requests. However, any field with an
|
||||
// empty value appearing in NullFields will be sent to the server as
|
||||
// null. It is an error if a field in this list has a non-empty value.
|
||||
// This may be used to include null fields in Patch requests.
|
||||
NullFields []string `json:"-"`
|
||||
}
|
||||
|
||||
func (s *GeoJsonGeometryCollection) MarshalJSON() ([]byte, error) {
|
||||
type noMethod GeoJsonGeometryCollection
|
||||
raw := noMethod(*s)
|
||||
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
|
||||
}
|
||||
|
||||
type GeoJsonLineString struct {
|
||||
// Coordinates: An array of two or more positions, representing a line.
|
||||
Coordinates [][]float64 `json:"coordinates,omitempty"`
|
||||
|
||||
// Type: Identifies this object as a GeoJsonLineString.
|
||||
//
|
||||
// Possible values:
|
||||
// "LineString"
|
||||
Type string `json:"type,omitempty"`
|
||||
|
||||
// ForceSendFields is a list of field names (e.g. "Coordinates") to
|
||||
// unconditionally include in API requests. By default, fields with
|
||||
// empty values are omitted from API requests. However, any non-pointer,
|
||||
// non-interface field appearing in ForceSendFields will be sent to the
|
||||
// server regardless of whether the field is empty or not. This may be
|
||||
// used to include empty fields in Patch requests.
|
||||
ForceSendFields []string `json:"-"`
|
||||
|
||||
// NullFields is a list of field names (e.g. "Coordinates") to include
|
||||
// in API requests with the JSON null value. By default, fields with
|
||||
// empty values are omitted from API requests. However, any field with
|
||||
// an empty value appearing in NullFields will be sent to the server as
|
||||
// null. It is an error if a field in this list has a non-empty value.
|
||||
// This may be used to include null fields in Patch requests.
|
||||
NullFields []string `json:"-"`
|
||||
}
|
||||
|
||||
func (s *GeoJsonLineString) MarshalJSON() ([]byte, error) {
|
||||
type noMethod GeoJsonLineString
|
||||
raw := noMethod(*s)
|
||||
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
|
||||
}
|
||||
|
||||
// GeoJsonMultiLineString: Multi Line String
|
||||
type GeoJsonMultiLineString struct {
|
||||
// Coordinates: An array of at least two GeoJsonLineString coordinate
|
||||
// arrays.
|
||||
Coordinates [][][]float64 `json:"coordinates,omitempty"`
|
||||
|
||||
// Type: Identifies this object as a GeoJsonMultiLineString.
|
||||
//
|
||||
// Possible values:
|
||||
// "MultiLineString"
|
||||
Type string `json:"type,omitempty"`
|
||||
|
||||
// ForceSendFields is a list of field names (e.g. "Coordinates") to
|
||||
// unconditionally include in API requests. By default, fields with
|
||||
// empty values are omitted from API requests. However, any non-pointer,
|
||||
// non-interface field appearing in ForceSendFields will be sent to the
|
||||
// server regardless of whether the field is empty or not. This may be
|
||||
// used to include empty fields in Patch requests.
|
||||
ForceSendFields []string `json:"-"`
|
||||
|
||||
// NullFields is a list of field names (e.g. "Coordinates") to include
|
||||
// in API requests with the JSON null value. By default, fields with
|
||||
// empty values are omitted from API requests. However, any field with
|
||||
// an empty value appearing in NullFields will be sent to the server as
|
||||
// null. It is an error if a field in this list has a non-empty value.
|
||||
// This may be used to include null fields in Patch requests.
|
||||
NullFields []string `json:"-"`
|
||||
}
|
||||
|
||||
func (s *GeoJsonMultiLineString) MarshalJSON() ([]byte, error) {
|
||||
type noMethod GeoJsonMultiLineString
|
||||
raw := noMethod(*s)
|
||||
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
|
||||
}
|
||||
|
||||
type GeoJsonMultiPoint struct {
|
||||
// Coordinates: An array of at least two GeoJsonPoint coordinate arrays.
|
||||
Coordinates [][]float64 `json:"coordinates,omitempty"`
|
||||
|
||||
// Type: Identifies this object as a GeoJsonMultiPoint.
|
||||
//
|
||||
// Possible values:
|
||||
// "MultiPoint"
|
||||
Type string `json:"type,omitempty"`
|
||||
|
||||
// ForceSendFields is a list of field names (e.g. "Coordinates") to
|
||||
// unconditionally include in API requests. By default, fields with
|
||||
// empty values are omitted from API requests. However, any non-pointer,
|
||||
// non-interface field appearing in ForceSendFields will be sent to the
|
||||
// server regardless of whether the field is empty or not. This may be
|
||||
// used to include empty fields in Patch requests.
|
||||
ForceSendFields []string `json:"-"`
|
||||
|
||||
// NullFields is a list of field names (e.g. "Coordinates") to include
|
||||
// in API requests with the JSON null value. By default, fields with
|
||||
// empty values are omitted from API requests. However, any field with
|
||||
// an empty value appearing in NullFields will be sent to the server as
|
||||
// null. It is an error if a field in this list has a non-empty value.
|
||||
// This may be used to include null fields in Patch requests.
|
||||
NullFields []string `json:"-"`
|
||||
}
|
||||
|
||||
func (s *GeoJsonMultiPoint) MarshalJSON() ([]byte, error) {
|
||||
type noMethod GeoJsonMultiPoint
|
||||
raw := noMethod(*s)
|
||||
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
|
||||
}
|
||||
|
||||
type GeoJsonMultiPolygon struct {
|
||||
// Coordinates: An array of at least two GeoJsonPolygon coordinate
|
||||
// arrays.
|
||||
Coordinates [][][][]float64 `json:"coordinates,omitempty"`
|
||||
|
||||
// Type: Identifies this object as a GeoJsonMultiPolygon.
|
||||
//
|
||||
// Possible values:
|
||||
// "MultiPolygon"
|
||||
Type string `json:"type,omitempty"`
|
||||
|
||||
// ForceSendFields is a list of field names (e.g. "Coordinates") to
|
||||
// unconditionally include in API requests. By default, fields with
|
||||
// empty values are omitted from API requests. However, any non-pointer,
|
||||
// non-interface field appearing in ForceSendFields will be sent to the
|
||||
// server regardless of whether the field is empty or not. This may be
|
||||
// used to include empty fields in Patch requests.
|
||||
ForceSendFields []string `json:"-"`
|
||||
|
||||
// NullFields is a list of field names (e.g. "Coordinates") to include
|
||||
// in API requests with the JSON null value. By default, fields with
|
||||
// empty values are omitted from API requests. However, any field with
|
||||
// an empty value appearing in NullFields will be sent to the server as
|
||||
// null. It is an error if a field in this list has a non-empty value.
|
||||
// This may be used to include null fields in Patch requests.
|
||||
NullFields []string `json:"-"`
|
||||
}
|
||||
|
||||
func (s *GeoJsonMultiPolygon) MarshalJSON() ([]byte, error) {
|
||||
type noMethod GeoJsonMultiPolygon
|
||||
raw := noMethod(*s)
|
||||
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
|
||||
}
|
||||
|
||||
type GeoJsonPoint struct {
|
||||
// Coordinates: A single GeoJsonPosition, specifying the location of the
|
||||
// point.
|
||||
Coordinates []float64 `json:"coordinates,omitempty"`
|
||||
|
||||
// Type: Identifies this object as a GeoJsonPoint.
|
||||
//
|
||||
// Possible values:
|
||||
// "Point"
|
||||
Type string `json:"type,omitempty"`
|
||||
|
||||
// ForceSendFields is a list of field names (e.g. "Coordinates") to
|
||||
// unconditionally include in API requests. By default, fields with
|
||||
// empty values are omitted from API requests. However, any non-pointer,
|
||||
// non-interface field appearing in ForceSendFields will be sent to the
|
||||
// server regardless of whether the field is empty or not. This may be
|
||||
// used to include empty fields in Patch requests.
|
||||
ForceSendFields []string `json:"-"`
|
||||
|
||||
// NullFields is a list of field names (e.g. "Coordinates") to include
|
||||
// in API requests with the JSON null value. By default, fields with
|
||||
// empty values are omitted from API requests. However, any field with
|
||||
// an empty value appearing in NullFields will be sent to the server as
|
||||
// null. It is an error if a field in this list has a non-empty value.
|
||||
// This may be used to include null fields in Patch requests.
|
||||
NullFields []string `json:"-"`
|
||||
}
|
||||
|
||||
func (s *GeoJsonPoint) MarshalJSON() ([]byte, error) {
|
||||
type noMethod GeoJsonPoint
|
||||
raw := noMethod(*s)
|
||||
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
|
||||
}
|
||||
|
||||
type GeoJsonPolygon struct {
|
||||
// Coordinates: An array of LinearRings, each of which is an array of
|
||||
// four or more GeoJsonPositions. The first and last coordinates in each
|
||||
// LinearRing must be the same. For polygons with multiple rings, the
|
||||
// first LinearRing is the external ring, with subsequent rings being
|
||||
// interior rings (i.e. hole). All LinearRings must contain
|
||||
// GeoJsonPositions in counter-clockwise order.
|
||||
Coordinates [][][]float64 `json:"coordinates,omitempty"`
|
||||
|
||||
// Type: Identifies this object as a GeoJsonPolygon.
|
||||
//
|
||||
// Possible values:
|
||||
// "Polygon"
|
||||
Type string `json:"type,omitempty"`
|
||||
|
||||
// ForceSendFields is a list of field names (e.g. "Coordinates") to
|
||||
// unconditionally include in API requests. By default, fields with
|
||||
// empty values are omitted from API requests. However, any non-pointer,
|
||||
// non-interface field appearing in ForceSendFields will be sent to the
|
||||
// server regardless of whether the field is empty or not. This may be
|
||||
// used to include empty fields in Patch requests.
|
||||
ForceSendFields []string `json:"-"`
|
||||
|
||||
// NullFields is a list of field names (e.g. "Coordinates") to include
|
||||
// in API requests with the JSON null value. By default, fields with
|
||||
// empty values are omitted from API requests. However, any field with
|
||||
// an empty value appearing in NullFields will be sent to the server as
|
||||
// null. It is an error if a field in this list has a non-empty value.
|
||||
// This may be used to include null fields in Patch requests.
|
||||
NullFields []string `json:"-"`
|
||||
}
|
||||
|
||||
func (s *GeoJsonPolygon) MarshalJSON() ([]byte, error) {
|
||||
type noMethod GeoJsonPolygon
|
||||
raw := noMethod(*s)
|
||||
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
|
||||
}
|
||||
|
||||
type MapFolder struct {
|
||||
Contents []MapItem `json:"contents,omitempty"`
|
||||
|
||||
// DefaultViewport: An array of four numbers (west, south, east, north)
|
||||
// which defines the rectangular bounding box of the default viewport.
|
||||
// The numbers represent latitude and longitude in decimal degrees.
|
||||
DefaultViewport []float64 `json:"defaultViewport,omitempty"`
|
||||
|
||||
// Expandable: The expandability setting of this MapFolder. If true, the
|
||||
// folder can be expanded.
|
||||
Expandable bool `json:"expandable,omitempty"`
|
||||
|
||||
// Key: A user defined alias for this MapFolder, specific to this Map.
|
||||
Key string `json:"key,omitempty"`
|
||||
|
||||
// Name: The name of this MapFolder.
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// Type: Identifies this object as a MapFolder.
|
||||
//
|
||||
// Possible values:
|
||||
// "folder"
|
||||
Type string `json:"type,omitempty"`
|
||||
|
||||
// Visibility: The visibility setting of this MapFolder. One of
|
||||
// "defaultOn" or "defaultOff".
|
||||
Visibility string `json:"visibility,omitempty"`
|
||||
|
||||
// ForceSendFields is a list of field names (e.g. "Contents") to
|
||||
// unconditionally include in API requests. By default, fields with
|
||||
// empty values are omitted from API requests. However, any non-pointer,
|
||||
// non-interface field appearing in ForceSendFields will be sent to the
|
||||
// server regardless of whether the field is empty or not. This may be
|
||||
// used to include empty fields in Patch requests.
|
||||
ForceSendFields []string `json:"-"`
|
||||
|
||||
// NullFields is a list of field names (e.g. "Contents") to include in
|
||||
// API requests with the JSON null value. By default, fields with empty
|
||||
// values are omitted from API requests. However, any field with an
|
||||
// empty value appearing in NullFields will be sent to the server as
|
||||
// null. It is an error if a field in this list has a non-empty value.
|
||||
// This may be used to include null fields in Patch requests.
|
||||
NullFields []string `json:"-"`
|
||||
}
|
||||
|
||||
func (s *MapFolder) MarshalJSON() ([]byte, error) {
|
||||
type noMethod MapFolder
|
||||
raw := noMethod(*s)
|
||||
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
|
||||
}
|
||||
|
||||
type MapItem map[string]interface{}
|
||||
|
||||
func (t MapItem) Type() string {
|
||||
return googleapi.VariantType(t)
|
||||
}
|
||||
|
||||
func (t MapItem) Folder() (r MapFolder, ok bool) {
|
||||
if t.Type() != "Folder" {
|
||||
return r, false
|
||||
}
|
||||
ok = googleapi.ConvertVariant(map[string]interface{}(t), &r)
|
||||
return r, ok
|
||||
}
|
||||
|
||||
func (t MapItem) KmlLink() (r MapKmlLink, ok bool) {
|
||||
if t.Type() != "KmlLink" {
|
||||
return r, false
|
||||
}
|
||||
ok = googleapi.ConvertVariant(map[string]interface{}(t), &r)
|
||||
return r, ok
|
||||
}
|
||||
|
||||
func (t MapItem) Layer() (r MapLayer, ok bool) {
|
||||
if t.Type() != "Layer" {
|
||||
return r, false
|
||||
}
|
||||
ok = googleapi.ConvertVariant(map[string]interface{}(t), &r)
|
||||
return r, ok
|
||||
}
|
||||
|
||||
type MapKmlLink struct {
|
||||
// DefaultViewport: An array of four numbers (west, south, east, north)
|
||||
// which defines the rectangular bounding box of the default viewport.
|
||||
// The numbers represent latitude and longitude in decimal degrees.
|
||||
DefaultViewport []float64 `json:"defaultViewport,omitempty"`
|
||||
|
||||
// KmlUrl: The URL to the KML file represented by this MapKmlLink.
|
||||
KmlUrl string `json:"kmlUrl,omitempty"`
|
||||
|
||||
// Name: The name of this MapKmlLink.
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// Type: Identifies this object as a MapKmlLink.
|
||||
//
|
||||
// Possible values:
|
||||
// "kmlLink"
|
||||
Type string `json:"type,omitempty"`
|
||||
|
||||
// Visibility: The visibility setting of this MapKmlLink. One of
|
||||
// "defaultOn" or "defaultOff".
|
||||
Visibility string `json:"visibility,omitempty"`
|
||||
|
||||
// ForceSendFields is a list of field names (e.g. "DefaultViewport") to
|
||||
// unconditionally include in API requests. By default, fields with
|
||||
// empty values are omitted from API requests. However, any non-pointer,
|
||||
// non-interface field appearing in ForceSendFields will be sent to the
|
||||
// server regardless of whether the field is empty or not. This may be
|
||||
// used to include empty fields in Patch requests.
|
||||
ForceSendFields []string `json:"-"`
|
||||
|
||||
// NullFields is a list of field names (e.g. "DefaultViewport") to
|
||||
// include in API requests with the JSON null value. By default, fields
|
||||
// with empty values are omitted from API requests. However, any field
|
||||
// with an empty value appearing in NullFields will be sent to the
|
||||
// server as null. It is an error if a field in this list has a
|
||||
// non-empty value. This may be used to include null fields in Patch
|
||||
// requests.
|
||||
NullFields []string `json:"-"`
|
||||
}
|
||||
|
||||
func (s *MapKmlLink) MarshalJSON() ([]byte, error) {
|
||||
type noMethod MapKmlLink
|
||||
raw := noMethod(*s)
|
||||
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
|
||||
}
|
||||
|
||||
type MapLayer struct {
|
||||
// DefaultViewport: An array of four numbers (west, south, east, north)
|
||||
// which defines the rectangular bounding box of the default viewport.
|
||||
// The numbers represent latitude and longitude in decimal degrees.
|
||||
DefaultViewport []float64 `json:"defaultViewport,omitempty"`
|
||||
|
||||
// Id: The ID of this MapLayer. This ID can be used to request more
|
||||
// details about the layer.
|
||||
Id string `json:"id,omitempty"`
|
||||
|
||||
// Key: A user defined alias for this MapLayer, specific to this Map.
|
||||
Key string `json:"key,omitempty"`
|
||||
|
||||
// Name: The name of this MapLayer.
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// Type: Identifies this object as a MapLayer.
|
||||
//
|
||||
// Possible values:
|
||||
// "layer"
|
||||
Type string `json:"type,omitempty"`
|
||||
|
||||
// Visibility: The visibility setting of this MapLayer. One of
|
||||
// "defaultOn" or "defaultOff".
|
||||
Visibility string `json:"visibility,omitempty"`
|
||||
|
||||
// ForceSendFields is a list of field names (e.g. "DefaultViewport") to
|
||||
// unconditionally include in API requests. By default, fields with
|
||||
// empty values are omitted from API requests. However, any non-pointer,
|
||||
// non-interface field appearing in ForceSendFields will be sent to the
|
||||
// server regardless of whether the field is empty or not. This may be
|
||||
// used to include empty fields in Patch requests.
|
||||
ForceSendFields []string `json:"-"`
|
||||
|
||||
// NullFields is a list of field names (e.g. "DefaultViewport") to
|
||||
// include in API requests with the JSON null value. By default, fields
|
||||
// with empty values are omitted from API requests. However, any field
|
||||
// with an empty value appearing in NullFields will be sent to the
|
||||
// server as null. It is an error if a field in this list has a
|
||||
// non-empty value. This may be used to include null fields in Patch
|
||||
// requests.
|
||||
NullFields []string `json:"-"`
|
||||
}
|
||||
|
||||
func (s *MapLayer) MarshalJSON() ([]byte, error) {
|
||||
type noMethod MapLayer
|
||||
raw := noMethod(*s)
|
||||
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
|
||||
}
|
30
vendor/google.golang.org/api/google-api-go-generator/testdata/wrapnewlines.json
generated
vendored
Normal file
30
vendor/google.golang.org/api/google-api-go-generator/testdata/wrapnewlines.json
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"kind": "discovery#restDescription",
|
||||
"etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/3m5rB86FE5KuW1K3jAl88AxCreg\"",
|
||||
"discoveryVersion": "v1",
|
||||
"id": "wrapnewlines:v1",
|
||||
"name": "wrapnewlines",
|
||||
"version": "v1",
|
||||
"title": "Example API",
|
||||
"description": "The Example API demonstrates wrapping of descriptions containing newlines.",
|
||||
"ownerDomain": "google.com",
|
||||
"ownerName": "Google",
|
||||
"protocol": "rest",
|
||||
"schemas": {
|
||||
"Thing": {
|
||||
"id": "Thing",
|
||||
"type": "object",
|
||||
"description": "don't care",
|
||||
"properties": {
|
||||
"oneline": {
|
||||
"type": "string",
|
||||
"description": "First sentence. Second sentence. Description is long enough to be wrapped."
|
||||
},
|
||||
"twoline": {
|
||||
"type": "string",
|
||||
"description": "First sentence.\nSecond sentence. Description is long enough to be wrapped."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
98
vendor/google.golang.org/api/google-api-go-generator/testdata/wrapnewlines.want
generated
vendored
Normal file
98
vendor/google.golang.org/api/google-api-go-generator/testdata/wrapnewlines.want
generated
vendored
Normal file
@@ -0,0 +1,98 @@
|
||||
// Package wrapnewlines provides access to the Example API.
|
||||
//
|
||||
// Usage example:
|
||||
//
|
||||
// import "google.golang.org/api/wrapnewlines/v1"
|
||||
// ...
|
||||
// wrapnewlinesService, err := wrapnewlines.New(oauthHttpClient)
|
||||
package wrapnewlines // import "google.golang.org/api/wrapnewlines/v1"
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
context "golang.org/x/net/context"
|
||||
ctxhttp "golang.org/x/net/context/ctxhttp"
|
||||
gensupport "google.golang.org/api/gensupport"
|
||||
googleapi "google.golang.org/api/googleapi"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Always reference these packages, just in case the auto-generated code
|
||||
// below doesn't.
|
||||
var _ = bytes.NewBuffer
|
||||
var _ = strconv.Itoa
|
||||
var _ = fmt.Sprintf
|
||||
var _ = json.NewDecoder
|
||||
var _ = io.Copy
|
||||
var _ = url.Parse
|
||||
var _ = gensupport.MarshalJSON
|
||||
var _ = googleapi.Version
|
||||
var _ = errors.New
|
||||
var _ = strings.Replace
|
||||
var _ = context.Canceled
|
||||
var _ = ctxhttp.Do
|
||||
|
||||
const apiId = "wrapnewlines:v1"
|
||||
const apiName = "wrapnewlines"
|
||||
const apiVersion = "v1"
|
||||
const basePath = "https://www.googleapis.com/discovery/v1/apis"
|
||||
|
||||
func New(client *http.Client) (*Service, error) {
|
||||
if client == nil {
|
||||
return nil, errors.New("client is nil")
|
||||
}
|
||||
s := &Service{client: client, BasePath: basePath}
|
||||
return s, nil
|
||||
}
|
||||
|
||||
type Service struct {
|
||||
client *http.Client
|
||||
BasePath string // API endpoint base URL
|
||||
UserAgent string // optional additional User-Agent fragment
|
||||
}
|
||||
|
||||
func (s *Service) userAgent() string {
|
||||
if s.UserAgent == "" {
|
||||
return googleapi.UserAgent
|
||||
}
|
||||
return googleapi.UserAgent + " " + s.UserAgent
|
||||
}
|
||||
|
||||
// Thing: don't care
|
||||
type Thing struct {
|
||||
// Oneline: First sentence. Second sentence. Description is long enough
|
||||
// to be wrapped.
|
||||
Oneline string `json:"oneline,omitempty"`
|
||||
|
||||
// Twoline: First sentence.
|
||||
// Second sentence. Description is long enough to be wrapped.
|
||||
Twoline string `json:"twoline,omitempty"`
|
||||
|
||||
// ForceSendFields is a list of field names (e.g. "Oneline") to
|
||||
// unconditionally include in API requests. By default, fields with
|
||||
// empty values are omitted from API requests. However, any non-pointer,
|
||||
// non-interface field appearing in ForceSendFields will be sent to the
|
||||
// server regardless of whether the field is empty or not. This may be
|
||||
// used to include empty fields in Patch requests.
|
||||
ForceSendFields []string `json:"-"`
|
||||
|
||||
// NullFields is a list of field names (e.g. "Oneline") to include in
|
||||
// API requests with the JSON null value. By default, fields with empty
|
||||
// values are omitted from API requests. However, any field with an
|
||||
// empty value appearing in NullFields will be sent to the server as
|
||||
// null. It is an error if a field in this list has a non-empty value.
|
||||
// This may be used to include null fields in Patch requests.
|
||||
NullFields []string `json:"-"`
|
||||
}
|
||||
|
||||
func (s *Thing) MarshalJSON() ([]byte, error) {
|
||||
type noMethod Thing
|
||||
raw := noMethod(*s)
|
||||
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
|
||||
}
|
Reference in New Issue
Block a user