1// Copyright 2019 Google LLC.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5// Code generated file. DO NOT EDIT.
6
7// Package cloudresourcemanager provides access to the Cloud Resource Manager API.
8//
9// For product documentation, see: https://cloud.google.com/resource-manager
10//
11// Creating a client
12//
13// Usage example:
14//
15//   import "google.golang.org/api/cloudresourcemanager/v1beta1"
16//   ...
17//   ctx := context.Background()
18//   cloudresourcemanagerService, err := cloudresourcemanager.NewService(ctx)
19//
20// In this example, Google Application Default Credentials are used for authentication.
21//
22// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
23//
24// Other authentication options
25//
26// By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
27//
28//   cloudresourcemanagerService, err := cloudresourcemanager.NewService(ctx, option.WithScopes(cloudresourcemanager.CloudPlatformReadOnlyScope))
29//
30// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
31//
32//   cloudresourcemanagerService, err := cloudresourcemanager.NewService(ctx, option.WithAPIKey("AIza..."))
33//
34// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
35//
36//   config := &oauth2.Config{...}
37//   // ...
38//   token, err := config.Exchange(ctx, ...)
39//   cloudresourcemanagerService, err := cloudresourcemanager.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
40//
41// See https://godoc.org/google.golang.org/api/option/ for details on options.
42package cloudresourcemanager // import "google.golang.org/api/cloudresourcemanager/v1beta1"
43
44import (
45	"bytes"
46	"context"
47	"encoding/json"
48	"errors"
49	"fmt"
50	"io"
51	"net/http"
52	"net/url"
53	"strconv"
54	"strings"
55
56	googleapi "google.golang.org/api/googleapi"
57	gensupport "google.golang.org/api/internal/gensupport"
58	option "google.golang.org/api/option"
59	htransport "google.golang.org/api/transport/http"
60)
61
62// Always reference these packages, just in case the auto-generated code
63// below doesn't.
64var _ = bytes.NewBuffer
65var _ = strconv.Itoa
66var _ = fmt.Sprintf
67var _ = json.NewDecoder
68var _ = io.Copy
69var _ = url.Parse
70var _ = gensupport.MarshalJSON
71var _ = googleapi.Version
72var _ = errors.New
73var _ = strings.Replace
74var _ = context.Canceled
75
76const apiId = "cloudresourcemanager:v1beta1"
77const apiName = "cloudresourcemanager"
78const apiVersion = "v1beta1"
79const basePath = "https://cloudresourcemanager.googleapis.com/"
80
81// OAuth2 scopes used by this API.
82const (
83	// View and manage your data across Google Cloud Platform services
84	CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
85
86	// View your data across Google Cloud Platform services
87	CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only"
88)
89
90// NewService creates a new Service.
91func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
92	scopesOption := option.WithScopes(
93		"https://www.googleapis.com/auth/cloud-platform",
94		"https://www.googleapis.com/auth/cloud-platform.read-only",
95	)
96	// NOTE: prepend, so we don't override user-specified scopes.
97	opts = append([]option.ClientOption{scopesOption}, opts...)
98	client, endpoint, err := htransport.NewClient(ctx, opts...)
99	if err != nil {
100		return nil, err
101	}
102	s, err := New(client)
103	if err != nil {
104		return nil, err
105	}
106	if endpoint != "" {
107		s.BasePath = endpoint
108	}
109	return s, nil
110}
111
112// New creates a new Service. It uses the provided http.Client for requests.
113//
114// Deprecated: please use NewService instead.
115// To provide a custom HTTP client, use option.WithHTTPClient.
116// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
117func New(client *http.Client) (*Service, error) {
118	if client == nil {
119		return nil, errors.New("client is nil")
120	}
121	s := &Service{client: client, BasePath: basePath}
122	s.Organizations = NewOrganizationsService(s)
123	s.Projects = NewProjectsService(s)
124	return s, nil
125}
126
127type Service struct {
128	client    *http.Client
129	BasePath  string // API endpoint base URL
130	UserAgent string // optional additional User-Agent fragment
131
132	Organizations *OrganizationsService
133
134	Projects *ProjectsService
135}
136
137func (s *Service) userAgent() string {
138	if s.UserAgent == "" {
139		return googleapi.UserAgent
140	}
141	return googleapi.UserAgent + " " + s.UserAgent
142}
143
144func NewOrganizationsService(s *Service) *OrganizationsService {
145	rs := &OrganizationsService{s: s}
146	return rs
147}
148
149type OrganizationsService struct {
150	s *Service
151}
152
153func NewProjectsService(s *Service) *ProjectsService {
154	rs := &ProjectsService{s: s}
155	return rs
156}
157
158type ProjectsService struct {
159	s *Service
160}
161
162// Ancestor: Identifying information for a single ancestor of a project.
163type Ancestor struct {
164	// ResourceId: Resource id of the ancestor.
165	ResourceId *ResourceId `json:"resourceId,omitempty"`
166
167	// ForceSendFields is a list of field names (e.g. "ResourceId") to
168	// unconditionally include in API requests. By default, fields with
169	// empty values are omitted from API requests. However, any non-pointer,
170	// non-interface field appearing in ForceSendFields will be sent to the
171	// server regardless of whether the field is empty or not. This may be
172	// used to include empty fields in Patch requests.
173	ForceSendFields []string `json:"-"`
174
175	// NullFields is a list of field names (e.g. "ResourceId") to include in
176	// API requests with the JSON null value. By default, fields with empty
177	// values are omitted from API requests. However, any field with an
178	// empty value appearing in NullFields will be sent to the server as
179	// null. It is an error if a field in this list has a non-empty value.
180	// This may be used to include null fields in Patch requests.
181	NullFields []string `json:"-"`
182}
183
184func (s *Ancestor) MarshalJSON() ([]byte, error) {
185	type NoMethod Ancestor
186	raw := NoMethod(*s)
187	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
188}
189
190// AuditConfig: Specifies the audit configuration for a service.
191// The configuration determines which permission types are logged, and
192// what
193// identities, if any, are exempted from logging.
194// An AuditConfig must have one or more AuditLogConfigs.
195//
196// If there are AuditConfigs for both `allServices` and a specific
197// service,
198// the union of the two AuditConfigs is used for that service: the
199// log_types
200// specified in each AuditConfig are enabled, and the exempted_members
201// in each
202// AuditLogConfig are exempted.
203//
204// Example Policy with multiple AuditConfigs:
205//
206//     {
207//       "audit_configs": [
208//         {
209//           "service": "allServices"
210//           "audit_log_configs": [
211//             {
212//               "log_type": "DATA_READ",
213//               "exempted_members": [
214//                 "user:jose@example.com"
215//               ]
216//             },
217//             {
218//               "log_type": "DATA_WRITE",
219//             },
220//             {
221//               "log_type": "ADMIN_READ",
222//             }
223//           ]
224//         },
225//         {
226//           "service": "sampleservice.googleapis.com"
227//           "audit_log_configs": [
228//             {
229//               "log_type": "DATA_READ",
230//             },
231//             {
232//               "log_type": "DATA_WRITE",
233//               "exempted_members": [
234//                 "user:aliya@example.com"
235//               ]
236//             }
237//           ]
238//         }
239//       ]
240//     }
241//
242// For sampleservice, this policy enables DATA_READ, DATA_WRITE and
243// ADMIN_READ
244// logging. It also exempts jose@example.com from DATA_READ logging,
245// and
246// aliya@example.com from DATA_WRITE logging.
247type AuditConfig struct {
248	// AuditLogConfigs: The configuration for logging of each type of
249	// permission.
250	AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"`
251
252	// Service: Specifies a service that will be enabled for audit
253	// logging.
254	// For example, `storage.googleapis.com`,
255	// `cloudsql.googleapis.com`.
256	// `allServices` is a special value that covers all services.
257	Service string `json:"service,omitempty"`
258
259	// ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to
260	// unconditionally include in API requests. By default, fields with
261	// empty values are omitted from API requests. However, any non-pointer,
262	// non-interface field appearing in ForceSendFields will be sent to the
263	// server regardless of whether the field is empty or not. This may be
264	// used to include empty fields in Patch requests.
265	ForceSendFields []string `json:"-"`
266
267	// NullFields is a list of field names (e.g. "AuditLogConfigs") to
268	// include in API requests with the JSON null value. By default, fields
269	// with empty values are omitted from API requests. However, any field
270	// with an empty value appearing in NullFields will be sent to the
271	// server as null. It is an error if a field in this list has a
272	// non-empty value. This may be used to include null fields in Patch
273	// requests.
274	NullFields []string `json:"-"`
275}
276
277func (s *AuditConfig) MarshalJSON() ([]byte, error) {
278	type NoMethod AuditConfig
279	raw := NoMethod(*s)
280	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
281}
282
283// AuditLogConfig: Provides the configuration for logging a type of
284// permissions.
285// Example:
286//
287//     {
288//       "audit_log_configs": [
289//         {
290//           "log_type": "DATA_READ",
291//           "exempted_members": [
292//             "user:jose@example.com"
293//           ]
294//         },
295//         {
296//           "log_type": "DATA_WRITE",
297//         }
298//       ]
299//     }
300//
301// This enables 'DATA_READ' and 'DATA_WRITE' logging, while
302// exempting
303// jose@example.com from DATA_READ logging.
304type AuditLogConfig struct {
305	// ExemptedMembers: Specifies the identities that do not cause logging
306	// for this type of
307	// permission.
308	// Follows the same format of Binding.members.
309	ExemptedMembers []string `json:"exemptedMembers,omitempty"`
310
311	// LogType: The log type that this config enables.
312	//
313	// Possible values:
314	//   "LOG_TYPE_UNSPECIFIED" - Default case. Should never be this.
315	//   "ADMIN_READ" - Admin reads. Example: CloudIAM getIamPolicy
316	//   "DATA_WRITE" - Data writes. Example: CloudSQL Users create
317	//   "DATA_READ" - Data reads. Example: CloudSQL Users list
318	LogType string `json:"logType,omitempty"`
319
320	// ForceSendFields is a list of field names (e.g. "ExemptedMembers") to
321	// unconditionally include in API requests. By default, fields with
322	// empty values are omitted from API requests. However, any non-pointer,
323	// non-interface field appearing in ForceSendFields will be sent to the
324	// server regardless of whether the field is empty or not. This may be
325	// used to include empty fields in Patch requests.
326	ForceSendFields []string `json:"-"`
327
328	// NullFields is a list of field names (e.g. "ExemptedMembers") to
329	// include in API requests with the JSON null value. By default, fields
330	// with empty values are omitted from API requests. However, any field
331	// with an empty value appearing in NullFields will be sent to the
332	// server as null. It is an error if a field in this list has a
333	// non-empty value. This may be used to include null fields in Patch
334	// requests.
335	NullFields []string `json:"-"`
336}
337
338func (s *AuditLogConfig) MarshalJSON() ([]byte, error) {
339	type NoMethod AuditLogConfig
340	raw := NoMethod(*s)
341	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
342}
343
344// Binding: Associates `members` with a `role`.
345type Binding struct {
346	// Condition: The condition that is associated with this binding.
347	// NOTE: An unsatisfied condition will not allow user access via
348	// current
349	// binding. Different bindings, including their conditions, are
350	// examined
351	// independently.
352	Condition *Expr `json:"condition,omitempty"`
353
354	// Members: Specifies the identities requesting access for a Cloud
355	// Platform resource.
356	// `members` can have the following values:
357	//
358	// * `allUsers`: A special identifier that represents anyone who is
359	//    on the internet; with or without a Google account.
360	//
361	// * `allAuthenticatedUsers`: A special identifier that represents
362	// anyone
363	//    who is authenticated with a Google account or a service
364	// account.
365	//
366	// * `user:{emailid}`: An email address that represents a specific
367	// Google
368	//    account. For example, `alice@example.com` .
369	//
370	//
371	// * `serviceAccount:{emailid}`: An email address that represents a
372	// service
373	//    account. For example,
374	// `my-other-app@appspot.gserviceaccount.com`.
375	//
376	// * `group:{emailid}`: An email address that represents a Google
377	// group.
378	//    For example, `admins@example.com`.
379	//
380	//
381	// * `domain:{domain}`: The G Suite domain (primary) that represents all
382	// the
383	//    users of that domain. For example, `google.com` or
384	// `example.com`.
385	//
386	//
387	Members []string `json:"members,omitempty"`
388
389	// Role: Role that is assigned to `members`.
390	// For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
391	Role string `json:"role,omitempty"`
392
393	// ForceSendFields is a list of field names (e.g. "Condition") to
394	// unconditionally include in API requests. By default, fields with
395	// empty values are omitted from API requests. However, any non-pointer,
396	// non-interface field appearing in ForceSendFields will be sent to the
397	// server regardless of whether the field is empty or not. This may be
398	// used to include empty fields in Patch requests.
399	ForceSendFields []string `json:"-"`
400
401	// NullFields is a list of field names (e.g. "Condition") to include in
402	// API requests with the JSON null value. By default, fields with empty
403	// values are omitted from API requests. However, any field with an
404	// empty value appearing in NullFields will be sent to the server as
405	// null. It is an error if a field in this list has a non-empty value.
406	// This may be used to include null fields in Patch requests.
407	NullFields []string `json:"-"`
408}
409
410func (s *Binding) MarshalJSON() ([]byte, error) {
411	type NoMethod Binding
412	raw := NoMethod(*s)
413	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
414}
415
416// Empty: A generic empty message that you can re-use to avoid defining
417// duplicated
418// empty messages in your APIs. A typical example is to use it as the
419// request
420// or the response type of an API method. For instance:
421//
422//     service Foo {
423//       rpc Bar(google.protobuf.Empty) returns
424// (google.protobuf.Empty);
425//     }
426//
427// The JSON representation for `Empty` is empty JSON object `{}`.
428type Empty struct {
429	// ServerResponse contains the HTTP response code and headers from the
430	// server.
431	googleapi.ServerResponse `json:"-"`
432}
433
434// Expr: Represents an expression text. Example:
435//
436//     title: "User account presence"
437//     description: "Determines whether the request has a user account"
438//     expression: "size(request.user) > 0"
439type Expr struct {
440	// Description: An optional description of the expression. This is a
441	// longer text which
442	// describes the expression, e.g. when hovered over it in a UI.
443	Description string `json:"description,omitempty"`
444
445	// Expression: Textual representation of an expression in
446	// Common Expression Language syntax.
447	//
448	// The application context of the containing message determines
449	// which
450	// well-known feature set of CEL is supported.
451	Expression string `json:"expression,omitempty"`
452
453	// Location: An optional string indicating the location of the
454	// expression for error
455	// reporting, e.g. a file name and a position in the file.
456	Location string `json:"location,omitempty"`
457
458	// Title: An optional title for the expression, i.e. a short string
459	// describing
460	// its purpose. This can be used e.g. in UIs which allow to enter
461	// the
462	// expression.
463	Title string `json:"title,omitempty"`
464
465	// ForceSendFields is a list of field names (e.g. "Description") to
466	// unconditionally include in API requests. By default, fields with
467	// empty values are omitted from API requests. However, any non-pointer,
468	// non-interface field appearing in ForceSendFields will be sent to the
469	// server regardless of whether the field is empty or not. This may be
470	// used to include empty fields in Patch requests.
471	ForceSendFields []string `json:"-"`
472
473	// NullFields is a list of field names (e.g. "Description") to include
474	// in API requests with the JSON null value. By default, fields with
475	// empty values are omitted from API requests. However, any field with
476	// an empty value appearing in NullFields will be sent to the server as
477	// null. It is an error if a field in this list has a non-empty value.
478	// This may be used to include null fields in Patch requests.
479	NullFields []string `json:"-"`
480}
481
482func (s *Expr) MarshalJSON() ([]byte, error) {
483	type NoMethod Expr
484	raw := NoMethod(*s)
485	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
486}
487
488// FolderOperation: Metadata describing a long running folder operation
489type FolderOperation struct {
490	// DestinationParent: The resource name of the folder or organization we
491	// are either creating
492	// the folder under or moving the folder to.
493	DestinationParent string `json:"destinationParent,omitempty"`
494
495	// DisplayName: The display name of the folder.
496	DisplayName string `json:"displayName,omitempty"`
497
498	// OperationType: The type of this operation.
499	//
500	// Possible values:
501	//   "OPERATION_TYPE_UNSPECIFIED" - Operation type not specified.
502	//   "CREATE" - A create folder operation.
503	//   "MOVE" - A move folder operation.
504	OperationType string `json:"operationType,omitempty"`
505
506	// SourceParent: The resource name of the folder's parent.
507	// Only applicable when the operation_type is MOVE.
508	SourceParent string `json:"sourceParent,omitempty"`
509
510	// ForceSendFields is a list of field names (e.g. "DestinationParent")
511	// to unconditionally include in API requests. By default, fields with
512	// empty values are omitted from API requests. However, any non-pointer,
513	// non-interface field appearing in ForceSendFields will be sent to the
514	// server regardless of whether the field is empty or not. This may be
515	// used to include empty fields in Patch requests.
516	ForceSendFields []string `json:"-"`
517
518	// NullFields is a list of field names (e.g. "DestinationParent") to
519	// include in API requests with the JSON null value. By default, fields
520	// with empty values are omitted from API requests. However, any field
521	// with an empty value appearing in NullFields will be sent to the
522	// server as null. It is an error if a field in this list has a
523	// non-empty value. This may be used to include null fields in Patch
524	// requests.
525	NullFields []string `json:"-"`
526}
527
528func (s *FolderOperation) MarshalJSON() ([]byte, error) {
529	type NoMethod FolderOperation
530	raw := NoMethod(*s)
531	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
532}
533
534// FolderOperationError: A classification of the Folder Operation error.
535type FolderOperationError struct {
536	// ErrorMessageId: The type of operation error experienced.
537	//
538	// Possible values:
539	//   "ERROR_TYPE_UNSPECIFIED" - The error type was unrecognized or
540	// unspecified.
541	//   "ACTIVE_FOLDER_HEIGHT_VIOLATION" - The attempted action would
542	// violate the max folder depth constraint.
543	//   "MAX_CHILD_FOLDERS_VIOLATION" - The attempted action would violate
544	// the max child folders constraint.
545	//   "FOLDER_NAME_UNIQUENESS_VIOLATION" - The attempted action would
546	// violate the locally-unique folder
547	// display_name constraint.
548	//   "RESOURCE_DELETED_VIOLATION" - The resource being moved has been
549	// deleted.
550	//   "PARENT_DELETED_VIOLATION" - The resource a folder was being added
551	// to has been deleted.
552	//   "CYCLE_INTRODUCED_VIOLATION" - The attempted action would introduce
553	// cycle in resource path.
554	//   "FOLDER_BEING_MOVED_VIOLATION" - The attempted action would move a
555	// folder that is already being moved.
556	//   "FOLDER_TO_DELETE_NON_EMPTY_VIOLATION" - The folder the caller is
557	// trying to delete contains active resources.
558	//   "DELETED_FOLDER_HEIGHT_VIOLATION" - The attempted action would
559	// violate the max deleted folder depth
560	// constraint.
561	ErrorMessageId string `json:"errorMessageId,omitempty"`
562
563	// ForceSendFields is a list of field names (e.g. "ErrorMessageId") to
564	// unconditionally include in API requests. By default, fields with
565	// empty values are omitted from API requests. However, any non-pointer,
566	// non-interface field appearing in ForceSendFields will be sent to the
567	// server regardless of whether the field is empty or not. This may be
568	// used to include empty fields in Patch requests.
569	ForceSendFields []string `json:"-"`
570
571	// NullFields is a list of field names (e.g. "ErrorMessageId") to
572	// include in API requests with the JSON null value. By default, fields
573	// with empty values are omitted from API requests. However, any field
574	// with an empty value appearing in NullFields will be sent to the
575	// server as null. It is an error if a field in this list has a
576	// non-empty value. This may be used to include null fields in Patch
577	// requests.
578	NullFields []string `json:"-"`
579}
580
581func (s *FolderOperationError) MarshalJSON() ([]byte, error) {
582	type NoMethod FolderOperationError
583	raw := NoMethod(*s)
584	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
585}
586
587// GetAncestryRequest: The request sent to the
588// GetAncestry
589// method.
590type GetAncestryRequest struct {
591}
592
593// GetAncestryResponse: Response from the GetAncestry method.
594type GetAncestryResponse struct {
595	// Ancestor: Ancestors are ordered from bottom to top of the resource
596	// hierarchy. The
597	// first ancestor is the project itself, followed by the project's
598	// parent,
599	// etc.
600	Ancestor []*Ancestor `json:"ancestor,omitempty"`
601
602	// ServerResponse contains the HTTP response code and headers from the
603	// server.
604	googleapi.ServerResponse `json:"-"`
605
606	// ForceSendFields is a list of field names (e.g. "Ancestor") to
607	// unconditionally include in API requests. By default, fields with
608	// empty values are omitted from API requests. However, any non-pointer,
609	// non-interface field appearing in ForceSendFields will be sent to the
610	// server regardless of whether the field is empty or not. This may be
611	// used to include empty fields in Patch requests.
612	ForceSendFields []string `json:"-"`
613
614	// NullFields is a list of field names (e.g. "Ancestor") to include in
615	// API requests with the JSON null value. By default, fields with empty
616	// values are omitted from API requests. However, any field with an
617	// empty value appearing in NullFields will be sent to the server as
618	// null. It is an error if a field in this list has a non-empty value.
619	// This may be used to include null fields in Patch requests.
620	NullFields []string `json:"-"`
621}
622
623func (s *GetAncestryResponse) MarshalJSON() ([]byte, error) {
624	type NoMethod GetAncestryResponse
625	raw := NoMethod(*s)
626	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
627}
628
629// GetIamPolicyRequest: Request message for `GetIamPolicy` method.
630type GetIamPolicyRequest struct {
631	// Options: OPTIONAL: A `GetPolicyOptions` object for specifying options
632	// to
633	// `GetIamPolicy`. This field is only used by Cloud IAM.
634	Options *GetPolicyOptions `json:"options,omitempty"`
635
636	// ForceSendFields is a list of field names (e.g. "Options") to
637	// unconditionally include in API requests. By default, fields with
638	// empty values are omitted from API requests. However, any non-pointer,
639	// non-interface field appearing in ForceSendFields will be sent to the
640	// server regardless of whether the field is empty or not. This may be
641	// used to include empty fields in Patch requests.
642	ForceSendFields []string `json:"-"`
643
644	// NullFields is a list of field names (e.g. "Options") to include in
645	// API requests with the JSON null value. By default, fields with empty
646	// values are omitted from API requests. However, any field with an
647	// empty value appearing in NullFields will be sent to the server as
648	// null. It is an error if a field in this list has a non-empty value.
649	// This may be used to include null fields in Patch requests.
650	NullFields []string `json:"-"`
651}
652
653func (s *GetIamPolicyRequest) MarshalJSON() ([]byte, error) {
654	type NoMethod GetIamPolicyRequest
655	raw := NoMethod(*s)
656	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
657}
658
659// GetPolicyOptions: Encapsulates settings provided to GetIamPolicy.
660type GetPolicyOptions struct {
661	// RequestedPolicyVersion: Optional. The policy format version to be
662	// returned.
663	//
664	// Valid values are 0, 1, and 3. Requests specifying an invalid value
665	// will be
666	// rejected.
667	//
668	// Requests for policies with any conditional bindings must specify
669	// version 3.
670	// Policies without any conditional bindings may specify any valid value
671	// or
672	// leave the field unset.
673	RequestedPolicyVersion int64 `json:"requestedPolicyVersion,omitempty"`
674
675	// ForceSendFields is a list of field names (e.g.
676	// "RequestedPolicyVersion") to unconditionally include in API requests.
677	// By default, fields with empty values are omitted from API requests.
678	// However, any non-pointer, non-interface field appearing in
679	// ForceSendFields will be sent to the server regardless of whether the
680	// field is empty or not. This may be used to include empty fields in
681	// Patch requests.
682	ForceSendFields []string `json:"-"`
683
684	// NullFields is a list of field names (e.g. "RequestedPolicyVersion")
685	// to include in API requests with the JSON null value. By default,
686	// fields with empty values are omitted from API requests. However, any
687	// field with an empty value appearing in NullFields will be sent to the
688	// server as null. It is an error if a field in this list has a
689	// non-empty value. This may be used to include null fields in Patch
690	// requests.
691	NullFields []string `json:"-"`
692}
693
694func (s *GetPolicyOptions) MarshalJSON() ([]byte, error) {
695	type NoMethod GetPolicyOptions
696	raw := NoMethod(*s)
697	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
698}
699
700// ListOrganizationsResponse: The response returned from the
701// `ListOrganizations` method.
702type ListOrganizationsResponse struct {
703	// NextPageToken: A pagination token to be used to retrieve the next
704	// page of results. If the
705	// result is too large to fit within the page size specified in the
706	// request,
707	// this field will be set with a token that can be used to fetch the
708	// next page
709	// of results. If this field is empty, it indicates that this
710	// response
711	// contains the last page of results.
712	NextPageToken string `json:"nextPageToken,omitempty"`
713
714	// Organizations: The list of Organizations that matched the list query,
715	// possibly paginated.
716	Organizations []*Organization `json:"organizations,omitempty"`
717
718	// ServerResponse contains the HTTP response code and headers from the
719	// server.
720	googleapi.ServerResponse `json:"-"`
721
722	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
723	// unconditionally include in API requests. By default, fields with
724	// empty values are omitted from API requests. However, any non-pointer,
725	// non-interface field appearing in ForceSendFields will be sent to the
726	// server regardless of whether the field is empty or not. This may be
727	// used to include empty fields in Patch requests.
728	ForceSendFields []string `json:"-"`
729
730	// NullFields is a list of field names (e.g. "NextPageToken") to include
731	// in API requests with the JSON null value. By default, fields with
732	// empty values are omitted from API requests. However, any field with
733	// an empty value appearing in NullFields will be sent to the server as
734	// null. It is an error if a field in this list has a non-empty value.
735	// This may be used to include null fields in Patch requests.
736	NullFields []string `json:"-"`
737}
738
739func (s *ListOrganizationsResponse) MarshalJSON() ([]byte, error) {
740	type NoMethod ListOrganizationsResponse
741	raw := NoMethod(*s)
742	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
743}
744
745// ListProjectsResponse: A page of the response received from
746// the
747// ListProjects
748// method.
749//
750// A paginated response where more pages are available
751// has
752// `next_page_token` set. This token can be used in a subsequent request
753// to
754// retrieve the next request page.
755type ListProjectsResponse struct {
756	// NextPageToken: Pagination token.
757	//
758	// If the result set is too large to fit in a single response, this
759	// token
760	// is returned. It encodes the position of the current result
761	// cursor.
762	// Feeding this value into a new list request with the `page_token`
763	// parameter
764	// gives the next page of the results.
765	//
766	// When `next_page_token` is not filled in, there is no next page
767	// and
768	// the list returned is the last page in the result set.
769	//
770	// Pagination tokens have a limited lifetime.
771	NextPageToken string `json:"nextPageToken,omitempty"`
772
773	// Projects: The list of Projects that matched the list filter. This
774	// list can
775	// be paginated.
776	Projects []*Project `json:"projects,omitempty"`
777
778	// ServerResponse contains the HTTP response code and headers from the
779	// server.
780	googleapi.ServerResponse `json:"-"`
781
782	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
783	// unconditionally include in API requests. By default, fields with
784	// empty values are omitted from API requests. However, any non-pointer,
785	// non-interface field appearing in ForceSendFields will be sent to the
786	// server regardless of whether the field is empty or not. This may be
787	// used to include empty fields in Patch requests.
788	ForceSendFields []string `json:"-"`
789
790	// NullFields is a list of field names (e.g. "NextPageToken") to include
791	// in API requests with the JSON null value. By default, fields with
792	// empty values are omitted from API requests. However, any field with
793	// an empty value appearing in NullFields will be sent to the server as
794	// null. It is an error if a field in this list has a non-empty value.
795	// This may be used to include null fields in Patch requests.
796	NullFields []string `json:"-"`
797}
798
799func (s *ListProjectsResponse) MarshalJSON() ([]byte, error) {
800	type NoMethod ListProjectsResponse
801	raw := NoMethod(*s)
802	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
803}
804
805// Organization: The root node in the resource hierarchy to which a
806// particular entity's
807// (e.g., company) resources belong.
808type Organization struct {
809	// CreationTime: Timestamp when the Organization was created. Assigned
810	// by the server.
811	CreationTime string `json:"creationTime,omitempty"`
812
813	// DisplayName: A human-readable string that refers to the Organization
814	// in the
815	// GCP Console UI. This string is set by the server and cannot
816	// be
817	// changed. The string will be set to the primary domain (for
818	// example,
819	// "google.com") of the G Suite customer that owns the organization.
820	DisplayName string `json:"displayName,omitempty"`
821
822	// LifecycleState: The organization's current lifecycle state. Assigned
823	// by the server.
824	//
825	// Possible values:
826	//   "LIFECYCLE_STATE_UNSPECIFIED" - Unspecified state.  This is only
827	// useful for distinguishing unset values.
828	//   "ACTIVE" - The normal and active state.
829	//   "DELETE_REQUESTED" - The organization has been marked for deletion
830	// by the user.
831	LifecycleState string `json:"lifecycleState,omitempty"`
832
833	// Name: Output only. The resource name of the organization. This is
834	// the
835	// organization's relative path in the API. Its format
836	// is
837	// "organizations/[organization_id]". For example, "organizations/1234".
838	Name string `json:"name,omitempty"`
839
840	// OrganizationId: An immutable id for the Organization that is assigned
841	// on creation. This
842	// should be omitted when creating a new Organization.
843	// This field is read-only.
844	OrganizationId string `json:"organizationId,omitempty"`
845
846	// Owner: The owner of this Organization. The owner should be specified
847	// on
848	// creation. Once set, it cannot be changed.
849	// This field is required.
850	Owner *OrganizationOwner `json:"owner,omitempty"`
851
852	// ServerResponse contains the HTTP response code and headers from the
853	// server.
854	googleapi.ServerResponse `json:"-"`
855
856	// ForceSendFields is a list of field names (e.g. "CreationTime") to
857	// unconditionally include in API requests. By default, fields with
858	// empty values are omitted from API requests. However, any non-pointer,
859	// non-interface field appearing in ForceSendFields will be sent to the
860	// server regardless of whether the field is empty or not. This may be
861	// used to include empty fields in Patch requests.
862	ForceSendFields []string `json:"-"`
863
864	// NullFields is a list of field names (e.g. "CreationTime") to include
865	// in API requests with the JSON null value. By default, fields with
866	// empty values are omitted from API requests. However, any field with
867	// an empty value appearing in NullFields will be sent to the server as
868	// null. It is an error if a field in this list has a non-empty value.
869	// This may be used to include null fields in Patch requests.
870	NullFields []string `json:"-"`
871}
872
873func (s *Organization) MarshalJSON() ([]byte, error) {
874	type NoMethod Organization
875	raw := NoMethod(*s)
876	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
877}
878
879// OrganizationOwner: The entity that owns an Organization. The lifetime
880// of the Organization and
881// all of its descendants are bound to the `OrganizationOwner`. If
882// the
883// `OrganizationOwner` is deleted, the Organization and all its
884// descendants will
885// be deleted.
886type OrganizationOwner struct {
887	// DirectoryCustomerId: The G Suite customer id used in the Directory
888	// API.
889	DirectoryCustomerId string `json:"directoryCustomerId,omitempty"`
890
891	// ForceSendFields is a list of field names (e.g. "DirectoryCustomerId")
892	// to unconditionally include in API requests. By default, fields with
893	// empty values are omitted from API requests. However, any non-pointer,
894	// non-interface field appearing in ForceSendFields will be sent to the
895	// server regardless of whether the field is empty or not. This may be
896	// used to include empty fields in Patch requests.
897	ForceSendFields []string `json:"-"`
898
899	// NullFields is a list of field names (e.g. "DirectoryCustomerId") to
900	// include in API requests with the JSON null value. By default, fields
901	// with empty values are omitted from API requests. However, any field
902	// with an empty value appearing in NullFields will be sent to the
903	// server as null. It is an error if a field in this list has a
904	// non-empty value. This may be used to include null fields in Patch
905	// requests.
906	NullFields []string `json:"-"`
907}
908
909func (s *OrganizationOwner) MarshalJSON() ([]byte, error) {
910	type NoMethod OrganizationOwner
911	raw := NoMethod(*s)
912	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
913}
914
915// Policy: Defines an Identity and Access Management (IAM) policy. It is
916// used to
917// specify access control policies for Cloud Platform resources.
918//
919//
920// A `Policy` is a collection of `bindings`. A `binding` binds one or
921// more
922// `members` to a single `role`. Members can be user accounts, service
923// accounts,
924// Google groups, and domains (such as G Suite). A `role` is a named
925// list of
926// permissions (defined by IAM or configured by users). A `binding`
927// can
928// optionally specify a `condition`, which is a logic expression that
929// further
930// constrains the role binding based on attributes about the request
931// and/or
932// target resource.
933//
934// **JSON Example**
935//
936//     {
937//       "bindings": [
938//         {
939//           "role": "roles/resourcemanager.organizationAdmin",
940//           "members": [
941//             "user:mike@example.com",
942//             "group:admins@example.com",
943//             "domain:google.com",
944//
945// "serviceAccount:my-project-id@appspot.gserviceaccount.com"
946//           ]
947//         },
948//         {
949//           "role": "roles/resourcemanager.organizationViewer",
950//           "members": ["user:eve@example.com"],
951//           "condition": {
952//             "title": "expirable access",
953//             "description": "Does not grant access after Sep 2020",
954//             "expression": "request.time <
955//             timestamp('2020-10-01T00:00:00.000Z')",
956//           }
957//         }
958//       ]
959//     }
960//
961// **YAML Example**
962//
963//     bindings:
964//     - members:
965//       - user:mike@example.com
966//       - group:admins@example.com
967//       - domain:google.com
968//       - serviceAccount:my-project-id@appspot.gserviceaccount.com
969//       role: roles/resourcemanager.organizationAdmin
970//     - members:
971//       - user:eve@example.com
972//       role: roles/resourcemanager.organizationViewer
973//       condition:
974//         title: expirable access
975//         description: Does not grant access after Sep 2020
976//         expression: request.time <
977// timestamp('2020-10-01T00:00:00.000Z')
978//
979// For a description of IAM and its features, see the
980// [IAM developer's guide](https://cloud.google.com/iam/docs).
981type Policy struct {
982	// AuditConfigs: Specifies cloud audit logging configuration for this
983	// policy.
984	AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"`
985
986	// Bindings: Associates a list of `members` to a `role`. Optionally may
987	// specify a
988	// `condition` that determines when binding is in effect.
989	// `bindings` with no members will result in an error.
990	Bindings []*Binding `json:"bindings,omitempty"`
991
992	// Etag: `etag` is used for optimistic concurrency control as a way to
993	// help
994	// prevent simultaneous updates of a policy from overwriting each
995	// other.
996	// It is strongly suggested that systems make use of the `etag` in
997	// the
998	// read-modify-write cycle to perform policy updates in order to avoid
999	// race
1000	// conditions: An `etag` is returned in the response to `getIamPolicy`,
1001	// and
1002	// systems are expected to put that etag in the request to
1003	// `setIamPolicy` to
1004	// ensure that their change will be applied to the same version of the
1005	// policy.
1006	//
1007	// If no `etag` is provided in the call to `setIamPolicy`, then the
1008	// existing
1009	// policy is overwritten. Due to blind-set semantics of an etag-less
1010	// policy,
1011	// 'setIamPolicy' will not fail even if the incoming policy version does
1012	// not
1013	// meet the requirements for modifying the stored policy.
1014	Etag string `json:"etag,omitempty"`
1015
1016	// Version: Specifies the format of the policy.
1017	//
1018	// Valid values are 0, 1, and 3. Requests specifying an invalid value
1019	// will be
1020	// rejected.
1021	//
1022	// Operations affecting conditional bindings must specify version 3.
1023	// This can
1024	// be either setting a conditional policy, modifying a conditional
1025	// binding,
1026	// or removing a binding (conditional or unconditional) from the
1027	// stored
1028	// conditional policy.
1029	// Operations on non-conditional policies may specify any valid value
1030	// or
1031	// leave the field unset.
1032	//
1033	// If no etag is provided in the call to `setIamPolicy`, version
1034	// compliance
1035	// checks against the stored policy is skipped.
1036	Version int64 `json:"version,omitempty"`
1037
1038	// ServerResponse contains the HTTP response code and headers from the
1039	// server.
1040	googleapi.ServerResponse `json:"-"`
1041
1042	// ForceSendFields is a list of field names (e.g. "AuditConfigs") to
1043	// unconditionally include in API requests. By default, fields with
1044	// empty values are omitted from API requests. However, any non-pointer,
1045	// non-interface field appearing in ForceSendFields will be sent to the
1046	// server regardless of whether the field is empty or not. This may be
1047	// used to include empty fields in Patch requests.
1048	ForceSendFields []string `json:"-"`
1049
1050	// NullFields is a list of field names (e.g. "AuditConfigs") to include
1051	// in API requests with the JSON null value. By default, fields with
1052	// empty values are omitted from API requests. However, any field with
1053	// an empty value appearing in NullFields will be sent to the server as
1054	// null. It is an error if a field in this list has a non-empty value.
1055	// This may be used to include null fields in Patch requests.
1056	NullFields []string `json:"-"`
1057}
1058
1059func (s *Policy) MarshalJSON() ([]byte, error) {
1060	type NoMethod Policy
1061	raw := NoMethod(*s)
1062	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1063}
1064
1065// Project: A Project is a high-level Google Cloud Platform entity.  It
1066// is a
1067// container for ACLs, APIs, App Engine Apps, VMs, and other
1068// Google Cloud Platform resources.
1069type Project struct {
1070	// CreateTime: Creation time.
1071	//
1072	// Read-only.
1073	CreateTime string `json:"createTime,omitempty"`
1074
1075	// Labels: The labels associated with this Project.
1076	//
1077	// Label keys must be between 1 and 63 characters long and must
1078	// conform
1079	// to the following regular expression:
1080	// \[a-z\](\[-a-z0-9\]*\[a-z0-9\])?.
1081	//
1082	// Label values must be between 0 and 63 characters long and must
1083	// conform
1084	// to the regular expression (\[a-z\](\[-a-z0-9\]*\[a-z0-9\])?)?. A
1085	// label
1086	// value can be empty.
1087	//
1088	// No more than 256 labels can be associated with a given
1089	// resource.
1090	//
1091	// Clients should store labels in a representation such as JSON that
1092	// does not
1093	// depend on specific characters being disallowed.
1094	//
1095	// Example: <code>"environment" : "dev"</code>
1096	// Read-write.
1097	Labels map[string]string `json:"labels,omitempty"`
1098
1099	// LifecycleState: The Project lifecycle state.
1100	//
1101	// Read-only.
1102	//
1103	// Possible values:
1104	//   "LIFECYCLE_STATE_UNSPECIFIED" - Unspecified state.  This is only
1105	// used/useful for distinguishing
1106	// unset values.
1107	//   "ACTIVE" - The normal and active state.
1108	//   "DELETE_REQUESTED" - The project has been marked for deletion by
1109	// the user
1110	// (by invoking
1111	// DeleteProject)
1112	// or by the system (Google Cloud Platform).
1113	// This can generally be reversed by invoking UndeleteProject.
1114	//   "DELETE_IN_PROGRESS" - This lifecycle state is no longer used and
1115	// is not returned by the API.
1116	LifecycleState string `json:"lifecycleState,omitempty"`
1117
1118	// Name: The optional user-assigned display name of the Project.
1119	// When present it must be between 4 to 30 characters.
1120	// Allowed characters are: lowercase and uppercase letters,
1121	// numbers,
1122	// hyphen, single-quote, double-quote, space, and exclamation
1123	// point.
1124	//
1125	// Example: <code>My Project</code>
1126	// Read-write.
1127	Name string `json:"name,omitempty"`
1128
1129	// Parent: An optional reference to a parent Resource.
1130	//
1131	// Supported parent types include "organization" and "folder". Once set,
1132	// the
1133	// parent cannot be cleared. The `parent` can be set on creation or
1134	// using the
1135	// `UpdateProject` method; the end user must have
1136	// the
1137	// `resourcemanager.projects.create` permission on the
1138	// parent.
1139	//
1140	// Read-write.
1141	Parent *ResourceId `json:"parent,omitempty"`
1142
1143	// ProjectId: The unique, user-assigned ID of the Project.
1144	// It must be 6 to 30 lowercase letters, digits, or hyphens.
1145	// It must start with a letter.
1146	// Trailing hyphens are prohibited.
1147	//
1148	// Example: <code>tokyo-rain-123</code>
1149	// Read-only after creation.
1150	ProjectId string `json:"projectId,omitempty"`
1151
1152	// ProjectNumber: The number uniquely identifying the project.
1153	//
1154	// Example: <code>415104041262</code>
1155	// Read-only.
1156	ProjectNumber int64 `json:"projectNumber,omitempty,string"`
1157
1158	// ServerResponse contains the HTTP response code and headers from the
1159	// server.
1160	googleapi.ServerResponse `json:"-"`
1161
1162	// ForceSendFields is a list of field names (e.g. "CreateTime") to
1163	// unconditionally include in API requests. By default, fields with
1164	// empty values are omitted from API requests. However, any non-pointer,
1165	// non-interface field appearing in ForceSendFields will be sent to the
1166	// server regardless of whether the field is empty or not. This may be
1167	// used to include empty fields in Patch requests.
1168	ForceSendFields []string `json:"-"`
1169
1170	// NullFields is a list of field names (e.g. "CreateTime") to include in
1171	// API requests with the JSON null value. By default, fields with empty
1172	// values are omitted from API requests. However, any field with an
1173	// empty value appearing in NullFields will be sent to the server as
1174	// null. It is an error if a field in this list has a non-empty value.
1175	// This may be used to include null fields in Patch requests.
1176	NullFields []string `json:"-"`
1177}
1178
1179func (s *Project) MarshalJSON() ([]byte, error) {
1180	type NoMethod Project
1181	raw := NoMethod(*s)
1182	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1183}
1184
1185// ProjectCreationStatus: A status object which is used as the
1186// `metadata` field for the Operation
1187// returned by CreateProject. It provides insight for when significant
1188// phases of
1189// Project creation have completed.
1190type ProjectCreationStatus struct {
1191	// CreateTime: Creation time of the project creation workflow.
1192	CreateTime string `json:"createTime,omitempty"`
1193
1194	// Gettable: True if the project can be retrieved using GetProject. No
1195	// other operations
1196	// on the project are guaranteed to work until the project creation
1197	// is
1198	// complete.
1199	Gettable bool `json:"gettable,omitempty"`
1200
1201	// Ready: True if the project creation process is complete.
1202	Ready bool `json:"ready,omitempty"`
1203
1204	// ForceSendFields is a list of field names (e.g. "CreateTime") to
1205	// unconditionally include in API requests. By default, fields with
1206	// empty values are omitted from API requests. However, any non-pointer,
1207	// non-interface field appearing in ForceSendFields will be sent to the
1208	// server regardless of whether the field is empty or not. This may be
1209	// used to include empty fields in Patch requests.
1210	ForceSendFields []string `json:"-"`
1211
1212	// NullFields is a list of field names (e.g. "CreateTime") to include in
1213	// API requests with the JSON null value. By default, fields with empty
1214	// values are omitted from API requests. However, any field with an
1215	// empty value appearing in NullFields will be sent to the server as
1216	// null. It is an error if a field in this list has a non-empty value.
1217	// This may be used to include null fields in Patch requests.
1218	NullFields []string `json:"-"`
1219}
1220
1221func (s *ProjectCreationStatus) MarshalJSON() ([]byte, error) {
1222	type NoMethod ProjectCreationStatus
1223	raw := NoMethod(*s)
1224	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1225}
1226
1227// ResourceId: A container to reference an id for any resource type. A
1228// `resource` in Google
1229// Cloud Platform is a generic term for something you (a developer) may
1230// want to
1231// interact with through one of our API's. Some examples are an App
1232// Engine app,
1233// a Compute Engine instance, a Cloud SQL database, and so on.
1234type ResourceId struct {
1235	// Id: Required field for the type-specific id. This should correspond
1236	// to the id
1237	// used in the type-specific API's.
1238	Id string `json:"id,omitempty"`
1239
1240	// Type: Required field representing the resource type this id is
1241	// for.
1242	// At present, the valid types are "project", "folder", and
1243	// "organization".
1244	Type string `json:"type,omitempty"`
1245
1246	// ForceSendFields is a list of field names (e.g. "Id") to
1247	// unconditionally include in API requests. By default, fields with
1248	// empty values are omitted from API requests. However, any non-pointer,
1249	// non-interface field appearing in ForceSendFields will be sent to the
1250	// server regardless of whether the field is empty or not. This may be
1251	// used to include empty fields in Patch requests.
1252	ForceSendFields []string `json:"-"`
1253
1254	// NullFields is a list of field names (e.g. "Id") to include in API
1255	// requests with the JSON null value. By default, fields with empty
1256	// values are omitted from API requests. However, any field with an
1257	// empty value appearing in NullFields will be sent to the server as
1258	// null. It is an error if a field in this list has a non-empty value.
1259	// This may be used to include null fields in Patch requests.
1260	NullFields []string `json:"-"`
1261}
1262
1263func (s *ResourceId) MarshalJSON() ([]byte, error) {
1264	type NoMethod ResourceId
1265	raw := NoMethod(*s)
1266	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1267}
1268
1269// SetIamPolicyRequest: Request message for `SetIamPolicy` method.
1270type SetIamPolicyRequest struct {
1271	// Policy: REQUIRED: The complete policy to be applied to the
1272	// `resource`. The size of
1273	// the policy is limited to a few 10s of KB. An empty policy is a
1274	// valid policy but certain Cloud Platform services (such as
1275	// Projects)
1276	// might reject them.
1277	Policy *Policy `json:"policy,omitempty"`
1278
1279	// UpdateMask: OPTIONAL: A FieldMask specifying which fields of the
1280	// policy to modify. Only
1281	// the fields in the mask will be modified. If no mask is provided,
1282	// the
1283	// following default mask is used:
1284	// paths: "bindings, etag"
1285	// This field is only used by Cloud IAM.
1286	UpdateMask string `json:"updateMask,omitempty"`
1287
1288	// ForceSendFields is a list of field names (e.g. "Policy") to
1289	// unconditionally include in API requests. By default, fields with
1290	// empty values are omitted from API requests. However, any non-pointer,
1291	// non-interface field appearing in ForceSendFields will be sent to the
1292	// server regardless of whether the field is empty or not. This may be
1293	// used to include empty fields in Patch requests.
1294	ForceSendFields []string `json:"-"`
1295
1296	// NullFields is a list of field names (e.g. "Policy") to include in API
1297	// requests with the JSON null value. By default, fields with empty
1298	// values are omitted from API requests. However, any field with an
1299	// empty value appearing in NullFields will be sent to the server as
1300	// null. It is an error if a field in this list has a non-empty value.
1301	// This may be used to include null fields in Patch requests.
1302	NullFields []string `json:"-"`
1303}
1304
1305func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) {
1306	type NoMethod SetIamPolicyRequest
1307	raw := NoMethod(*s)
1308	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1309}
1310
1311// TestIamPermissionsRequest: Request message for `TestIamPermissions`
1312// method.
1313type TestIamPermissionsRequest struct {
1314	// Permissions: The set of permissions to check for the `resource`.
1315	// Permissions with
1316	// wildcards (such as '*' or 'storage.*') are not allowed. For
1317	// more
1318	// information see
1319	// [IAM
1320	// Overview](https://cloud.google.com/iam/docs/overview#permissions).
1321	Permissions []string `json:"permissions,omitempty"`
1322
1323	// ForceSendFields is a list of field names (e.g. "Permissions") to
1324	// unconditionally include in API requests. By default, fields with
1325	// empty values are omitted from API requests. However, any non-pointer,
1326	// non-interface field appearing in ForceSendFields will be sent to the
1327	// server regardless of whether the field is empty or not. This may be
1328	// used to include empty fields in Patch requests.
1329	ForceSendFields []string `json:"-"`
1330
1331	// NullFields is a list of field names (e.g. "Permissions") to include
1332	// in API requests with the JSON null value. By default, fields with
1333	// empty values are omitted from API requests. However, any field with
1334	// an empty value appearing in NullFields will be sent to the server as
1335	// null. It is an error if a field in this list has a non-empty value.
1336	// This may be used to include null fields in Patch requests.
1337	NullFields []string `json:"-"`
1338}
1339
1340func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) {
1341	type NoMethod TestIamPermissionsRequest
1342	raw := NoMethod(*s)
1343	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1344}
1345
1346// TestIamPermissionsResponse: Response message for `TestIamPermissions`
1347// method.
1348type TestIamPermissionsResponse struct {
1349	// Permissions: A subset of `TestPermissionsRequest.permissions` that
1350	// the caller is
1351	// allowed.
1352	Permissions []string `json:"permissions,omitempty"`
1353
1354	// ServerResponse contains the HTTP response code and headers from the
1355	// server.
1356	googleapi.ServerResponse `json:"-"`
1357
1358	// ForceSendFields is a list of field names (e.g. "Permissions") to
1359	// unconditionally include in API requests. By default, fields with
1360	// empty values are omitted from API requests. However, any non-pointer,
1361	// non-interface field appearing in ForceSendFields will be sent to the
1362	// server regardless of whether the field is empty or not. This may be
1363	// used to include empty fields in Patch requests.
1364	ForceSendFields []string `json:"-"`
1365
1366	// NullFields is a list of field names (e.g. "Permissions") to include
1367	// in API requests with the JSON null value. By default, fields with
1368	// empty values are omitted from API requests. However, any field with
1369	// an empty value appearing in NullFields will be sent to the server as
1370	// null. It is an error if a field in this list has a non-empty value.
1371	// This may be used to include null fields in Patch requests.
1372	NullFields []string `json:"-"`
1373}
1374
1375func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
1376	type NoMethod TestIamPermissionsResponse
1377	raw := NoMethod(*s)
1378	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1379}
1380
1381// UndeleteProjectRequest: The request sent to the
1382// UndeleteProject
1383// method.
1384type UndeleteProjectRequest struct {
1385}
1386
1387// method id "cloudresourcemanager.organizations.get":
1388
1389type OrganizationsGetCall struct {
1390	s            *Service
1391	name         string
1392	urlParams_   gensupport.URLParams
1393	ifNoneMatch_ string
1394	ctx_         context.Context
1395	header_      http.Header
1396}
1397
1398// Get: Fetches an Organization resource identified by the specified
1399// resource name.
1400func (r *OrganizationsService) Get(name string) *OrganizationsGetCall {
1401	c := &OrganizationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1402	c.name = name
1403	return c
1404}
1405
1406// OrganizationId sets the optional parameter "organizationId": The id
1407// of the Organization resource to fetch.
1408// This field is deprecated and will be removed in v1. Use name instead.
1409func (c *OrganizationsGetCall) OrganizationId(organizationId string) *OrganizationsGetCall {
1410	c.urlParams_.Set("organizationId", organizationId)
1411	return c
1412}
1413
1414// Fields allows partial responses to be retrieved. See
1415// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1416// for more information.
1417func (c *OrganizationsGetCall) Fields(s ...googleapi.Field) *OrganizationsGetCall {
1418	c.urlParams_.Set("fields", googleapi.CombineFields(s))
1419	return c
1420}
1421
1422// IfNoneMatch sets the optional parameter which makes the operation
1423// fail if the object's ETag matches the given value. This is useful for
1424// getting updates only after the object has changed since the last
1425// request. Use googleapi.IsNotModified to check whether the response
1426// error from Do is the result of In-None-Match.
1427func (c *OrganizationsGetCall) IfNoneMatch(entityTag string) *OrganizationsGetCall {
1428	c.ifNoneMatch_ = entityTag
1429	return c
1430}
1431
1432// Context sets the context to be used in this call's Do method. Any
1433// pending HTTP request will be aborted if the provided context is
1434// canceled.
1435func (c *OrganizationsGetCall) Context(ctx context.Context) *OrganizationsGetCall {
1436	c.ctx_ = ctx
1437	return c
1438}
1439
1440// Header returns an http.Header that can be modified by the caller to
1441// add HTTP headers to the request.
1442func (c *OrganizationsGetCall) Header() http.Header {
1443	if c.header_ == nil {
1444		c.header_ = make(http.Header)
1445	}
1446	return c.header_
1447}
1448
1449func (c *OrganizationsGetCall) doRequest(alt string) (*http.Response, error) {
1450	reqHeaders := make(http.Header)
1451	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216")
1452	for k, v := range c.header_ {
1453		reqHeaders[k] = v
1454	}
1455	reqHeaders.Set("User-Agent", c.s.userAgent())
1456	if c.ifNoneMatch_ != "" {
1457		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1458	}
1459	var body io.Reader = nil
1460	c.urlParams_.Set("alt", alt)
1461	c.urlParams_.Set("prettyPrint", "false")
1462	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
1463	urls += "?" + c.urlParams_.Encode()
1464	req, err := http.NewRequest("GET", urls, body)
1465	if err != nil {
1466		return nil, err
1467	}
1468	req.Header = reqHeaders
1469	googleapi.Expand(req.URL, map[string]string{
1470		"name": c.name,
1471	})
1472	return gensupport.SendRequest(c.ctx_, c.s.client, req)
1473}
1474
1475// Do executes the "cloudresourcemanager.organizations.get" call.
1476// Exactly one of *Organization or error will be non-nil. Any non-2xx
1477// status code is an error. Response headers are in either
1478// *Organization.ServerResponse.Header or (if a response was returned at
1479// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
1480// to check whether the returned error was because
1481// http.StatusNotModified was returned.
1482func (c *OrganizationsGetCall) Do(opts ...googleapi.CallOption) (*Organization, error) {
1483	gensupport.SetOptions(c.urlParams_, opts...)
1484	res, err := c.doRequest("json")
1485	if res != nil && res.StatusCode == http.StatusNotModified {
1486		if res.Body != nil {
1487			res.Body.Close()
1488		}
1489		return nil, &googleapi.Error{
1490			Code:   res.StatusCode,
1491			Header: res.Header,
1492		}
1493	}
1494	if err != nil {
1495		return nil, err
1496	}
1497	defer googleapi.CloseBody(res)
1498	if err := googleapi.CheckResponse(res); err != nil {
1499		return nil, err
1500	}
1501	ret := &Organization{
1502		ServerResponse: googleapi.ServerResponse{
1503			Header:         res.Header,
1504			HTTPStatusCode: res.StatusCode,
1505		},
1506	}
1507	target := &ret
1508	if err := gensupport.DecodeResponse(target, res); err != nil {
1509		return nil, err
1510	}
1511	return ret, nil
1512	// {
1513	//   "description": "Fetches an Organization resource identified by the specified resource name.",
1514	//   "flatPath": "v1beta1/organizations/{organizationsId}",
1515	//   "httpMethod": "GET",
1516	//   "id": "cloudresourcemanager.organizations.get",
1517	//   "parameterOrder": [
1518	//     "name"
1519	//   ],
1520	//   "parameters": {
1521	//     "name": {
1522	//       "description": "The resource name of the Organization to fetch. This is the organization's\nrelative path in the API, formatted as \"organizations/[organizationId]\".\nFor example, \"organizations/1234\".",
1523	//       "location": "path",
1524	//       "pattern": "^organizations/[^/]+$",
1525	//       "required": true,
1526	//       "type": "string"
1527	//     },
1528	//     "organizationId": {
1529	//       "description": "The id of the Organization resource to fetch.\nThis field is deprecated and will be removed in v1. Use name instead.",
1530	//       "location": "query",
1531	//       "type": "string"
1532	//     }
1533	//   },
1534	//   "path": "v1beta1/{+name}",
1535	//   "response": {
1536	//     "$ref": "Organization"
1537	//   },
1538	//   "scopes": [
1539	//     "https://www.googleapis.com/auth/cloud-platform",
1540	//     "https://www.googleapis.com/auth/cloud-platform.read-only"
1541	//   ]
1542	// }
1543
1544}
1545
1546// method id "cloudresourcemanager.organizations.getIamPolicy":
1547
1548type OrganizationsGetIamPolicyCall struct {
1549	s                   *Service
1550	resource            string
1551	getiampolicyrequest *GetIamPolicyRequest
1552	urlParams_          gensupport.URLParams
1553	ctx_                context.Context
1554	header_             http.Header
1555}
1556
1557// GetIamPolicy: Gets the access control policy for an Organization
1558// resource. May be empty
1559// if no such policy or resource exists. The `resource` field should be
1560// the
1561// organization's resource name, e.g. "organizations/123".
1562func (r *OrganizationsService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *OrganizationsGetIamPolicyCall {
1563	c := &OrganizationsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1564	c.resource = resource
1565	c.getiampolicyrequest = getiampolicyrequest
1566	return c
1567}
1568
1569// Fields allows partial responses to be retrieved. See
1570// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1571// for more information.
1572func (c *OrganizationsGetIamPolicyCall) Fields(s ...googleapi.Field) *OrganizationsGetIamPolicyCall {
1573	c.urlParams_.Set("fields", googleapi.CombineFields(s))
1574	return c
1575}
1576
1577// Context sets the context to be used in this call's Do method. Any
1578// pending HTTP request will be aborted if the provided context is
1579// canceled.
1580func (c *OrganizationsGetIamPolicyCall) Context(ctx context.Context) *OrganizationsGetIamPolicyCall {
1581	c.ctx_ = ctx
1582	return c
1583}
1584
1585// Header returns an http.Header that can be modified by the caller to
1586// add HTTP headers to the request.
1587func (c *OrganizationsGetIamPolicyCall) Header() http.Header {
1588	if c.header_ == nil {
1589		c.header_ = make(http.Header)
1590	}
1591	return c.header_
1592}
1593
1594func (c *OrganizationsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
1595	reqHeaders := make(http.Header)
1596	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216")
1597	for k, v := range c.header_ {
1598		reqHeaders[k] = v
1599	}
1600	reqHeaders.Set("User-Agent", c.s.userAgent())
1601	var body io.Reader = nil
1602	body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest)
1603	if err != nil {
1604		return nil, err
1605	}
1606	reqHeaders.Set("Content-Type", "application/json")
1607	c.urlParams_.Set("alt", alt)
1608	c.urlParams_.Set("prettyPrint", "false")
1609	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy")
1610	urls += "?" + c.urlParams_.Encode()
1611	req, err := http.NewRequest("POST", urls, body)
1612	if err != nil {
1613		return nil, err
1614	}
1615	req.Header = reqHeaders
1616	googleapi.Expand(req.URL, map[string]string{
1617		"resource": c.resource,
1618	})
1619	return gensupport.SendRequest(c.ctx_, c.s.client, req)
1620}
1621
1622// Do executes the "cloudresourcemanager.organizations.getIamPolicy" call.
1623// Exactly one of *Policy or error will be non-nil. Any non-2xx status
1624// code is an error. Response headers are in either
1625// *Policy.ServerResponse.Header or (if a response was returned at all)
1626// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
1627// check whether the returned error was because http.StatusNotModified
1628// was returned.
1629func (c *OrganizationsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
1630	gensupport.SetOptions(c.urlParams_, opts...)
1631	res, err := c.doRequest("json")
1632	if res != nil && res.StatusCode == http.StatusNotModified {
1633		if res.Body != nil {
1634			res.Body.Close()
1635		}
1636		return nil, &googleapi.Error{
1637			Code:   res.StatusCode,
1638			Header: res.Header,
1639		}
1640	}
1641	if err != nil {
1642		return nil, err
1643	}
1644	defer googleapi.CloseBody(res)
1645	if err := googleapi.CheckResponse(res); err != nil {
1646		return nil, err
1647	}
1648	ret := &Policy{
1649		ServerResponse: googleapi.ServerResponse{
1650			Header:         res.Header,
1651			HTTPStatusCode: res.StatusCode,
1652		},
1653	}
1654	target := &ret
1655	if err := gensupport.DecodeResponse(target, res); err != nil {
1656		return nil, err
1657	}
1658	return ret, nil
1659	// {
1660	//   "description": "Gets the access control policy for an Organization resource. May be empty\nif no such policy or resource exists. The `resource` field should be the\norganization's resource name, e.g. \"organizations/123\".",
1661	//   "flatPath": "v1beta1/organizations/{organizationsId}:getIamPolicy",
1662	//   "httpMethod": "POST",
1663	//   "id": "cloudresourcemanager.organizations.getIamPolicy",
1664	//   "parameterOrder": [
1665	//     "resource"
1666	//   ],
1667	//   "parameters": {
1668	//     "resource": {
1669	//       "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field.",
1670	//       "location": "path",
1671	//       "pattern": "^organizations/[^/]+$",
1672	//       "required": true,
1673	//       "type": "string"
1674	//     }
1675	//   },
1676	//   "path": "v1beta1/{+resource}:getIamPolicy",
1677	//   "request": {
1678	//     "$ref": "GetIamPolicyRequest"
1679	//   },
1680	//   "response": {
1681	//     "$ref": "Policy"
1682	//   },
1683	//   "scopes": [
1684	//     "https://www.googleapis.com/auth/cloud-platform",
1685	//     "https://www.googleapis.com/auth/cloud-platform.read-only"
1686	//   ]
1687	// }
1688
1689}
1690
1691// method id "cloudresourcemanager.organizations.list":
1692
1693type OrganizationsListCall struct {
1694	s            *Service
1695	urlParams_   gensupport.URLParams
1696	ifNoneMatch_ string
1697	ctx_         context.Context
1698	header_      http.Header
1699}
1700
1701// List: Lists Organization resources that are visible to the user and
1702// satisfy
1703// the specified filter. This method returns Organizations in an
1704// unspecified
1705// order. New Organizations do not necessarily appear at the end of the
1706// list.
1707func (r *OrganizationsService) List() *OrganizationsListCall {
1708	c := &OrganizationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1709	return c
1710}
1711
1712// Filter sets the optional parameter "filter": An optional query string
1713// used to filter the Organizations to return in
1714// the response. Filter rules are case-insensitive.
1715//
1716//
1717// Organizations may be filtered by `owner.directoryCustomerId` or
1718// by
1719// `domain`, where the domain is a G Suite domain, for example:
1720//
1721// * Filter `owner.directorycustomerid:123456789` returns
1722// Organization
1723// resources with `owner.directory_customer_id` equal to `123456789`.
1724// * Filter `domain:google.com` returns Organization resources
1725// corresponding
1726// to the domain `google.com`.
1727//
1728// This field is optional.
1729func (c *OrganizationsListCall) Filter(filter string) *OrganizationsListCall {
1730	c.urlParams_.Set("filter", filter)
1731	return c
1732}
1733
1734// PageSize sets the optional parameter "pageSize": The maximum number
1735// of Organizations to return in the response.
1736// This field is optional.
1737func (c *OrganizationsListCall) PageSize(pageSize int64) *OrganizationsListCall {
1738	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
1739	return c
1740}
1741
1742// PageToken sets the optional parameter "pageToken": A pagination token
1743// returned from a previous call to `ListOrganizations`
1744// that indicates from where listing should continue.
1745// This field is optional.
1746func (c *OrganizationsListCall) PageToken(pageToken string) *OrganizationsListCall {
1747	c.urlParams_.Set("pageToken", pageToken)
1748	return c
1749}
1750
1751// Fields allows partial responses to be retrieved. See
1752// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1753// for more information.
1754func (c *OrganizationsListCall) Fields(s ...googleapi.Field) *OrganizationsListCall {
1755	c.urlParams_.Set("fields", googleapi.CombineFields(s))
1756	return c
1757}
1758
1759// IfNoneMatch sets the optional parameter which makes the operation
1760// fail if the object's ETag matches the given value. This is useful for
1761// getting updates only after the object has changed since the last
1762// request. Use googleapi.IsNotModified to check whether the response
1763// error from Do is the result of In-None-Match.
1764func (c *OrganizationsListCall) IfNoneMatch(entityTag string) *OrganizationsListCall {
1765	c.ifNoneMatch_ = entityTag
1766	return c
1767}
1768
1769// Context sets the context to be used in this call's Do method. Any
1770// pending HTTP request will be aborted if the provided context is
1771// canceled.
1772func (c *OrganizationsListCall) Context(ctx context.Context) *OrganizationsListCall {
1773	c.ctx_ = ctx
1774	return c
1775}
1776
1777// Header returns an http.Header that can be modified by the caller to
1778// add HTTP headers to the request.
1779func (c *OrganizationsListCall) Header() http.Header {
1780	if c.header_ == nil {
1781		c.header_ = make(http.Header)
1782	}
1783	return c.header_
1784}
1785
1786func (c *OrganizationsListCall) doRequest(alt string) (*http.Response, error) {
1787	reqHeaders := make(http.Header)
1788	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216")
1789	for k, v := range c.header_ {
1790		reqHeaders[k] = v
1791	}
1792	reqHeaders.Set("User-Agent", c.s.userAgent())
1793	if c.ifNoneMatch_ != "" {
1794		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1795	}
1796	var body io.Reader = nil
1797	c.urlParams_.Set("alt", alt)
1798	c.urlParams_.Set("prettyPrint", "false")
1799	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/organizations")
1800	urls += "?" + c.urlParams_.Encode()
1801	req, err := http.NewRequest("GET", urls, body)
1802	if err != nil {
1803		return nil, err
1804	}
1805	req.Header = reqHeaders
1806	return gensupport.SendRequest(c.ctx_, c.s.client, req)
1807}
1808
1809// Do executes the "cloudresourcemanager.organizations.list" call.
1810// Exactly one of *ListOrganizationsResponse or error will be non-nil.
1811// Any non-2xx status code is an error. Response headers are in either
1812// *ListOrganizationsResponse.ServerResponse.Header or (if a response
1813// was returned at all) in error.(*googleapi.Error).Header. Use
1814// googleapi.IsNotModified to check whether the returned error was
1815// because http.StatusNotModified was returned.
1816func (c *OrganizationsListCall) Do(opts ...googleapi.CallOption) (*ListOrganizationsResponse, error) {
1817	gensupport.SetOptions(c.urlParams_, opts...)
1818	res, err := c.doRequest("json")
1819	if res != nil && res.StatusCode == http.StatusNotModified {
1820		if res.Body != nil {
1821			res.Body.Close()
1822		}
1823		return nil, &googleapi.Error{
1824			Code:   res.StatusCode,
1825			Header: res.Header,
1826		}
1827	}
1828	if err != nil {
1829		return nil, err
1830	}
1831	defer googleapi.CloseBody(res)
1832	if err := googleapi.CheckResponse(res); err != nil {
1833		return nil, err
1834	}
1835	ret := &ListOrganizationsResponse{
1836		ServerResponse: googleapi.ServerResponse{
1837			Header:         res.Header,
1838			HTTPStatusCode: res.StatusCode,
1839		},
1840	}
1841	target := &ret
1842	if err := gensupport.DecodeResponse(target, res); err != nil {
1843		return nil, err
1844	}
1845	return ret, nil
1846	// {
1847	//   "description": "Lists Organization resources that are visible to the user and satisfy\nthe specified filter. This method returns Organizations in an unspecified\norder. New Organizations do not necessarily appear at the end of the list.",
1848	//   "flatPath": "v1beta1/organizations",
1849	//   "httpMethod": "GET",
1850	//   "id": "cloudresourcemanager.organizations.list",
1851	//   "parameterOrder": [],
1852	//   "parameters": {
1853	//     "filter": {
1854	//       "description": "An optional query string used to filter the Organizations to return in\nthe response. Filter rules are case-insensitive.\n\n\nOrganizations may be filtered by `owner.directoryCustomerId` or by\n`domain`, where the domain is a G Suite domain, for example:\n\n* Filter `owner.directorycustomerid:123456789` returns Organization\nresources with `owner.directory_customer_id` equal to `123456789`.\n* Filter `domain:google.com` returns Organization resources corresponding\nto the domain `google.com`.\n\nThis field is optional.",
1855	//       "location": "query",
1856	//       "type": "string"
1857	//     },
1858	//     "pageSize": {
1859	//       "description": "The maximum number of Organizations to return in the response.\nThis field is optional.",
1860	//       "format": "int32",
1861	//       "location": "query",
1862	//       "type": "integer"
1863	//     },
1864	//     "pageToken": {
1865	//       "description": "A pagination token returned from a previous call to `ListOrganizations`\nthat indicates from where listing should continue.\nThis field is optional.",
1866	//       "location": "query",
1867	//       "type": "string"
1868	//     }
1869	//   },
1870	//   "path": "v1beta1/organizations",
1871	//   "response": {
1872	//     "$ref": "ListOrganizationsResponse"
1873	//   },
1874	//   "scopes": [
1875	//     "https://www.googleapis.com/auth/cloud-platform",
1876	//     "https://www.googleapis.com/auth/cloud-platform.read-only"
1877	//   ]
1878	// }
1879
1880}
1881
1882// Pages invokes f for each page of results.
1883// A non-nil error returned from f will halt the iteration.
1884// The provided context supersedes any context provided to the Context method.
1885func (c *OrganizationsListCall) Pages(ctx context.Context, f func(*ListOrganizationsResponse) error) error {
1886	c.ctx_ = ctx
1887	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
1888	for {
1889		x, err := c.Do()
1890		if err != nil {
1891			return err
1892		}
1893		if err := f(x); err != nil {
1894			return err
1895		}
1896		if x.NextPageToken == "" {
1897			return nil
1898		}
1899		c.PageToken(x.NextPageToken)
1900	}
1901}
1902
1903// method id "cloudresourcemanager.organizations.setIamPolicy":
1904
1905type OrganizationsSetIamPolicyCall struct {
1906	s                   *Service
1907	resource            string
1908	setiampolicyrequest *SetIamPolicyRequest
1909	urlParams_          gensupport.URLParams
1910	ctx_                context.Context
1911	header_             http.Header
1912}
1913
1914// SetIamPolicy: Sets the access control policy on an Organization
1915// resource. Replaces any
1916// existing policy. The `resource` field should be the organization's
1917// resource
1918// name, e.g. "organizations/123".
1919func (r *OrganizationsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *OrganizationsSetIamPolicyCall {
1920	c := &OrganizationsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1921	c.resource = resource
1922	c.setiampolicyrequest = setiampolicyrequest
1923	return c
1924}
1925
1926// Fields allows partial responses to be retrieved. See
1927// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1928// for more information.
1929func (c *OrganizationsSetIamPolicyCall) Fields(s ...googleapi.Field) *OrganizationsSetIamPolicyCall {
1930	c.urlParams_.Set("fields", googleapi.CombineFields(s))
1931	return c
1932}
1933
1934// Context sets the context to be used in this call's Do method. Any
1935// pending HTTP request will be aborted if the provided context is
1936// canceled.
1937func (c *OrganizationsSetIamPolicyCall) Context(ctx context.Context) *OrganizationsSetIamPolicyCall {
1938	c.ctx_ = ctx
1939	return c
1940}
1941
1942// Header returns an http.Header that can be modified by the caller to
1943// add HTTP headers to the request.
1944func (c *OrganizationsSetIamPolicyCall) Header() http.Header {
1945	if c.header_ == nil {
1946		c.header_ = make(http.Header)
1947	}
1948	return c.header_
1949}
1950
1951func (c *OrganizationsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
1952	reqHeaders := make(http.Header)
1953	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216")
1954	for k, v := range c.header_ {
1955		reqHeaders[k] = v
1956	}
1957	reqHeaders.Set("User-Agent", c.s.userAgent())
1958	var body io.Reader = nil
1959	body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
1960	if err != nil {
1961		return nil, err
1962	}
1963	reqHeaders.Set("Content-Type", "application/json")
1964	c.urlParams_.Set("alt", alt)
1965	c.urlParams_.Set("prettyPrint", "false")
1966	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:setIamPolicy")
1967	urls += "?" + c.urlParams_.Encode()
1968	req, err := http.NewRequest("POST", urls, body)
1969	if err != nil {
1970		return nil, err
1971	}
1972	req.Header = reqHeaders
1973	googleapi.Expand(req.URL, map[string]string{
1974		"resource": c.resource,
1975	})
1976	return gensupport.SendRequest(c.ctx_, c.s.client, req)
1977}
1978
1979// Do executes the "cloudresourcemanager.organizations.setIamPolicy" call.
1980// Exactly one of *Policy or error will be non-nil. Any non-2xx status
1981// code is an error. Response headers are in either
1982// *Policy.ServerResponse.Header or (if a response was returned at all)
1983// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
1984// check whether the returned error was because http.StatusNotModified
1985// was returned.
1986func (c *OrganizationsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
1987	gensupport.SetOptions(c.urlParams_, opts...)
1988	res, err := c.doRequest("json")
1989	if res != nil && res.StatusCode == http.StatusNotModified {
1990		if res.Body != nil {
1991			res.Body.Close()
1992		}
1993		return nil, &googleapi.Error{
1994			Code:   res.StatusCode,
1995			Header: res.Header,
1996		}
1997	}
1998	if err != nil {
1999		return nil, err
2000	}
2001	defer googleapi.CloseBody(res)
2002	if err := googleapi.CheckResponse(res); err != nil {
2003		return nil, err
2004	}
2005	ret := &Policy{
2006		ServerResponse: googleapi.ServerResponse{
2007			Header:         res.Header,
2008			HTTPStatusCode: res.StatusCode,
2009		},
2010	}
2011	target := &ret
2012	if err := gensupport.DecodeResponse(target, res); err != nil {
2013		return nil, err
2014	}
2015	return ret, nil
2016	// {
2017	//   "description": "Sets the access control policy on an Organization resource. Replaces any\nexisting policy. The `resource` field should be the organization's resource\nname, e.g. \"organizations/123\".",
2018	//   "flatPath": "v1beta1/organizations/{organizationsId}:setIamPolicy",
2019	//   "httpMethod": "POST",
2020	//   "id": "cloudresourcemanager.organizations.setIamPolicy",
2021	//   "parameterOrder": [
2022	//     "resource"
2023	//   ],
2024	//   "parameters": {
2025	//     "resource": {
2026	//       "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field.",
2027	//       "location": "path",
2028	//       "pattern": "^organizations/[^/]+$",
2029	//       "required": true,
2030	//       "type": "string"
2031	//     }
2032	//   },
2033	//   "path": "v1beta1/{+resource}:setIamPolicy",
2034	//   "request": {
2035	//     "$ref": "SetIamPolicyRequest"
2036	//   },
2037	//   "response": {
2038	//     "$ref": "Policy"
2039	//   },
2040	//   "scopes": [
2041	//     "https://www.googleapis.com/auth/cloud-platform"
2042	//   ]
2043	// }
2044
2045}
2046
2047// method id "cloudresourcemanager.organizations.testIamPermissions":
2048
2049type OrganizationsTestIamPermissionsCall struct {
2050	s                         *Service
2051	resource                  string
2052	testiampermissionsrequest *TestIamPermissionsRequest
2053	urlParams_                gensupport.URLParams
2054	ctx_                      context.Context
2055	header_                   http.Header
2056}
2057
2058// TestIamPermissions: Returns permissions that a caller has on the
2059// specified Organization.
2060// The `resource` field should be the organization's resource name,
2061// e.g. "organizations/123".
2062func (r *OrganizationsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *OrganizationsTestIamPermissionsCall {
2063	c := &OrganizationsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2064	c.resource = resource
2065	c.testiampermissionsrequest = testiampermissionsrequest
2066	return c
2067}
2068
2069// Fields allows partial responses to be retrieved. See
2070// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2071// for more information.
2072func (c *OrganizationsTestIamPermissionsCall) Fields(s ...googleapi.Field) *OrganizationsTestIamPermissionsCall {
2073	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2074	return c
2075}
2076
2077// Context sets the context to be used in this call's Do method. Any
2078// pending HTTP request will be aborted if the provided context is
2079// canceled.
2080func (c *OrganizationsTestIamPermissionsCall) Context(ctx context.Context) *OrganizationsTestIamPermissionsCall {
2081	c.ctx_ = ctx
2082	return c
2083}
2084
2085// Header returns an http.Header that can be modified by the caller to
2086// add HTTP headers to the request.
2087func (c *OrganizationsTestIamPermissionsCall) Header() http.Header {
2088	if c.header_ == nil {
2089		c.header_ = make(http.Header)
2090	}
2091	return c.header_
2092}
2093
2094func (c *OrganizationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
2095	reqHeaders := make(http.Header)
2096	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216")
2097	for k, v := range c.header_ {
2098		reqHeaders[k] = v
2099	}
2100	reqHeaders.Set("User-Agent", c.s.userAgent())
2101	var body io.Reader = nil
2102	body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
2103	if err != nil {
2104		return nil, err
2105	}
2106	reqHeaders.Set("Content-Type", "application/json")
2107	c.urlParams_.Set("alt", alt)
2108	c.urlParams_.Set("prettyPrint", "false")
2109	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:testIamPermissions")
2110	urls += "?" + c.urlParams_.Encode()
2111	req, err := http.NewRequest("POST", urls, body)
2112	if err != nil {
2113		return nil, err
2114	}
2115	req.Header = reqHeaders
2116	googleapi.Expand(req.URL, map[string]string{
2117		"resource": c.resource,
2118	})
2119	return gensupport.SendRequest(c.ctx_, c.s.client, req)
2120}
2121
2122// Do executes the "cloudresourcemanager.organizations.testIamPermissions" call.
2123// Exactly one of *TestIamPermissionsResponse or error will be non-nil.
2124// Any non-2xx status code is an error. Response headers are in either
2125// *TestIamPermissionsResponse.ServerResponse.Header or (if a response
2126// was returned at all) in error.(*googleapi.Error).Header. Use
2127// googleapi.IsNotModified to check whether the returned error was
2128// because http.StatusNotModified was returned.
2129func (c *OrganizationsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
2130	gensupport.SetOptions(c.urlParams_, opts...)
2131	res, err := c.doRequest("json")
2132	if res != nil && res.StatusCode == http.StatusNotModified {
2133		if res.Body != nil {
2134			res.Body.Close()
2135		}
2136		return nil, &googleapi.Error{
2137			Code:   res.StatusCode,
2138			Header: res.Header,
2139		}
2140	}
2141	if err != nil {
2142		return nil, err
2143	}
2144	defer googleapi.CloseBody(res)
2145	if err := googleapi.CheckResponse(res); err != nil {
2146		return nil, err
2147	}
2148	ret := &TestIamPermissionsResponse{
2149		ServerResponse: googleapi.ServerResponse{
2150			Header:         res.Header,
2151			HTTPStatusCode: res.StatusCode,
2152		},
2153	}
2154	target := &ret
2155	if err := gensupport.DecodeResponse(target, res); err != nil {
2156		return nil, err
2157	}
2158	return ret, nil
2159	// {
2160	//   "description": "Returns permissions that a caller has on the specified Organization.\nThe `resource` field should be the organization's resource name,\ne.g. \"organizations/123\".",
2161	//   "flatPath": "v1beta1/organizations/{organizationsId}:testIamPermissions",
2162	//   "httpMethod": "POST",
2163	//   "id": "cloudresourcemanager.organizations.testIamPermissions",
2164	//   "parameterOrder": [
2165	//     "resource"
2166	//   ],
2167	//   "parameters": {
2168	//     "resource": {
2169	//       "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.",
2170	//       "location": "path",
2171	//       "pattern": "^organizations/[^/]+$",
2172	//       "required": true,
2173	//       "type": "string"
2174	//     }
2175	//   },
2176	//   "path": "v1beta1/{+resource}:testIamPermissions",
2177	//   "request": {
2178	//     "$ref": "TestIamPermissionsRequest"
2179	//   },
2180	//   "response": {
2181	//     "$ref": "TestIamPermissionsResponse"
2182	//   },
2183	//   "scopes": [
2184	//     "https://www.googleapis.com/auth/cloud-platform",
2185	//     "https://www.googleapis.com/auth/cloud-platform.read-only"
2186	//   ]
2187	// }
2188
2189}
2190
2191// method id "cloudresourcemanager.organizations.update":
2192
2193type OrganizationsUpdateCall struct {
2194	s            *Service
2195	name         string
2196	organization *Organization
2197	urlParams_   gensupport.URLParams
2198	ctx_         context.Context
2199	header_      http.Header
2200}
2201
2202// Update: Updates an Organization resource identified by the specified
2203// resource name.
2204func (r *OrganizationsService) Update(name string, organization *Organization) *OrganizationsUpdateCall {
2205	c := &OrganizationsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2206	c.name = name
2207	c.organization = organization
2208	return c
2209}
2210
2211// Fields allows partial responses to be retrieved. See
2212// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2213// for more information.
2214func (c *OrganizationsUpdateCall) Fields(s ...googleapi.Field) *OrganizationsUpdateCall {
2215	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2216	return c
2217}
2218
2219// Context sets the context to be used in this call's Do method. Any
2220// pending HTTP request will be aborted if the provided context is
2221// canceled.
2222func (c *OrganizationsUpdateCall) Context(ctx context.Context) *OrganizationsUpdateCall {
2223	c.ctx_ = ctx
2224	return c
2225}
2226
2227// Header returns an http.Header that can be modified by the caller to
2228// add HTTP headers to the request.
2229func (c *OrganizationsUpdateCall) Header() http.Header {
2230	if c.header_ == nil {
2231		c.header_ = make(http.Header)
2232	}
2233	return c.header_
2234}
2235
2236func (c *OrganizationsUpdateCall) doRequest(alt string) (*http.Response, error) {
2237	reqHeaders := make(http.Header)
2238	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216")
2239	for k, v := range c.header_ {
2240		reqHeaders[k] = v
2241	}
2242	reqHeaders.Set("User-Agent", c.s.userAgent())
2243	var body io.Reader = nil
2244	body, err := googleapi.WithoutDataWrapper.JSONReader(c.organization)
2245	if err != nil {
2246		return nil, err
2247	}
2248	reqHeaders.Set("Content-Type", "application/json")
2249	c.urlParams_.Set("alt", alt)
2250	c.urlParams_.Set("prettyPrint", "false")
2251	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
2252	urls += "?" + c.urlParams_.Encode()
2253	req, err := http.NewRequest("PUT", urls, body)
2254	if err != nil {
2255		return nil, err
2256	}
2257	req.Header = reqHeaders
2258	googleapi.Expand(req.URL, map[string]string{
2259		"name": c.name,
2260	})
2261	return gensupport.SendRequest(c.ctx_, c.s.client, req)
2262}
2263
2264// Do executes the "cloudresourcemanager.organizations.update" call.
2265// Exactly one of *Organization or error will be non-nil. Any non-2xx
2266// status code is an error. Response headers are in either
2267// *Organization.ServerResponse.Header or (if a response was returned at
2268// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
2269// to check whether the returned error was because
2270// http.StatusNotModified was returned.
2271func (c *OrganizationsUpdateCall) Do(opts ...googleapi.CallOption) (*Organization, error) {
2272	gensupport.SetOptions(c.urlParams_, opts...)
2273	res, err := c.doRequest("json")
2274	if res != nil && res.StatusCode == http.StatusNotModified {
2275		if res.Body != nil {
2276			res.Body.Close()
2277		}
2278		return nil, &googleapi.Error{
2279			Code:   res.StatusCode,
2280			Header: res.Header,
2281		}
2282	}
2283	if err != nil {
2284		return nil, err
2285	}
2286	defer googleapi.CloseBody(res)
2287	if err := googleapi.CheckResponse(res); err != nil {
2288		return nil, err
2289	}
2290	ret := &Organization{
2291		ServerResponse: googleapi.ServerResponse{
2292			Header:         res.Header,
2293			HTTPStatusCode: res.StatusCode,
2294		},
2295	}
2296	target := &ret
2297	if err := gensupport.DecodeResponse(target, res); err != nil {
2298		return nil, err
2299	}
2300	return ret, nil
2301	// {
2302	//   "description": "Updates an Organization resource identified by the specified resource name.",
2303	//   "flatPath": "v1beta1/organizations/{organizationsId}",
2304	//   "httpMethod": "PUT",
2305	//   "id": "cloudresourcemanager.organizations.update",
2306	//   "parameterOrder": [
2307	//     "name"
2308	//   ],
2309	//   "parameters": {
2310	//     "name": {
2311	//       "description": "Output only. The resource name of the organization. This is the\norganization's relative path in the API. Its format is\n\"organizations/[organization_id]\". For example, \"organizations/1234\".",
2312	//       "location": "path",
2313	//       "pattern": "^organizations/[^/]+$",
2314	//       "required": true,
2315	//       "type": "string"
2316	//     }
2317	//   },
2318	//   "path": "v1beta1/{+name}",
2319	//   "request": {
2320	//     "$ref": "Organization"
2321	//   },
2322	//   "response": {
2323	//     "$ref": "Organization"
2324	//   },
2325	//   "scopes": [
2326	//     "https://www.googleapis.com/auth/cloud-platform"
2327	//   ]
2328	// }
2329
2330}
2331
2332// method id "cloudresourcemanager.projects.create":
2333
2334type ProjectsCreateCall struct {
2335	s          *Service
2336	project    *Project
2337	urlParams_ gensupport.URLParams
2338	ctx_       context.Context
2339	header_    http.Header
2340}
2341
2342// Create: Creates a Project resource.
2343//
2344// Initially, the Project resource is owned by its creator
2345// exclusively.
2346// The creator can later grant permission to others to read or update
2347// the
2348// Project.
2349//
2350// Several APIs are activated automatically for the Project,
2351// including
2352// Google Cloud Storage. The parent is identified by a
2353// specified
2354// ResourceId, which must include both an ID and a type, such
2355// as
2356// project, folder, or organization.
2357//
2358// This method does not associate the new project with a billing
2359// account.
2360// You can set or update the billing account associated with a project
2361// using
2362// the
2363// [`projects.updateBillingInfo`]
2364// (/billing/reference/rest/v1/projects/up
2365// dateBillingInfo) method.
2366func (r *ProjectsService) Create(project *Project) *ProjectsCreateCall {
2367	c := &ProjectsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2368	c.project = project
2369	return c
2370}
2371
2372// UseLegacyStack sets the optional parameter "useLegacyStack": A safety
2373// hatch to opt out of the new reliable project creation process.
2374func (c *ProjectsCreateCall) UseLegacyStack(useLegacyStack bool) *ProjectsCreateCall {
2375	c.urlParams_.Set("useLegacyStack", fmt.Sprint(useLegacyStack))
2376	return c
2377}
2378
2379// Fields allows partial responses to be retrieved. See
2380// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2381// for more information.
2382func (c *ProjectsCreateCall) Fields(s ...googleapi.Field) *ProjectsCreateCall {
2383	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2384	return c
2385}
2386
2387// Context sets the context to be used in this call's Do method. Any
2388// pending HTTP request will be aborted if the provided context is
2389// canceled.
2390func (c *ProjectsCreateCall) Context(ctx context.Context) *ProjectsCreateCall {
2391	c.ctx_ = ctx
2392	return c
2393}
2394
2395// Header returns an http.Header that can be modified by the caller to
2396// add HTTP headers to the request.
2397func (c *ProjectsCreateCall) Header() http.Header {
2398	if c.header_ == nil {
2399		c.header_ = make(http.Header)
2400	}
2401	return c.header_
2402}
2403
2404func (c *ProjectsCreateCall) doRequest(alt string) (*http.Response, error) {
2405	reqHeaders := make(http.Header)
2406	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216")
2407	for k, v := range c.header_ {
2408		reqHeaders[k] = v
2409	}
2410	reqHeaders.Set("User-Agent", c.s.userAgent())
2411	var body io.Reader = nil
2412	body, err := googleapi.WithoutDataWrapper.JSONReader(c.project)
2413	if err != nil {
2414		return nil, err
2415	}
2416	reqHeaders.Set("Content-Type", "application/json")
2417	c.urlParams_.Set("alt", alt)
2418	c.urlParams_.Set("prettyPrint", "false")
2419	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects")
2420	urls += "?" + c.urlParams_.Encode()
2421	req, err := http.NewRequest("POST", urls, body)
2422	if err != nil {
2423		return nil, err
2424	}
2425	req.Header = reqHeaders
2426	return gensupport.SendRequest(c.ctx_, c.s.client, req)
2427}
2428
2429// Do executes the "cloudresourcemanager.projects.create" call.
2430// Exactly one of *Project or error will be non-nil. Any non-2xx status
2431// code is an error. Response headers are in either
2432// *Project.ServerResponse.Header or (if a response was returned at all)
2433// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
2434// check whether the returned error was because http.StatusNotModified
2435// was returned.
2436func (c *ProjectsCreateCall) Do(opts ...googleapi.CallOption) (*Project, error) {
2437	gensupport.SetOptions(c.urlParams_, opts...)
2438	res, err := c.doRequest("json")
2439	if res != nil && res.StatusCode == http.StatusNotModified {
2440		if res.Body != nil {
2441			res.Body.Close()
2442		}
2443		return nil, &googleapi.Error{
2444			Code:   res.StatusCode,
2445			Header: res.Header,
2446		}
2447	}
2448	if err != nil {
2449		return nil, err
2450	}
2451	defer googleapi.CloseBody(res)
2452	if err := googleapi.CheckResponse(res); err != nil {
2453		return nil, err
2454	}
2455	ret := &Project{
2456		ServerResponse: googleapi.ServerResponse{
2457			Header:         res.Header,
2458			HTTPStatusCode: res.StatusCode,
2459		},
2460	}
2461	target := &ret
2462	if err := gensupport.DecodeResponse(target, res); err != nil {
2463		return nil, err
2464	}
2465	return ret, nil
2466	// {
2467	//   "description": "Creates a Project resource.\n\nInitially, the Project resource is owned by its creator exclusively.\nThe creator can later grant permission to others to read or update the\nProject.\n\nSeveral APIs are activated automatically for the Project, including\nGoogle Cloud Storage. The parent is identified by a specified\nResourceId, which must include both an ID and a type, such as\nproject, folder, or organization.\n\nThis method does not associate the new project with a billing account.\nYou can set or update the billing account associated with a project using\nthe [`projects.updateBillingInfo`]\n(/billing/reference/rest/v1/projects/updateBillingInfo) method.",
2468	//   "flatPath": "v1beta1/projects",
2469	//   "httpMethod": "POST",
2470	//   "id": "cloudresourcemanager.projects.create",
2471	//   "parameterOrder": [],
2472	//   "parameters": {
2473	//     "useLegacyStack": {
2474	//       "description": "A safety hatch to opt out of the new reliable project creation process.",
2475	//       "location": "query",
2476	//       "type": "boolean"
2477	//     }
2478	//   },
2479	//   "path": "v1beta1/projects",
2480	//   "request": {
2481	//     "$ref": "Project"
2482	//   },
2483	//   "response": {
2484	//     "$ref": "Project"
2485	//   },
2486	//   "scopes": [
2487	//     "https://www.googleapis.com/auth/cloud-platform"
2488	//   ]
2489	// }
2490
2491}
2492
2493// method id "cloudresourcemanager.projects.delete":
2494
2495type ProjectsDeleteCall struct {
2496	s          *Service
2497	projectId  string
2498	urlParams_ gensupport.URLParams
2499	ctx_       context.Context
2500	header_    http.Header
2501}
2502
2503// Delete: Marks the Project identified by the specified
2504// `project_id` (for example, `my-project-123`) for deletion.
2505// This method will only affect the Project if it has a lifecycle state
2506// of
2507// ACTIVE.
2508//
2509// This method changes the Project's lifecycle state from
2510// ACTIVE
2511// to DELETE_REQUESTED.
2512// The deletion starts at an unspecified time, at which point the
2513// project is
2514// no longer accessible.
2515//
2516// Until the deletion completes, you can check the lifecycle
2517// state
2518// checked by retrieving the Project with GetProject,
2519// and the Project remains visible to ListProjects.
2520// However, you cannot update the project.
2521//
2522// After the deletion completes, the Project is not retrievable by
2523// the  GetProject
2524// and ListProjects
2525// methods.
2526//
2527// The caller must have modify permissions for this Project.
2528func (r *ProjectsService) Delete(projectId string) *ProjectsDeleteCall {
2529	c := &ProjectsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2530	c.projectId = projectId
2531	return c
2532}
2533
2534// Fields allows partial responses to be retrieved. See
2535// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2536// for more information.
2537func (c *ProjectsDeleteCall) Fields(s ...googleapi.Field) *ProjectsDeleteCall {
2538	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2539	return c
2540}
2541
2542// Context sets the context to be used in this call's Do method. Any
2543// pending HTTP request will be aborted if the provided context is
2544// canceled.
2545func (c *ProjectsDeleteCall) Context(ctx context.Context) *ProjectsDeleteCall {
2546	c.ctx_ = ctx
2547	return c
2548}
2549
2550// Header returns an http.Header that can be modified by the caller to
2551// add HTTP headers to the request.
2552func (c *ProjectsDeleteCall) Header() http.Header {
2553	if c.header_ == nil {
2554		c.header_ = make(http.Header)
2555	}
2556	return c.header_
2557}
2558
2559func (c *ProjectsDeleteCall) doRequest(alt string) (*http.Response, error) {
2560	reqHeaders := make(http.Header)
2561	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216")
2562	for k, v := range c.header_ {
2563		reqHeaders[k] = v
2564	}
2565	reqHeaders.Set("User-Agent", c.s.userAgent())
2566	var body io.Reader = nil
2567	c.urlParams_.Set("alt", alt)
2568	c.urlParams_.Set("prettyPrint", "false")
2569	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}")
2570	urls += "?" + c.urlParams_.Encode()
2571	req, err := http.NewRequest("DELETE", urls, body)
2572	if err != nil {
2573		return nil, err
2574	}
2575	req.Header = reqHeaders
2576	googleapi.Expand(req.URL, map[string]string{
2577		"projectId": c.projectId,
2578	})
2579	return gensupport.SendRequest(c.ctx_, c.s.client, req)
2580}
2581
2582// Do executes the "cloudresourcemanager.projects.delete" call.
2583// Exactly one of *Empty or error will be non-nil. Any non-2xx status
2584// code is an error. Response headers are in either
2585// *Empty.ServerResponse.Header or (if a response was returned at all)
2586// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
2587// check whether the returned error was because http.StatusNotModified
2588// was returned.
2589func (c *ProjectsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
2590	gensupport.SetOptions(c.urlParams_, opts...)
2591	res, err := c.doRequest("json")
2592	if res != nil && res.StatusCode == http.StatusNotModified {
2593		if res.Body != nil {
2594			res.Body.Close()
2595		}
2596		return nil, &googleapi.Error{
2597			Code:   res.StatusCode,
2598			Header: res.Header,
2599		}
2600	}
2601	if err != nil {
2602		return nil, err
2603	}
2604	defer googleapi.CloseBody(res)
2605	if err := googleapi.CheckResponse(res); err != nil {
2606		return nil, err
2607	}
2608	ret := &Empty{
2609		ServerResponse: googleapi.ServerResponse{
2610			Header:         res.Header,
2611			HTTPStatusCode: res.StatusCode,
2612		},
2613	}
2614	target := &ret
2615	if err := gensupport.DecodeResponse(target, res); err != nil {
2616		return nil, err
2617	}
2618	return ret, nil
2619	// {
2620	//   "description": "Marks the Project identified by the specified\n`project_id` (for example, `my-project-123`) for deletion.\nThis method will only affect the Project if it has a lifecycle state of\nACTIVE.\n\nThis method changes the Project's lifecycle state from\nACTIVE\nto DELETE_REQUESTED.\nThe deletion starts at an unspecified time, at which point the project is\nno longer accessible.\n\nUntil the deletion completes, you can check the lifecycle state\nchecked by retrieving the Project with GetProject,\nand the Project remains visible to ListProjects.\nHowever, you cannot update the project.\n\nAfter the deletion completes, the Project is not retrievable by\nthe  GetProject\nand ListProjects\nmethods.\n\nThe caller must have modify permissions for this Project.",
2621	//   "flatPath": "v1beta1/projects/{projectId}",
2622	//   "httpMethod": "DELETE",
2623	//   "id": "cloudresourcemanager.projects.delete",
2624	//   "parameterOrder": [
2625	//     "projectId"
2626	//   ],
2627	//   "parameters": {
2628	//     "projectId": {
2629	//       "description": "The Project ID (for example, `foo-bar-123`).\n\nRequired.",
2630	//       "location": "path",
2631	//       "required": true,
2632	//       "type": "string"
2633	//     }
2634	//   },
2635	//   "path": "v1beta1/projects/{projectId}",
2636	//   "response": {
2637	//     "$ref": "Empty"
2638	//   },
2639	//   "scopes": [
2640	//     "https://www.googleapis.com/auth/cloud-platform"
2641	//   ]
2642	// }
2643
2644}
2645
2646// method id "cloudresourcemanager.projects.get":
2647
2648type ProjectsGetCall struct {
2649	s            *Service
2650	projectId    string
2651	urlParams_   gensupport.URLParams
2652	ifNoneMatch_ string
2653	ctx_         context.Context
2654	header_      http.Header
2655}
2656
2657// Get: Retrieves the Project identified by the specified
2658// `project_id` (for example, `my-project-123`).
2659//
2660// The caller must have read permissions for this Project.
2661func (r *ProjectsService) Get(projectId string) *ProjectsGetCall {
2662	c := &ProjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2663	c.projectId = projectId
2664	return c
2665}
2666
2667// Fields allows partial responses to be retrieved. See
2668// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2669// for more information.
2670func (c *ProjectsGetCall) Fields(s ...googleapi.Field) *ProjectsGetCall {
2671	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2672	return c
2673}
2674
2675// IfNoneMatch sets the optional parameter which makes the operation
2676// fail if the object's ETag matches the given value. This is useful for
2677// getting updates only after the object has changed since the last
2678// request. Use googleapi.IsNotModified to check whether the response
2679// error from Do is the result of In-None-Match.
2680func (c *ProjectsGetCall) IfNoneMatch(entityTag string) *ProjectsGetCall {
2681	c.ifNoneMatch_ = entityTag
2682	return c
2683}
2684
2685// Context sets the context to be used in this call's Do method. Any
2686// pending HTTP request will be aborted if the provided context is
2687// canceled.
2688func (c *ProjectsGetCall) Context(ctx context.Context) *ProjectsGetCall {
2689	c.ctx_ = ctx
2690	return c
2691}
2692
2693// Header returns an http.Header that can be modified by the caller to
2694// add HTTP headers to the request.
2695func (c *ProjectsGetCall) Header() http.Header {
2696	if c.header_ == nil {
2697		c.header_ = make(http.Header)
2698	}
2699	return c.header_
2700}
2701
2702func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) {
2703	reqHeaders := make(http.Header)
2704	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216")
2705	for k, v := range c.header_ {
2706		reqHeaders[k] = v
2707	}
2708	reqHeaders.Set("User-Agent", c.s.userAgent())
2709	if c.ifNoneMatch_ != "" {
2710		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2711	}
2712	var body io.Reader = nil
2713	c.urlParams_.Set("alt", alt)
2714	c.urlParams_.Set("prettyPrint", "false")
2715	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}")
2716	urls += "?" + c.urlParams_.Encode()
2717	req, err := http.NewRequest("GET", urls, body)
2718	if err != nil {
2719		return nil, err
2720	}
2721	req.Header = reqHeaders
2722	googleapi.Expand(req.URL, map[string]string{
2723		"projectId": c.projectId,
2724	})
2725	return gensupport.SendRequest(c.ctx_, c.s.client, req)
2726}
2727
2728// Do executes the "cloudresourcemanager.projects.get" call.
2729// Exactly one of *Project or error will be non-nil. Any non-2xx status
2730// code is an error. Response headers are in either
2731// *Project.ServerResponse.Header or (if a response was returned at all)
2732// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
2733// check whether the returned error was because http.StatusNotModified
2734// was returned.
2735func (c *ProjectsGetCall) Do(opts ...googleapi.CallOption) (*Project, error) {
2736	gensupport.SetOptions(c.urlParams_, opts...)
2737	res, err := c.doRequest("json")
2738	if res != nil && res.StatusCode == http.StatusNotModified {
2739		if res.Body != nil {
2740			res.Body.Close()
2741		}
2742		return nil, &googleapi.Error{
2743			Code:   res.StatusCode,
2744			Header: res.Header,
2745		}
2746	}
2747	if err != nil {
2748		return nil, err
2749	}
2750	defer googleapi.CloseBody(res)
2751	if err := googleapi.CheckResponse(res); err != nil {
2752		return nil, err
2753	}
2754	ret := &Project{
2755		ServerResponse: googleapi.ServerResponse{
2756			Header:         res.Header,
2757			HTTPStatusCode: res.StatusCode,
2758		},
2759	}
2760	target := &ret
2761	if err := gensupport.DecodeResponse(target, res); err != nil {
2762		return nil, err
2763	}
2764	return ret, nil
2765	// {
2766	//   "description": "Retrieves the Project identified by the specified\n`project_id` (for example, `my-project-123`).\n\nThe caller must have read permissions for this Project.",
2767	//   "flatPath": "v1beta1/projects/{projectId}",
2768	//   "httpMethod": "GET",
2769	//   "id": "cloudresourcemanager.projects.get",
2770	//   "parameterOrder": [
2771	//     "projectId"
2772	//   ],
2773	//   "parameters": {
2774	//     "projectId": {
2775	//       "description": "The Project ID (for example, `my-project-123`).\n\nRequired.",
2776	//       "location": "path",
2777	//       "required": true,
2778	//       "type": "string"
2779	//     }
2780	//   },
2781	//   "path": "v1beta1/projects/{projectId}",
2782	//   "response": {
2783	//     "$ref": "Project"
2784	//   },
2785	//   "scopes": [
2786	//     "https://www.googleapis.com/auth/cloud-platform",
2787	//     "https://www.googleapis.com/auth/cloud-platform.read-only"
2788	//   ]
2789	// }
2790
2791}
2792
2793// method id "cloudresourcemanager.projects.getAncestry":
2794
2795type ProjectsGetAncestryCall struct {
2796	s                  *Service
2797	projectId          string
2798	getancestryrequest *GetAncestryRequest
2799	urlParams_         gensupport.URLParams
2800	ctx_               context.Context
2801	header_            http.Header
2802}
2803
2804// GetAncestry: Gets a list of ancestors in the resource hierarchy for
2805// the Project
2806// identified by the specified `project_id` (for example,
2807// `my-project-123`).
2808//
2809// The caller must have read permissions for this Project.
2810func (r *ProjectsService) GetAncestry(projectId string, getancestryrequest *GetAncestryRequest) *ProjectsGetAncestryCall {
2811	c := &ProjectsGetAncestryCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2812	c.projectId = projectId
2813	c.getancestryrequest = getancestryrequest
2814	return c
2815}
2816
2817// Fields allows partial responses to be retrieved. See
2818// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2819// for more information.
2820func (c *ProjectsGetAncestryCall) Fields(s ...googleapi.Field) *ProjectsGetAncestryCall {
2821	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2822	return c
2823}
2824
2825// Context sets the context to be used in this call's Do method. Any
2826// pending HTTP request will be aborted if the provided context is
2827// canceled.
2828func (c *ProjectsGetAncestryCall) Context(ctx context.Context) *ProjectsGetAncestryCall {
2829	c.ctx_ = ctx
2830	return c
2831}
2832
2833// Header returns an http.Header that can be modified by the caller to
2834// add HTTP headers to the request.
2835func (c *ProjectsGetAncestryCall) Header() http.Header {
2836	if c.header_ == nil {
2837		c.header_ = make(http.Header)
2838	}
2839	return c.header_
2840}
2841
2842func (c *ProjectsGetAncestryCall) doRequest(alt string) (*http.Response, error) {
2843	reqHeaders := make(http.Header)
2844	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216")
2845	for k, v := range c.header_ {
2846		reqHeaders[k] = v
2847	}
2848	reqHeaders.Set("User-Agent", c.s.userAgent())
2849	var body io.Reader = nil
2850	body, err := googleapi.WithoutDataWrapper.JSONReader(c.getancestryrequest)
2851	if err != nil {
2852		return nil, err
2853	}
2854	reqHeaders.Set("Content-Type", "application/json")
2855	c.urlParams_.Set("alt", alt)
2856	c.urlParams_.Set("prettyPrint", "false")
2857	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}:getAncestry")
2858	urls += "?" + c.urlParams_.Encode()
2859	req, err := http.NewRequest("POST", urls, body)
2860	if err != nil {
2861		return nil, err
2862	}
2863	req.Header = reqHeaders
2864	googleapi.Expand(req.URL, map[string]string{
2865		"projectId": c.projectId,
2866	})
2867	return gensupport.SendRequest(c.ctx_, c.s.client, req)
2868}
2869
2870// Do executes the "cloudresourcemanager.projects.getAncestry" call.
2871// Exactly one of *GetAncestryResponse or error will be non-nil. Any
2872// non-2xx status code is an error. Response headers are in either
2873// *GetAncestryResponse.ServerResponse.Header or (if a response was
2874// returned at all) in error.(*googleapi.Error).Header. Use
2875// googleapi.IsNotModified to check whether the returned error was
2876// because http.StatusNotModified was returned.
2877func (c *ProjectsGetAncestryCall) Do(opts ...googleapi.CallOption) (*GetAncestryResponse, error) {
2878	gensupport.SetOptions(c.urlParams_, opts...)
2879	res, err := c.doRequest("json")
2880	if res != nil && res.StatusCode == http.StatusNotModified {
2881		if res.Body != nil {
2882			res.Body.Close()
2883		}
2884		return nil, &googleapi.Error{
2885			Code:   res.StatusCode,
2886			Header: res.Header,
2887		}
2888	}
2889	if err != nil {
2890		return nil, err
2891	}
2892	defer googleapi.CloseBody(res)
2893	if err := googleapi.CheckResponse(res); err != nil {
2894		return nil, err
2895	}
2896	ret := &GetAncestryResponse{
2897		ServerResponse: googleapi.ServerResponse{
2898			Header:         res.Header,
2899			HTTPStatusCode: res.StatusCode,
2900		},
2901	}
2902	target := &ret
2903	if err := gensupport.DecodeResponse(target, res); err != nil {
2904		return nil, err
2905	}
2906	return ret, nil
2907	// {
2908	//   "description": "Gets a list of ancestors in the resource hierarchy for the Project\nidentified by the specified `project_id` (for example, `my-project-123`).\n\nThe caller must have read permissions for this Project.",
2909	//   "flatPath": "v1beta1/projects/{projectId}:getAncestry",
2910	//   "httpMethod": "POST",
2911	//   "id": "cloudresourcemanager.projects.getAncestry",
2912	//   "parameterOrder": [
2913	//     "projectId"
2914	//   ],
2915	//   "parameters": {
2916	//     "projectId": {
2917	//       "description": "The Project ID (for example, `my-project-123`).\n\nRequired.",
2918	//       "location": "path",
2919	//       "required": true,
2920	//       "type": "string"
2921	//     }
2922	//   },
2923	//   "path": "v1beta1/projects/{projectId}:getAncestry",
2924	//   "request": {
2925	//     "$ref": "GetAncestryRequest"
2926	//   },
2927	//   "response": {
2928	//     "$ref": "GetAncestryResponse"
2929	//   },
2930	//   "scopes": [
2931	//     "https://www.googleapis.com/auth/cloud-platform",
2932	//     "https://www.googleapis.com/auth/cloud-platform.read-only"
2933	//   ]
2934	// }
2935
2936}
2937
2938// method id "cloudresourcemanager.projects.getIamPolicy":
2939
2940type ProjectsGetIamPolicyCall struct {
2941	s                   *Service
2942	resource            string
2943	getiampolicyrequest *GetIamPolicyRequest
2944	urlParams_          gensupport.URLParams
2945	ctx_                context.Context
2946	header_             http.Header
2947}
2948
2949// GetIamPolicy: Returns the IAM access control policy for the specified
2950// Project.
2951// Permission is denied if the policy or the resource does not
2952// exist.
2953//
2954// For additional information about resource structure and
2955// identification,
2956// see [Resource Names](/apis/design/resource_names).
2957func (r *ProjectsService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *ProjectsGetIamPolicyCall {
2958	c := &ProjectsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2959	c.resource = resource
2960	c.getiampolicyrequest = getiampolicyrequest
2961	return c
2962}
2963
2964// Fields allows partial responses to be retrieved. See
2965// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2966// for more information.
2967func (c *ProjectsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsGetIamPolicyCall {
2968	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2969	return c
2970}
2971
2972// Context sets the context to be used in this call's Do method. Any
2973// pending HTTP request will be aborted if the provided context is
2974// canceled.
2975func (c *ProjectsGetIamPolicyCall) Context(ctx context.Context) *ProjectsGetIamPolicyCall {
2976	c.ctx_ = ctx
2977	return c
2978}
2979
2980// Header returns an http.Header that can be modified by the caller to
2981// add HTTP headers to the request.
2982func (c *ProjectsGetIamPolicyCall) Header() http.Header {
2983	if c.header_ == nil {
2984		c.header_ = make(http.Header)
2985	}
2986	return c.header_
2987}
2988
2989func (c *ProjectsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
2990	reqHeaders := make(http.Header)
2991	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216")
2992	for k, v := range c.header_ {
2993		reqHeaders[k] = v
2994	}
2995	reqHeaders.Set("User-Agent", c.s.userAgent())
2996	var body io.Reader = nil
2997	body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest)
2998	if err != nil {
2999		return nil, err
3000	}
3001	reqHeaders.Set("Content-Type", "application/json")
3002	c.urlParams_.Set("alt", alt)
3003	c.urlParams_.Set("prettyPrint", "false")
3004	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{resource}:getIamPolicy")
3005	urls += "?" + c.urlParams_.Encode()
3006	req, err := http.NewRequest("POST", urls, body)
3007	if err != nil {
3008		return nil, err
3009	}
3010	req.Header = reqHeaders
3011	googleapi.Expand(req.URL, map[string]string{
3012		"resource": c.resource,
3013	})
3014	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3015}
3016
3017// Do executes the "cloudresourcemanager.projects.getIamPolicy" call.
3018// Exactly one of *Policy or error will be non-nil. Any non-2xx status
3019// code is an error. Response headers are in either
3020// *Policy.ServerResponse.Header or (if a response was returned at all)
3021// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
3022// check whether the returned error was because http.StatusNotModified
3023// was returned.
3024func (c *ProjectsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
3025	gensupport.SetOptions(c.urlParams_, opts...)
3026	res, err := c.doRequest("json")
3027	if res != nil && res.StatusCode == http.StatusNotModified {
3028		if res.Body != nil {
3029			res.Body.Close()
3030		}
3031		return nil, &googleapi.Error{
3032			Code:   res.StatusCode,
3033			Header: res.Header,
3034		}
3035	}
3036	if err != nil {
3037		return nil, err
3038	}
3039	defer googleapi.CloseBody(res)
3040	if err := googleapi.CheckResponse(res); err != nil {
3041		return nil, err
3042	}
3043	ret := &Policy{
3044		ServerResponse: googleapi.ServerResponse{
3045			Header:         res.Header,
3046			HTTPStatusCode: res.StatusCode,
3047		},
3048	}
3049	target := &ret
3050	if err := gensupport.DecodeResponse(target, res); err != nil {
3051		return nil, err
3052	}
3053	return ret, nil
3054	// {
3055	//   "description": "Returns the IAM access control policy for the specified Project.\nPermission is denied if the policy or the resource does not exist.\n\nFor additional information about resource structure and identification,\nsee [Resource Names](/apis/design/resource_names).",
3056	//   "flatPath": "v1beta1/projects/{resource}:getIamPolicy",
3057	//   "httpMethod": "POST",
3058	//   "id": "cloudresourcemanager.projects.getIamPolicy",
3059	//   "parameterOrder": [
3060	//     "resource"
3061	//   ],
3062	//   "parameters": {
3063	//     "resource": {
3064	//       "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field.",
3065	//       "location": "path",
3066	//       "required": true,
3067	//       "type": "string"
3068	//     }
3069	//   },
3070	//   "path": "v1beta1/projects/{resource}:getIamPolicy",
3071	//   "request": {
3072	//     "$ref": "GetIamPolicyRequest"
3073	//   },
3074	//   "response": {
3075	//     "$ref": "Policy"
3076	//   },
3077	//   "scopes": [
3078	//     "https://www.googleapis.com/auth/cloud-platform",
3079	//     "https://www.googleapis.com/auth/cloud-platform.read-only"
3080	//   ]
3081	// }
3082
3083}
3084
3085// method id "cloudresourcemanager.projects.list":
3086
3087type ProjectsListCall struct {
3088	s            *Service
3089	urlParams_   gensupport.URLParams
3090	ifNoneMatch_ string
3091	ctx_         context.Context
3092	header_      http.Header
3093}
3094
3095// List: Lists Projects that the caller has the
3096// `resourcemanager.projects.get`
3097// permission on and satisfy the specified filter.
3098//
3099// This method returns Projects in an unspecified order.
3100// This method is eventually consistent with project mutations; this
3101// means
3102// that a newly created project may not appear in the results or
3103// recent
3104// updates to an existing project may not be reflected in the results.
3105// To
3106// retrieve the latest state of a project, use the
3107// GetProject method.
3108//
3109// NOTE: If the request filter contains a `parent.type` and `parent.id`
3110// and
3111// the caller has the `resourcemanager.projects.list` permission on
3112// the
3113// parent, the results will be drawn from an alternate index which
3114// provides
3115// more consistent results. In future versions of this API, this List
3116// method
3117// will be split into List and Search to properly capture the
3118// behavorial
3119// difference.
3120func (r *ProjectsService) List() *ProjectsListCall {
3121	c := &ProjectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3122	return c
3123}
3124
3125// Filter sets the optional parameter "filter": An expression for
3126// filtering the results of the request.  Filter rules are
3127// case insensitive. The fields eligible for filtering are:
3128//
3129// + `name`
3130// + `id`
3131// + `labels.<key>` (where *key* is the name of a label)
3132// + `parent.type`
3133// + `parent.id`
3134//
3135// Some examples of using labels as filters:
3136//
3137// | Filter           | Description
3138//
3139// |
3140// |------------------|------------------------------------------------
3141// -----|
3142// | name:how*        | The project's name starts with "how".
3143//    |
3144// | name:Howl        | The project's name is `Howl` or `howl`.
3145//    |
3146// | name:HOWL        | Equivalent to above.
3147//    |
3148// | NAME:howl        | Equivalent to above.
3149//    |
3150// | labels.color:*   | The project has the label `color`.
3151//    |
3152// | labels.color:red | The project's label `color` has the value `red`.
3153//    |
3154// | labels.color:red&nbsp;labels.size:big |The project's label `color`
3155// has
3156//   the value `red` and its label `size` has the value `big`.
3157//    |
3158//
3159// If no filter is specified, the call will return projects for which
3160// the user
3161// has the `resourcemanager.projects.get` permission.
3162//
3163// NOTE: To perform a by-parent query (eg., what projects are directly
3164// in a
3165// Folder), the caller must have the
3166// `resourcemanager.projects.list`
3167// permission on the parent and the filter must contain both a
3168// `parent.type`
3169// and a `parent.id` restriction
3170// (example: "parent.type:folder parent.id:123"). In this case an
3171// alternate
3172// search index is used which provides more consistent results.
3173func (c *ProjectsListCall) Filter(filter string) *ProjectsListCall {
3174	c.urlParams_.Set("filter", filter)
3175	return c
3176}
3177
3178// PageSize sets the optional parameter "pageSize": The maximum number
3179// of Projects to return in the response.
3180// The server can return fewer Projects than requested.
3181// If unspecified, server picks an appropriate default.
3182func (c *ProjectsListCall) PageSize(pageSize int64) *ProjectsListCall {
3183	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3184	return c
3185}
3186
3187// PageToken sets the optional parameter "pageToken": A pagination token
3188// returned from a previous call to ListProjects
3189// that indicates from where listing should continue.
3190func (c *ProjectsListCall) PageToken(pageToken string) *ProjectsListCall {
3191	c.urlParams_.Set("pageToken", pageToken)
3192	return c
3193}
3194
3195// Fields allows partial responses to be retrieved. See
3196// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3197// for more information.
3198func (c *ProjectsListCall) Fields(s ...googleapi.Field) *ProjectsListCall {
3199	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3200	return c
3201}
3202
3203// IfNoneMatch sets the optional parameter which makes the operation
3204// fail if the object's ETag matches the given value. This is useful for
3205// getting updates only after the object has changed since the last
3206// request. Use googleapi.IsNotModified to check whether the response
3207// error from Do is the result of In-None-Match.
3208func (c *ProjectsListCall) IfNoneMatch(entityTag string) *ProjectsListCall {
3209	c.ifNoneMatch_ = entityTag
3210	return c
3211}
3212
3213// Context sets the context to be used in this call's Do method. Any
3214// pending HTTP request will be aborted if the provided context is
3215// canceled.
3216func (c *ProjectsListCall) Context(ctx context.Context) *ProjectsListCall {
3217	c.ctx_ = ctx
3218	return c
3219}
3220
3221// Header returns an http.Header that can be modified by the caller to
3222// add HTTP headers to the request.
3223func (c *ProjectsListCall) Header() http.Header {
3224	if c.header_ == nil {
3225		c.header_ = make(http.Header)
3226	}
3227	return c.header_
3228}
3229
3230func (c *ProjectsListCall) doRequest(alt string) (*http.Response, error) {
3231	reqHeaders := make(http.Header)
3232	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216")
3233	for k, v := range c.header_ {
3234		reqHeaders[k] = v
3235	}
3236	reqHeaders.Set("User-Agent", c.s.userAgent())
3237	if c.ifNoneMatch_ != "" {
3238		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3239	}
3240	var body io.Reader = nil
3241	c.urlParams_.Set("alt", alt)
3242	c.urlParams_.Set("prettyPrint", "false")
3243	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects")
3244	urls += "?" + c.urlParams_.Encode()
3245	req, err := http.NewRequest("GET", urls, body)
3246	if err != nil {
3247		return nil, err
3248	}
3249	req.Header = reqHeaders
3250	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3251}
3252
3253// Do executes the "cloudresourcemanager.projects.list" call.
3254// Exactly one of *ListProjectsResponse or error will be non-nil. Any
3255// non-2xx status code is an error. Response headers are in either
3256// *ListProjectsResponse.ServerResponse.Header or (if a response was
3257// returned at all) in error.(*googleapi.Error).Header. Use
3258// googleapi.IsNotModified to check whether the returned error was
3259// because http.StatusNotModified was returned.
3260func (c *ProjectsListCall) Do(opts ...googleapi.CallOption) (*ListProjectsResponse, error) {
3261	gensupport.SetOptions(c.urlParams_, opts...)
3262	res, err := c.doRequest("json")
3263	if res != nil && res.StatusCode == http.StatusNotModified {
3264		if res.Body != nil {
3265			res.Body.Close()
3266		}
3267		return nil, &googleapi.Error{
3268			Code:   res.StatusCode,
3269			Header: res.Header,
3270		}
3271	}
3272	if err != nil {
3273		return nil, err
3274	}
3275	defer googleapi.CloseBody(res)
3276	if err := googleapi.CheckResponse(res); err != nil {
3277		return nil, err
3278	}
3279	ret := &ListProjectsResponse{
3280		ServerResponse: googleapi.ServerResponse{
3281			Header:         res.Header,
3282			HTTPStatusCode: res.StatusCode,
3283		},
3284	}
3285	target := &ret
3286	if err := gensupport.DecodeResponse(target, res); err != nil {
3287		return nil, err
3288	}
3289	return ret, nil
3290	// {
3291	//   "description": "Lists Projects that the caller has the `resourcemanager.projects.get`\npermission on and satisfy the specified filter.\n\nThis method returns Projects in an unspecified order.\nThis method is eventually consistent with project mutations; this means\nthat a newly created project may not appear in the results or recent\nupdates to an existing project may not be reflected in the results. To\nretrieve the latest state of a project, use the\nGetProject method.\n\nNOTE: If the request filter contains a `parent.type` and `parent.id` and\nthe caller has the `resourcemanager.projects.list` permission on the\nparent, the results will be drawn from an alternate index which provides\nmore consistent results. In future versions of this API, this List method\nwill be split into List and Search to properly capture the behavorial\ndifference.",
3292	//   "flatPath": "v1beta1/projects",
3293	//   "httpMethod": "GET",
3294	//   "id": "cloudresourcemanager.projects.list",
3295	//   "parameterOrder": [],
3296	//   "parameters": {
3297	//     "filter": {
3298	//       "description": "An expression for filtering the results of the request.  Filter rules are\ncase insensitive. The fields eligible for filtering are:\n\n+ `name`\n+ `id`\n+ `labels.\u003ckey\u003e` (where *key* is the name of a label)\n+ `parent.type`\n+ `parent.id`\n\nSome examples of using labels as filters:\n\n| Filter           | Description                                         |\n|------------------|-----------------------------------------------------|\n| name:how*        | The project's name starts with \"how\".               |\n| name:Howl        | The project's name is `Howl` or `howl`.             |\n| name:HOWL        | Equivalent to above.                                |\n| NAME:howl        | Equivalent to above.                                |\n| labels.color:*   | The project has the label `color`.                  |\n| labels.color:red | The project's label `color` has the value `red`.    |\n| labels.color:red\u0026nbsp;labels.size:big |The project's label `color` has\n  the value `red` and its label `size` has the value `big`.              |\n\nIf no filter is specified, the call will return projects for which the user\nhas the `resourcemanager.projects.get` permission.\n\nNOTE: To perform a by-parent query (eg., what projects are directly in a\nFolder), the caller must have the `resourcemanager.projects.list`\npermission on the parent and the filter must contain both a `parent.type`\nand a `parent.id` restriction\n(example: \"parent.type:folder parent.id:123\"). In this case an alternate\nsearch index is used which provides more consistent results.\n\nOptional.",
3299	//       "location": "query",
3300	//       "type": "string"
3301	//     },
3302	//     "pageSize": {
3303	//       "description": "The maximum number of Projects to return in the response.\nThe server can return fewer Projects than requested.\nIf unspecified, server picks an appropriate default.\n\nOptional.",
3304	//       "format": "int32",
3305	//       "location": "query",
3306	//       "type": "integer"
3307	//     },
3308	//     "pageToken": {
3309	//       "description": "A pagination token returned from a previous call to ListProjects\nthat indicates from where listing should continue.\n\nOptional.",
3310	//       "location": "query",
3311	//       "type": "string"
3312	//     }
3313	//   },
3314	//   "path": "v1beta1/projects",
3315	//   "response": {
3316	//     "$ref": "ListProjectsResponse"
3317	//   },
3318	//   "scopes": [
3319	//     "https://www.googleapis.com/auth/cloud-platform",
3320	//     "https://www.googleapis.com/auth/cloud-platform.read-only"
3321	//   ]
3322	// }
3323
3324}
3325
3326// Pages invokes f for each page of results.
3327// A non-nil error returned from f will halt the iteration.
3328// The provided context supersedes any context provided to the Context method.
3329func (c *ProjectsListCall) Pages(ctx context.Context, f func(*ListProjectsResponse) error) error {
3330	c.ctx_ = ctx
3331	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
3332	for {
3333		x, err := c.Do()
3334		if err != nil {
3335			return err
3336		}
3337		if err := f(x); err != nil {
3338			return err
3339		}
3340		if x.NextPageToken == "" {
3341			return nil
3342		}
3343		c.PageToken(x.NextPageToken)
3344	}
3345}
3346
3347// method id "cloudresourcemanager.projects.setIamPolicy":
3348
3349type ProjectsSetIamPolicyCall struct {
3350	s                   *Service
3351	resource            string
3352	setiampolicyrequest *SetIamPolicyRequest
3353	urlParams_          gensupport.URLParams
3354	ctx_                context.Context
3355	header_             http.Header
3356}
3357
3358// SetIamPolicy: Sets the IAM access control policy for the specified
3359// Project. Overwrites
3360// any existing policy.
3361//
3362// The following constraints apply when using `setIamPolicy()`:
3363//
3364// + Project does not support `allUsers` and `allAuthenticatedUsers`
3365// as
3366// `members` in a `Binding` of a `Policy`.
3367//
3368// + The owner role can be granted to a `user`, `serviceAccount`, or a
3369// group
3370// that is part of an organization. For
3371// example,
3372// group@myownpersonaldomain.com could be added as an owner to a project
3373// in
3374// the myownpersonaldomain.com organization, but not the
3375// examplepetstore.com
3376// organization.
3377//
3378// + Service accounts can be made owners of a project directly
3379// without any restrictions. However, to be added as an owner, a user
3380// must be
3381// invited via Cloud Platform console and must accept the invitation.
3382//
3383// + A user cannot be granted the owner role using `setIamPolicy()`. The
3384// user
3385// must be granted the owner role using the Cloud Platform Console and
3386// must
3387// explicitly accept the invitation.
3388//
3389// + Invitations to grant the owner role cannot be sent
3390// using
3391// `setIamPolicy()`; they must be sent only using the Cloud Platform
3392// Console.
3393//
3394// + Membership changes that leave the project without any owners that
3395// have
3396// accepted the Terms of Service (ToS) will be rejected.
3397//
3398// + If the project is not part of an organization, there must be at
3399// least
3400// one owner who has accepted the Terms of Service (ToS) agreement in
3401// the
3402// policy. Calling `setIamPolicy()` to remove the last ToS-accepted
3403// owner
3404// from the policy will fail. This restriction also applies to
3405// legacy
3406// projects that no longer have owners who have accepted the ToS. Edits
3407// to
3408// IAM policies will be rejected until the lack of a ToS-accepting owner
3409// is
3410// rectified.
3411//
3412// + This method will replace the existing policy, and cannot be used
3413// to
3414// append additional IAM settings.
3415//
3416// Note: Removing service accounts from policies or changing their
3417// roles
3418// can render services completely inoperable. It is important to
3419// understand
3420// how the service account is being used before removing or updating
3421// its
3422// roles.
3423func (r *ProjectsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsSetIamPolicyCall {
3424	c := &ProjectsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3425	c.resource = resource
3426	c.setiampolicyrequest = setiampolicyrequest
3427	return c
3428}
3429
3430// Fields allows partial responses to be retrieved. See
3431// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3432// for more information.
3433func (c *ProjectsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsSetIamPolicyCall {
3434	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3435	return c
3436}
3437
3438// Context sets the context to be used in this call's Do method. Any
3439// pending HTTP request will be aborted if the provided context is
3440// canceled.
3441func (c *ProjectsSetIamPolicyCall) Context(ctx context.Context) *ProjectsSetIamPolicyCall {
3442	c.ctx_ = ctx
3443	return c
3444}
3445
3446// Header returns an http.Header that can be modified by the caller to
3447// add HTTP headers to the request.
3448func (c *ProjectsSetIamPolicyCall) Header() http.Header {
3449	if c.header_ == nil {
3450		c.header_ = make(http.Header)
3451	}
3452	return c.header_
3453}
3454
3455func (c *ProjectsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
3456	reqHeaders := make(http.Header)
3457	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216")
3458	for k, v := range c.header_ {
3459		reqHeaders[k] = v
3460	}
3461	reqHeaders.Set("User-Agent", c.s.userAgent())
3462	var body io.Reader = nil
3463	body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
3464	if err != nil {
3465		return nil, err
3466	}
3467	reqHeaders.Set("Content-Type", "application/json")
3468	c.urlParams_.Set("alt", alt)
3469	c.urlParams_.Set("prettyPrint", "false")
3470	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{resource}:setIamPolicy")
3471	urls += "?" + c.urlParams_.Encode()
3472	req, err := http.NewRequest("POST", urls, body)
3473	if err != nil {
3474		return nil, err
3475	}
3476	req.Header = reqHeaders
3477	googleapi.Expand(req.URL, map[string]string{
3478		"resource": c.resource,
3479	})
3480	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3481}
3482
3483// Do executes the "cloudresourcemanager.projects.setIamPolicy" call.
3484// Exactly one of *Policy or error will be non-nil. Any non-2xx status
3485// code is an error. Response headers are in either
3486// *Policy.ServerResponse.Header or (if a response was returned at all)
3487// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
3488// check whether the returned error was because http.StatusNotModified
3489// was returned.
3490func (c *ProjectsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
3491	gensupport.SetOptions(c.urlParams_, opts...)
3492	res, err := c.doRequest("json")
3493	if res != nil && res.StatusCode == http.StatusNotModified {
3494		if res.Body != nil {
3495			res.Body.Close()
3496		}
3497		return nil, &googleapi.Error{
3498			Code:   res.StatusCode,
3499			Header: res.Header,
3500		}
3501	}
3502	if err != nil {
3503		return nil, err
3504	}
3505	defer googleapi.CloseBody(res)
3506	if err := googleapi.CheckResponse(res); err != nil {
3507		return nil, err
3508	}
3509	ret := &Policy{
3510		ServerResponse: googleapi.ServerResponse{
3511			Header:         res.Header,
3512			HTTPStatusCode: res.StatusCode,
3513		},
3514	}
3515	target := &ret
3516	if err := gensupport.DecodeResponse(target, res); err != nil {
3517		return nil, err
3518	}
3519	return ret, nil
3520	// {
3521	//   "description": "Sets the IAM access control policy for the specified Project. Overwrites\nany existing policy.\n\nThe following constraints apply when using `setIamPolicy()`:\n\n+ Project does not support `allUsers` and `allAuthenticatedUsers` as\n`members` in a `Binding` of a `Policy`.\n\n+ The owner role can be granted to a `user`, `serviceAccount`, or a group\nthat is part of an organization. For example,\ngroup@myownpersonaldomain.com could be added as an owner to a project in\nthe myownpersonaldomain.com organization, but not the examplepetstore.com\norganization.\n\n+ Service accounts can be made owners of a project directly\nwithout any restrictions. However, to be added as an owner, a user must be\ninvited via Cloud Platform console and must accept the invitation.\n\n+ A user cannot be granted the owner role using `setIamPolicy()`. The user\nmust be granted the owner role using the Cloud Platform Console and must\nexplicitly accept the invitation.\n\n+ Invitations to grant the owner role cannot be sent using\n`setIamPolicy()`; they must be sent only using the Cloud Platform Console.\n\n+ Membership changes that leave the project without any owners that have\naccepted the Terms of Service (ToS) will be rejected.\n\n+ If the project is not part of an organization, there must be at least\none owner who has accepted the Terms of Service (ToS) agreement in the\npolicy. Calling `setIamPolicy()` to remove the last ToS-accepted owner\nfrom the policy will fail. This restriction also applies to legacy\nprojects that no longer have owners who have accepted the ToS. Edits to\nIAM policies will be rejected until the lack of a ToS-accepting owner is\nrectified.\n\n+ This method will replace the existing policy, and cannot be used to\nappend additional IAM settings.\n\nNote: Removing service accounts from policies or changing their roles\ncan render services completely inoperable. It is important to understand\nhow the service account is being used before removing or updating its\nroles.",
3522	//   "flatPath": "v1beta1/projects/{resource}:setIamPolicy",
3523	//   "httpMethod": "POST",
3524	//   "id": "cloudresourcemanager.projects.setIamPolicy",
3525	//   "parameterOrder": [
3526	//     "resource"
3527	//   ],
3528	//   "parameters": {
3529	//     "resource": {
3530	//       "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field.",
3531	//       "location": "path",
3532	//       "required": true,
3533	//       "type": "string"
3534	//     }
3535	//   },
3536	//   "path": "v1beta1/projects/{resource}:setIamPolicy",
3537	//   "request": {
3538	//     "$ref": "SetIamPolicyRequest"
3539	//   },
3540	//   "response": {
3541	//     "$ref": "Policy"
3542	//   },
3543	//   "scopes": [
3544	//     "https://www.googleapis.com/auth/cloud-platform"
3545	//   ]
3546	// }
3547
3548}
3549
3550// method id "cloudresourcemanager.projects.testIamPermissions":
3551
3552type ProjectsTestIamPermissionsCall struct {
3553	s                         *Service
3554	resource                  string
3555	testiampermissionsrequest *TestIamPermissionsRequest
3556	urlParams_                gensupport.URLParams
3557	ctx_                      context.Context
3558	header_                   http.Header
3559}
3560
3561// TestIamPermissions: Returns permissions that a caller has on the
3562// specified Project.
3563func (r *ProjectsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsTestIamPermissionsCall {
3564	c := &ProjectsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3565	c.resource = resource
3566	c.testiampermissionsrequest = testiampermissionsrequest
3567	return c
3568}
3569
3570// Fields allows partial responses to be retrieved. See
3571// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3572// for more information.
3573func (c *ProjectsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsTestIamPermissionsCall {
3574	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3575	return c
3576}
3577
3578// Context sets the context to be used in this call's Do method. Any
3579// pending HTTP request will be aborted if the provided context is
3580// canceled.
3581func (c *ProjectsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsTestIamPermissionsCall {
3582	c.ctx_ = ctx
3583	return c
3584}
3585
3586// Header returns an http.Header that can be modified by the caller to
3587// add HTTP headers to the request.
3588func (c *ProjectsTestIamPermissionsCall) Header() http.Header {
3589	if c.header_ == nil {
3590		c.header_ = make(http.Header)
3591	}
3592	return c.header_
3593}
3594
3595func (c *ProjectsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
3596	reqHeaders := make(http.Header)
3597	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216")
3598	for k, v := range c.header_ {
3599		reqHeaders[k] = v
3600	}
3601	reqHeaders.Set("User-Agent", c.s.userAgent())
3602	var body io.Reader = nil
3603	body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
3604	if err != nil {
3605		return nil, err
3606	}
3607	reqHeaders.Set("Content-Type", "application/json")
3608	c.urlParams_.Set("alt", alt)
3609	c.urlParams_.Set("prettyPrint", "false")
3610	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{resource}:testIamPermissions")
3611	urls += "?" + c.urlParams_.Encode()
3612	req, err := http.NewRequest("POST", urls, body)
3613	if err != nil {
3614		return nil, err
3615	}
3616	req.Header = reqHeaders
3617	googleapi.Expand(req.URL, map[string]string{
3618		"resource": c.resource,
3619	})
3620	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3621}
3622
3623// Do executes the "cloudresourcemanager.projects.testIamPermissions" call.
3624// Exactly one of *TestIamPermissionsResponse or error will be non-nil.
3625// Any non-2xx status code is an error. Response headers are in either
3626// *TestIamPermissionsResponse.ServerResponse.Header or (if a response
3627// was returned at all) in error.(*googleapi.Error).Header. Use
3628// googleapi.IsNotModified to check whether the returned error was
3629// because http.StatusNotModified was returned.
3630func (c *ProjectsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
3631	gensupport.SetOptions(c.urlParams_, opts...)
3632	res, err := c.doRequest("json")
3633	if res != nil && res.StatusCode == http.StatusNotModified {
3634		if res.Body != nil {
3635			res.Body.Close()
3636		}
3637		return nil, &googleapi.Error{
3638			Code:   res.StatusCode,
3639			Header: res.Header,
3640		}
3641	}
3642	if err != nil {
3643		return nil, err
3644	}
3645	defer googleapi.CloseBody(res)
3646	if err := googleapi.CheckResponse(res); err != nil {
3647		return nil, err
3648	}
3649	ret := &TestIamPermissionsResponse{
3650		ServerResponse: googleapi.ServerResponse{
3651			Header:         res.Header,
3652			HTTPStatusCode: res.StatusCode,
3653		},
3654	}
3655	target := &ret
3656	if err := gensupport.DecodeResponse(target, res); err != nil {
3657		return nil, err
3658	}
3659	return ret, nil
3660	// {
3661	//   "description": "Returns permissions that a caller has on the specified Project.",
3662	//   "flatPath": "v1beta1/projects/{resource}:testIamPermissions",
3663	//   "httpMethod": "POST",
3664	//   "id": "cloudresourcemanager.projects.testIamPermissions",
3665	//   "parameterOrder": [
3666	//     "resource"
3667	//   ],
3668	//   "parameters": {
3669	//     "resource": {
3670	//       "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.",
3671	//       "location": "path",
3672	//       "required": true,
3673	//       "type": "string"
3674	//     }
3675	//   },
3676	//   "path": "v1beta1/projects/{resource}:testIamPermissions",
3677	//   "request": {
3678	//     "$ref": "TestIamPermissionsRequest"
3679	//   },
3680	//   "response": {
3681	//     "$ref": "TestIamPermissionsResponse"
3682	//   },
3683	//   "scopes": [
3684	//     "https://www.googleapis.com/auth/cloud-platform",
3685	//     "https://www.googleapis.com/auth/cloud-platform.read-only"
3686	//   ]
3687	// }
3688
3689}
3690
3691// method id "cloudresourcemanager.projects.undelete":
3692
3693type ProjectsUndeleteCall struct {
3694	s                      *Service
3695	projectId              string
3696	undeleteprojectrequest *UndeleteProjectRequest
3697	urlParams_             gensupport.URLParams
3698	ctx_                   context.Context
3699	header_                http.Header
3700}
3701
3702// Undelete: Restores the Project identified by the
3703// specified
3704// `project_id` (for example, `my-project-123`).
3705// You can only use this method for a Project that has a lifecycle state
3706// of
3707// DELETE_REQUESTED.
3708// After deletion starts, the Project cannot be restored.
3709//
3710// The caller must have modify permissions for this Project.
3711func (r *ProjectsService) Undelete(projectId string, undeleteprojectrequest *UndeleteProjectRequest) *ProjectsUndeleteCall {
3712	c := &ProjectsUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3713	c.projectId = projectId
3714	c.undeleteprojectrequest = undeleteprojectrequest
3715	return c
3716}
3717
3718// Fields allows partial responses to be retrieved. See
3719// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3720// for more information.
3721func (c *ProjectsUndeleteCall) Fields(s ...googleapi.Field) *ProjectsUndeleteCall {
3722	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3723	return c
3724}
3725
3726// Context sets the context to be used in this call's Do method. Any
3727// pending HTTP request will be aborted if the provided context is
3728// canceled.
3729func (c *ProjectsUndeleteCall) Context(ctx context.Context) *ProjectsUndeleteCall {
3730	c.ctx_ = ctx
3731	return c
3732}
3733
3734// Header returns an http.Header that can be modified by the caller to
3735// add HTTP headers to the request.
3736func (c *ProjectsUndeleteCall) Header() http.Header {
3737	if c.header_ == nil {
3738		c.header_ = make(http.Header)
3739	}
3740	return c.header_
3741}
3742
3743func (c *ProjectsUndeleteCall) doRequest(alt string) (*http.Response, error) {
3744	reqHeaders := make(http.Header)
3745	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216")
3746	for k, v := range c.header_ {
3747		reqHeaders[k] = v
3748	}
3749	reqHeaders.Set("User-Agent", c.s.userAgent())
3750	var body io.Reader = nil
3751	body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeleteprojectrequest)
3752	if err != nil {
3753		return nil, err
3754	}
3755	reqHeaders.Set("Content-Type", "application/json")
3756	c.urlParams_.Set("alt", alt)
3757	c.urlParams_.Set("prettyPrint", "false")
3758	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}:undelete")
3759	urls += "?" + c.urlParams_.Encode()
3760	req, err := http.NewRequest("POST", urls, body)
3761	if err != nil {
3762		return nil, err
3763	}
3764	req.Header = reqHeaders
3765	googleapi.Expand(req.URL, map[string]string{
3766		"projectId": c.projectId,
3767	})
3768	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3769}
3770
3771// Do executes the "cloudresourcemanager.projects.undelete" call.
3772// Exactly one of *Empty or error will be non-nil. Any non-2xx status
3773// code is an error. Response headers are in either
3774// *Empty.ServerResponse.Header or (if a response was returned at all)
3775// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
3776// check whether the returned error was because http.StatusNotModified
3777// was returned.
3778func (c *ProjectsUndeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
3779	gensupport.SetOptions(c.urlParams_, opts...)
3780	res, err := c.doRequest("json")
3781	if res != nil && res.StatusCode == http.StatusNotModified {
3782		if res.Body != nil {
3783			res.Body.Close()
3784		}
3785		return nil, &googleapi.Error{
3786			Code:   res.StatusCode,
3787			Header: res.Header,
3788		}
3789	}
3790	if err != nil {
3791		return nil, err
3792	}
3793	defer googleapi.CloseBody(res)
3794	if err := googleapi.CheckResponse(res); err != nil {
3795		return nil, err
3796	}
3797	ret := &Empty{
3798		ServerResponse: googleapi.ServerResponse{
3799			Header:         res.Header,
3800			HTTPStatusCode: res.StatusCode,
3801		},
3802	}
3803	target := &ret
3804	if err := gensupport.DecodeResponse(target, res); err != nil {
3805		return nil, err
3806	}
3807	return ret, nil
3808	// {
3809	//   "description": "Restores the Project identified by the specified\n`project_id` (for example, `my-project-123`).\nYou can only use this method for a Project that has a lifecycle state of\nDELETE_REQUESTED.\nAfter deletion starts, the Project cannot be restored.\n\nThe caller must have modify permissions for this Project.",
3810	//   "flatPath": "v1beta1/projects/{projectId}:undelete",
3811	//   "httpMethod": "POST",
3812	//   "id": "cloudresourcemanager.projects.undelete",
3813	//   "parameterOrder": [
3814	//     "projectId"
3815	//   ],
3816	//   "parameters": {
3817	//     "projectId": {
3818	//       "description": "The project ID (for example, `foo-bar-123`).\n\nRequired.",
3819	//       "location": "path",
3820	//       "required": true,
3821	//       "type": "string"
3822	//     }
3823	//   },
3824	//   "path": "v1beta1/projects/{projectId}:undelete",
3825	//   "request": {
3826	//     "$ref": "UndeleteProjectRequest"
3827	//   },
3828	//   "response": {
3829	//     "$ref": "Empty"
3830	//   },
3831	//   "scopes": [
3832	//     "https://www.googleapis.com/auth/cloud-platform"
3833	//   ]
3834	// }
3835
3836}
3837
3838// method id "cloudresourcemanager.projects.update":
3839
3840type ProjectsUpdateCall struct {
3841	s          *Service
3842	projectId  string
3843	project    *Project
3844	urlParams_ gensupport.URLParams
3845	ctx_       context.Context
3846	header_    http.Header
3847}
3848
3849// Update: Updates the attributes of the Project identified by the
3850// specified
3851// `project_id` (for example, `my-project-123`).
3852//
3853// The caller must have modify permissions for this Project.
3854func (r *ProjectsService) Update(projectId string, project *Project) *ProjectsUpdateCall {
3855	c := &ProjectsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3856	c.projectId = projectId
3857	c.project = project
3858	return c
3859}
3860
3861// Fields allows partial responses to be retrieved. See
3862// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3863// for more information.
3864func (c *ProjectsUpdateCall) Fields(s ...googleapi.Field) *ProjectsUpdateCall {
3865	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3866	return c
3867}
3868
3869// Context sets the context to be used in this call's Do method. Any
3870// pending HTTP request will be aborted if the provided context is
3871// canceled.
3872func (c *ProjectsUpdateCall) Context(ctx context.Context) *ProjectsUpdateCall {
3873	c.ctx_ = ctx
3874	return c
3875}
3876
3877// Header returns an http.Header that can be modified by the caller to
3878// add HTTP headers to the request.
3879func (c *ProjectsUpdateCall) Header() http.Header {
3880	if c.header_ == nil {
3881		c.header_ = make(http.Header)
3882	}
3883	return c.header_
3884}
3885
3886func (c *ProjectsUpdateCall) doRequest(alt string) (*http.Response, error) {
3887	reqHeaders := make(http.Header)
3888	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216")
3889	for k, v := range c.header_ {
3890		reqHeaders[k] = v
3891	}
3892	reqHeaders.Set("User-Agent", c.s.userAgent())
3893	var body io.Reader = nil
3894	body, err := googleapi.WithoutDataWrapper.JSONReader(c.project)
3895	if err != nil {
3896		return nil, err
3897	}
3898	reqHeaders.Set("Content-Type", "application/json")
3899	c.urlParams_.Set("alt", alt)
3900	c.urlParams_.Set("prettyPrint", "false")
3901	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}")
3902	urls += "?" + c.urlParams_.Encode()
3903	req, err := http.NewRequest("PUT", urls, body)
3904	if err != nil {
3905		return nil, err
3906	}
3907	req.Header = reqHeaders
3908	googleapi.Expand(req.URL, map[string]string{
3909		"projectId": c.projectId,
3910	})
3911	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3912}
3913
3914// Do executes the "cloudresourcemanager.projects.update" call.
3915// Exactly one of *Project or error will be non-nil. Any non-2xx status
3916// code is an error. Response headers are in either
3917// *Project.ServerResponse.Header or (if a response was returned at all)
3918// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
3919// check whether the returned error was because http.StatusNotModified
3920// was returned.
3921func (c *ProjectsUpdateCall) Do(opts ...googleapi.CallOption) (*Project, error) {
3922	gensupport.SetOptions(c.urlParams_, opts...)
3923	res, err := c.doRequest("json")
3924	if res != nil && res.StatusCode == http.StatusNotModified {
3925		if res.Body != nil {
3926			res.Body.Close()
3927		}
3928		return nil, &googleapi.Error{
3929			Code:   res.StatusCode,
3930			Header: res.Header,
3931		}
3932	}
3933	if err != nil {
3934		return nil, err
3935	}
3936	defer googleapi.CloseBody(res)
3937	if err := googleapi.CheckResponse(res); err != nil {
3938		return nil, err
3939	}
3940	ret := &Project{
3941		ServerResponse: googleapi.ServerResponse{
3942			Header:         res.Header,
3943			HTTPStatusCode: res.StatusCode,
3944		},
3945	}
3946	target := &ret
3947	if err := gensupport.DecodeResponse(target, res); err != nil {
3948		return nil, err
3949	}
3950	return ret, nil
3951	// {
3952	//   "description": "Updates the attributes of the Project identified by the specified\n`project_id` (for example, `my-project-123`).\n\nThe caller must have modify permissions for this Project.",
3953	//   "flatPath": "v1beta1/projects/{projectId}",
3954	//   "httpMethod": "PUT",
3955	//   "id": "cloudresourcemanager.projects.update",
3956	//   "parameterOrder": [
3957	//     "projectId"
3958	//   ],
3959	//   "parameters": {
3960	//     "projectId": {
3961	//       "description": "The project ID (for example, `my-project-123`).\n\nRequired.",
3962	//       "location": "path",
3963	//       "required": true,
3964	//       "type": "string"
3965	//     }
3966	//   },
3967	//   "path": "v1beta1/projects/{projectId}",
3968	//   "request": {
3969	//     "$ref": "Project"
3970	//   },
3971	//   "response": {
3972	//     "$ref": "Project"
3973	//   },
3974	//   "scopes": [
3975	//     "https://www.googleapis.com/auth/cloud-platform"
3976	//   ]
3977	// }
3978
3979}
3980