Merge pull request #39351 from wojtek-t/update_google_apis

Automatic merge from submit-queue

Update Google API dependencies

In order to experiment with alpha or beta GCP APIs (that are new), we need to make the client compatible with v1 client. And there were some cosmetic changes that make them incompatible with the version that we were using before (e.g. passing pointers vs non-pointers in gensupport functions).
This commit is contained in:
Kubernetes Submit Queue 2017-01-03 00:02:39 -08:00 committed by GitHub
commit f6e596d468
13 changed files with 18813 additions and 400 deletions

14
Godeps/Godeps.json generated
View File

@ -2530,31 +2530,31 @@
},
{
"ImportPath": "google.golang.org/api/cloudmonitoring/v2beta2",
"Rev": "a69f0f19d246419bb931b0ac8f4f8d3f3e6d4feb"
"Rev": "55146ba61254fdb1c26d65ff3c04bc1611ad73fb"
},
{
"ImportPath": "google.golang.org/api/compute/v1",
"Rev": "a69f0f19d246419bb931b0ac8f4f8d3f3e6d4feb"
"Rev": "55146ba61254fdb1c26d65ff3c04bc1611ad73fb"
},
{
"ImportPath": "google.golang.org/api/container/v1",
"Rev": "a69f0f19d246419bb931b0ac8f4f8d3f3e6d4feb"
"Rev": "55146ba61254fdb1c26d65ff3c04bc1611ad73fb"
},
{
"ImportPath": "google.golang.org/api/dns/v1",
"Rev": "a69f0f19d246419bb931b0ac8f4f8d3f3e6d4feb"
"Rev": "55146ba61254fdb1c26d65ff3c04bc1611ad73fb"
},
{
"ImportPath": "google.golang.org/api/gensupport",
"Rev": "a69f0f19d246419bb931b0ac8f4f8d3f3e6d4feb"
"Rev": "55146ba61254fdb1c26d65ff3c04bc1611ad73fb"
},
{
"ImportPath": "google.golang.org/api/googleapi",
"Rev": "a69f0f19d246419bb931b0ac8f4f8d3f3e6d4feb"
"Rev": "55146ba61254fdb1c26d65ff3c04bc1611ad73fb"
},
{
"ImportPath": "google.golang.org/api/googleapi/internal/uritemplates",
"Rev": "a69f0f19d246419bb931b0ac8f4f8d3f3e6d4feb"
"Rev": "55146ba61254fdb1c26d65ff3c04bc1611ad73fb"
},
{
"ImportPath": "google.golang.org/appengine",

View File

@ -1,19 +1,19 @@
{
"kind": "discovery#restDescription",
"etag": "\"bRFOOrZKfO9LweMbPqu0kcu6De8/A2G_NAa29vne9MPSojupRQ5bVuo\"",
"etag": "\"tbys6C40o18GZwyMen5GMkdK-3s/mLggzdz9EvP0lVEQoxoRvdSJShg\"",
"discoveryVersion": "v1",
"id": "cloudmonitoring:v2beta2",
"name": "cloudmonitoring",
"canonicalName": "Cloud Monitoring",
"version": "v2beta2",
"revision": "20160314",
"revision": "20161031",
"title": "Cloud Monitoring API",
"description": "Accesses Google Cloud Monitoring data.",
"ownerDomain": "google.com",
"ownerName": "Google",
"icons": {
"x16": "http://www.google.com/images/icons/product/search-16.gif",
"x32": "http://www.google.com/images/icons/product/search-32.gif"
"x16": "https://www.gstatic.com/images/branding/product/1x/googleg_16dp.png",
"x32": "https://www.gstatic.com/images/branding/product/1x/googleg_32dp.png"
},
"documentationLink": "https://cloud.google.com/monitoring/v2beta2/",
"protocol": "rest",

View File

@ -130,12 +130,20 @@ type DeleteMetricDescriptorResponse struct {
// 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 *DeleteMetricDescriptorResponse) MarshalJSON() ([]byte, error) {
type noMethod DeleteMetricDescriptorResponse
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ListMetricDescriptorsRequest: The request of
@ -152,12 +160,20 @@ type ListMetricDescriptorsRequest struct {
// 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 *ListMetricDescriptorsRequest) MarshalJSON() ([]byte, error) {
type noMethod ListMetricDescriptorsRequest
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ListMetricDescriptorsResponse: The response of
@ -187,12 +203,20 @@ type ListMetricDescriptorsResponse struct {
// 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 *ListMetricDescriptorsResponse) MarshalJSON() ([]byte, error) {
type noMethod ListMetricDescriptorsResponse
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ListTimeseriesDescriptorsRequest: The request of
@ -209,12 +233,20 @@ type ListTimeseriesDescriptorsRequest struct {
// 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 *ListTimeseriesDescriptorsRequest) MarshalJSON() ([]byte, error) {
type noMethod ListTimeseriesDescriptorsRequest
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ListTimeseriesDescriptorsResponse: The response of
@ -252,12 +284,20 @@ type ListTimeseriesDescriptorsResponse struct {
// 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 *ListTimeseriesDescriptorsResponse) MarshalJSON() ([]byte, error) {
type noMethod ListTimeseriesDescriptorsResponse
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ListTimeseriesRequest: The request of cloudmonitoring.timeseries.list
@ -273,12 +313,20 @@ type ListTimeseriesRequest struct {
// 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 *ListTimeseriesRequest) MarshalJSON() ([]byte, error) {
type noMethod ListTimeseriesRequest
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ListTimeseriesResponse: The response of
@ -317,12 +365,20 @@ type ListTimeseriesResponse struct {
// 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 *ListTimeseriesResponse) MarshalJSON() ([]byte, error) {
type noMethod ListTimeseriesResponse
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// MetricDescriptor: A metricDescriptor defines the name, label keys,
@ -354,12 +410,20 @@ type MetricDescriptor struct {
// 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. "Description") 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 *MetricDescriptor) MarshalJSON() ([]byte, error) {
type noMethod MetricDescriptor
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// MetricDescriptorLabelDescriptor: A label in a metric is a description
@ -379,12 +443,20 @@ type MetricDescriptorLabelDescriptor struct {
// 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. "Description") 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 *MetricDescriptorLabelDescriptor) MarshalJSON() ([]byte, error) {
type noMethod MetricDescriptorLabelDescriptor
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// MetricDescriptorTypeDescriptor: A type in a metric contains
@ -406,12 +478,20 @@ type MetricDescriptorTypeDescriptor struct {
// 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. "MetricType") 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 *MetricDescriptorTypeDescriptor) MarshalJSON() ([]byte, error) {
type noMethod MetricDescriptorTypeDescriptor
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Point: Point is a single point in a time series. It consists of a
@ -459,12 +539,20 @@ type Point struct {
// 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. "BoolValue") 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 *Point) MarshalJSON() ([]byte, error) {
type noMethod Point
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// PointDistribution: Distribution data point value type. When writing
@ -488,12 +576,20 @@ type PointDistribution struct {
// 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. "Buckets") 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 *PointDistribution) MarshalJSON() ([]byte, error) {
type noMethod PointDistribution
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// PointDistributionBucket: The histogram's bucket. Buckets that form
@ -520,12 +616,20 @@ type PointDistributionBucket struct {
// 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. "Count") 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 *PointDistributionBucket) MarshalJSON() ([]byte, error) {
type noMethod PointDistributionBucket
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// PointDistributionOverflowBucket: The overflow bucket is a special
@ -547,12 +651,20 @@ type PointDistributionOverflowBucket struct {
// 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. "Count") 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 *PointDistributionOverflowBucket) MarshalJSON() ([]byte, error) {
type noMethod PointDistributionOverflowBucket
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// PointDistributionUnderflowBucket: The underflow bucket is a special
@ -574,12 +686,20 @@ type PointDistributionUnderflowBucket struct {
// 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. "Count") 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 *PointDistributionUnderflowBucket) MarshalJSON() ([]byte, error) {
type noMethod PointDistributionUnderflowBucket
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Timeseries: The monitoring data is organized as metrics and stored as
@ -601,12 +721,20 @@ type Timeseries struct {
// 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. "Points") 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 *Timeseries) MarshalJSON() ([]byte, error) {
type noMethod Timeseries
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// TimeseriesDescriptor: TimeseriesDescriptor identifies a single time
@ -629,12 +757,20 @@ type TimeseriesDescriptor struct {
// 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)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
type TimeseriesDescriptorLabel struct {
@ -651,12 +787,20 @@ type TimeseriesDescriptorLabel struct {
// 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. "Key") 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 *TimeseriesDescriptorLabel) MarshalJSON() ([]byte, error) {
type noMethod TimeseriesDescriptorLabel
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// TimeseriesPoint: When writing time series, TimeseriesPoint should be
@ -676,12 +820,20 @@ type TimeseriesPoint struct {
// 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. "Point") 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 *TimeseriesPoint) MarshalJSON() ([]byte, error) {
type noMethod TimeseriesPoint
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// WriteTimeseriesRequest: The request of
@ -702,12 +854,20 @@ type WriteTimeseriesRequest struct {
// 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. "CommonLabels") 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 *WriteTimeseriesRequest) MarshalJSON() ([]byte, error) {
type noMethod WriteTimeseriesRequest
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// WriteTimeseriesResponse: The response of
@ -728,12 +888,20 @@ type WriteTimeseriesResponse struct {
// 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 *WriteTimeseriesResponse) MarshalJSON() ([]byte, error) {
type noMethod WriteTimeseriesResponse
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// method id "cloudmonitoring.metricDescriptors.create":
@ -744,6 +912,7 @@ type MetricDescriptorsCreateCall struct {
metricdescriptor *MetricDescriptor
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Create: Create a new metric.
@ -770,8 +939,20 @@ func (c *MetricDescriptorsCreateCall) Context(ctx context.Context) *MetricDescri
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *MetricDescriptorsCreateCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *MetricDescriptorsCreateCall) 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
body, err := googleapi.WithoutDataWrapper.JSONReader(c.metricdescriptor)
@ -865,6 +1046,7 @@ type MetricDescriptorsDeleteCall struct {
metric string
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Delete: Delete an existing metric.
@ -891,8 +1073,20 @@ func (c *MetricDescriptorsDeleteCall) Context(ctx context.Context) *MetricDescri
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *MetricDescriptorsDeleteCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *MetricDescriptorsDeleteCall) 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)
@ -987,6 +1181,7 @@ type MetricDescriptorsListCall struct {
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// List: List metric descriptors that match the query. If the query is
@ -1055,8 +1250,20 @@ func (c *MetricDescriptorsListCall) Context(ctx context.Context) *MetricDescript
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_)
@ -1190,6 +1397,7 @@ type TimeseriesListCall struct {
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// List: List the data points of the time series that match the metric
@ -1319,8 +1527,20 @@ func (c *TimeseriesListCall) Context(ctx context.Context) *TimeseriesListCall {
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *TimeseriesListCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *TimeseriesListCall) 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_)
@ -1503,6 +1723,7 @@ type TimeseriesWriteCall struct {
writetimeseriesrequest *WriteTimeseriesRequest
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Write: Put data points to one or more time series for one or more
@ -1536,8 +1757,20 @@ func (c *TimeseriesWriteCall) Context(ctx context.Context) *TimeseriesWriteCall
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *TimeseriesWriteCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *TimeseriesWriteCall) 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
body, err := googleapi.WithoutDataWrapper.JSONReader(c.writetimeseriesrequest)
@ -1633,6 +1866,7 @@ type TimeseriesDescriptorsListCall struct {
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// List: List the descriptors of the time series that match the metric
@ -1763,8 +1997,20 @@ func (c *TimeseriesDescriptorsListCall) Context(ctx context.Context) *Timeseries
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *TimeseriesDescriptorsListCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *TimeseriesDescriptorsListCall) 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_)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -154,12 +154,21 @@ type AddonsConfig struct {
// 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. "HorizontalPodAutoscaling")
// 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 *AddonsConfig) MarshalJSON() ([]byte, error) {
type noMethod AddonsConfig
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Cluster: A Google Container Engine cluster.
@ -322,12 +331,20 @@ type Cluster struct {
// 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. "AddonsConfig") 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 *Cluster) MarshalJSON() ([]byte, error) {
type noMethod Cluster
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ClusterUpdate: ClusterUpdate describes an update to the cluster.
@ -366,12 +383,21 @@ type ClusterUpdate struct {
// 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. "DesiredAddonsConfig") 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 *ClusterUpdate) MarshalJSON() ([]byte, error) {
type noMethod ClusterUpdate
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CreateClusterRequest: CreateClusterRequest creates a cluster.
@ -387,12 +413,20 @@ type CreateClusterRequest struct {
// 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. "Cluster") 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 *CreateClusterRequest) MarshalJSON() ([]byte, error) {
type noMethod CreateClusterRequest
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CreateNodePoolRequest: CreateNodePoolRequest creates a node pool for
@ -408,12 +442,20 @@ type CreateNodePoolRequest struct {
// 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. "NodePool") 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 *CreateNodePoolRequest) MarshalJSON() ([]byte, error) {
type noMethod CreateNodePoolRequest
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// HorizontalPodAutoscaling: Configuration options for the horizontal
@ -434,12 +476,20 @@ type HorizontalPodAutoscaling struct {
// 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. "Disabled") 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 *HorizontalPodAutoscaling) MarshalJSON() ([]byte, error) {
type noMethod HorizontalPodAutoscaling
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// HttpLoadBalancing: Configuration options for the HTTP (L7) load
@ -458,12 +508,20 @@ type HttpLoadBalancing struct {
// 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. "Disabled") 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 *HttpLoadBalancing) MarshalJSON() ([]byte, error) {
type noMethod HttpLoadBalancing
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ListClustersResponse: ListClustersResponse is the result of
@ -488,12 +546,20 @@ type ListClustersResponse struct {
// 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. "Clusters") 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 *ListClustersResponse) MarshalJSON() ([]byte, error) {
type noMethod ListClustersResponse
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ListNodePoolsResponse: ListNodePoolsResponse is the result of
@ -513,12 +579,20 @@ type ListNodePoolsResponse struct {
// 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. "NodePools") 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 *ListNodePoolsResponse) MarshalJSON() ([]byte, error) {
type noMethod ListNodePoolsResponse
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ListOperationsResponse: ListOperationsResponse is the result of
@ -543,12 +617,20 @@ type ListOperationsResponse struct {
// 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. "MissingZones") 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 *ListOperationsResponse) MarshalJSON() ([]byte, error) {
type noMethod ListOperationsResponse
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// MasterAuth: The authentication information for accessing the master
@ -583,12 +665,21 @@ type MasterAuth struct {
// 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. "ClientCertificate") 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 *MasterAuth) MarshalJSON() ([]byte, error) {
type noMethod MasterAuth
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// NodeConfig: Parameters that describe the nodes in a cluster.
@ -635,12 +726,20 @@ type NodeConfig struct {
// 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. "DiskSizeGb") 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 *NodeConfig) MarshalJSON() ([]byte, error) {
type noMethod NodeConfig
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// NodePool: NodePool contains the name and configuration for a
@ -700,12 +799,20 @@ type NodePool struct {
// 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. "Config") 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 *NodePool) MarshalJSON() ([]byte, error) {
type noMethod NodePool
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Operation: This operation resource represents operations that may
@ -767,12 +874,20 @@ type Operation struct {
// 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. "Detail") 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 *Operation) MarshalJSON() ([]byte, error) {
type noMethod Operation
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ServerConfig: Container Engine service configuration.
@ -802,12 +917,21 @@ type ServerConfig struct {
// 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. "DefaultClusterVersion") 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 *ServerConfig) MarshalJSON() ([]byte, error) {
type noMethod ServerConfig
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// UpdateClusterRequest: UpdateClusterRequest updates the settings of a
@ -823,12 +947,20 @@ type UpdateClusterRequest struct {
// 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. "Update") 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 *UpdateClusterRequest) MarshalJSON() ([]byte, error) {
type noMethod UpdateClusterRequest
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// method id "container.projects.zones.getServerconfig":
@ -840,6 +972,7 @@ type ProjectsZonesGetServerconfigCall struct {
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// GetServerconfig: Returns configuration info about the Container
@ -877,8 +1010,20 @@ func (c *ProjectsZonesGetServerconfigCall) Context(ctx context.Context) *Project
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ProjectsZonesGetServerconfigCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsZonesGetServerconfigCall) 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_)
@ -975,6 +1120,7 @@ type ProjectsZonesClustersCreateCall struct {
createclusterrequest *CreateClusterRequest
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Create: Creates a cluster, consisting of the specified number and
@ -1010,8 +1156,20 @@ func (c *ProjectsZonesClustersCreateCall) Context(ctx context.Context) *Projects
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ProjectsZonesClustersCreateCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsZonesClustersCreateCall) 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
body, err := googleapi.WithoutDataWrapper.JSONReader(c.createclusterrequest)
@ -1113,6 +1271,7 @@ type ProjectsZonesClustersDeleteCall struct {
clusterId string
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Delete: Deletes the cluster, including the Kubernetes endpoint and
@ -1145,8 +1304,20 @@ func (c *ProjectsZonesClustersDeleteCall) Context(ctx context.Context) *Projects
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ProjectsZonesClustersDeleteCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsZonesClustersDeleteCall) 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)
@ -1249,6 +1420,7 @@ type ProjectsZonesClustersGetCall struct {
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// Get: Gets the details of a specific cluster.
@ -1286,8 +1458,20 @@ func (c *ProjectsZonesClustersGetCall) Context(ctx context.Context) *ProjectsZon
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ProjectsZonesClustersGetCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsZonesClustersGetCall) 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_)
@ -1392,6 +1576,7 @@ type ProjectsZonesClustersListCall struct {
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// List: Lists all clusters owned by a project in either the specified
@ -1429,8 +1614,20 @@ func (c *ProjectsZonesClustersListCall) Context(ctx context.Context) *ProjectsZo
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ProjectsZonesClustersListCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsZonesClustersListCall) 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_)
@ -1528,6 +1725,7 @@ type ProjectsZonesClustersUpdateCall struct {
updateclusterrequest *UpdateClusterRequest
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Update: Updates the settings of a specific cluster.
@ -1556,8 +1754,20 @@ func (c *ProjectsZonesClustersUpdateCall) Context(ctx context.Context) *Projects
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ProjectsZonesClustersUpdateCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsZonesClustersUpdateCall) 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
body, err := googleapi.WithoutDataWrapper.JSONReader(c.updateclusterrequest)
@ -1668,6 +1878,7 @@ type ProjectsZonesClustersNodePoolsCreateCall struct {
createnodepoolrequest *CreateNodePoolRequest
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Create: Creates a node pool for a cluster.
@ -1696,8 +1907,20 @@ func (c *ProjectsZonesClustersNodePoolsCreateCall) Context(ctx context.Context)
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ProjectsZonesClustersNodePoolsCreateCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsZonesClustersNodePoolsCreateCall) 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
body, err := googleapi.WithoutDataWrapper.JSONReader(c.createnodepoolrequest)
@ -1808,6 +2031,7 @@ type ProjectsZonesClustersNodePoolsDeleteCall struct {
nodePoolId string
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Delete: Deletes a node pool from a cluster.
@ -1836,8 +2060,20 @@ func (c *ProjectsZonesClustersNodePoolsDeleteCall) Context(ctx context.Context)
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ProjectsZonesClustersNodePoolsDeleteCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsZonesClustersNodePoolsDeleteCall) 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)
@ -1949,6 +2185,7 @@ type ProjectsZonesClustersNodePoolsGetCall struct {
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// Get: Retrieves the node pool requested.
@ -1987,8 +2224,20 @@ func (c *ProjectsZonesClustersNodePoolsGetCall) Context(ctx context.Context) *Pr
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ProjectsZonesClustersNodePoolsGetCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsZonesClustersNodePoolsGetCall) 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_)
@ -2102,6 +2351,7 @@ type ProjectsZonesClustersNodePoolsListCall struct {
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// List: Lists the node pools for a cluster.
@ -2139,8 +2389,20 @@ func (c *ProjectsZonesClustersNodePoolsListCall) Context(ctx context.Context) *P
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ProjectsZonesClustersNodePoolsListCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsZonesClustersNodePoolsListCall) 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_)
@ -2246,6 +2508,7 @@ type ProjectsZonesOperationsGetCall struct {
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// Get: Gets the specified operation.
@ -2283,8 +2546,20 @@ func (c *ProjectsZonesOperationsGetCall) Context(ctx context.Context) *ProjectsZ
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ProjectsZonesOperationsGetCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsZonesOperationsGetCall) 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_)
@ -2389,6 +2664,7 @@ type ProjectsZonesOperationsListCall struct {
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// List: Lists all operations in a project in a specific zone or all
@ -2426,8 +2702,20 @@ func (c *ProjectsZonesOperationsListCall) Context(ctx context.Context) *Projects
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ProjectsZonesOperationsListCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsZonesOperationsListCall) 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_)

View File

@ -1,18 +1,18 @@
{
"kind": "discovery#restDescription",
"etag": "\"jQLIOHBVnDZie4rQHGH1WJF-INE/ctEt-71wWAltEdgLnIcGLfJZeFE\"",
"etag": "\"tbys6C40o18GZwyMen5GMkdK-3s/RqBsQyB2YZT-ZAkK7pcLByI9SZs\"",
"discoveryVersion": "v1",
"id": "dns:v1",
"name": "dns",
"version": "v1",
"revision": "20160413",
"revision": "20161110",
"title": "Google Cloud DNS API",
"description": "Configures and serves authoritative DNS records.",
"ownerDomain": "google.com",
"ownerName": "Google",
"icons": {
"x16": "http://www.google.com/images/icons/product/search-16.gif",
"x32": "http://www.google.com/images/icons/product/search-32.gif"
"x16": "https://www.gstatic.com/images/branding/product/1x/googleg_16dp.png",
"x32": "https://www.gstatic.com/images/branding/product/1x/googleg_32dp.png"
},
"documentationLink": "https://developers.google.com/cloud-dns",
"protocol": "rest",
@ -183,7 +183,7 @@
},
"name": {
"type": "string",
"description": "User assigned name for this resource. Must be unique within the project. The name must be 1-32 characters long, must begin with a letter, end with a letter or digit, and only contain lowercase letters, digits or dashes."
"description": "User assigned name for this resource. Must be unique within the project. The name must be 1-63 characters long, must begin with a letter, end with a letter or digit, and only contain lowercase letters, digits or dashes."
},
"nameServerSet": {
"type": "string",

View File

@ -168,12 +168,20 @@ type Change struct {
// 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. "Additions") 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 *Change) MarshalJSON() ([]byte, error) {
type noMethod Change
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ChangesListResponse: The response to a request to enumerate Changes
@ -209,12 +217,20 @@ type ChangesListResponse struct {
// 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. "Changes") 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 *ChangesListResponse) MarshalJSON() ([]byte, error) {
type noMethod ChangesListResponse
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ManagedZone: A zone is a subtree of the DNS namespace under one
@ -243,7 +259,7 @@ type ManagedZone struct {
Kind string `json:"kind,omitempty"`
// Name: User assigned name for this resource. Must be unique within the
// project. The name must be 1-32 characters long, must begin with a
// project. The name must be 1-63 characters long, must begin with a
// letter, end with a letter or digit, and only contain lowercase
// letters, digits or dashes.
Name string `json:"name,omitempty"`
@ -268,12 +284,20 @@ type ManagedZone struct {
// 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. "CreationTime") 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 *ManagedZone) MarshalJSON() ([]byte, error) {
type noMethod ManagedZone
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
type ManagedZonesListResponse struct {
@ -307,12 +331,20 @@ type ManagedZonesListResponse struct {
// 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 *ManagedZonesListResponse) MarshalJSON() ([]byte, error) {
type noMethod ManagedZonesListResponse
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Project: A project resource. The project is a top level container for
@ -344,12 +376,20 @@ type Project struct {
// 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. "Id") 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 *Project) MarshalJSON() ([]byte, error) {
type noMethod Project
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Quota: Limits associated with a Project.
@ -388,12 +428,20 @@ type Quota struct {
// 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 *Quota) MarshalJSON() ([]byte, error) {
type noMethod Quota
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ResourceRecordSet: A unit of data that will be returned by the DNS
@ -425,12 +473,20 @@ type ResourceRecordSet struct {
// 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 *ResourceRecordSet) MarshalJSON() ([]byte, error) {
type noMethod ResourceRecordSet
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
type ResourceRecordSetsListResponse struct {
@ -464,12 +520,20 @@ type ResourceRecordSetsListResponse struct {
// 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 *ResourceRecordSetsListResponse) MarshalJSON() ([]byte, error) {
type noMethod ResourceRecordSetsListResponse
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// method id "dns.changes.create":
@ -481,6 +545,7 @@ type ChangesCreateCall struct {
change *Change
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Create: Atomically update the ResourceRecordSet collection.
@ -508,8 +573,20 @@ func (c *ChangesCreateCall) Context(ctx context.Context) *ChangesCreateCall {
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ChangesCreateCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ChangesCreateCall) 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
body, err := googleapi.WithoutDataWrapper.JSONReader(c.change)
@ -613,6 +690,7 @@ type ChangesGetCall struct {
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// Get: Fetch the representation of an existing Change.
@ -650,8 +728,20 @@ func (c *ChangesGetCall) Context(ctx context.Context) *ChangesGetCall {
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ChangesGetCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ChangesGetCall) 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_)
@ -759,6 +849,7 @@ type ChangesListCall struct {
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// List: Enumerate Changes to a ResourceRecordSet collection.
@ -828,8 +919,20 @@ func (c *ChangesListCall) Context(ctx context.Context) *ChangesListCall {
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ChangesListCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ChangesListCall) 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_)
@ -977,6 +1080,7 @@ type ManagedZonesCreateCall struct {
managedzone *ManagedZone
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Create: Create a new ManagedZone.
@ -1003,8 +1107,20 @@ func (c *ManagedZonesCreateCall) Context(ctx context.Context) *ManagedZonesCreat
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ManagedZonesCreateCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ManagedZonesCreateCall) 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
body, err := googleapi.WithoutDataWrapper.JSONReader(c.managedzone)
@ -1098,6 +1214,7 @@ type ManagedZonesDeleteCall struct {
managedZone string
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Delete: Delete a previously created ManagedZone.
@ -1124,8 +1241,20 @@ func (c *ManagedZonesDeleteCall) Context(ctx context.Context) *ManagedZonesDelet
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ManagedZonesDeleteCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ManagedZonesDeleteCall) 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)
@ -1192,6 +1321,7 @@ type ManagedZonesGetCall struct {
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// Get: Fetch the representation of an existing ManagedZone.
@ -1228,8 +1358,20 @@ func (c *ManagedZonesGetCall) Context(ctx context.Context) *ManagedZonesGetCall
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ManagedZonesGetCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ManagedZonesGetCall) 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_)
@ -1328,6 +1470,7 @@ type ManagedZonesListCall struct {
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// List: Enumerate ManagedZones that have been created but not yet
@ -1387,8 +1530,20 @@ func (c *ManagedZonesListCall) Context(ctx context.Context) *ManagedZonesListCal
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ManagedZonesListCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ManagedZonesListCall) 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_)
@ -1516,6 +1671,7 @@ type ProjectsGetCall struct {
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// Get: Fetch the representation of an existing Project.
@ -1551,8 +1707,20 @@ func (c *ProjectsGetCall) Context(ctx context.Context) *ProjectsGetCall {
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ProjectsGetCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsGetCall) 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_)
@ -1644,6 +1812,7 @@ type ResourceRecordSetsListCall struct {
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// List: Enumerate ResourceRecordSets that have been created but not yet
@ -1712,8 +1881,20 @@ func (c *ResourceRecordSetsListCall) Context(ctx context.Context) *ResourceRecor
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ResourceRecordSetsListCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ResourceRecordSetsListCall) 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_)

View File

@ -12,13 +12,13 @@ import (
)
// MarshalJSON returns a JSON encoding of schema containing only selected fields.
// A field is selected if:
// * it has a non-empty value, or
// * its field name is present in forceSendFields, and
// * it is not a nil pointer or nil interface.
// A field is selected if any of the following is true:
// * it has a non-empty value
// * its field name is present in forceSendFields and it is not a nil pointer or nil interface
// * its field name is present in nullFields.
// The JSON key for each selected field is taken from the field's json: struct tag.
func MarshalJSON(schema interface{}, forceSendFields []string) ([]byte, error) {
if len(forceSendFields) == 0 {
func MarshalJSON(schema interface{}, forceSendFields, nullFields []string) ([]byte, error) {
if len(forceSendFields) == 0 && len(nullFields) == 0 {
return json.Marshal(schema)
}
@ -26,15 +26,19 @@ func MarshalJSON(schema interface{}, forceSendFields []string) ([]byte, error) {
for _, f := range forceSendFields {
mustInclude[f] = struct{}{}
}
useNull := make(map[string]struct{})
for _, f := range nullFields {
useNull[f] = struct{}{}
}
dataMap, err := schemaToMap(schema, mustInclude)
dataMap, err := schemaToMap(schema, mustInclude, useNull)
if err != nil {
return nil, err
}
return json.Marshal(dataMap)
}
func schemaToMap(schema interface{}, mustInclude map[string]struct{}) (map[string]interface{}, error) {
func schemaToMap(schema interface{}, mustInclude, useNull map[string]struct{}) (map[string]interface{}, error) {
m := make(map[string]interface{})
s := reflect.ValueOf(schema)
st := s.Type()
@ -54,6 +58,14 @@ func schemaToMap(schema interface{}, mustInclude map[string]struct{}) (map[strin
v := s.Field(i)
f := st.Field(i)
if _, ok := useNull[f.Name]; ok {
if !isEmptyValue(v) {
return nil, fmt.Errorf("field %q in NullFields has non-empty value", f.Name)
}
m[tag.apiName] = nil
continue
}
if !includeField(v, f, mustInclude) {
continue
}

View File

@ -5,6 +5,7 @@
package gensupport
import (
"errors"
"fmt"
"io"
"net/http"
@ -15,10 +16,6 @@ import (
)
const (
// statusResumeIncomplete is the code returned by the Google uploader
// when the transfer is not yet complete.
statusResumeIncomplete = 308
// statusTooManyRequests is returned by the storage API if the
// per-project limits have been temporarily exceeded. The request
// should be retried.
@ -79,8 +76,23 @@ func (rx *ResumableUpload) doUploadRequest(ctx context.Context, data io.Reader,
req.Header.Set("Content-Range", contentRange)
req.Header.Set("Content-Type", rx.MediaType)
req.Header.Set("User-Agent", rx.UserAgent)
return SendRequest(ctx, rx.Client, req)
// Google's upload endpoint uses status code 308 for a
// different purpose than the "308 Permanent Redirect"
// since-standardized in RFC 7238. Because of the conflict in
// semantics, Google added this new request header which
// causes it to not use "308" and instead reply with 200 OK
// and sets the upload-specific "X-HTTP-Status-Code-Override:
// 308" response header.
req.Header.Set("X-GUploader-No-308", "yes")
return SendRequest(ctx, rx.Client, req)
}
func statusResumeIncomplete(resp *http.Response) bool {
// This is how the server signals "status resume incomplete"
// when X-GUploader-No-308 is set to "yes":
return resp != nil && resp.Header.Get("X-Http-Status-Code-Override") == "308"
}
// reportProgress calls a user-supplied callback to report upload progress.
@ -111,11 +123,17 @@ func (rx *ResumableUpload) transferChunk(ctx context.Context) (*http.Response, e
return res, err
}
if res.StatusCode == statusResumeIncomplete || res.StatusCode == http.StatusOK {
// We sent "X-GUploader-No-308: yes" (see comment elsewhere in
// this file), so we don't expect to get a 308.
if res.StatusCode == 308 {
return nil, errors.New("unexpected 308 response status code")
}
if res.StatusCode == http.StatusOK {
rx.reportProgress(off, off+int64(size))
}
if res.StatusCode == statusResumeIncomplete {
if statusResumeIncomplete(res) {
rx.Media.Next()
}
return res, nil
@ -177,7 +195,7 @@ func (rx *ResumableUpload) Upload(ctx context.Context) (resp *http.Response, err
// If the chunk was uploaded successfully, but there's still
// more to go, upload the next chunk without any delay.
if status == statusResumeIncomplete {
if statusResumeIncomplete(resp) {
pause = 0
backoff.Reset()
resp.Body.Close()

View File

@ -55,23 +55,17 @@ func DefaultBackoffStrategy() BackoffStrategy {
// shouldRetry returns true if the HTTP response / error indicates that the
// request should be attempted again.
func shouldRetry(status int, err error) bool {
// Retry for 5xx response codes.
if 500 <= status && status < 600 {
if 500 <= status && status <= 599 {
return true
}
// Retry on statusTooManyRequests{
if status == statusTooManyRequests {
return true
}
// Retry on unexpected EOFs and temporary network errors.
if err == io.ErrUnexpectedEOF {
return true
}
if err, ok := err.(net.Error); ok {
return err.Temporary()
}
return false
}

View File

@ -50,7 +50,7 @@ const (
// UserAgent is the header string used to identify this package.
UserAgent = "google-api-go-client/" + Version
// The default chunk size to use for resumable uplods if not specified by the user.
// The default chunk size to use for resumable uploads if not specified by the user.
DefaultUploadChunkSize = 8 * 1024 * 1024
// The minimum chunk size that can be used for resumable uploads. All

View File

@ -6,6 +6,7 @@ package googleapi
import (
"encoding/json"
"errors"
"strconv"
)
@ -149,6 +150,25 @@ func (s Float64s) MarshalJSON() ([]byte, error) {
})
}
// RawMessage is a raw encoded JSON value.
// It is identical to json.RawMessage, except it does not suffer from
// https://golang.org/issue/14493.
type RawMessage []byte
// MarshalJSON returns m.
func (m RawMessage) MarshalJSON() ([]byte, error) {
return m, nil
}
// UnmarshalJSON sets *m to a copy of data.
func (m *RawMessage) UnmarshalJSON(data []byte) error {
if m == nil {
return errors.New("googleapi.RawMessage: UnmarshalJSON on nil pointer")
}
*m = append((*m)[:0], data...)
return nil
}
/*
* Helper routines for simplifying the creation of optional fields of basic type.
*/