Update vendored dependencies
This includes github.com/kurin/blazer 0.2.0, which resolves #1291
This commit is contained in:
parent
ba23d24dd1
commit
61cb1cc6f8
1044 changed files with 203022 additions and 97709 deletions
542
vendor/google.golang.org/api/compute/v0.alpha/compute-gen.go
generated
vendored
542
vendor/google.golang.org/api/compute/v0.alpha/compute-gen.go
generated
vendored
|
@ -1409,7 +1409,7 @@ func (s *AccessConfig) MarshalJSON() ([]byte, error) {
|
|||
|
||||
// Address: A reserved address resource.
|
||||
type Address struct {
|
||||
// Address: The static external IP address represented by this resource.
|
||||
// Address: The static IP address represented by this resource.
|
||||
Address string `json:"address,omitempty"`
|
||||
|
||||
// AddressType: The type of address to reserve. If unspecified, defaults
|
||||
|
@ -3771,12 +3771,20 @@ type BackendService struct {
|
|||
// When the load balancing scheme is INTERNAL, this field is not used.
|
||||
AffinityCookieTtlSec int64 `json:"affinityCookieTtlSec,omitempty"`
|
||||
|
||||
// AppEngineBackend: Directs request to an App Engine app.
|
||||
// cloudFunctionBackend and backends[] must be empty if this is set.
|
||||
AppEngineBackend *BackendServiceAppEngineBackend `json:"appEngineBackend,omitempty"`
|
||||
|
||||
// Backends: The list of backends that serve this BackendService.
|
||||
Backends []*Backend `json:"backends,omitempty"`
|
||||
|
||||
// CdnPolicy: Cloud CDN configuration for this BackendService.
|
||||
CdnPolicy *BackendServiceCdnPolicy `json:"cdnPolicy,omitempty"`
|
||||
|
||||
// CloudFunctionBackend: Directs request to a cloud function.
|
||||
// appEngineBackend and backends[] must be empty if this is set.
|
||||
CloudFunctionBackend *BackendServiceCloudFunctionBackend `json:"cloudFunctionBackend,omitempty"`
|
||||
|
||||
ConnectionDraining *ConnectionDraining `json:"connectionDraining,omitempty"`
|
||||
|
||||
// CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
|
||||
|
@ -4090,6 +4098,45 @@ func (s *BackendServiceAggregatedListWarningData) MarshalJSON() ([]byte, error)
|
|||
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
|
||||
}
|
||||
|
||||
// BackendServiceAppEngineBackend: Configuration of a App Engine
|
||||
// backend.
|
||||
type BackendServiceAppEngineBackend struct {
|
||||
// AppEngineService: Optional. App Engine app service name.
|
||||
AppEngineService string `json:"appEngineService,omitempty"`
|
||||
|
||||
// TargetProject: Required. Project ID of the project hosting the app.
|
||||
// This is the project ID of this project. Reference to another project
|
||||
// is not allowed.
|
||||
TargetProject string `json:"targetProject,omitempty"`
|
||||
|
||||
// Version: Optional. Version of App Engine app service. When empty, App
|
||||
// Engine will do its normal traffic split.
|
||||
Version string `json:"version,omitempty"`
|
||||
|
||||
// ForceSendFields is a list of field names (e.g. "AppEngineService") 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. "AppEngineService") 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 *BackendServiceAppEngineBackend) MarshalJSON() ([]byte, error) {
|
||||
type noMethod BackendServiceAppEngineBackend
|
||||
raw := noMethod(*s)
|
||||
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
|
||||
}
|
||||
|
||||
// BackendServiceCdnPolicy: Message containing Cloud CDN configuration
|
||||
// for a backend service.
|
||||
type BackendServiceCdnPolicy struct {
|
||||
|
@ -4134,6 +4181,40 @@ func (s *BackendServiceCdnPolicy) MarshalJSON() ([]byte, error) {
|
|||
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
|
||||
}
|
||||
|
||||
// BackendServiceCloudFunctionBackend: Configuration of a Cloud Function
|
||||
// backend.
|
||||
type BackendServiceCloudFunctionBackend struct {
|
||||
// FunctionName: Required. A cloud function name. Special value ?*?
|
||||
// represents all cloud functions in the project.
|
||||
FunctionName string `json:"functionName,omitempty"`
|
||||
|
||||
// TargetProject: Required. Project ID of the project hosting the cloud
|
||||
// function.
|
||||
TargetProject string `json:"targetProject,omitempty"`
|
||||
|
||||
// ForceSendFields is a list of field names (e.g. "FunctionName") 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. "FunctionName") 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 *BackendServiceCloudFunctionBackend) MarshalJSON() ([]byte, error) {
|
||||
type noMethod BackendServiceCloudFunctionBackend
|
||||
raw := noMethod(*s)
|
||||
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
|
||||
}
|
||||
|
||||
type BackendServiceFailoverPolicy struct {
|
||||
// DisableConnectionDrainOnFailover: On failover or failback, this field
|
||||
// indicates whether connection drain will be honored. Setting this to
|
||||
|
@ -8043,8 +8124,7 @@ type GuestOsFeature struct {
|
|||
// Type: The type of supported feature. Currently only
|
||||
// VIRTIO_SCSI_MULTIQUEUE is supported. For newer Windows images, the
|
||||
// server might also populate this property with the value WINDOWS to
|
||||
// indicate that this is a Windows image. This value is purely
|
||||
// informational and does not enable or disable any features.
|
||||
// indicate that this is a Windows image.
|
||||
//
|
||||
// Possible values:
|
||||
// "FEATURE_TYPE_UNSPECIFIED"
|
||||
|
@ -10276,10 +10356,9 @@ type Image struct {
|
|||
// higher. Linux images with kernel versions 3.17 and higher will
|
||||
// support VIRTIO_SCSI_MULTIQUEUE.
|
||||
//
|
||||
// For new Windows images, the server might also populate this field
|
||||
// with the value WINDOWS, to indicate that this is a Windows image.
|
||||
// This value is purely informational and does not enable or disable any
|
||||
// features.
|
||||
// For newer Windows images, the server might also populate this
|
||||
// property with the value WINDOWS to indicate that this is a Windows
|
||||
// image.
|
||||
GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
|
||||
|
||||
// Id: [Output Only] The unique identifier for the resource. This
|
||||
|
@ -23698,7 +23777,7 @@ type Snapshot struct {
|
|||
// "UPLOADING"
|
||||
Status string `json:"status,omitempty"`
|
||||
|
||||
// StorageBytes: [Output Only] A size of the the storage used by the
|
||||
// StorageBytes: [Output Only] A size of the storage used by the
|
||||
// snapshot. As snapshots share storage, this number is expected to
|
||||
// change with snapshot creation/deletion.
|
||||
StorageBytes int64 `json:"storageBytes,omitempty,string"`
|
||||
|
@ -70661,6 +70740,453 @@ func (c *LicenseCodesGetCall) Do(opts ...googleapi.CallOption) (*LicenseCode, er
|
|||
|
||||
}
|
||||
|
||||
// method id "compute.licenseCodes.getIamPolicy":
|
||||
|
||||
type LicenseCodesGetIamPolicyCall struct {
|
||||
s *Service
|
||||
project string
|
||||
resource string
|
||||
urlParams_ gensupport.URLParams
|
||||
ifNoneMatch_ string
|
||||
ctx_ context.Context
|
||||
header_ http.Header
|
||||
}
|
||||
|
||||
// GetIamPolicy: Gets the access control policy for a resource. May be
|
||||
// empty if no such policy or resource exists.
|
||||
func (r *LicenseCodesService) GetIamPolicy(project string, resource string) *LicenseCodesGetIamPolicyCall {
|
||||
c := &LicenseCodesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
|
||||
c.project = project
|
||||
c.resource = resource
|
||||
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 *LicenseCodesGetIamPolicyCall) Fields(s ...googleapi.Field) *LicenseCodesGetIamPolicyCall {
|
||||
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 *LicenseCodesGetIamPolicyCall) IfNoneMatch(entityTag string) *LicenseCodesGetIamPolicyCall {
|
||||
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 *LicenseCodesGetIamPolicyCall) Context(ctx context.Context) *LicenseCodesGetIamPolicyCall {
|
||||
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 *LicenseCodesGetIamPolicyCall) Header() http.Header {
|
||||
if c.header_ == nil {
|
||||
c.header_ = make(http.Header)
|
||||
}
|
||||
return c.header_
|
||||
}
|
||||
|
||||
func (c *LicenseCodesGetIamPolicyCall) 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}/global/licenseCodes/{resource}/getIamPolicy")
|
||||
urls += "?" + c.urlParams_.Encode()
|
||||
req, _ := http.NewRequest("GET", urls, body)
|
||||
req.Header = reqHeaders
|
||||
googleapi.Expand(req.URL, map[string]string{
|
||||
"project": c.project,
|
||||
"resource": c.resource,
|
||||
})
|
||||
return gensupport.SendRequest(c.ctx_, c.s.client, req)
|
||||
}
|
||||
|
||||
// Do executes the "compute.licenseCodes.getIamPolicy" call.
|
||||
// Exactly one of *Policy or error will be non-nil. Any non-2xx status
|
||||
// code is an error. Response headers are in either
|
||||
// *Policy.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 *LicenseCodesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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 := &Policy{
|
||||
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": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
|
||||
// "httpMethod": "GET",
|
||||
// "id": "compute.licenseCodes.getIamPolicy",
|
||||
// "parameterOrder": [
|
||||
// "project",
|
||||
// "resource"
|
||||
// ],
|
||||
// "parameters": {
|
||||
// "project": {
|
||||
// "description": "Project ID for this request.",
|
||||
// "location": "path",
|
||||
// "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
|
||||
// "required": true,
|
||||
// "type": "string"
|
||||
// },
|
||||
// "resource": {
|
||||
// "description": "Name of the resource for this request.",
|
||||
// "location": "path",
|
||||
// "pattern": "[a-z0-9](?:[-a-z0-9_]{0,61}[a-z0-9])?",
|
||||
// "required": true,
|
||||
// "type": "string"
|
||||
// }
|
||||
// },
|
||||
// "path": "{project}/global/licenseCodes/{resource}/getIamPolicy",
|
||||
// "response": {
|
||||
// "$ref": "Policy"
|
||||
// },
|
||||
// "scopes": [
|
||||
// "https://www.googleapis.com/auth/cloud-platform",
|
||||
// "https://www.googleapis.com/auth/compute",
|
||||
// "https://www.googleapis.com/auth/compute.readonly"
|
||||
// ]
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
// method id "compute.licenseCodes.setIamPolicy":
|
||||
|
||||
type LicenseCodesSetIamPolicyCall struct {
|
||||
s *Service
|
||||
project string
|
||||
resource string
|
||||
policy *Policy
|
||||
urlParams_ gensupport.URLParams
|
||||
ctx_ context.Context
|
||||
header_ http.Header
|
||||
}
|
||||
|
||||
// SetIamPolicy: Sets the access control policy on the specified
|
||||
// resource. Replaces any existing policy.
|
||||
func (r *LicenseCodesService) SetIamPolicy(project string, resource string, policy *Policy) *LicenseCodesSetIamPolicyCall {
|
||||
c := &LicenseCodesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
|
||||
c.project = project
|
||||
c.resource = resource
|
||||
c.policy = policy
|
||||
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 *LicenseCodesSetIamPolicyCall) Fields(s ...googleapi.Field) *LicenseCodesSetIamPolicyCall {
|
||||
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 *LicenseCodesSetIamPolicyCall) Context(ctx context.Context) *LicenseCodesSetIamPolicyCall {
|
||||
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 *LicenseCodesSetIamPolicyCall) Header() http.Header {
|
||||
if c.header_ == nil {
|
||||
c.header_ = make(http.Header)
|
||||
}
|
||||
return c.header_
|
||||
}
|
||||
|
||||
func (c *LicenseCodesSetIamPolicyCall) 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.policy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
reqHeaders.Set("Content-Type", "application/json")
|
||||
c.urlParams_.Set("alt", alt)
|
||||
urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenseCodes/{resource}/setIamPolicy")
|
||||
urls += "?" + c.urlParams_.Encode()
|
||||
req, _ := http.NewRequest("POST", urls, body)
|
||||
req.Header = reqHeaders
|
||||
googleapi.Expand(req.URL, map[string]string{
|
||||
"project": c.project,
|
||||
"resource": c.resource,
|
||||
})
|
||||
return gensupport.SendRequest(c.ctx_, c.s.client, req)
|
||||
}
|
||||
|
||||
// Do executes the "compute.licenseCodes.setIamPolicy" call.
|
||||
// Exactly one of *Policy or error will be non-nil. Any non-2xx status
|
||||
// code is an error. Response headers are in either
|
||||
// *Policy.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 *LicenseCodesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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 := &Policy{
|
||||
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": "Sets the access control policy on the specified resource. Replaces any existing policy.",
|
||||
// "httpMethod": "POST",
|
||||
// "id": "compute.licenseCodes.setIamPolicy",
|
||||
// "parameterOrder": [
|
||||
// "project",
|
||||
// "resource"
|
||||
// ],
|
||||
// "parameters": {
|
||||
// "project": {
|
||||
// "description": "Project ID for this request.",
|
||||
// "location": "path",
|
||||
// "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
|
||||
// "required": true,
|
||||
// "type": "string"
|
||||
// },
|
||||
// "resource": {
|
||||
// "description": "Name of the resource for this request.",
|
||||
// "location": "path",
|
||||
// "pattern": "[a-z0-9](?:[-a-z0-9_]{0,61}[a-z0-9])?",
|
||||
// "required": true,
|
||||
// "type": "string"
|
||||
// }
|
||||
// },
|
||||
// "path": "{project}/global/licenseCodes/{resource}/setIamPolicy",
|
||||
// "request": {
|
||||
// "$ref": "Policy"
|
||||
// },
|
||||
// "response": {
|
||||
// "$ref": "Policy"
|
||||
// },
|
||||
// "scopes": [
|
||||
// "https://www.googleapis.com/auth/cloud-platform",
|
||||
// "https://www.googleapis.com/auth/compute"
|
||||
// ]
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
// method id "compute.licenseCodes.testIamPermissions":
|
||||
|
||||
type LicenseCodesTestIamPermissionsCall struct {
|
||||
s *Service
|
||||
project string
|
||||
resource string
|
||||
testpermissionsrequest *TestPermissionsRequest
|
||||
urlParams_ gensupport.URLParams
|
||||
ctx_ context.Context
|
||||
header_ http.Header
|
||||
}
|
||||
|
||||
// TestIamPermissions: Returns permissions that a caller has on the
|
||||
// specified resource.
|
||||
func (r *LicenseCodesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *LicenseCodesTestIamPermissionsCall {
|
||||
c := &LicenseCodesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
|
||||
c.project = project
|
||||
c.resource = resource
|
||||
c.testpermissionsrequest = testpermissionsrequest
|
||||
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 *LicenseCodesTestIamPermissionsCall) Fields(s ...googleapi.Field) *LicenseCodesTestIamPermissionsCall {
|
||||
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 *LicenseCodesTestIamPermissionsCall) Context(ctx context.Context) *LicenseCodesTestIamPermissionsCall {
|
||||
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 *LicenseCodesTestIamPermissionsCall) Header() http.Header {
|
||||
if c.header_ == nil {
|
||||
c.header_ = make(http.Header)
|
||||
}
|
||||
return c.header_
|
||||
}
|
||||
|
||||
func (c *LicenseCodesTestIamPermissionsCall) 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.testpermissionsrequest)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
reqHeaders.Set("Content-Type", "application/json")
|
||||
c.urlParams_.Set("alt", alt)
|
||||
urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenseCodes/{resource}/testIamPermissions")
|
||||
urls += "?" + c.urlParams_.Encode()
|
||||
req, _ := http.NewRequest("POST", urls, body)
|
||||
req.Header = reqHeaders
|
||||
googleapi.Expand(req.URL, map[string]string{
|
||||
"project": c.project,
|
||||
"resource": c.resource,
|
||||
})
|
||||
return gensupport.SendRequest(c.ctx_, c.s.client, req)
|
||||
}
|
||||
|
||||
// Do executes the "compute.licenseCodes.testIamPermissions" call.
|
||||
// Exactly one of *TestPermissionsResponse or error will be non-nil. Any
|
||||
// non-2xx status code is an error. Response headers are in either
|
||||
// *TestPermissionsResponse.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 *LicenseCodesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, 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 := &TestPermissionsResponse{
|
||||
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": "Returns permissions that a caller has on the specified resource.",
|
||||
// "httpMethod": "POST",
|
||||
// "id": "compute.licenseCodes.testIamPermissions",
|
||||
// "parameterOrder": [
|
||||
// "project",
|
||||
// "resource"
|
||||
// ],
|
||||
// "parameters": {
|
||||
// "project": {
|
||||
// "description": "Project ID for this request.",
|
||||
// "location": "path",
|
||||
// "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
|
||||
// "required": true,
|
||||
// "type": "string"
|
||||
// },
|
||||
// "resource": {
|
||||
// "description": "Name of the resource for this request.",
|
||||
// "location": "path",
|
||||
// "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
|
||||
// "required": true,
|
||||
// "type": "string"
|
||||
// }
|
||||
// },
|
||||
// "path": "{project}/global/licenseCodes/{resource}/testIamPermissions",
|
||||
// "request": {
|
||||
// "$ref": "TestPermissionsRequest"
|
||||
// },
|
||||
// "response": {
|
||||
// "$ref": "TestPermissionsResponse"
|
||||
// },
|
||||
// "scopes": [
|
||||
// "https://www.googleapis.com/auth/cloud-platform",
|
||||
// "https://www.googleapis.com/auth/compute",
|
||||
// "https://www.googleapis.com/auth/compute.readonly"
|
||||
// ]
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
// method id "compute.licenses.delete":
|
||||
|
||||
type LicensesDeleteCall struct {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue