...

Source file src/google.golang.org/api/accessapproval/v1/accessapproval-gen.go

Documentation: google.golang.org/api/accessapproval/v1

     1  // Copyright 2024 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 accessapproval provides access to the Access Approval API.
     8  //
     9  // For product documentation, see: https://cloud.google.com/assured-workloads/access-approval/docs
    10  //
    11  // # Library status
    12  //
    13  // These client libraries are officially supported by Google. However, this
    14  // library is considered complete and is in maintenance mode. This means
    15  // that we will address critical bugs and security issues but will not add
    16  // any new features.
    17  //
    18  // When possible, we recommend using our newer
    19  // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)
    20  // that are still actively being worked and iterated on.
    21  //
    22  // # Creating a client
    23  //
    24  // Usage example:
    25  //
    26  //	import "google.golang.org/api/accessapproval/v1"
    27  //	...
    28  //	ctx := context.Background()
    29  //	accessapprovalService, err := accessapproval.NewService(ctx)
    30  //
    31  // In this example, Google Application Default Credentials are used for
    32  // authentication. For information on how to create and obtain Application
    33  // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
    34  //
    35  // # Other authentication options
    36  //
    37  // To use an API key for authentication (note: some APIs do not support API
    38  // keys), use [google.golang.org/api/option.WithAPIKey]:
    39  //
    40  //	accessapprovalService, err := accessapproval.NewService(ctx, option.WithAPIKey("AIza..."))
    41  //
    42  // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth
    43  // flow, use [google.golang.org/api/option.WithTokenSource]:
    44  //
    45  //	config := &oauth2.Config{...}
    46  //	// ...
    47  //	token, err := config.Exchange(ctx, ...)
    48  //	accessapprovalService, err := accessapproval.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    49  //
    50  // See [google.golang.org/api/option.ClientOption] for details on options.
    51  package accessapproval // import "google.golang.org/api/accessapproval/v1"
    52  
    53  import (
    54  	"bytes"
    55  	"context"
    56  	"encoding/json"
    57  	"errors"
    58  	"fmt"
    59  	"io"
    60  	"net/http"
    61  	"net/url"
    62  	"strconv"
    63  	"strings"
    64  
    65  	googleapi "google.golang.org/api/googleapi"
    66  	internal "google.golang.org/api/internal"
    67  	gensupport "google.golang.org/api/internal/gensupport"
    68  	option "google.golang.org/api/option"
    69  	internaloption "google.golang.org/api/option/internaloption"
    70  	htransport "google.golang.org/api/transport/http"
    71  )
    72  
    73  // Always reference these packages, just in case the auto-generated code
    74  // below doesn't.
    75  var _ = bytes.NewBuffer
    76  var _ = strconv.Itoa
    77  var _ = fmt.Sprintf
    78  var _ = json.NewDecoder
    79  var _ = io.Copy
    80  var _ = url.Parse
    81  var _ = gensupport.MarshalJSON
    82  var _ = googleapi.Version
    83  var _ = errors.New
    84  var _ = strings.Replace
    85  var _ = context.Canceled
    86  var _ = internaloption.WithDefaultEndpoint
    87  var _ = internal.Version
    88  
    89  const apiId = "accessapproval:v1"
    90  const apiName = "accessapproval"
    91  const apiVersion = "v1"
    92  const basePath = "https://accessapproval.googleapis.com/"
    93  const basePathTemplate = "https://accessapproval.UNIVERSE_DOMAIN/"
    94  const mtlsBasePath = "https://accessapproval.mtls.googleapis.com/"
    95  
    96  // OAuth2 scopes used by this API.
    97  const (
    98  	// See, edit, configure, and delete your Google Cloud data and see the email
    99  	// address for your Google Account.
   100  	CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
   101  )
   102  
   103  // NewService creates a new Service.
   104  func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
   105  	scopesOption := internaloption.WithDefaultScopes(
   106  		"https://www.googleapis.com/auth/cloud-platform",
   107  	)
   108  	// NOTE: prepend, so we don't override user-specified scopes.
   109  	opts = append([]option.ClientOption{scopesOption}, opts...)
   110  	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
   111  	opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
   112  	opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
   113  	opts = append(opts, internaloption.EnableNewAuthLibrary())
   114  	client, endpoint, err := htransport.NewClient(ctx, opts...)
   115  	if err != nil {
   116  		return nil, err
   117  	}
   118  	s, err := New(client)
   119  	if err != nil {
   120  		return nil, err
   121  	}
   122  	if endpoint != "" {
   123  		s.BasePath = endpoint
   124  	}
   125  	return s, nil
   126  }
   127  
   128  // New creates a new Service. It uses the provided http.Client for requests.
   129  //
   130  // Deprecated: please use NewService instead.
   131  // To provide a custom HTTP client, use option.WithHTTPClient.
   132  // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
   133  func New(client *http.Client) (*Service, error) {
   134  	if client == nil {
   135  		return nil, errors.New("client is nil")
   136  	}
   137  	s := &Service{client: client, BasePath: basePath}
   138  	s.Folders = NewFoldersService(s)
   139  	s.Organizations = NewOrganizationsService(s)
   140  	s.Projects = NewProjectsService(s)
   141  	return s, nil
   142  }
   143  
   144  type Service struct {
   145  	client    *http.Client
   146  	BasePath  string // API endpoint base URL
   147  	UserAgent string // optional additional User-Agent fragment
   148  
   149  	Folders *FoldersService
   150  
   151  	Organizations *OrganizationsService
   152  
   153  	Projects *ProjectsService
   154  }
   155  
   156  func (s *Service) userAgent() string {
   157  	if s.UserAgent == "" {
   158  		return googleapi.UserAgent
   159  	}
   160  	return googleapi.UserAgent + " " + s.UserAgent
   161  }
   162  
   163  func NewFoldersService(s *Service) *FoldersService {
   164  	rs := &FoldersService{s: s}
   165  	rs.ApprovalRequests = NewFoldersApprovalRequestsService(s)
   166  	return rs
   167  }
   168  
   169  type FoldersService struct {
   170  	s *Service
   171  
   172  	ApprovalRequests *FoldersApprovalRequestsService
   173  }
   174  
   175  func NewFoldersApprovalRequestsService(s *Service) *FoldersApprovalRequestsService {
   176  	rs := &FoldersApprovalRequestsService{s: s}
   177  	return rs
   178  }
   179  
   180  type FoldersApprovalRequestsService struct {
   181  	s *Service
   182  }
   183  
   184  func NewOrganizationsService(s *Service) *OrganizationsService {
   185  	rs := &OrganizationsService{s: s}
   186  	rs.ApprovalRequests = NewOrganizationsApprovalRequestsService(s)
   187  	return rs
   188  }
   189  
   190  type OrganizationsService struct {
   191  	s *Service
   192  
   193  	ApprovalRequests *OrganizationsApprovalRequestsService
   194  }
   195  
   196  func NewOrganizationsApprovalRequestsService(s *Service) *OrganizationsApprovalRequestsService {
   197  	rs := &OrganizationsApprovalRequestsService{s: s}
   198  	return rs
   199  }
   200  
   201  type OrganizationsApprovalRequestsService struct {
   202  	s *Service
   203  }
   204  
   205  func NewProjectsService(s *Service) *ProjectsService {
   206  	rs := &ProjectsService{s: s}
   207  	rs.ApprovalRequests = NewProjectsApprovalRequestsService(s)
   208  	return rs
   209  }
   210  
   211  type ProjectsService struct {
   212  	s *Service
   213  
   214  	ApprovalRequests *ProjectsApprovalRequestsService
   215  }
   216  
   217  func NewProjectsApprovalRequestsService(s *Service) *ProjectsApprovalRequestsService {
   218  	rs := &ProjectsApprovalRequestsService{s: s}
   219  	return rs
   220  }
   221  
   222  type ProjectsApprovalRequestsService struct {
   223  	s *Service
   224  }
   225  
   226  // AccessApprovalServiceAccount: Access Approval service account related to a
   227  // project/folder/organization.
   228  type AccessApprovalServiceAccount struct {
   229  	// AccountEmail: Email address of the service account.
   230  	AccountEmail string `json:"accountEmail,omitempty"`
   231  	// Name: The resource name of the Access Approval service account. Format is
   232  	// one of: * "projects/{project}/serviceAccount" *
   233  	// "folders/{folder}/serviceAccount" *
   234  	// "organizations/{organization}/serviceAccount"
   235  	Name string `json:"name,omitempty"`
   236  
   237  	// ServerResponse contains the HTTP response code and headers from the server.
   238  	googleapi.ServerResponse `json:"-"`
   239  	// ForceSendFields is a list of field names (e.g. "AccountEmail") to
   240  	// unconditionally include in API requests. By default, fields with empty or
   241  	// default values are omitted from API requests. See
   242  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   243  	// details.
   244  	ForceSendFields []string `json:"-"`
   245  	// NullFields is a list of field names (e.g. "AccountEmail") to include in API
   246  	// requests with the JSON null value. By default, fields with empty values are
   247  	// omitted from API requests. See
   248  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   249  	NullFields []string `json:"-"`
   250  }
   251  
   252  func (s *AccessApprovalServiceAccount) MarshalJSON() ([]byte, error) {
   253  	type NoMethod AccessApprovalServiceAccount
   254  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   255  }
   256  
   257  // AccessApprovalSettings: Settings on a Project/Folder/Organization related to
   258  // Access Approval.
   259  type AccessApprovalSettings struct {
   260  	// ActiveKeyVersion: The asymmetric crypto key version to use for signing
   261  	// approval requests. Empty active_key_version indicates that a Google-managed
   262  	// key should be used for signing. This property will be ignored if set by an
   263  	// ancestor of this resource, and new non-empty values may not be set.
   264  	ActiveKeyVersion string `json:"activeKeyVersion,omitempty"`
   265  	// AncestorHasActiveKeyVersion: Output only. This field is read only (not
   266  	// settable via UpdateAccessApprovalSettings method). If the field is true,
   267  	// that indicates that an ancestor of this Project or Folder has set
   268  	// active_key_version (this field will always be unset for the organization
   269  	// since organizations do not have ancestors).
   270  	AncestorHasActiveKeyVersion bool `json:"ancestorHasActiveKeyVersion,omitempty"`
   271  	// EnrolledAncestor: Output only. This field is read only (not settable via
   272  	// UpdateAccessApprovalSettings method). If the field is true, that indicates
   273  	// that at least one service is enrolled for Access Approval in one or more
   274  	// ancestors of the Project or Folder (this field will always be unset for the
   275  	// organization since organizations do not have ancestors).
   276  	EnrolledAncestor bool `json:"enrolledAncestor,omitempty"`
   277  	// EnrolledServices: A list of Google Cloud Services for which the given
   278  	// resource has Access Approval enrolled. Access requests for the resource
   279  	// given by name against any of these services contained here will be required
   280  	// to have explicit approval. If name refers to an organization, enrollment can
   281  	// be done for individual services. If name refers to a folder or project,
   282  	// enrollment can only be done on an all or nothing basis. If a cloud_product
   283  	// is repeated in this list, the first entry will be honored and all following
   284  	// entries will be discarded. A maximum of 10 enrolled services will be
   285  	// enforced, to be expanded as the set of supported services is expanded.
   286  	EnrolledServices []*EnrolledService `json:"enrolledServices,omitempty"`
   287  	// InvalidKeyVersion: Output only. This field is read only (not settable via
   288  	// UpdateAccessApprovalSettings method). If the field is true, that indicates
   289  	// that there is some configuration issue with the active_key_version
   290  	// configured at this level in the resource hierarchy (e.g. it doesn't exist or
   291  	// the Access Approval service account doesn't have the correct permissions on
   292  	// it, etc.) This key version is not necessarily the effective key version at
   293  	// this level, as key versions are inherited top-down.
   294  	InvalidKeyVersion bool `json:"invalidKeyVersion,omitempty"`
   295  	// Name: The resource name of the settings. Format is one of: *
   296  	// "projects/{project}/accessApprovalSettings" *
   297  	// "folders/{folder}/accessApprovalSettings" *
   298  	// "organizations/{organization}/accessApprovalSettings"
   299  	Name string `json:"name,omitempty"`
   300  	// NotificationEmails: A list of email addresses to which notifications
   301  	// relating to approval requests should be sent. Notifications relating to a
   302  	// resource will be sent to all emails in the settings of ancestor resources of
   303  	// that resource. A maximum of 50 email addresses are allowed.
   304  	NotificationEmails []string `json:"notificationEmails,omitempty"`
   305  	// NotificationPubsubTopic: Optional. A pubsub topic to which notifications
   306  	// relating to approval requests should be sent.
   307  	NotificationPubsubTopic string `json:"notificationPubsubTopic,omitempty"`
   308  	// PreferNoBroadApprovalRequests: This preference is communicated to Google
   309  	// personnel when sending an approval request but can be overridden if
   310  	// necessary.
   311  	PreferNoBroadApprovalRequests bool `json:"preferNoBroadApprovalRequests,omitempty"`
   312  	// PreferredRequestExpirationDays: This preference is shared with Google
   313  	// personnel, but can be overridden if said personnel deems necessary. The
   314  	// approver ultimately can set the expiration at approval time.
   315  	PreferredRequestExpirationDays int64 `json:"preferredRequestExpirationDays,omitempty"`
   316  	// RequireCustomerVisibleJustification: Optional. A setting to require approval
   317  	// request justifications to be customer visible.
   318  	RequireCustomerVisibleJustification bool `json:"requireCustomerVisibleJustification,omitempty"`
   319  
   320  	// ServerResponse contains the HTTP response code and headers from the server.
   321  	googleapi.ServerResponse `json:"-"`
   322  	// ForceSendFields is a list of field names (e.g. "ActiveKeyVersion") to
   323  	// unconditionally include in API requests. By default, fields with empty or
   324  	// default values are omitted from API requests. See
   325  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   326  	// details.
   327  	ForceSendFields []string `json:"-"`
   328  	// NullFields is a list of field names (e.g. "ActiveKeyVersion") to include in
   329  	// API requests with the JSON null value. By default, fields with empty values
   330  	// are omitted from API requests. See
   331  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   332  	NullFields []string `json:"-"`
   333  }
   334  
   335  func (s *AccessApprovalSettings) MarshalJSON() ([]byte, error) {
   336  	type NoMethod AccessApprovalSettings
   337  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   338  }
   339  
   340  // AccessLocations: Home office and physical location of the principal.
   341  type AccessLocations struct {
   342  	// PrincipalOfficeCountry: The "home office" location of the principal. A
   343  	// two-letter country code (ISO 3166-1 alpha-2), such as "US", "DE" or "GB" or
   344  	// a region code. In some limited situations Google systems may refer refer to
   345  	// a region code instead of a country code. Possible Region Codes: * ASI: Asia
   346  	// * EUR: Europe * OCE: Oceania * AFR: Africa * NAM: North America * SAM: South
   347  	// America * ANT: Antarctica * ANY: Any location
   348  	PrincipalOfficeCountry string `json:"principalOfficeCountry,omitempty"`
   349  	// PrincipalPhysicalLocationCountry: Physical location of the principal at the
   350  	// time of the access. A two-letter country code (ISO 3166-1 alpha-2), such as
   351  	// "US", "DE" or "GB" or a region code. In some limited situations Google
   352  	// systems may refer refer to a region code instead of a country code. Possible
   353  	// Region Codes: * ASI: Asia * EUR: Europe * OCE: Oceania * AFR: Africa * NAM:
   354  	// North America * SAM: South America * ANT: Antarctica * ANY: Any location
   355  	PrincipalPhysicalLocationCountry string `json:"principalPhysicalLocationCountry,omitempty"`
   356  	// ForceSendFields is a list of field names (e.g. "PrincipalOfficeCountry") to
   357  	// unconditionally include in API requests. By default, fields with empty or
   358  	// default values are omitted from API requests. See
   359  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   360  	// details.
   361  	ForceSendFields []string `json:"-"`
   362  	// NullFields is a list of field names (e.g. "PrincipalOfficeCountry") to
   363  	// include in API requests with the JSON null value. By default, fields with
   364  	// empty values are omitted from API requests. See
   365  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   366  	NullFields []string `json:"-"`
   367  }
   368  
   369  func (s *AccessLocations) MarshalJSON() ([]byte, error) {
   370  	type NoMethod AccessLocations
   371  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   372  }
   373  
   374  type AccessReason struct {
   375  	// Detail: More detail about certain reason types. See comments for each type
   376  	// above.
   377  	Detail string `json:"detail,omitempty"`
   378  	// Type: Type of access justification.
   379  	//
   380  	// Possible values:
   381  	//   "TYPE_UNSPECIFIED" - Default value for proto, shouldn't be used.
   382  	//   "CUSTOMER_INITIATED_SUPPORT" - Customer made a request or raised an issue
   383  	// that required the principal to access customer data. `detail` is of the form
   384  	// ("#####" is the issue ID): * "Feedback Report: #####" * "Case Number: #####"
   385  	// * "Case ID: #####" * "E-PIN Reference: #####" * "Google-#####" * "T-#####"
   386  	//   "GOOGLE_INITIATED_SERVICE" - The principal accessed customer data in order
   387  	// to diagnose or resolve a suspected issue in services. Often this access is
   388  	// used to confirm that customers are not affected by a suspected service issue
   389  	// or to remediate a reversible system issue.
   390  	//   "GOOGLE_INITIATED_REVIEW" - Google initiated service for security, fraud,
   391  	// abuse, or compliance purposes.
   392  	//   "THIRD_PARTY_DATA_REQUEST" - The principal was compelled to access
   393  	// customer data in order to respond to a legal third party data request or
   394  	// process, including legal processes from customers themselves.
   395  	//   "GOOGLE_RESPONSE_TO_PRODUCTION_ALERT" - The principal accessed customer
   396  	// data in order to diagnose or resolve a suspected issue in services or a
   397  	// known outage.
   398  	//   "CLOUD_INITIATED_ACCESS" - Similar to 'GOOGLE_INITIATED_SERVICE' or
   399  	// 'GOOGLE_INITIATED_REVIEW', but with universe agnostic naming. The principal
   400  	// accessed customer data in order to diagnose or resolve a suspected issue in
   401  	// services or a known outage, or for security, fraud, abuse, or compliance
   402  	// review purposes.
   403  	Type string `json:"type,omitempty"`
   404  	// ForceSendFields is a list of field names (e.g. "Detail") to unconditionally
   405  	// include in API requests. By default, fields with empty or default values are
   406  	// omitted from API requests. See
   407  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   408  	// details.
   409  	ForceSendFields []string `json:"-"`
   410  	// NullFields is a list of field names (e.g. "Detail") to include in API
   411  	// requests with the JSON null value. By default, fields with empty values are
   412  	// omitted from API requests. See
   413  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   414  	NullFields []string `json:"-"`
   415  }
   416  
   417  func (s *AccessReason) MarshalJSON() ([]byte, error) {
   418  	type NoMethod AccessReason
   419  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   420  }
   421  
   422  // ApprovalRequest: A request for the customer to approve access to a resource.
   423  type ApprovalRequest struct {
   424  	// Approve: Access was approved.
   425  	Approve *ApproveDecision `json:"approve,omitempty"`
   426  	// Dismiss: The request was dismissed.
   427  	Dismiss *DismissDecision `json:"dismiss,omitempty"`
   428  	// Name: The resource name of the request. Format is
   429  	// "{projects|folders|organizations}/{id}/approvalRequests/{approval_request}".
   430  	Name string `json:"name,omitempty"`
   431  	// RequestTime: The time at which approval was requested.
   432  	RequestTime string `json:"requestTime,omitempty"`
   433  	// RequestedDuration: The requested access duration.
   434  	RequestedDuration string `json:"requestedDuration,omitempty"`
   435  	// RequestedExpiration: The original requested expiration for the approval.
   436  	// Calculated by adding the requested_duration to the request_time.
   437  	RequestedExpiration string `json:"requestedExpiration,omitempty"`
   438  	// RequestedLocations: The locations for which approval is being requested.
   439  	RequestedLocations *AccessLocations `json:"requestedLocations,omitempty"`
   440  	// RequestedReason: The justification for which approval is being requested.
   441  	RequestedReason *AccessReason `json:"requestedReason,omitempty"`
   442  	// RequestedResourceName: The resource for which approval is being requested.
   443  	// The format of the resource name is defined at
   444  	// https://cloud.google.com/apis/design/resource_names. The resource name here
   445  	// may either be a "full" resource name (e.g.
   446  	// "//library.googleapis.com/shelves/shelf1/books/book2") or a "relative"
   447  	// resource name (e.g. "shelves/shelf1/books/book2") as described in the
   448  	// resource name specification.
   449  	RequestedResourceName string `json:"requestedResourceName,omitempty"`
   450  	// RequestedResourceProperties: Properties related to the resource represented
   451  	// by requested_resource_name.
   452  	RequestedResourceProperties *ResourceProperties `json:"requestedResourceProperties,omitempty"`
   453  
   454  	// ServerResponse contains the HTTP response code and headers from the server.
   455  	googleapi.ServerResponse `json:"-"`
   456  	// ForceSendFields is a list of field names (e.g. "Approve") to unconditionally
   457  	// include in API requests. By default, fields with empty or default values are
   458  	// omitted from API requests. See
   459  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   460  	// details.
   461  	ForceSendFields []string `json:"-"`
   462  	// NullFields is a list of field names (e.g. "Approve") to include in API
   463  	// requests with the JSON null value. By default, fields with empty values are
   464  	// omitted from API requests. See
   465  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   466  	NullFields []string `json:"-"`
   467  }
   468  
   469  func (s *ApprovalRequest) MarshalJSON() ([]byte, error) {
   470  	type NoMethod ApprovalRequest
   471  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   472  }
   473  
   474  // ApproveApprovalRequestMessage: Request to approve an ApprovalRequest.
   475  type ApproveApprovalRequestMessage struct {
   476  	// ExpireTime: The expiration time of this approval.
   477  	ExpireTime string `json:"expireTime,omitempty"`
   478  	// ForceSendFields is a list of field names (e.g. "ExpireTime") to
   479  	// unconditionally include in API requests. By default, fields with empty or
   480  	// default values are omitted from API requests. See
   481  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   482  	// details.
   483  	ForceSendFields []string `json:"-"`
   484  	// NullFields is a list of field names (e.g. "ExpireTime") to include in API
   485  	// requests with the JSON null value. By default, fields with empty values are
   486  	// omitted from API requests. See
   487  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   488  	NullFields []string `json:"-"`
   489  }
   490  
   491  func (s *ApproveApprovalRequestMessage) MarshalJSON() ([]byte, error) {
   492  	type NoMethod ApproveApprovalRequestMessage
   493  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   494  }
   495  
   496  // ApproveDecision: A decision that has been made to approve access to a
   497  // resource.
   498  type ApproveDecision struct {
   499  	// ApproveTime: The time at which approval was granted.
   500  	ApproveTime string `json:"approveTime,omitempty"`
   501  	// AutoApproved: True when the request has been auto-approved.
   502  	AutoApproved bool `json:"autoApproved,omitempty"`
   503  	// ExpireTime: The time at which the approval expires.
   504  	ExpireTime string `json:"expireTime,omitempty"`
   505  	// InvalidateTime: If set, denotes the timestamp at which the approval is
   506  	// invalidated.
   507  	InvalidateTime string `json:"invalidateTime,omitempty"`
   508  	// SignatureInfo: The signature for the ApprovalRequest and details on how it
   509  	// was signed.
   510  	SignatureInfo *SignatureInfo `json:"signatureInfo,omitempty"`
   511  	// ForceSendFields is a list of field names (e.g. "ApproveTime") to
   512  	// unconditionally include in API requests. By default, fields with empty or
   513  	// default values are omitted from API requests. See
   514  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   515  	// details.
   516  	ForceSendFields []string `json:"-"`
   517  	// NullFields is a list of field names (e.g. "ApproveTime") to include in API
   518  	// requests with the JSON null value. By default, fields with empty values are
   519  	// omitted from API requests. See
   520  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   521  	NullFields []string `json:"-"`
   522  }
   523  
   524  func (s *ApproveDecision) MarshalJSON() ([]byte, error) {
   525  	type NoMethod ApproveDecision
   526  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   527  }
   528  
   529  // DismissApprovalRequestMessage: Request to dismiss an approval request.
   530  type DismissApprovalRequestMessage struct {
   531  }
   532  
   533  // DismissDecision: A decision that has been made to dismiss an approval
   534  // request.
   535  type DismissDecision struct {
   536  	// DismissTime: The time at which the approval request was dismissed.
   537  	DismissTime string `json:"dismissTime,omitempty"`
   538  	// Implicit: This field will be true if the ApprovalRequest was implicitly
   539  	// dismissed due to inaction by the access approval approvers (the request is
   540  	// not acted on by the approvers before the exiration time).
   541  	Implicit bool `json:"implicit,omitempty"`
   542  	// ForceSendFields is a list of field names (e.g. "DismissTime") to
   543  	// unconditionally include in API requests. By default, fields with empty or
   544  	// default values are omitted from API requests. See
   545  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   546  	// details.
   547  	ForceSendFields []string `json:"-"`
   548  	// NullFields is a list of field names (e.g. "DismissTime") to include in API
   549  	// requests with the JSON null value. By default, fields with empty values are
   550  	// omitted from API requests. See
   551  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   552  	NullFields []string `json:"-"`
   553  }
   554  
   555  func (s *DismissDecision) MarshalJSON() ([]byte, error) {
   556  	type NoMethod DismissDecision
   557  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   558  }
   559  
   560  // Empty: A generic empty message that you can re-use to avoid defining
   561  // duplicated empty messages in your APIs. A typical example is to use it as
   562  // the request or the response type of an API method. For instance: service Foo
   563  // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
   564  type Empty struct {
   565  	// ServerResponse contains the HTTP response code and headers from the server.
   566  	googleapi.ServerResponse `json:"-"`
   567  }
   568  
   569  // EnrolledService: Represents the enrollment of a cloud resource into a
   570  // specific service.
   571  type EnrolledService struct {
   572  	// CloudProduct: The product for which Access Approval will be enrolled.
   573  	// Allowed values are listed below (case-sensitive): * all * GA * App Engine *
   574  	// Artifact Registry * BigQuery * Certificate Authority Service * Cloud
   575  	// Bigtable * Cloud Key Management Service * Compute Engine * Cloud Composer *
   576  	// Cloud Dataflow * Cloud Dataproc * Cloud DLP * Cloud EKM * Cloud Firestore *
   577  	// Cloud HSM * Cloud Identity and Access Management * Cloud Logging * Cloud NAT
   578  	// * Cloud Pub/Sub * Cloud Spanner * Cloud SQL * Cloud Storage * Eventarc *
   579  	// Google Kubernetes Engine * Organization Policy Serivice * Persistent Disk *
   580  	// Resource Manager * Secret Manager * Speaker ID Note: These values are
   581  	// supported as input for legacy purposes, but will not be returned from the
   582  	// API. * all * ga-only * appengine.googleapis.com *
   583  	// artifactregistry.googleapis.com * bigquery.googleapis.com *
   584  	// bigtable.googleapis.com * container.googleapis.com * cloudkms.googleapis.com
   585  	// * cloudresourcemanager.googleapis.com * cloudsql.googleapis.com *
   586  	// compute.googleapis.com * dataflow.googleapis.com * dataproc.googleapis.com *
   587  	// dlp.googleapis.com * iam.googleapis.com * logging.googleapis.com *
   588  	// orgpolicy.googleapis.com * pubsub.googleapis.com * spanner.googleapis.com *
   589  	// secretmanager.googleapis.com * speakerid.googleapis.com *
   590  	// storage.googleapis.com Calls to UpdateAccessApprovalSettings using 'all' or
   591  	// any of the XXX.googleapis.com will be translated to the associated product
   592  	// name ('all', 'App Engine', etc.). Note: 'all' will enroll the resource in
   593  	// all products supported at both 'GA' and 'Preview' levels. More information
   594  	// about levels of support is available at
   595  	// https://cloud.google.com/access-approval/docs/supported-services
   596  	CloudProduct string `json:"cloudProduct,omitempty"`
   597  	// EnrollmentLevel: The enrollment level of the service.
   598  	//
   599  	// Possible values:
   600  	//   "ENROLLMENT_LEVEL_UNSPECIFIED" - Default value for proto, shouldn't be
   601  	// used.
   602  	//   "BLOCK_ALL" - Service is enrolled in Access Approval for all requests
   603  	EnrollmentLevel string `json:"enrollmentLevel,omitempty"`
   604  	// ForceSendFields is a list of field names (e.g. "CloudProduct") to
   605  	// unconditionally include in API requests. By default, fields with empty or
   606  	// default values are omitted from API requests. See
   607  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   608  	// details.
   609  	ForceSendFields []string `json:"-"`
   610  	// NullFields is a list of field names (e.g. "CloudProduct") to include in API
   611  	// requests with the JSON null value. By default, fields with empty values are
   612  	// omitted from API requests. See
   613  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   614  	NullFields []string `json:"-"`
   615  }
   616  
   617  func (s *EnrolledService) MarshalJSON() ([]byte, error) {
   618  	type NoMethod EnrolledService
   619  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   620  }
   621  
   622  // InvalidateApprovalRequestMessage: Request to invalidate an existing
   623  // approval.
   624  type InvalidateApprovalRequestMessage struct {
   625  }
   626  
   627  // ListApprovalRequestsResponse: Response to listing of ApprovalRequest
   628  // objects.
   629  type ListApprovalRequestsResponse struct {
   630  	// ApprovalRequests: Approval request details.
   631  	ApprovalRequests []*ApprovalRequest `json:"approvalRequests,omitempty"`
   632  	// NextPageToken: Token to retrieve the next page of results, or empty if there
   633  	// are no more.
   634  	NextPageToken string `json:"nextPageToken,omitempty"`
   635  
   636  	// ServerResponse contains the HTTP response code and headers from the server.
   637  	googleapi.ServerResponse `json:"-"`
   638  	// ForceSendFields is a list of field names (e.g. "ApprovalRequests") to
   639  	// unconditionally include in API requests. By default, fields with empty or
   640  	// default values are omitted from API requests. See
   641  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   642  	// details.
   643  	ForceSendFields []string `json:"-"`
   644  	// NullFields is a list of field names (e.g. "ApprovalRequests") to include in
   645  	// API requests with the JSON null value. By default, fields with empty values
   646  	// are omitted from API requests. See
   647  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   648  	NullFields []string `json:"-"`
   649  }
   650  
   651  func (s *ListApprovalRequestsResponse) MarshalJSON() ([]byte, error) {
   652  	type NoMethod ListApprovalRequestsResponse
   653  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   654  }
   655  
   656  // ResourceProperties: The properties associated with the resource of the
   657  // request.
   658  type ResourceProperties struct {
   659  	// ExcludesDescendants: Whether an approval will exclude the descendants of the
   660  	// resource being requested.
   661  	ExcludesDescendants bool `json:"excludesDescendants,omitempty"`
   662  	// ForceSendFields is a list of field names (e.g. "ExcludesDescendants") to
   663  	// unconditionally include in API requests. By default, fields with empty or
   664  	// default values are omitted from API requests. See
   665  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   666  	// details.
   667  	ForceSendFields []string `json:"-"`
   668  	// NullFields is a list of field names (e.g. "ExcludesDescendants") to include
   669  	// in API requests with the JSON null value. By default, fields with empty
   670  	// values are omitted from API requests. See
   671  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   672  	NullFields []string `json:"-"`
   673  }
   674  
   675  func (s *ResourceProperties) MarshalJSON() ([]byte, error) {
   676  	type NoMethod ResourceProperties
   677  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   678  }
   679  
   680  // SignatureInfo: Information about the digital signature of the resource.
   681  type SignatureInfo struct {
   682  	// CustomerKmsKeyVersion: The resource name of the customer CryptoKeyVersion
   683  	// used for signing.
   684  	CustomerKmsKeyVersion string `json:"customerKmsKeyVersion,omitempty"`
   685  	// GoogleKeyAlgorithm: The hashing algorithm used for signature verification.
   686  	// It will only be present in the case of Google managed keys.
   687  	//
   688  	// Possible values:
   689  	//   "CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED" - Not specified.
   690  	//   "GOOGLE_SYMMETRIC_ENCRYPTION" - Creates symmetric encryption keys.
   691  	//   "AES_128_GCM" - AES-GCM (Galois Counter Mode) using 128-bit keys.
   692  	//   "AES_256_GCM" - AES-GCM (Galois Counter Mode) using 256-bit keys.
   693  	//   "AES_128_CBC" - AES-CBC (Cipher Block Chaining Mode) using 128-bit keys.
   694  	//   "AES_256_CBC" - AES-CBC (Cipher Block Chaining Mode) using 256-bit keys.
   695  	//   "AES_128_CTR" - AES-CTR (Counter Mode) using 128-bit keys.
   696  	//   "AES_256_CTR" - AES-CTR (Counter Mode) using 256-bit keys.
   697  	//   "RSA_SIGN_PSS_2048_SHA256" - RSASSA-PSS 2048 bit key with a SHA256 digest.
   698  	//   "RSA_SIGN_PSS_3072_SHA256" - RSASSA-PSS 3072 bit key with a SHA256 digest.
   699  	//   "RSA_SIGN_PSS_4096_SHA256" - RSASSA-PSS 4096 bit key with a SHA256 digest.
   700  	//   "RSA_SIGN_PSS_4096_SHA512" - RSASSA-PSS 4096 bit key with a SHA512 digest.
   701  	//   "RSA_SIGN_PKCS1_2048_SHA256" - RSASSA-PKCS1-v1_5 with a 2048 bit key and a
   702  	// SHA256 digest.
   703  	//   "RSA_SIGN_PKCS1_3072_SHA256" - RSASSA-PKCS1-v1_5 with a 3072 bit key and a
   704  	// SHA256 digest.
   705  	//   "RSA_SIGN_PKCS1_4096_SHA256" - RSASSA-PKCS1-v1_5 with a 4096 bit key and a
   706  	// SHA256 digest.
   707  	//   "RSA_SIGN_PKCS1_4096_SHA512" - RSASSA-PKCS1-v1_5 with a 4096 bit key and a
   708  	// SHA512 digest.
   709  	//   "RSA_SIGN_RAW_PKCS1_2048" - RSASSA-PKCS1-v1_5 signing without encoding,
   710  	// with a 2048 bit key.
   711  	//   "RSA_SIGN_RAW_PKCS1_3072" - RSASSA-PKCS1-v1_5 signing without encoding,
   712  	// with a 3072 bit key.
   713  	//   "RSA_SIGN_RAW_PKCS1_4096" - RSASSA-PKCS1-v1_5 signing without encoding,
   714  	// with a 4096 bit key.
   715  	//   "RSA_DECRYPT_OAEP_2048_SHA256" - RSAES-OAEP 2048 bit key with a SHA256
   716  	// digest.
   717  	//   "RSA_DECRYPT_OAEP_3072_SHA256" - RSAES-OAEP 3072 bit key with a SHA256
   718  	// digest.
   719  	//   "RSA_DECRYPT_OAEP_4096_SHA256" - RSAES-OAEP 4096 bit key with a SHA256
   720  	// digest.
   721  	//   "RSA_DECRYPT_OAEP_4096_SHA512" - RSAES-OAEP 4096 bit key with a SHA512
   722  	// digest.
   723  	//   "RSA_DECRYPT_OAEP_2048_SHA1" - RSAES-OAEP 2048 bit key with a SHA1 digest.
   724  	//   "RSA_DECRYPT_OAEP_3072_SHA1" - RSAES-OAEP 3072 bit key with a SHA1 digest.
   725  	//   "RSA_DECRYPT_OAEP_4096_SHA1" - RSAES-OAEP 4096 bit key with a SHA1 digest.
   726  	//   "EC_SIGN_P256_SHA256" - ECDSA on the NIST P-256 curve with a SHA256
   727  	// digest. Other hash functions can also be used:
   728  	// https://cloud.google.com/kms/docs/create-validate-signatures#ecdsa_support_for_other_hash_algorithms
   729  	//   "EC_SIGN_P384_SHA384" - ECDSA on the NIST P-384 curve with a SHA384
   730  	// digest. Other hash functions can also be used:
   731  	// https://cloud.google.com/kms/docs/create-validate-signatures#ecdsa_support_for_other_hash_algorithms
   732  	//   "EC_SIGN_SECP256K1_SHA256" - ECDSA on the non-NIST secp256k1 curve. This
   733  	// curve is only supported for HSM protection level. Other hash functions can
   734  	// also be used:
   735  	// https://cloud.google.com/kms/docs/create-validate-signatures#ecdsa_support_for_other_hash_algorithms
   736  	//   "EC_SIGN_ED25519" - EdDSA on the Curve25519 in pure mode (taking data as
   737  	// input).
   738  	//   "HMAC_SHA256" - HMAC-SHA256 signing with a 256 bit key.
   739  	//   "HMAC_SHA1" - HMAC-SHA1 signing with a 160 bit key.
   740  	//   "HMAC_SHA384" - HMAC-SHA384 signing with a 384 bit key.
   741  	//   "HMAC_SHA512" - HMAC-SHA512 signing with a 512 bit key.
   742  	//   "HMAC_SHA224" - HMAC-SHA224 signing with a 224 bit key.
   743  	//   "EXTERNAL_SYMMETRIC_ENCRYPTION" - Algorithm representing symmetric
   744  	// encryption by an external key manager.
   745  	GoogleKeyAlgorithm string `json:"googleKeyAlgorithm,omitempty"`
   746  	// GooglePublicKeyPem: The public key for the Google default signing, encoded
   747  	// in PEM format. The signature was created using a private key which may be
   748  	// verified using this public key.
   749  	GooglePublicKeyPem string `json:"googlePublicKeyPem,omitempty"`
   750  	// SerializedApprovalRequest: The ApprovalRequest that is serialized without
   751  	// the SignatureInfo message field. This data is used with the hashing
   752  	// algorithm to generate the digital signature, and it can be used for
   753  	// signature verification.
   754  	SerializedApprovalRequest string `json:"serializedApprovalRequest,omitempty"`
   755  	// Signature: The digital signature.
   756  	Signature string `json:"signature,omitempty"`
   757  	// ForceSendFields is a list of field names (e.g. "CustomerKmsKeyVersion") to
   758  	// unconditionally include in API requests. By default, fields with empty or
   759  	// default values are omitted from API requests. See
   760  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   761  	// details.
   762  	ForceSendFields []string `json:"-"`
   763  	// NullFields is a list of field names (e.g. "CustomerKmsKeyVersion") to
   764  	// include in API requests with the JSON null value. By default, fields with
   765  	// empty values are omitted from API requests. See
   766  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   767  	NullFields []string `json:"-"`
   768  }
   769  
   770  func (s *SignatureInfo) MarshalJSON() ([]byte, error) {
   771  	type NoMethod SignatureInfo
   772  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   773  }
   774  
   775  type FoldersDeleteAccessApprovalSettingsCall struct {
   776  	s          *Service
   777  	name       string
   778  	urlParams_ gensupport.URLParams
   779  	ctx_       context.Context
   780  	header_    http.Header
   781  }
   782  
   783  // DeleteAccessApprovalSettings: Deletes the settings associated with a
   784  // project, folder, or organization. This will have the effect of disabling
   785  // Access Approval for the project, folder, or organization, but only if all
   786  // ancestors also have Access Approval disabled. If Access Approval is enabled
   787  // at a higher level of the hierarchy, then Access Approval will still be
   788  // enabled at this level as the settings are inherited.
   789  //
   790  // - name: Name of the AccessApprovalSettings to delete.
   791  func (r *FoldersService) DeleteAccessApprovalSettings(name string) *FoldersDeleteAccessApprovalSettingsCall {
   792  	c := &FoldersDeleteAccessApprovalSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   793  	c.name = name
   794  	return c
   795  }
   796  
   797  // Fields allows partial responses to be retrieved. See
   798  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   799  // details.
   800  func (c *FoldersDeleteAccessApprovalSettingsCall) Fields(s ...googleapi.Field) *FoldersDeleteAccessApprovalSettingsCall {
   801  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   802  	return c
   803  }
   804  
   805  // Context sets the context to be used in this call's Do method.
   806  func (c *FoldersDeleteAccessApprovalSettingsCall) Context(ctx context.Context) *FoldersDeleteAccessApprovalSettingsCall {
   807  	c.ctx_ = ctx
   808  	return c
   809  }
   810  
   811  // Header returns a http.Header that can be modified by the caller to add
   812  // headers to the request.
   813  func (c *FoldersDeleteAccessApprovalSettingsCall) Header() http.Header {
   814  	if c.header_ == nil {
   815  		c.header_ = make(http.Header)
   816  	}
   817  	return c.header_
   818  }
   819  
   820  func (c *FoldersDeleteAccessApprovalSettingsCall) doRequest(alt string) (*http.Response, error) {
   821  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
   822  	var body io.Reader = nil
   823  	c.urlParams_.Set("alt", alt)
   824  	c.urlParams_.Set("prettyPrint", "false")
   825  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
   826  	urls += "?" + c.urlParams_.Encode()
   827  	req, err := http.NewRequest("DELETE", urls, body)
   828  	if err != nil {
   829  		return nil, err
   830  	}
   831  	req.Header = reqHeaders
   832  	googleapi.Expand(req.URL, map[string]string{
   833  		"name": c.name,
   834  	})
   835  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   836  }
   837  
   838  // Do executes the "accessapproval.folders.deleteAccessApprovalSettings" call.
   839  // Any non-2xx status code is an error. Response headers are in either
   840  // *Empty.ServerResponse.Header or (if a response was returned at all) in
   841  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
   842  // whether the returned error was because http.StatusNotModified was returned.
   843  func (c *FoldersDeleteAccessApprovalSettingsCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
   844  	gensupport.SetOptions(c.urlParams_, opts...)
   845  	res, err := c.doRequest("json")
   846  	if res != nil && res.StatusCode == http.StatusNotModified {
   847  		if res.Body != nil {
   848  			res.Body.Close()
   849  		}
   850  		return nil, gensupport.WrapError(&googleapi.Error{
   851  			Code:   res.StatusCode,
   852  			Header: res.Header,
   853  		})
   854  	}
   855  	if err != nil {
   856  		return nil, err
   857  	}
   858  	defer googleapi.CloseBody(res)
   859  	if err := googleapi.CheckResponse(res); err != nil {
   860  		return nil, gensupport.WrapError(err)
   861  	}
   862  	ret := &Empty{
   863  		ServerResponse: googleapi.ServerResponse{
   864  			Header:         res.Header,
   865  			HTTPStatusCode: res.StatusCode,
   866  		},
   867  	}
   868  	target := &ret
   869  	if err := gensupport.DecodeResponse(target, res); err != nil {
   870  		return nil, err
   871  	}
   872  	return ret, nil
   873  }
   874  
   875  type FoldersGetAccessApprovalSettingsCall struct {
   876  	s            *Service
   877  	name         string
   878  	urlParams_   gensupport.URLParams
   879  	ifNoneMatch_ string
   880  	ctx_         context.Context
   881  	header_      http.Header
   882  }
   883  
   884  // GetAccessApprovalSettings: Gets the settings associated with a project,
   885  // folder, or organization.
   886  //
   887  //   - name: The name of the AccessApprovalSettings to retrieve. Format:
   888  //     "{projects|folders|organizations}/{id}/accessApprovalSettings".
   889  func (r *FoldersService) GetAccessApprovalSettings(name string) *FoldersGetAccessApprovalSettingsCall {
   890  	c := &FoldersGetAccessApprovalSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   891  	c.name = name
   892  	return c
   893  }
   894  
   895  // Fields allows partial responses to be retrieved. See
   896  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   897  // details.
   898  func (c *FoldersGetAccessApprovalSettingsCall) Fields(s ...googleapi.Field) *FoldersGetAccessApprovalSettingsCall {
   899  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   900  	return c
   901  }
   902  
   903  // IfNoneMatch sets an optional parameter which makes the operation fail if the
   904  // object's ETag matches the given value. This is useful for getting updates
   905  // only after the object has changed since the last request.
   906  func (c *FoldersGetAccessApprovalSettingsCall) IfNoneMatch(entityTag string) *FoldersGetAccessApprovalSettingsCall {
   907  	c.ifNoneMatch_ = entityTag
   908  	return c
   909  }
   910  
   911  // Context sets the context to be used in this call's Do method.
   912  func (c *FoldersGetAccessApprovalSettingsCall) Context(ctx context.Context) *FoldersGetAccessApprovalSettingsCall {
   913  	c.ctx_ = ctx
   914  	return c
   915  }
   916  
   917  // Header returns a http.Header that can be modified by the caller to add
   918  // headers to the request.
   919  func (c *FoldersGetAccessApprovalSettingsCall) Header() http.Header {
   920  	if c.header_ == nil {
   921  		c.header_ = make(http.Header)
   922  	}
   923  	return c.header_
   924  }
   925  
   926  func (c *FoldersGetAccessApprovalSettingsCall) doRequest(alt string) (*http.Response, error) {
   927  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
   928  	if c.ifNoneMatch_ != "" {
   929  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
   930  	}
   931  	var body io.Reader = nil
   932  	c.urlParams_.Set("alt", alt)
   933  	c.urlParams_.Set("prettyPrint", "false")
   934  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
   935  	urls += "?" + c.urlParams_.Encode()
   936  	req, err := http.NewRequest("GET", urls, body)
   937  	if err != nil {
   938  		return nil, err
   939  	}
   940  	req.Header = reqHeaders
   941  	googleapi.Expand(req.URL, map[string]string{
   942  		"name": c.name,
   943  	})
   944  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   945  }
   946  
   947  // Do executes the "accessapproval.folders.getAccessApprovalSettings" call.
   948  // Any non-2xx status code is an error. Response headers are in either
   949  // *AccessApprovalSettings.ServerResponse.Header or (if a response was returned
   950  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
   951  // check whether the returned error was because http.StatusNotModified was
   952  // returned.
   953  func (c *FoldersGetAccessApprovalSettingsCall) Do(opts ...googleapi.CallOption) (*AccessApprovalSettings, error) {
   954  	gensupport.SetOptions(c.urlParams_, opts...)
   955  	res, err := c.doRequest("json")
   956  	if res != nil && res.StatusCode == http.StatusNotModified {
   957  		if res.Body != nil {
   958  			res.Body.Close()
   959  		}
   960  		return nil, gensupport.WrapError(&googleapi.Error{
   961  			Code:   res.StatusCode,
   962  			Header: res.Header,
   963  		})
   964  	}
   965  	if err != nil {
   966  		return nil, err
   967  	}
   968  	defer googleapi.CloseBody(res)
   969  	if err := googleapi.CheckResponse(res); err != nil {
   970  		return nil, gensupport.WrapError(err)
   971  	}
   972  	ret := &AccessApprovalSettings{
   973  		ServerResponse: googleapi.ServerResponse{
   974  			Header:         res.Header,
   975  			HTTPStatusCode: res.StatusCode,
   976  		},
   977  	}
   978  	target := &ret
   979  	if err := gensupport.DecodeResponse(target, res); err != nil {
   980  		return nil, err
   981  	}
   982  	return ret, nil
   983  }
   984  
   985  type FoldersGetServiceAccountCall struct {
   986  	s            *Service
   987  	name         string
   988  	urlParams_   gensupport.URLParams
   989  	ifNoneMatch_ string
   990  	ctx_         context.Context
   991  	header_      http.Header
   992  }
   993  
   994  // GetServiceAccount: Retrieves the service account that is used by Access
   995  // Approval to access KMS keys for signing approved approval requests.
   996  //
   997  // - name: Name of the AccessApprovalServiceAccount to retrieve.
   998  func (r *FoldersService) GetServiceAccount(name string) *FoldersGetServiceAccountCall {
   999  	c := &FoldersGetServiceAccountCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1000  	c.name = name
  1001  	return c
  1002  }
  1003  
  1004  // Fields allows partial responses to be retrieved. See
  1005  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1006  // details.
  1007  func (c *FoldersGetServiceAccountCall) Fields(s ...googleapi.Field) *FoldersGetServiceAccountCall {
  1008  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1009  	return c
  1010  }
  1011  
  1012  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1013  // object's ETag matches the given value. This is useful for getting updates
  1014  // only after the object has changed since the last request.
  1015  func (c *FoldersGetServiceAccountCall) IfNoneMatch(entityTag string) *FoldersGetServiceAccountCall {
  1016  	c.ifNoneMatch_ = entityTag
  1017  	return c
  1018  }
  1019  
  1020  // Context sets the context to be used in this call's Do method.
  1021  func (c *FoldersGetServiceAccountCall) Context(ctx context.Context) *FoldersGetServiceAccountCall {
  1022  	c.ctx_ = ctx
  1023  	return c
  1024  }
  1025  
  1026  // Header returns a http.Header that can be modified by the caller to add
  1027  // headers to the request.
  1028  func (c *FoldersGetServiceAccountCall) Header() http.Header {
  1029  	if c.header_ == nil {
  1030  		c.header_ = make(http.Header)
  1031  	}
  1032  	return c.header_
  1033  }
  1034  
  1035  func (c *FoldersGetServiceAccountCall) doRequest(alt string) (*http.Response, error) {
  1036  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1037  	if c.ifNoneMatch_ != "" {
  1038  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1039  	}
  1040  	var body io.Reader = nil
  1041  	c.urlParams_.Set("alt", alt)
  1042  	c.urlParams_.Set("prettyPrint", "false")
  1043  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  1044  	urls += "?" + c.urlParams_.Encode()
  1045  	req, err := http.NewRequest("GET", urls, body)
  1046  	if err != nil {
  1047  		return nil, err
  1048  	}
  1049  	req.Header = reqHeaders
  1050  	googleapi.Expand(req.URL, map[string]string{
  1051  		"name": c.name,
  1052  	})
  1053  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1054  }
  1055  
  1056  // Do executes the "accessapproval.folders.getServiceAccount" call.
  1057  // Any non-2xx status code is an error. Response headers are in either
  1058  // *AccessApprovalServiceAccount.ServerResponse.Header or (if a response was
  1059  // returned at all) in error.(*googleapi.Error).Header. Use
  1060  // googleapi.IsNotModified to check whether the returned error was because
  1061  // http.StatusNotModified was returned.
  1062  func (c *FoldersGetServiceAccountCall) Do(opts ...googleapi.CallOption) (*AccessApprovalServiceAccount, error) {
  1063  	gensupport.SetOptions(c.urlParams_, opts...)
  1064  	res, err := c.doRequest("json")
  1065  	if res != nil && res.StatusCode == http.StatusNotModified {
  1066  		if res.Body != nil {
  1067  			res.Body.Close()
  1068  		}
  1069  		return nil, gensupport.WrapError(&googleapi.Error{
  1070  			Code:   res.StatusCode,
  1071  			Header: res.Header,
  1072  		})
  1073  	}
  1074  	if err != nil {
  1075  		return nil, err
  1076  	}
  1077  	defer googleapi.CloseBody(res)
  1078  	if err := googleapi.CheckResponse(res); err != nil {
  1079  		return nil, gensupport.WrapError(err)
  1080  	}
  1081  	ret := &AccessApprovalServiceAccount{
  1082  		ServerResponse: googleapi.ServerResponse{
  1083  			Header:         res.Header,
  1084  			HTTPStatusCode: res.StatusCode,
  1085  		},
  1086  	}
  1087  	target := &ret
  1088  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1089  		return nil, err
  1090  	}
  1091  	return ret, nil
  1092  }
  1093  
  1094  type FoldersUpdateAccessApprovalSettingsCall struct {
  1095  	s                      *Service
  1096  	name                   string
  1097  	accessapprovalsettings *AccessApprovalSettings
  1098  	urlParams_             gensupport.URLParams
  1099  	ctx_                   context.Context
  1100  	header_                http.Header
  1101  }
  1102  
  1103  // UpdateAccessApprovalSettings: Updates the settings associated with a
  1104  // project, folder, or organization. Settings to update are determined by the
  1105  // value of field_mask.
  1106  //
  1107  //   - name: The resource name of the settings. Format is one of: *
  1108  //     "projects/{project}/accessApprovalSettings" *
  1109  //     "folders/{folder}/accessApprovalSettings" *
  1110  //     "organizations/{organization}/accessApprovalSettings".
  1111  func (r *FoldersService) UpdateAccessApprovalSettings(name string, accessapprovalsettings *AccessApprovalSettings) *FoldersUpdateAccessApprovalSettingsCall {
  1112  	c := &FoldersUpdateAccessApprovalSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1113  	c.name = name
  1114  	c.accessapprovalsettings = accessapprovalsettings
  1115  	return c
  1116  }
  1117  
  1118  // UpdateMask sets the optional parameter "updateMask": The update mask applies
  1119  // to the settings. Only the top level fields of AccessApprovalSettings
  1120  // (notification_emails & enrolled_services) are supported. For each field, if
  1121  // it is included, the currently stored value will be entirely overwritten with
  1122  // the value of the field passed in this request. For the `FieldMask`
  1123  // definition, see
  1124  // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
  1125  // If this field is left unset, only the notification_emails field will be
  1126  // updated.
  1127  func (c *FoldersUpdateAccessApprovalSettingsCall) UpdateMask(updateMask string) *FoldersUpdateAccessApprovalSettingsCall {
  1128  	c.urlParams_.Set("updateMask", updateMask)
  1129  	return c
  1130  }
  1131  
  1132  // Fields allows partial responses to be retrieved. See
  1133  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1134  // details.
  1135  func (c *FoldersUpdateAccessApprovalSettingsCall) Fields(s ...googleapi.Field) *FoldersUpdateAccessApprovalSettingsCall {
  1136  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1137  	return c
  1138  }
  1139  
  1140  // Context sets the context to be used in this call's Do method.
  1141  func (c *FoldersUpdateAccessApprovalSettingsCall) Context(ctx context.Context) *FoldersUpdateAccessApprovalSettingsCall {
  1142  	c.ctx_ = ctx
  1143  	return c
  1144  }
  1145  
  1146  // Header returns a http.Header that can be modified by the caller to add
  1147  // headers to the request.
  1148  func (c *FoldersUpdateAccessApprovalSettingsCall) Header() http.Header {
  1149  	if c.header_ == nil {
  1150  		c.header_ = make(http.Header)
  1151  	}
  1152  	return c.header_
  1153  }
  1154  
  1155  func (c *FoldersUpdateAccessApprovalSettingsCall) doRequest(alt string) (*http.Response, error) {
  1156  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1157  	var body io.Reader = nil
  1158  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessapprovalsettings)
  1159  	if err != nil {
  1160  		return nil, err
  1161  	}
  1162  	c.urlParams_.Set("alt", alt)
  1163  	c.urlParams_.Set("prettyPrint", "false")
  1164  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  1165  	urls += "?" + c.urlParams_.Encode()
  1166  	req, err := http.NewRequest("PATCH", urls, body)
  1167  	if err != nil {
  1168  		return nil, err
  1169  	}
  1170  	req.Header = reqHeaders
  1171  	googleapi.Expand(req.URL, map[string]string{
  1172  		"name": c.name,
  1173  	})
  1174  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1175  }
  1176  
  1177  // Do executes the "accessapproval.folders.updateAccessApprovalSettings" call.
  1178  // Any non-2xx status code is an error. Response headers are in either
  1179  // *AccessApprovalSettings.ServerResponse.Header or (if a response was returned
  1180  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1181  // check whether the returned error was because http.StatusNotModified was
  1182  // returned.
  1183  func (c *FoldersUpdateAccessApprovalSettingsCall) Do(opts ...googleapi.CallOption) (*AccessApprovalSettings, error) {
  1184  	gensupport.SetOptions(c.urlParams_, opts...)
  1185  	res, err := c.doRequest("json")
  1186  	if res != nil && res.StatusCode == http.StatusNotModified {
  1187  		if res.Body != nil {
  1188  			res.Body.Close()
  1189  		}
  1190  		return nil, gensupport.WrapError(&googleapi.Error{
  1191  			Code:   res.StatusCode,
  1192  			Header: res.Header,
  1193  		})
  1194  	}
  1195  	if err != nil {
  1196  		return nil, err
  1197  	}
  1198  	defer googleapi.CloseBody(res)
  1199  	if err := googleapi.CheckResponse(res); err != nil {
  1200  		return nil, gensupport.WrapError(err)
  1201  	}
  1202  	ret := &AccessApprovalSettings{
  1203  		ServerResponse: googleapi.ServerResponse{
  1204  			Header:         res.Header,
  1205  			HTTPStatusCode: res.StatusCode,
  1206  		},
  1207  	}
  1208  	target := &ret
  1209  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1210  		return nil, err
  1211  	}
  1212  	return ret, nil
  1213  }
  1214  
  1215  type FoldersApprovalRequestsApproveCall struct {
  1216  	s                             *Service
  1217  	name                          string
  1218  	approveapprovalrequestmessage *ApproveApprovalRequestMessage
  1219  	urlParams_                    gensupport.URLParams
  1220  	ctx_                          context.Context
  1221  	header_                       http.Header
  1222  }
  1223  
  1224  // Approve: Approves a request and returns the updated ApprovalRequest. Returns
  1225  // NOT_FOUND if the request does not exist. Returns FAILED_PRECONDITION if the
  1226  // request exists but is not in a pending state.
  1227  //
  1228  // - name: Name of the approval request to approve.
  1229  func (r *FoldersApprovalRequestsService) Approve(name string, approveapprovalrequestmessage *ApproveApprovalRequestMessage) *FoldersApprovalRequestsApproveCall {
  1230  	c := &FoldersApprovalRequestsApproveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1231  	c.name = name
  1232  	c.approveapprovalrequestmessage = approveapprovalrequestmessage
  1233  	return c
  1234  }
  1235  
  1236  // Fields allows partial responses to be retrieved. See
  1237  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1238  // details.
  1239  func (c *FoldersApprovalRequestsApproveCall) Fields(s ...googleapi.Field) *FoldersApprovalRequestsApproveCall {
  1240  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1241  	return c
  1242  }
  1243  
  1244  // Context sets the context to be used in this call's Do method.
  1245  func (c *FoldersApprovalRequestsApproveCall) Context(ctx context.Context) *FoldersApprovalRequestsApproveCall {
  1246  	c.ctx_ = ctx
  1247  	return c
  1248  }
  1249  
  1250  // Header returns a http.Header that can be modified by the caller to add
  1251  // headers to the request.
  1252  func (c *FoldersApprovalRequestsApproveCall) Header() http.Header {
  1253  	if c.header_ == nil {
  1254  		c.header_ = make(http.Header)
  1255  	}
  1256  	return c.header_
  1257  }
  1258  
  1259  func (c *FoldersApprovalRequestsApproveCall) doRequest(alt string) (*http.Response, error) {
  1260  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1261  	var body io.Reader = nil
  1262  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.approveapprovalrequestmessage)
  1263  	if err != nil {
  1264  		return nil, err
  1265  	}
  1266  	c.urlParams_.Set("alt", alt)
  1267  	c.urlParams_.Set("prettyPrint", "false")
  1268  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:approve")
  1269  	urls += "?" + c.urlParams_.Encode()
  1270  	req, err := http.NewRequest("POST", urls, body)
  1271  	if err != nil {
  1272  		return nil, err
  1273  	}
  1274  	req.Header = reqHeaders
  1275  	googleapi.Expand(req.URL, map[string]string{
  1276  		"name": c.name,
  1277  	})
  1278  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1279  }
  1280  
  1281  // Do executes the "accessapproval.folders.approvalRequests.approve" call.
  1282  // Any non-2xx status code is an error. Response headers are in either
  1283  // *ApprovalRequest.ServerResponse.Header or (if a response was returned at
  1284  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1285  // check whether the returned error was because http.StatusNotModified was
  1286  // returned.
  1287  func (c *FoldersApprovalRequestsApproveCall) Do(opts ...googleapi.CallOption) (*ApprovalRequest, error) {
  1288  	gensupport.SetOptions(c.urlParams_, opts...)
  1289  	res, err := c.doRequest("json")
  1290  	if res != nil && res.StatusCode == http.StatusNotModified {
  1291  		if res.Body != nil {
  1292  			res.Body.Close()
  1293  		}
  1294  		return nil, gensupport.WrapError(&googleapi.Error{
  1295  			Code:   res.StatusCode,
  1296  			Header: res.Header,
  1297  		})
  1298  	}
  1299  	if err != nil {
  1300  		return nil, err
  1301  	}
  1302  	defer googleapi.CloseBody(res)
  1303  	if err := googleapi.CheckResponse(res); err != nil {
  1304  		return nil, gensupport.WrapError(err)
  1305  	}
  1306  	ret := &ApprovalRequest{
  1307  		ServerResponse: googleapi.ServerResponse{
  1308  			Header:         res.Header,
  1309  			HTTPStatusCode: res.StatusCode,
  1310  		},
  1311  	}
  1312  	target := &ret
  1313  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1314  		return nil, err
  1315  	}
  1316  	return ret, nil
  1317  }
  1318  
  1319  type FoldersApprovalRequestsDismissCall struct {
  1320  	s                             *Service
  1321  	name                          string
  1322  	dismissapprovalrequestmessage *DismissApprovalRequestMessage
  1323  	urlParams_                    gensupport.URLParams
  1324  	ctx_                          context.Context
  1325  	header_                       http.Header
  1326  }
  1327  
  1328  // Dismiss: Dismisses a request. Returns the updated ApprovalRequest. NOTE:
  1329  // This does not deny access to the resource if another request has been made
  1330  // and approved. It is equivalent in effect to ignoring the request altogether.
  1331  // Returns NOT_FOUND if the request does not exist. Returns FAILED_PRECONDITION
  1332  // if the request exists but is not in a pending state.
  1333  //
  1334  // - name: Name of the ApprovalRequest to dismiss.
  1335  func (r *FoldersApprovalRequestsService) Dismiss(name string, dismissapprovalrequestmessage *DismissApprovalRequestMessage) *FoldersApprovalRequestsDismissCall {
  1336  	c := &FoldersApprovalRequestsDismissCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1337  	c.name = name
  1338  	c.dismissapprovalrequestmessage = dismissapprovalrequestmessage
  1339  	return c
  1340  }
  1341  
  1342  // Fields allows partial responses to be retrieved. See
  1343  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1344  // details.
  1345  func (c *FoldersApprovalRequestsDismissCall) Fields(s ...googleapi.Field) *FoldersApprovalRequestsDismissCall {
  1346  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1347  	return c
  1348  }
  1349  
  1350  // Context sets the context to be used in this call's Do method.
  1351  func (c *FoldersApprovalRequestsDismissCall) Context(ctx context.Context) *FoldersApprovalRequestsDismissCall {
  1352  	c.ctx_ = ctx
  1353  	return c
  1354  }
  1355  
  1356  // Header returns a http.Header that can be modified by the caller to add
  1357  // headers to the request.
  1358  func (c *FoldersApprovalRequestsDismissCall) Header() http.Header {
  1359  	if c.header_ == nil {
  1360  		c.header_ = make(http.Header)
  1361  	}
  1362  	return c.header_
  1363  }
  1364  
  1365  func (c *FoldersApprovalRequestsDismissCall) doRequest(alt string) (*http.Response, error) {
  1366  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1367  	var body io.Reader = nil
  1368  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.dismissapprovalrequestmessage)
  1369  	if err != nil {
  1370  		return nil, err
  1371  	}
  1372  	c.urlParams_.Set("alt", alt)
  1373  	c.urlParams_.Set("prettyPrint", "false")
  1374  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:dismiss")
  1375  	urls += "?" + c.urlParams_.Encode()
  1376  	req, err := http.NewRequest("POST", urls, body)
  1377  	if err != nil {
  1378  		return nil, err
  1379  	}
  1380  	req.Header = reqHeaders
  1381  	googleapi.Expand(req.URL, map[string]string{
  1382  		"name": c.name,
  1383  	})
  1384  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1385  }
  1386  
  1387  // Do executes the "accessapproval.folders.approvalRequests.dismiss" call.
  1388  // Any non-2xx status code is an error. Response headers are in either
  1389  // *ApprovalRequest.ServerResponse.Header or (if a response was returned at
  1390  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1391  // check whether the returned error was because http.StatusNotModified was
  1392  // returned.
  1393  func (c *FoldersApprovalRequestsDismissCall) Do(opts ...googleapi.CallOption) (*ApprovalRequest, error) {
  1394  	gensupport.SetOptions(c.urlParams_, opts...)
  1395  	res, err := c.doRequest("json")
  1396  	if res != nil && res.StatusCode == http.StatusNotModified {
  1397  		if res.Body != nil {
  1398  			res.Body.Close()
  1399  		}
  1400  		return nil, gensupport.WrapError(&googleapi.Error{
  1401  			Code:   res.StatusCode,
  1402  			Header: res.Header,
  1403  		})
  1404  	}
  1405  	if err != nil {
  1406  		return nil, err
  1407  	}
  1408  	defer googleapi.CloseBody(res)
  1409  	if err := googleapi.CheckResponse(res); err != nil {
  1410  		return nil, gensupport.WrapError(err)
  1411  	}
  1412  	ret := &ApprovalRequest{
  1413  		ServerResponse: googleapi.ServerResponse{
  1414  			Header:         res.Header,
  1415  			HTTPStatusCode: res.StatusCode,
  1416  		},
  1417  	}
  1418  	target := &ret
  1419  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1420  		return nil, err
  1421  	}
  1422  	return ret, nil
  1423  }
  1424  
  1425  type FoldersApprovalRequestsGetCall struct {
  1426  	s            *Service
  1427  	name         string
  1428  	urlParams_   gensupport.URLParams
  1429  	ifNoneMatch_ string
  1430  	ctx_         context.Context
  1431  	header_      http.Header
  1432  }
  1433  
  1434  // Get: Gets an approval request. Returns NOT_FOUND if the request does not
  1435  // exist.
  1436  //
  1437  //   - name: The name of the approval request to retrieve. Format:
  1438  //     "{projects|folders|organizations}/{id}/approvalRequests/{approval_request}".
  1439  func (r *FoldersApprovalRequestsService) Get(name string) *FoldersApprovalRequestsGetCall {
  1440  	c := &FoldersApprovalRequestsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1441  	c.name = name
  1442  	return c
  1443  }
  1444  
  1445  // Fields allows partial responses to be retrieved. See
  1446  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1447  // details.
  1448  func (c *FoldersApprovalRequestsGetCall) Fields(s ...googleapi.Field) *FoldersApprovalRequestsGetCall {
  1449  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1450  	return c
  1451  }
  1452  
  1453  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1454  // object's ETag matches the given value. This is useful for getting updates
  1455  // only after the object has changed since the last request.
  1456  func (c *FoldersApprovalRequestsGetCall) IfNoneMatch(entityTag string) *FoldersApprovalRequestsGetCall {
  1457  	c.ifNoneMatch_ = entityTag
  1458  	return c
  1459  }
  1460  
  1461  // Context sets the context to be used in this call's Do method.
  1462  func (c *FoldersApprovalRequestsGetCall) Context(ctx context.Context) *FoldersApprovalRequestsGetCall {
  1463  	c.ctx_ = ctx
  1464  	return c
  1465  }
  1466  
  1467  // Header returns a http.Header that can be modified by the caller to add
  1468  // headers to the request.
  1469  func (c *FoldersApprovalRequestsGetCall) Header() http.Header {
  1470  	if c.header_ == nil {
  1471  		c.header_ = make(http.Header)
  1472  	}
  1473  	return c.header_
  1474  }
  1475  
  1476  func (c *FoldersApprovalRequestsGetCall) doRequest(alt string) (*http.Response, error) {
  1477  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1478  	if c.ifNoneMatch_ != "" {
  1479  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1480  	}
  1481  	var body io.Reader = nil
  1482  	c.urlParams_.Set("alt", alt)
  1483  	c.urlParams_.Set("prettyPrint", "false")
  1484  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  1485  	urls += "?" + c.urlParams_.Encode()
  1486  	req, err := http.NewRequest("GET", urls, body)
  1487  	if err != nil {
  1488  		return nil, err
  1489  	}
  1490  	req.Header = reqHeaders
  1491  	googleapi.Expand(req.URL, map[string]string{
  1492  		"name": c.name,
  1493  	})
  1494  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1495  }
  1496  
  1497  // Do executes the "accessapproval.folders.approvalRequests.get" call.
  1498  // Any non-2xx status code is an error. Response headers are in either
  1499  // *ApprovalRequest.ServerResponse.Header or (if a response was returned at
  1500  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1501  // check whether the returned error was because http.StatusNotModified was
  1502  // returned.
  1503  func (c *FoldersApprovalRequestsGetCall) Do(opts ...googleapi.CallOption) (*ApprovalRequest, error) {
  1504  	gensupport.SetOptions(c.urlParams_, opts...)
  1505  	res, err := c.doRequest("json")
  1506  	if res != nil && res.StatusCode == http.StatusNotModified {
  1507  		if res.Body != nil {
  1508  			res.Body.Close()
  1509  		}
  1510  		return nil, gensupport.WrapError(&googleapi.Error{
  1511  			Code:   res.StatusCode,
  1512  			Header: res.Header,
  1513  		})
  1514  	}
  1515  	if err != nil {
  1516  		return nil, err
  1517  	}
  1518  	defer googleapi.CloseBody(res)
  1519  	if err := googleapi.CheckResponse(res); err != nil {
  1520  		return nil, gensupport.WrapError(err)
  1521  	}
  1522  	ret := &ApprovalRequest{
  1523  		ServerResponse: googleapi.ServerResponse{
  1524  			Header:         res.Header,
  1525  			HTTPStatusCode: res.StatusCode,
  1526  		},
  1527  	}
  1528  	target := &ret
  1529  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1530  		return nil, err
  1531  	}
  1532  	return ret, nil
  1533  }
  1534  
  1535  type FoldersApprovalRequestsInvalidateCall struct {
  1536  	s                                *Service
  1537  	name                             string
  1538  	invalidateapprovalrequestmessage *InvalidateApprovalRequestMessage
  1539  	urlParams_                       gensupport.URLParams
  1540  	ctx_                             context.Context
  1541  	header_                          http.Header
  1542  }
  1543  
  1544  // Invalidate: Invalidates an existing ApprovalRequest. Returns the updated
  1545  // ApprovalRequest. NOTE: This does not deny access to the resource if another
  1546  // request has been made and approved. It only invalidates a single approval.
  1547  // Returns FAILED_PRECONDITION if the request exists but is not in an approved
  1548  // state.
  1549  //
  1550  // - name: Name of the ApprovalRequest to invalidate.
  1551  func (r *FoldersApprovalRequestsService) Invalidate(name string, invalidateapprovalrequestmessage *InvalidateApprovalRequestMessage) *FoldersApprovalRequestsInvalidateCall {
  1552  	c := &FoldersApprovalRequestsInvalidateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1553  	c.name = name
  1554  	c.invalidateapprovalrequestmessage = invalidateapprovalrequestmessage
  1555  	return c
  1556  }
  1557  
  1558  // Fields allows partial responses to be retrieved. See
  1559  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1560  // details.
  1561  func (c *FoldersApprovalRequestsInvalidateCall) Fields(s ...googleapi.Field) *FoldersApprovalRequestsInvalidateCall {
  1562  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1563  	return c
  1564  }
  1565  
  1566  // Context sets the context to be used in this call's Do method.
  1567  func (c *FoldersApprovalRequestsInvalidateCall) Context(ctx context.Context) *FoldersApprovalRequestsInvalidateCall {
  1568  	c.ctx_ = ctx
  1569  	return c
  1570  }
  1571  
  1572  // Header returns a http.Header that can be modified by the caller to add
  1573  // headers to the request.
  1574  func (c *FoldersApprovalRequestsInvalidateCall) Header() http.Header {
  1575  	if c.header_ == nil {
  1576  		c.header_ = make(http.Header)
  1577  	}
  1578  	return c.header_
  1579  }
  1580  
  1581  func (c *FoldersApprovalRequestsInvalidateCall) doRequest(alt string) (*http.Response, error) {
  1582  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1583  	var body io.Reader = nil
  1584  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.invalidateapprovalrequestmessage)
  1585  	if err != nil {
  1586  		return nil, err
  1587  	}
  1588  	c.urlParams_.Set("alt", alt)
  1589  	c.urlParams_.Set("prettyPrint", "false")
  1590  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:invalidate")
  1591  	urls += "?" + c.urlParams_.Encode()
  1592  	req, err := http.NewRequest("POST", urls, body)
  1593  	if err != nil {
  1594  		return nil, err
  1595  	}
  1596  	req.Header = reqHeaders
  1597  	googleapi.Expand(req.URL, map[string]string{
  1598  		"name": c.name,
  1599  	})
  1600  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1601  }
  1602  
  1603  // Do executes the "accessapproval.folders.approvalRequests.invalidate" call.
  1604  // Any non-2xx status code is an error. Response headers are in either
  1605  // *ApprovalRequest.ServerResponse.Header or (if a response was returned at
  1606  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1607  // check whether the returned error was because http.StatusNotModified was
  1608  // returned.
  1609  func (c *FoldersApprovalRequestsInvalidateCall) Do(opts ...googleapi.CallOption) (*ApprovalRequest, error) {
  1610  	gensupport.SetOptions(c.urlParams_, opts...)
  1611  	res, err := c.doRequest("json")
  1612  	if res != nil && res.StatusCode == http.StatusNotModified {
  1613  		if res.Body != nil {
  1614  			res.Body.Close()
  1615  		}
  1616  		return nil, gensupport.WrapError(&googleapi.Error{
  1617  			Code:   res.StatusCode,
  1618  			Header: res.Header,
  1619  		})
  1620  	}
  1621  	if err != nil {
  1622  		return nil, err
  1623  	}
  1624  	defer googleapi.CloseBody(res)
  1625  	if err := googleapi.CheckResponse(res); err != nil {
  1626  		return nil, gensupport.WrapError(err)
  1627  	}
  1628  	ret := &ApprovalRequest{
  1629  		ServerResponse: googleapi.ServerResponse{
  1630  			Header:         res.Header,
  1631  			HTTPStatusCode: res.StatusCode,
  1632  		},
  1633  	}
  1634  	target := &ret
  1635  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1636  		return nil, err
  1637  	}
  1638  	return ret, nil
  1639  }
  1640  
  1641  type FoldersApprovalRequestsListCall struct {
  1642  	s            *Service
  1643  	parent       string
  1644  	urlParams_   gensupport.URLParams
  1645  	ifNoneMatch_ string
  1646  	ctx_         context.Context
  1647  	header_      http.Header
  1648  }
  1649  
  1650  // List: Lists approval requests associated with a project, folder, or
  1651  // organization. Approval requests can be filtered by state (pending, active,
  1652  // dismissed). The order is reverse chronological.
  1653  //
  1654  //   - parent: The parent resource. This may be "projects/{project}",
  1655  //     "folders/{folder}", or "organizations/{organization}".
  1656  func (r *FoldersApprovalRequestsService) List(parent string) *FoldersApprovalRequestsListCall {
  1657  	c := &FoldersApprovalRequestsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1658  	c.parent = parent
  1659  	return c
  1660  }
  1661  
  1662  // Filter sets the optional parameter "filter": A filter on the type of
  1663  // approval requests to retrieve. Must be one of the following values: * [not
  1664  // set]: Requests that are pending or have active approvals. * ALL: All
  1665  // requests. * PENDING: Only pending requests. * ACTIVE: Only active (i.e.
  1666  // currently approved) requests. * DISMISSED: Only requests that have been
  1667  // dismissed, or requests that are not approved and past expiration. * EXPIRED:
  1668  // Only requests that have been approved, and the approval has expired. *
  1669  // HISTORY: Active, dismissed and expired requests.
  1670  func (c *FoldersApprovalRequestsListCall) Filter(filter string) *FoldersApprovalRequestsListCall {
  1671  	c.urlParams_.Set("filter", filter)
  1672  	return c
  1673  }
  1674  
  1675  // PageSize sets the optional parameter "pageSize": Requested page size.
  1676  func (c *FoldersApprovalRequestsListCall) PageSize(pageSize int64) *FoldersApprovalRequestsListCall {
  1677  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1678  	return c
  1679  }
  1680  
  1681  // PageToken sets the optional parameter "pageToken": A token identifying the
  1682  // page of results to return.
  1683  func (c *FoldersApprovalRequestsListCall) PageToken(pageToken string) *FoldersApprovalRequestsListCall {
  1684  	c.urlParams_.Set("pageToken", pageToken)
  1685  	return c
  1686  }
  1687  
  1688  // Fields allows partial responses to be retrieved. See
  1689  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1690  // details.
  1691  func (c *FoldersApprovalRequestsListCall) Fields(s ...googleapi.Field) *FoldersApprovalRequestsListCall {
  1692  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1693  	return c
  1694  }
  1695  
  1696  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1697  // object's ETag matches the given value. This is useful for getting updates
  1698  // only after the object has changed since the last request.
  1699  func (c *FoldersApprovalRequestsListCall) IfNoneMatch(entityTag string) *FoldersApprovalRequestsListCall {
  1700  	c.ifNoneMatch_ = entityTag
  1701  	return c
  1702  }
  1703  
  1704  // Context sets the context to be used in this call's Do method.
  1705  func (c *FoldersApprovalRequestsListCall) Context(ctx context.Context) *FoldersApprovalRequestsListCall {
  1706  	c.ctx_ = ctx
  1707  	return c
  1708  }
  1709  
  1710  // Header returns a http.Header that can be modified by the caller to add
  1711  // headers to the request.
  1712  func (c *FoldersApprovalRequestsListCall) Header() http.Header {
  1713  	if c.header_ == nil {
  1714  		c.header_ = make(http.Header)
  1715  	}
  1716  	return c.header_
  1717  }
  1718  
  1719  func (c *FoldersApprovalRequestsListCall) doRequest(alt string) (*http.Response, error) {
  1720  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1721  	if c.ifNoneMatch_ != "" {
  1722  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1723  	}
  1724  	var body io.Reader = nil
  1725  	c.urlParams_.Set("alt", alt)
  1726  	c.urlParams_.Set("prettyPrint", "false")
  1727  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/approvalRequests")
  1728  	urls += "?" + c.urlParams_.Encode()
  1729  	req, err := http.NewRequest("GET", urls, body)
  1730  	if err != nil {
  1731  		return nil, err
  1732  	}
  1733  	req.Header = reqHeaders
  1734  	googleapi.Expand(req.URL, map[string]string{
  1735  		"parent": c.parent,
  1736  	})
  1737  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1738  }
  1739  
  1740  // Do executes the "accessapproval.folders.approvalRequests.list" call.
  1741  // Any non-2xx status code is an error. Response headers are in either
  1742  // *ListApprovalRequestsResponse.ServerResponse.Header or (if a response was
  1743  // returned at all) in error.(*googleapi.Error).Header. Use
  1744  // googleapi.IsNotModified to check whether the returned error was because
  1745  // http.StatusNotModified was returned.
  1746  func (c *FoldersApprovalRequestsListCall) Do(opts ...googleapi.CallOption) (*ListApprovalRequestsResponse, error) {
  1747  	gensupport.SetOptions(c.urlParams_, opts...)
  1748  	res, err := c.doRequest("json")
  1749  	if res != nil && res.StatusCode == http.StatusNotModified {
  1750  		if res.Body != nil {
  1751  			res.Body.Close()
  1752  		}
  1753  		return nil, gensupport.WrapError(&googleapi.Error{
  1754  			Code:   res.StatusCode,
  1755  			Header: res.Header,
  1756  		})
  1757  	}
  1758  	if err != nil {
  1759  		return nil, err
  1760  	}
  1761  	defer googleapi.CloseBody(res)
  1762  	if err := googleapi.CheckResponse(res); err != nil {
  1763  		return nil, gensupport.WrapError(err)
  1764  	}
  1765  	ret := &ListApprovalRequestsResponse{
  1766  		ServerResponse: googleapi.ServerResponse{
  1767  			Header:         res.Header,
  1768  			HTTPStatusCode: res.StatusCode,
  1769  		},
  1770  	}
  1771  	target := &ret
  1772  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1773  		return nil, err
  1774  	}
  1775  	return ret, nil
  1776  }
  1777  
  1778  // Pages invokes f for each page of results.
  1779  // A non-nil error returned from f will halt the iteration.
  1780  // The provided context supersedes any context provided to the Context method.
  1781  func (c *FoldersApprovalRequestsListCall) Pages(ctx context.Context, f func(*ListApprovalRequestsResponse) error) error {
  1782  	c.ctx_ = ctx
  1783  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  1784  	for {
  1785  		x, err := c.Do()
  1786  		if err != nil {
  1787  			return err
  1788  		}
  1789  		if err := f(x); err != nil {
  1790  			return err
  1791  		}
  1792  		if x.NextPageToken == "" {
  1793  			return nil
  1794  		}
  1795  		c.PageToken(x.NextPageToken)
  1796  	}
  1797  }
  1798  
  1799  type OrganizationsDeleteAccessApprovalSettingsCall struct {
  1800  	s          *Service
  1801  	name       string
  1802  	urlParams_ gensupport.URLParams
  1803  	ctx_       context.Context
  1804  	header_    http.Header
  1805  }
  1806  
  1807  // DeleteAccessApprovalSettings: Deletes the settings associated with a
  1808  // project, folder, or organization. This will have the effect of disabling
  1809  // Access Approval for the project, folder, or organization, but only if all
  1810  // ancestors also have Access Approval disabled. If Access Approval is enabled
  1811  // at a higher level of the hierarchy, then Access Approval will still be
  1812  // enabled at this level as the settings are inherited.
  1813  //
  1814  // - name: Name of the AccessApprovalSettings to delete.
  1815  func (r *OrganizationsService) DeleteAccessApprovalSettings(name string) *OrganizationsDeleteAccessApprovalSettingsCall {
  1816  	c := &OrganizationsDeleteAccessApprovalSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1817  	c.name = name
  1818  	return c
  1819  }
  1820  
  1821  // Fields allows partial responses to be retrieved. See
  1822  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1823  // details.
  1824  func (c *OrganizationsDeleteAccessApprovalSettingsCall) Fields(s ...googleapi.Field) *OrganizationsDeleteAccessApprovalSettingsCall {
  1825  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1826  	return c
  1827  }
  1828  
  1829  // Context sets the context to be used in this call's Do method.
  1830  func (c *OrganizationsDeleteAccessApprovalSettingsCall) Context(ctx context.Context) *OrganizationsDeleteAccessApprovalSettingsCall {
  1831  	c.ctx_ = ctx
  1832  	return c
  1833  }
  1834  
  1835  // Header returns a http.Header that can be modified by the caller to add
  1836  // headers to the request.
  1837  func (c *OrganizationsDeleteAccessApprovalSettingsCall) Header() http.Header {
  1838  	if c.header_ == nil {
  1839  		c.header_ = make(http.Header)
  1840  	}
  1841  	return c.header_
  1842  }
  1843  
  1844  func (c *OrganizationsDeleteAccessApprovalSettingsCall) doRequest(alt string) (*http.Response, error) {
  1845  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1846  	var body io.Reader = nil
  1847  	c.urlParams_.Set("alt", alt)
  1848  	c.urlParams_.Set("prettyPrint", "false")
  1849  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  1850  	urls += "?" + c.urlParams_.Encode()
  1851  	req, err := http.NewRequest("DELETE", urls, body)
  1852  	if err != nil {
  1853  		return nil, err
  1854  	}
  1855  	req.Header = reqHeaders
  1856  	googleapi.Expand(req.URL, map[string]string{
  1857  		"name": c.name,
  1858  	})
  1859  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1860  }
  1861  
  1862  // Do executes the "accessapproval.organizations.deleteAccessApprovalSettings" call.
  1863  // Any non-2xx status code is an error. Response headers are in either
  1864  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  1865  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1866  // whether the returned error was because http.StatusNotModified was returned.
  1867  func (c *OrganizationsDeleteAccessApprovalSettingsCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  1868  	gensupport.SetOptions(c.urlParams_, opts...)
  1869  	res, err := c.doRequest("json")
  1870  	if res != nil && res.StatusCode == http.StatusNotModified {
  1871  		if res.Body != nil {
  1872  			res.Body.Close()
  1873  		}
  1874  		return nil, gensupport.WrapError(&googleapi.Error{
  1875  			Code:   res.StatusCode,
  1876  			Header: res.Header,
  1877  		})
  1878  	}
  1879  	if err != nil {
  1880  		return nil, err
  1881  	}
  1882  	defer googleapi.CloseBody(res)
  1883  	if err := googleapi.CheckResponse(res); err != nil {
  1884  		return nil, gensupport.WrapError(err)
  1885  	}
  1886  	ret := &Empty{
  1887  		ServerResponse: googleapi.ServerResponse{
  1888  			Header:         res.Header,
  1889  			HTTPStatusCode: res.StatusCode,
  1890  		},
  1891  	}
  1892  	target := &ret
  1893  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1894  		return nil, err
  1895  	}
  1896  	return ret, nil
  1897  }
  1898  
  1899  type OrganizationsGetAccessApprovalSettingsCall struct {
  1900  	s            *Service
  1901  	name         string
  1902  	urlParams_   gensupport.URLParams
  1903  	ifNoneMatch_ string
  1904  	ctx_         context.Context
  1905  	header_      http.Header
  1906  }
  1907  
  1908  // GetAccessApprovalSettings: Gets the settings associated with a project,
  1909  // folder, or organization.
  1910  //
  1911  //   - name: The name of the AccessApprovalSettings to retrieve. Format:
  1912  //     "{projects|folders|organizations}/{id}/accessApprovalSettings".
  1913  func (r *OrganizationsService) GetAccessApprovalSettings(name string) *OrganizationsGetAccessApprovalSettingsCall {
  1914  	c := &OrganizationsGetAccessApprovalSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1915  	c.name = name
  1916  	return c
  1917  }
  1918  
  1919  // Fields allows partial responses to be retrieved. See
  1920  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1921  // details.
  1922  func (c *OrganizationsGetAccessApprovalSettingsCall) Fields(s ...googleapi.Field) *OrganizationsGetAccessApprovalSettingsCall {
  1923  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1924  	return c
  1925  }
  1926  
  1927  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1928  // object's ETag matches the given value. This is useful for getting updates
  1929  // only after the object has changed since the last request.
  1930  func (c *OrganizationsGetAccessApprovalSettingsCall) IfNoneMatch(entityTag string) *OrganizationsGetAccessApprovalSettingsCall {
  1931  	c.ifNoneMatch_ = entityTag
  1932  	return c
  1933  }
  1934  
  1935  // Context sets the context to be used in this call's Do method.
  1936  func (c *OrganizationsGetAccessApprovalSettingsCall) Context(ctx context.Context) *OrganizationsGetAccessApprovalSettingsCall {
  1937  	c.ctx_ = ctx
  1938  	return c
  1939  }
  1940  
  1941  // Header returns a http.Header that can be modified by the caller to add
  1942  // headers to the request.
  1943  func (c *OrganizationsGetAccessApprovalSettingsCall) Header() http.Header {
  1944  	if c.header_ == nil {
  1945  		c.header_ = make(http.Header)
  1946  	}
  1947  	return c.header_
  1948  }
  1949  
  1950  func (c *OrganizationsGetAccessApprovalSettingsCall) doRequest(alt string) (*http.Response, error) {
  1951  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1952  	if c.ifNoneMatch_ != "" {
  1953  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1954  	}
  1955  	var body io.Reader = nil
  1956  	c.urlParams_.Set("alt", alt)
  1957  	c.urlParams_.Set("prettyPrint", "false")
  1958  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  1959  	urls += "?" + c.urlParams_.Encode()
  1960  	req, err := http.NewRequest("GET", urls, body)
  1961  	if err != nil {
  1962  		return nil, err
  1963  	}
  1964  	req.Header = reqHeaders
  1965  	googleapi.Expand(req.URL, map[string]string{
  1966  		"name": c.name,
  1967  	})
  1968  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1969  }
  1970  
  1971  // Do executes the "accessapproval.organizations.getAccessApprovalSettings" call.
  1972  // Any non-2xx status code is an error. Response headers are in either
  1973  // *AccessApprovalSettings.ServerResponse.Header or (if a response was returned
  1974  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1975  // check whether the returned error was because http.StatusNotModified was
  1976  // returned.
  1977  func (c *OrganizationsGetAccessApprovalSettingsCall) Do(opts ...googleapi.CallOption) (*AccessApprovalSettings, error) {
  1978  	gensupport.SetOptions(c.urlParams_, opts...)
  1979  	res, err := c.doRequest("json")
  1980  	if res != nil && res.StatusCode == http.StatusNotModified {
  1981  		if res.Body != nil {
  1982  			res.Body.Close()
  1983  		}
  1984  		return nil, gensupport.WrapError(&googleapi.Error{
  1985  			Code:   res.StatusCode,
  1986  			Header: res.Header,
  1987  		})
  1988  	}
  1989  	if err != nil {
  1990  		return nil, err
  1991  	}
  1992  	defer googleapi.CloseBody(res)
  1993  	if err := googleapi.CheckResponse(res); err != nil {
  1994  		return nil, gensupport.WrapError(err)
  1995  	}
  1996  	ret := &AccessApprovalSettings{
  1997  		ServerResponse: googleapi.ServerResponse{
  1998  			Header:         res.Header,
  1999  			HTTPStatusCode: res.StatusCode,
  2000  		},
  2001  	}
  2002  	target := &ret
  2003  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2004  		return nil, err
  2005  	}
  2006  	return ret, nil
  2007  }
  2008  
  2009  type OrganizationsGetServiceAccountCall struct {
  2010  	s            *Service
  2011  	name         string
  2012  	urlParams_   gensupport.URLParams
  2013  	ifNoneMatch_ string
  2014  	ctx_         context.Context
  2015  	header_      http.Header
  2016  }
  2017  
  2018  // GetServiceAccount: Retrieves the service account that is used by Access
  2019  // Approval to access KMS keys for signing approved approval requests.
  2020  //
  2021  // - name: Name of the AccessApprovalServiceAccount to retrieve.
  2022  func (r *OrganizationsService) GetServiceAccount(name string) *OrganizationsGetServiceAccountCall {
  2023  	c := &OrganizationsGetServiceAccountCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2024  	c.name = name
  2025  	return c
  2026  }
  2027  
  2028  // Fields allows partial responses to be retrieved. See
  2029  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2030  // details.
  2031  func (c *OrganizationsGetServiceAccountCall) Fields(s ...googleapi.Field) *OrganizationsGetServiceAccountCall {
  2032  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2033  	return c
  2034  }
  2035  
  2036  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2037  // object's ETag matches the given value. This is useful for getting updates
  2038  // only after the object has changed since the last request.
  2039  func (c *OrganizationsGetServiceAccountCall) IfNoneMatch(entityTag string) *OrganizationsGetServiceAccountCall {
  2040  	c.ifNoneMatch_ = entityTag
  2041  	return c
  2042  }
  2043  
  2044  // Context sets the context to be used in this call's Do method.
  2045  func (c *OrganizationsGetServiceAccountCall) Context(ctx context.Context) *OrganizationsGetServiceAccountCall {
  2046  	c.ctx_ = ctx
  2047  	return c
  2048  }
  2049  
  2050  // Header returns a http.Header that can be modified by the caller to add
  2051  // headers to the request.
  2052  func (c *OrganizationsGetServiceAccountCall) Header() http.Header {
  2053  	if c.header_ == nil {
  2054  		c.header_ = make(http.Header)
  2055  	}
  2056  	return c.header_
  2057  }
  2058  
  2059  func (c *OrganizationsGetServiceAccountCall) doRequest(alt string) (*http.Response, error) {
  2060  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2061  	if c.ifNoneMatch_ != "" {
  2062  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2063  	}
  2064  	var body io.Reader = nil
  2065  	c.urlParams_.Set("alt", alt)
  2066  	c.urlParams_.Set("prettyPrint", "false")
  2067  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  2068  	urls += "?" + c.urlParams_.Encode()
  2069  	req, err := http.NewRequest("GET", urls, body)
  2070  	if err != nil {
  2071  		return nil, err
  2072  	}
  2073  	req.Header = reqHeaders
  2074  	googleapi.Expand(req.URL, map[string]string{
  2075  		"name": c.name,
  2076  	})
  2077  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2078  }
  2079  
  2080  // Do executes the "accessapproval.organizations.getServiceAccount" call.
  2081  // Any non-2xx status code is an error. Response headers are in either
  2082  // *AccessApprovalServiceAccount.ServerResponse.Header or (if a response was
  2083  // returned at all) in error.(*googleapi.Error).Header. Use
  2084  // googleapi.IsNotModified to check whether the returned error was because
  2085  // http.StatusNotModified was returned.
  2086  func (c *OrganizationsGetServiceAccountCall) Do(opts ...googleapi.CallOption) (*AccessApprovalServiceAccount, error) {
  2087  	gensupport.SetOptions(c.urlParams_, opts...)
  2088  	res, err := c.doRequest("json")
  2089  	if res != nil && res.StatusCode == http.StatusNotModified {
  2090  		if res.Body != nil {
  2091  			res.Body.Close()
  2092  		}
  2093  		return nil, gensupport.WrapError(&googleapi.Error{
  2094  			Code:   res.StatusCode,
  2095  			Header: res.Header,
  2096  		})
  2097  	}
  2098  	if err != nil {
  2099  		return nil, err
  2100  	}
  2101  	defer googleapi.CloseBody(res)
  2102  	if err := googleapi.CheckResponse(res); err != nil {
  2103  		return nil, gensupport.WrapError(err)
  2104  	}
  2105  	ret := &AccessApprovalServiceAccount{
  2106  		ServerResponse: googleapi.ServerResponse{
  2107  			Header:         res.Header,
  2108  			HTTPStatusCode: res.StatusCode,
  2109  		},
  2110  	}
  2111  	target := &ret
  2112  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2113  		return nil, err
  2114  	}
  2115  	return ret, nil
  2116  }
  2117  
  2118  type OrganizationsUpdateAccessApprovalSettingsCall struct {
  2119  	s                      *Service
  2120  	name                   string
  2121  	accessapprovalsettings *AccessApprovalSettings
  2122  	urlParams_             gensupport.URLParams
  2123  	ctx_                   context.Context
  2124  	header_                http.Header
  2125  }
  2126  
  2127  // UpdateAccessApprovalSettings: Updates the settings associated with a
  2128  // project, folder, or organization. Settings to update are determined by the
  2129  // value of field_mask.
  2130  //
  2131  //   - name: The resource name of the settings. Format is one of: *
  2132  //     "projects/{project}/accessApprovalSettings" *
  2133  //     "folders/{folder}/accessApprovalSettings" *
  2134  //     "organizations/{organization}/accessApprovalSettings".
  2135  func (r *OrganizationsService) UpdateAccessApprovalSettings(name string, accessapprovalsettings *AccessApprovalSettings) *OrganizationsUpdateAccessApprovalSettingsCall {
  2136  	c := &OrganizationsUpdateAccessApprovalSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2137  	c.name = name
  2138  	c.accessapprovalsettings = accessapprovalsettings
  2139  	return c
  2140  }
  2141  
  2142  // UpdateMask sets the optional parameter "updateMask": The update mask applies
  2143  // to the settings. Only the top level fields of AccessApprovalSettings
  2144  // (notification_emails & enrolled_services) are supported. For each field, if
  2145  // it is included, the currently stored value will be entirely overwritten with
  2146  // the value of the field passed in this request. For the `FieldMask`
  2147  // definition, see
  2148  // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
  2149  // If this field is left unset, only the notification_emails field will be
  2150  // updated.
  2151  func (c *OrganizationsUpdateAccessApprovalSettingsCall) UpdateMask(updateMask string) *OrganizationsUpdateAccessApprovalSettingsCall {
  2152  	c.urlParams_.Set("updateMask", updateMask)
  2153  	return c
  2154  }
  2155  
  2156  // Fields allows partial responses to be retrieved. See
  2157  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2158  // details.
  2159  func (c *OrganizationsUpdateAccessApprovalSettingsCall) Fields(s ...googleapi.Field) *OrganizationsUpdateAccessApprovalSettingsCall {
  2160  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2161  	return c
  2162  }
  2163  
  2164  // Context sets the context to be used in this call's Do method.
  2165  func (c *OrganizationsUpdateAccessApprovalSettingsCall) Context(ctx context.Context) *OrganizationsUpdateAccessApprovalSettingsCall {
  2166  	c.ctx_ = ctx
  2167  	return c
  2168  }
  2169  
  2170  // Header returns a http.Header that can be modified by the caller to add
  2171  // headers to the request.
  2172  func (c *OrganizationsUpdateAccessApprovalSettingsCall) Header() http.Header {
  2173  	if c.header_ == nil {
  2174  		c.header_ = make(http.Header)
  2175  	}
  2176  	return c.header_
  2177  }
  2178  
  2179  func (c *OrganizationsUpdateAccessApprovalSettingsCall) doRequest(alt string) (*http.Response, error) {
  2180  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2181  	var body io.Reader = nil
  2182  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessapprovalsettings)
  2183  	if err != nil {
  2184  		return nil, err
  2185  	}
  2186  	c.urlParams_.Set("alt", alt)
  2187  	c.urlParams_.Set("prettyPrint", "false")
  2188  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  2189  	urls += "?" + c.urlParams_.Encode()
  2190  	req, err := http.NewRequest("PATCH", urls, body)
  2191  	if err != nil {
  2192  		return nil, err
  2193  	}
  2194  	req.Header = reqHeaders
  2195  	googleapi.Expand(req.URL, map[string]string{
  2196  		"name": c.name,
  2197  	})
  2198  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2199  }
  2200  
  2201  // Do executes the "accessapproval.organizations.updateAccessApprovalSettings" call.
  2202  // Any non-2xx status code is an error. Response headers are in either
  2203  // *AccessApprovalSettings.ServerResponse.Header or (if a response was returned
  2204  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2205  // check whether the returned error was because http.StatusNotModified was
  2206  // returned.
  2207  func (c *OrganizationsUpdateAccessApprovalSettingsCall) Do(opts ...googleapi.CallOption) (*AccessApprovalSettings, error) {
  2208  	gensupport.SetOptions(c.urlParams_, opts...)
  2209  	res, err := c.doRequest("json")
  2210  	if res != nil && res.StatusCode == http.StatusNotModified {
  2211  		if res.Body != nil {
  2212  			res.Body.Close()
  2213  		}
  2214  		return nil, gensupport.WrapError(&googleapi.Error{
  2215  			Code:   res.StatusCode,
  2216  			Header: res.Header,
  2217  		})
  2218  	}
  2219  	if err != nil {
  2220  		return nil, err
  2221  	}
  2222  	defer googleapi.CloseBody(res)
  2223  	if err := googleapi.CheckResponse(res); err != nil {
  2224  		return nil, gensupport.WrapError(err)
  2225  	}
  2226  	ret := &AccessApprovalSettings{
  2227  		ServerResponse: googleapi.ServerResponse{
  2228  			Header:         res.Header,
  2229  			HTTPStatusCode: res.StatusCode,
  2230  		},
  2231  	}
  2232  	target := &ret
  2233  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2234  		return nil, err
  2235  	}
  2236  	return ret, nil
  2237  }
  2238  
  2239  type OrganizationsApprovalRequestsApproveCall struct {
  2240  	s                             *Service
  2241  	name                          string
  2242  	approveapprovalrequestmessage *ApproveApprovalRequestMessage
  2243  	urlParams_                    gensupport.URLParams
  2244  	ctx_                          context.Context
  2245  	header_                       http.Header
  2246  }
  2247  
  2248  // Approve: Approves a request and returns the updated ApprovalRequest. Returns
  2249  // NOT_FOUND if the request does not exist. Returns FAILED_PRECONDITION if the
  2250  // request exists but is not in a pending state.
  2251  //
  2252  // - name: Name of the approval request to approve.
  2253  func (r *OrganizationsApprovalRequestsService) Approve(name string, approveapprovalrequestmessage *ApproveApprovalRequestMessage) *OrganizationsApprovalRequestsApproveCall {
  2254  	c := &OrganizationsApprovalRequestsApproveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2255  	c.name = name
  2256  	c.approveapprovalrequestmessage = approveapprovalrequestmessage
  2257  	return c
  2258  }
  2259  
  2260  // Fields allows partial responses to be retrieved. See
  2261  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2262  // details.
  2263  func (c *OrganizationsApprovalRequestsApproveCall) Fields(s ...googleapi.Field) *OrganizationsApprovalRequestsApproveCall {
  2264  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2265  	return c
  2266  }
  2267  
  2268  // Context sets the context to be used in this call's Do method.
  2269  func (c *OrganizationsApprovalRequestsApproveCall) Context(ctx context.Context) *OrganizationsApprovalRequestsApproveCall {
  2270  	c.ctx_ = ctx
  2271  	return c
  2272  }
  2273  
  2274  // Header returns a http.Header that can be modified by the caller to add
  2275  // headers to the request.
  2276  func (c *OrganizationsApprovalRequestsApproveCall) Header() http.Header {
  2277  	if c.header_ == nil {
  2278  		c.header_ = make(http.Header)
  2279  	}
  2280  	return c.header_
  2281  }
  2282  
  2283  func (c *OrganizationsApprovalRequestsApproveCall) doRequest(alt string) (*http.Response, error) {
  2284  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2285  	var body io.Reader = nil
  2286  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.approveapprovalrequestmessage)
  2287  	if err != nil {
  2288  		return nil, err
  2289  	}
  2290  	c.urlParams_.Set("alt", alt)
  2291  	c.urlParams_.Set("prettyPrint", "false")
  2292  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:approve")
  2293  	urls += "?" + c.urlParams_.Encode()
  2294  	req, err := http.NewRequest("POST", urls, body)
  2295  	if err != nil {
  2296  		return nil, err
  2297  	}
  2298  	req.Header = reqHeaders
  2299  	googleapi.Expand(req.URL, map[string]string{
  2300  		"name": c.name,
  2301  	})
  2302  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2303  }
  2304  
  2305  // Do executes the "accessapproval.organizations.approvalRequests.approve" call.
  2306  // Any non-2xx status code is an error. Response headers are in either
  2307  // *ApprovalRequest.ServerResponse.Header or (if a response was returned at
  2308  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2309  // check whether the returned error was because http.StatusNotModified was
  2310  // returned.
  2311  func (c *OrganizationsApprovalRequestsApproveCall) Do(opts ...googleapi.CallOption) (*ApprovalRequest, error) {
  2312  	gensupport.SetOptions(c.urlParams_, opts...)
  2313  	res, err := c.doRequest("json")
  2314  	if res != nil && res.StatusCode == http.StatusNotModified {
  2315  		if res.Body != nil {
  2316  			res.Body.Close()
  2317  		}
  2318  		return nil, gensupport.WrapError(&googleapi.Error{
  2319  			Code:   res.StatusCode,
  2320  			Header: res.Header,
  2321  		})
  2322  	}
  2323  	if err != nil {
  2324  		return nil, err
  2325  	}
  2326  	defer googleapi.CloseBody(res)
  2327  	if err := googleapi.CheckResponse(res); err != nil {
  2328  		return nil, gensupport.WrapError(err)
  2329  	}
  2330  	ret := &ApprovalRequest{
  2331  		ServerResponse: googleapi.ServerResponse{
  2332  			Header:         res.Header,
  2333  			HTTPStatusCode: res.StatusCode,
  2334  		},
  2335  	}
  2336  	target := &ret
  2337  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2338  		return nil, err
  2339  	}
  2340  	return ret, nil
  2341  }
  2342  
  2343  type OrganizationsApprovalRequestsDismissCall struct {
  2344  	s                             *Service
  2345  	name                          string
  2346  	dismissapprovalrequestmessage *DismissApprovalRequestMessage
  2347  	urlParams_                    gensupport.URLParams
  2348  	ctx_                          context.Context
  2349  	header_                       http.Header
  2350  }
  2351  
  2352  // Dismiss: Dismisses a request. Returns the updated ApprovalRequest. NOTE:
  2353  // This does not deny access to the resource if another request has been made
  2354  // and approved. It is equivalent in effect to ignoring the request altogether.
  2355  // Returns NOT_FOUND if the request does not exist. Returns FAILED_PRECONDITION
  2356  // if the request exists but is not in a pending state.
  2357  //
  2358  // - name: Name of the ApprovalRequest to dismiss.
  2359  func (r *OrganizationsApprovalRequestsService) Dismiss(name string, dismissapprovalrequestmessage *DismissApprovalRequestMessage) *OrganizationsApprovalRequestsDismissCall {
  2360  	c := &OrganizationsApprovalRequestsDismissCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2361  	c.name = name
  2362  	c.dismissapprovalrequestmessage = dismissapprovalrequestmessage
  2363  	return c
  2364  }
  2365  
  2366  // Fields allows partial responses to be retrieved. See
  2367  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2368  // details.
  2369  func (c *OrganizationsApprovalRequestsDismissCall) Fields(s ...googleapi.Field) *OrganizationsApprovalRequestsDismissCall {
  2370  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2371  	return c
  2372  }
  2373  
  2374  // Context sets the context to be used in this call's Do method.
  2375  func (c *OrganizationsApprovalRequestsDismissCall) Context(ctx context.Context) *OrganizationsApprovalRequestsDismissCall {
  2376  	c.ctx_ = ctx
  2377  	return c
  2378  }
  2379  
  2380  // Header returns a http.Header that can be modified by the caller to add
  2381  // headers to the request.
  2382  func (c *OrganizationsApprovalRequestsDismissCall) Header() http.Header {
  2383  	if c.header_ == nil {
  2384  		c.header_ = make(http.Header)
  2385  	}
  2386  	return c.header_
  2387  }
  2388  
  2389  func (c *OrganizationsApprovalRequestsDismissCall) doRequest(alt string) (*http.Response, error) {
  2390  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2391  	var body io.Reader = nil
  2392  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.dismissapprovalrequestmessage)
  2393  	if err != nil {
  2394  		return nil, err
  2395  	}
  2396  	c.urlParams_.Set("alt", alt)
  2397  	c.urlParams_.Set("prettyPrint", "false")
  2398  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:dismiss")
  2399  	urls += "?" + c.urlParams_.Encode()
  2400  	req, err := http.NewRequest("POST", urls, body)
  2401  	if err != nil {
  2402  		return nil, err
  2403  	}
  2404  	req.Header = reqHeaders
  2405  	googleapi.Expand(req.URL, map[string]string{
  2406  		"name": c.name,
  2407  	})
  2408  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2409  }
  2410  
  2411  // Do executes the "accessapproval.organizations.approvalRequests.dismiss" call.
  2412  // Any non-2xx status code is an error. Response headers are in either
  2413  // *ApprovalRequest.ServerResponse.Header or (if a response was returned at
  2414  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2415  // check whether the returned error was because http.StatusNotModified was
  2416  // returned.
  2417  func (c *OrganizationsApprovalRequestsDismissCall) Do(opts ...googleapi.CallOption) (*ApprovalRequest, error) {
  2418  	gensupport.SetOptions(c.urlParams_, opts...)
  2419  	res, err := c.doRequest("json")
  2420  	if res != nil && res.StatusCode == http.StatusNotModified {
  2421  		if res.Body != nil {
  2422  			res.Body.Close()
  2423  		}
  2424  		return nil, gensupport.WrapError(&googleapi.Error{
  2425  			Code:   res.StatusCode,
  2426  			Header: res.Header,
  2427  		})
  2428  	}
  2429  	if err != nil {
  2430  		return nil, err
  2431  	}
  2432  	defer googleapi.CloseBody(res)
  2433  	if err := googleapi.CheckResponse(res); err != nil {
  2434  		return nil, gensupport.WrapError(err)
  2435  	}
  2436  	ret := &ApprovalRequest{
  2437  		ServerResponse: googleapi.ServerResponse{
  2438  			Header:         res.Header,
  2439  			HTTPStatusCode: res.StatusCode,
  2440  		},
  2441  	}
  2442  	target := &ret
  2443  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2444  		return nil, err
  2445  	}
  2446  	return ret, nil
  2447  }
  2448  
  2449  type OrganizationsApprovalRequestsGetCall struct {
  2450  	s            *Service
  2451  	name         string
  2452  	urlParams_   gensupport.URLParams
  2453  	ifNoneMatch_ string
  2454  	ctx_         context.Context
  2455  	header_      http.Header
  2456  }
  2457  
  2458  // Get: Gets an approval request. Returns NOT_FOUND if the request does not
  2459  // exist.
  2460  //
  2461  //   - name: The name of the approval request to retrieve. Format:
  2462  //     "{projects|folders|organizations}/{id}/approvalRequests/{approval_request}".
  2463  func (r *OrganizationsApprovalRequestsService) Get(name string) *OrganizationsApprovalRequestsGetCall {
  2464  	c := &OrganizationsApprovalRequestsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2465  	c.name = name
  2466  	return c
  2467  }
  2468  
  2469  // Fields allows partial responses to be retrieved. See
  2470  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2471  // details.
  2472  func (c *OrganizationsApprovalRequestsGetCall) Fields(s ...googleapi.Field) *OrganizationsApprovalRequestsGetCall {
  2473  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2474  	return c
  2475  }
  2476  
  2477  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2478  // object's ETag matches the given value. This is useful for getting updates
  2479  // only after the object has changed since the last request.
  2480  func (c *OrganizationsApprovalRequestsGetCall) IfNoneMatch(entityTag string) *OrganizationsApprovalRequestsGetCall {
  2481  	c.ifNoneMatch_ = entityTag
  2482  	return c
  2483  }
  2484  
  2485  // Context sets the context to be used in this call's Do method.
  2486  func (c *OrganizationsApprovalRequestsGetCall) Context(ctx context.Context) *OrganizationsApprovalRequestsGetCall {
  2487  	c.ctx_ = ctx
  2488  	return c
  2489  }
  2490  
  2491  // Header returns a http.Header that can be modified by the caller to add
  2492  // headers to the request.
  2493  func (c *OrganizationsApprovalRequestsGetCall) Header() http.Header {
  2494  	if c.header_ == nil {
  2495  		c.header_ = make(http.Header)
  2496  	}
  2497  	return c.header_
  2498  }
  2499  
  2500  func (c *OrganizationsApprovalRequestsGetCall) doRequest(alt string) (*http.Response, error) {
  2501  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2502  	if c.ifNoneMatch_ != "" {
  2503  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2504  	}
  2505  	var body io.Reader = nil
  2506  	c.urlParams_.Set("alt", alt)
  2507  	c.urlParams_.Set("prettyPrint", "false")
  2508  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  2509  	urls += "?" + c.urlParams_.Encode()
  2510  	req, err := http.NewRequest("GET", urls, body)
  2511  	if err != nil {
  2512  		return nil, err
  2513  	}
  2514  	req.Header = reqHeaders
  2515  	googleapi.Expand(req.URL, map[string]string{
  2516  		"name": c.name,
  2517  	})
  2518  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2519  }
  2520  
  2521  // Do executes the "accessapproval.organizations.approvalRequests.get" call.
  2522  // Any non-2xx status code is an error. Response headers are in either
  2523  // *ApprovalRequest.ServerResponse.Header or (if a response was returned at
  2524  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2525  // check whether the returned error was because http.StatusNotModified was
  2526  // returned.
  2527  func (c *OrganizationsApprovalRequestsGetCall) Do(opts ...googleapi.CallOption) (*ApprovalRequest, error) {
  2528  	gensupport.SetOptions(c.urlParams_, opts...)
  2529  	res, err := c.doRequest("json")
  2530  	if res != nil && res.StatusCode == http.StatusNotModified {
  2531  		if res.Body != nil {
  2532  			res.Body.Close()
  2533  		}
  2534  		return nil, gensupport.WrapError(&googleapi.Error{
  2535  			Code:   res.StatusCode,
  2536  			Header: res.Header,
  2537  		})
  2538  	}
  2539  	if err != nil {
  2540  		return nil, err
  2541  	}
  2542  	defer googleapi.CloseBody(res)
  2543  	if err := googleapi.CheckResponse(res); err != nil {
  2544  		return nil, gensupport.WrapError(err)
  2545  	}
  2546  	ret := &ApprovalRequest{
  2547  		ServerResponse: googleapi.ServerResponse{
  2548  			Header:         res.Header,
  2549  			HTTPStatusCode: res.StatusCode,
  2550  		},
  2551  	}
  2552  	target := &ret
  2553  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2554  		return nil, err
  2555  	}
  2556  	return ret, nil
  2557  }
  2558  
  2559  type OrganizationsApprovalRequestsInvalidateCall struct {
  2560  	s                                *Service
  2561  	name                             string
  2562  	invalidateapprovalrequestmessage *InvalidateApprovalRequestMessage
  2563  	urlParams_                       gensupport.URLParams
  2564  	ctx_                             context.Context
  2565  	header_                          http.Header
  2566  }
  2567  
  2568  // Invalidate: Invalidates an existing ApprovalRequest. Returns the updated
  2569  // ApprovalRequest. NOTE: This does not deny access to the resource if another
  2570  // request has been made and approved. It only invalidates a single approval.
  2571  // Returns FAILED_PRECONDITION if the request exists but is not in an approved
  2572  // state.
  2573  //
  2574  // - name: Name of the ApprovalRequest to invalidate.
  2575  func (r *OrganizationsApprovalRequestsService) Invalidate(name string, invalidateapprovalrequestmessage *InvalidateApprovalRequestMessage) *OrganizationsApprovalRequestsInvalidateCall {
  2576  	c := &OrganizationsApprovalRequestsInvalidateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2577  	c.name = name
  2578  	c.invalidateapprovalrequestmessage = invalidateapprovalrequestmessage
  2579  	return c
  2580  }
  2581  
  2582  // Fields allows partial responses to be retrieved. See
  2583  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2584  // details.
  2585  func (c *OrganizationsApprovalRequestsInvalidateCall) Fields(s ...googleapi.Field) *OrganizationsApprovalRequestsInvalidateCall {
  2586  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2587  	return c
  2588  }
  2589  
  2590  // Context sets the context to be used in this call's Do method.
  2591  func (c *OrganizationsApprovalRequestsInvalidateCall) Context(ctx context.Context) *OrganizationsApprovalRequestsInvalidateCall {
  2592  	c.ctx_ = ctx
  2593  	return c
  2594  }
  2595  
  2596  // Header returns a http.Header that can be modified by the caller to add
  2597  // headers to the request.
  2598  func (c *OrganizationsApprovalRequestsInvalidateCall) Header() http.Header {
  2599  	if c.header_ == nil {
  2600  		c.header_ = make(http.Header)
  2601  	}
  2602  	return c.header_
  2603  }
  2604  
  2605  func (c *OrganizationsApprovalRequestsInvalidateCall) doRequest(alt string) (*http.Response, error) {
  2606  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2607  	var body io.Reader = nil
  2608  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.invalidateapprovalrequestmessage)
  2609  	if err != nil {
  2610  		return nil, err
  2611  	}
  2612  	c.urlParams_.Set("alt", alt)
  2613  	c.urlParams_.Set("prettyPrint", "false")
  2614  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:invalidate")
  2615  	urls += "?" + c.urlParams_.Encode()
  2616  	req, err := http.NewRequest("POST", urls, body)
  2617  	if err != nil {
  2618  		return nil, err
  2619  	}
  2620  	req.Header = reqHeaders
  2621  	googleapi.Expand(req.URL, map[string]string{
  2622  		"name": c.name,
  2623  	})
  2624  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2625  }
  2626  
  2627  // Do executes the "accessapproval.organizations.approvalRequests.invalidate" call.
  2628  // Any non-2xx status code is an error. Response headers are in either
  2629  // *ApprovalRequest.ServerResponse.Header or (if a response was returned at
  2630  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2631  // check whether the returned error was because http.StatusNotModified was
  2632  // returned.
  2633  func (c *OrganizationsApprovalRequestsInvalidateCall) Do(opts ...googleapi.CallOption) (*ApprovalRequest, error) {
  2634  	gensupport.SetOptions(c.urlParams_, opts...)
  2635  	res, err := c.doRequest("json")
  2636  	if res != nil && res.StatusCode == http.StatusNotModified {
  2637  		if res.Body != nil {
  2638  			res.Body.Close()
  2639  		}
  2640  		return nil, gensupport.WrapError(&googleapi.Error{
  2641  			Code:   res.StatusCode,
  2642  			Header: res.Header,
  2643  		})
  2644  	}
  2645  	if err != nil {
  2646  		return nil, err
  2647  	}
  2648  	defer googleapi.CloseBody(res)
  2649  	if err := googleapi.CheckResponse(res); err != nil {
  2650  		return nil, gensupport.WrapError(err)
  2651  	}
  2652  	ret := &ApprovalRequest{
  2653  		ServerResponse: googleapi.ServerResponse{
  2654  			Header:         res.Header,
  2655  			HTTPStatusCode: res.StatusCode,
  2656  		},
  2657  	}
  2658  	target := &ret
  2659  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2660  		return nil, err
  2661  	}
  2662  	return ret, nil
  2663  }
  2664  
  2665  type OrganizationsApprovalRequestsListCall struct {
  2666  	s            *Service
  2667  	parent       string
  2668  	urlParams_   gensupport.URLParams
  2669  	ifNoneMatch_ string
  2670  	ctx_         context.Context
  2671  	header_      http.Header
  2672  }
  2673  
  2674  // List: Lists approval requests associated with a project, folder, or
  2675  // organization. Approval requests can be filtered by state (pending, active,
  2676  // dismissed). The order is reverse chronological.
  2677  //
  2678  //   - parent: The parent resource. This may be "projects/{project}",
  2679  //     "folders/{folder}", or "organizations/{organization}".
  2680  func (r *OrganizationsApprovalRequestsService) List(parent string) *OrganizationsApprovalRequestsListCall {
  2681  	c := &OrganizationsApprovalRequestsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2682  	c.parent = parent
  2683  	return c
  2684  }
  2685  
  2686  // Filter sets the optional parameter "filter": A filter on the type of
  2687  // approval requests to retrieve. Must be one of the following values: * [not
  2688  // set]: Requests that are pending or have active approvals. * ALL: All
  2689  // requests. * PENDING: Only pending requests. * ACTIVE: Only active (i.e.
  2690  // currently approved) requests. * DISMISSED: Only requests that have been
  2691  // dismissed, or requests that are not approved and past expiration. * EXPIRED:
  2692  // Only requests that have been approved, and the approval has expired. *
  2693  // HISTORY: Active, dismissed and expired requests.
  2694  func (c *OrganizationsApprovalRequestsListCall) Filter(filter string) *OrganizationsApprovalRequestsListCall {
  2695  	c.urlParams_.Set("filter", filter)
  2696  	return c
  2697  }
  2698  
  2699  // PageSize sets the optional parameter "pageSize": Requested page size.
  2700  func (c *OrganizationsApprovalRequestsListCall) PageSize(pageSize int64) *OrganizationsApprovalRequestsListCall {
  2701  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2702  	return c
  2703  }
  2704  
  2705  // PageToken sets the optional parameter "pageToken": A token identifying the
  2706  // page of results to return.
  2707  func (c *OrganizationsApprovalRequestsListCall) PageToken(pageToken string) *OrganizationsApprovalRequestsListCall {
  2708  	c.urlParams_.Set("pageToken", pageToken)
  2709  	return c
  2710  }
  2711  
  2712  // Fields allows partial responses to be retrieved. See
  2713  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2714  // details.
  2715  func (c *OrganizationsApprovalRequestsListCall) Fields(s ...googleapi.Field) *OrganizationsApprovalRequestsListCall {
  2716  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2717  	return c
  2718  }
  2719  
  2720  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2721  // object's ETag matches the given value. This is useful for getting updates
  2722  // only after the object has changed since the last request.
  2723  func (c *OrganizationsApprovalRequestsListCall) IfNoneMatch(entityTag string) *OrganizationsApprovalRequestsListCall {
  2724  	c.ifNoneMatch_ = entityTag
  2725  	return c
  2726  }
  2727  
  2728  // Context sets the context to be used in this call's Do method.
  2729  func (c *OrganizationsApprovalRequestsListCall) Context(ctx context.Context) *OrganizationsApprovalRequestsListCall {
  2730  	c.ctx_ = ctx
  2731  	return c
  2732  }
  2733  
  2734  // Header returns a http.Header that can be modified by the caller to add
  2735  // headers to the request.
  2736  func (c *OrganizationsApprovalRequestsListCall) Header() http.Header {
  2737  	if c.header_ == nil {
  2738  		c.header_ = make(http.Header)
  2739  	}
  2740  	return c.header_
  2741  }
  2742  
  2743  func (c *OrganizationsApprovalRequestsListCall) doRequest(alt string) (*http.Response, error) {
  2744  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2745  	if c.ifNoneMatch_ != "" {
  2746  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2747  	}
  2748  	var body io.Reader = nil
  2749  	c.urlParams_.Set("alt", alt)
  2750  	c.urlParams_.Set("prettyPrint", "false")
  2751  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/approvalRequests")
  2752  	urls += "?" + c.urlParams_.Encode()
  2753  	req, err := http.NewRequest("GET", urls, body)
  2754  	if err != nil {
  2755  		return nil, err
  2756  	}
  2757  	req.Header = reqHeaders
  2758  	googleapi.Expand(req.URL, map[string]string{
  2759  		"parent": c.parent,
  2760  	})
  2761  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2762  }
  2763  
  2764  // Do executes the "accessapproval.organizations.approvalRequests.list" call.
  2765  // Any non-2xx status code is an error. Response headers are in either
  2766  // *ListApprovalRequestsResponse.ServerResponse.Header or (if a response was
  2767  // returned at all) in error.(*googleapi.Error).Header. Use
  2768  // googleapi.IsNotModified to check whether the returned error was because
  2769  // http.StatusNotModified was returned.
  2770  func (c *OrganizationsApprovalRequestsListCall) Do(opts ...googleapi.CallOption) (*ListApprovalRequestsResponse, error) {
  2771  	gensupport.SetOptions(c.urlParams_, opts...)
  2772  	res, err := c.doRequest("json")
  2773  	if res != nil && res.StatusCode == http.StatusNotModified {
  2774  		if res.Body != nil {
  2775  			res.Body.Close()
  2776  		}
  2777  		return nil, gensupport.WrapError(&googleapi.Error{
  2778  			Code:   res.StatusCode,
  2779  			Header: res.Header,
  2780  		})
  2781  	}
  2782  	if err != nil {
  2783  		return nil, err
  2784  	}
  2785  	defer googleapi.CloseBody(res)
  2786  	if err := googleapi.CheckResponse(res); err != nil {
  2787  		return nil, gensupport.WrapError(err)
  2788  	}
  2789  	ret := &ListApprovalRequestsResponse{
  2790  		ServerResponse: googleapi.ServerResponse{
  2791  			Header:         res.Header,
  2792  			HTTPStatusCode: res.StatusCode,
  2793  		},
  2794  	}
  2795  	target := &ret
  2796  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2797  		return nil, err
  2798  	}
  2799  	return ret, nil
  2800  }
  2801  
  2802  // Pages invokes f for each page of results.
  2803  // A non-nil error returned from f will halt the iteration.
  2804  // The provided context supersedes any context provided to the Context method.
  2805  func (c *OrganizationsApprovalRequestsListCall) Pages(ctx context.Context, f func(*ListApprovalRequestsResponse) error) error {
  2806  	c.ctx_ = ctx
  2807  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  2808  	for {
  2809  		x, err := c.Do()
  2810  		if err != nil {
  2811  			return err
  2812  		}
  2813  		if err := f(x); err != nil {
  2814  			return err
  2815  		}
  2816  		if x.NextPageToken == "" {
  2817  			return nil
  2818  		}
  2819  		c.PageToken(x.NextPageToken)
  2820  	}
  2821  }
  2822  
  2823  type ProjectsDeleteAccessApprovalSettingsCall struct {
  2824  	s          *Service
  2825  	name       string
  2826  	urlParams_ gensupport.URLParams
  2827  	ctx_       context.Context
  2828  	header_    http.Header
  2829  }
  2830  
  2831  // DeleteAccessApprovalSettings: Deletes the settings associated with a
  2832  // project, folder, or organization. This will have the effect of disabling
  2833  // Access Approval for the project, folder, or organization, but only if all
  2834  // ancestors also have Access Approval disabled. If Access Approval is enabled
  2835  // at a higher level of the hierarchy, then Access Approval will still be
  2836  // enabled at this level as the settings are inherited.
  2837  //
  2838  // - name: Name of the AccessApprovalSettings to delete.
  2839  func (r *ProjectsService) DeleteAccessApprovalSettings(name string) *ProjectsDeleteAccessApprovalSettingsCall {
  2840  	c := &ProjectsDeleteAccessApprovalSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2841  	c.name = name
  2842  	return c
  2843  }
  2844  
  2845  // Fields allows partial responses to be retrieved. See
  2846  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2847  // details.
  2848  func (c *ProjectsDeleteAccessApprovalSettingsCall) Fields(s ...googleapi.Field) *ProjectsDeleteAccessApprovalSettingsCall {
  2849  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2850  	return c
  2851  }
  2852  
  2853  // Context sets the context to be used in this call's Do method.
  2854  func (c *ProjectsDeleteAccessApprovalSettingsCall) Context(ctx context.Context) *ProjectsDeleteAccessApprovalSettingsCall {
  2855  	c.ctx_ = ctx
  2856  	return c
  2857  }
  2858  
  2859  // Header returns a http.Header that can be modified by the caller to add
  2860  // headers to the request.
  2861  func (c *ProjectsDeleteAccessApprovalSettingsCall) Header() http.Header {
  2862  	if c.header_ == nil {
  2863  		c.header_ = make(http.Header)
  2864  	}
  2865  	return c.header_
  2866  }
  2867  
  2868  func (c *ProjectsDeleteAccessApprovalSettingsCall) doRequest(alt string) (*http.Response, error) {
  2869  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2870  	var body io.Reader = nil
  2871  	c.urlParams_.Set("alt", alt)
  2872  	c.urlParams_.Set("prettyPrint", "false")
  2873  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  2874  	urls += "?" + c.urlParams_.Encode()
  2875  	req, err := http.NewRequest("DELETE", urls, body)
  2876  	if err != nil {
  2877  		return nil, err
  2878  	}
  2879  	req.Header = reqHeaders
  2880  	googleapi.Expand(req.URL, map[string]string{
  2881  		"name": c.name,
  2882  	})
  2883  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2884  }
  2885  
  2886  // Do executes the "accessapproval.projects.deleteAccessApprovalSettings" call.
  2887  // Any non-2xx status code is an error. Response headers are in either
  2888  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  2889  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2890  // whether the returned error was because http.StatusNotModified was returned.
  2891  func (c *ProjectsDeleteAccessApprovalSettingsCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  2892  	gensupport.SetOptions(c.urlParams_, opts...)
  2893  	res, err := c.doRequest("json")
  2894  	if res != nil && res.StatusCode == http.StatusNotModified {
  2895  		if res.Body != nil {
  2896  			res.Body.Close()
  2897  		}
  2898  		return nil, gensupport.WrapError(&googleapi.Error{
  2899  			Code:   res.StatusCode,
  2900  			Header: res.Header,
  2901  		})
  2902  	}
  2903  	if err != nil {
  2904  		return nil, err
  2905  	}
  2906  	defer googleapi.CloseBody(res)
  2907  	if err := googleapi.CheckResponse(res); err != nil {
  2908  		return nil, gensupport.WrapError(err)
  2909  	}
  2910  	ret := &Empty{
  2911  		ServerResponse: googleapi.ServerResponse{
  2912  			Header:         res.Header,
  2913  			HTTPStatusCode: res.StatusCode,
  2914  		},
  2915  	}
  2916  	target := &ret
  2917  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2918  		return nil, err
  2919  	}
  2920  	return ret, nil
  2921  }
  2922  
  2923  type ProjectsGetAccessApprovalSettingsCall struct {
  2924  	s            *Service
  2925  	name         string
  2926  	urlParams_   gensupport.URLParams
  2927  	ifNoneMatch_ string
  2928  	ctx_         context.Context
  2929  	header_      http.Header
  2930  }
  2931  
  2932  // GetAccessApprovalSettings: Gets the settings associated with a project,
  2933  // folder, or organization.
  2934  //
  2935  //   - name: The name of the AccessApprovalSettings to retrieve. Format:
  2936  //     "{projects|folders|organizations}/{id}/accessApprovalSettings".
  2937  func (r *ProjectsService) GetAccessApprovalSettings(name string) *ProjectsGetAccessApprovalSettingsCall {
  2938  	c := &ProjectsGetAccessApprovalSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2939  	c.name = name
  2940  	return c
  2941  }
  2942  
  2943  // Fields allows partial responses to be retrieved. See
  2944  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2945  // details.
  2946  func (c *ProjectsGetAccessApprovalSettingsCall) Fields(s ...googleapi.Field) *ProjectsGetAccessApprovalSettingsCall {
  2947  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2948  	return c
  2949  }
  2950  
  2951  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2952  // object's ETag matches the given value. This is useful for getting updates
  2953  // only after the object has changed since the last request.
  2954  func (c *ProjectsGetAccessApprovalSettingsCall) IfNoneMatch(entityTag string) *ProjectsGetAccessApprovalSettingsCall {
  2955  	c.ifNoneMatch_ = entityTag
  2956  	return c
  2957  }
  2958  
  2959  // Context sets the context to be used in this call's Do method.
  2960  func (c *ProjectsGetAccessApprovalSettingsCall) Context(ctx context.Context) *ProjectsGetAccessApprovalSettingsCall {
  2961  	c.ctx_ = ctx
  2962  	return c
  2963  }
  2964  
  2965  // Header returns a http.Header that can be modified by the caller to add
  2966  // headers to the request.
  2967  func (c *ProjectsGetAccessApprovalSettingsCall) Header() http.Header {
  2968  	if c.header_ == nil {
  2969  		c.header_ = make(http.Header)
  2970  	}
  2971  	return c.header_
  2972  }
  2973  
  2974  func (c *ProjectsGetAccessApprovalSettingsCall) doRequest(alt string) (*http.Response, error) {
  2975  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2976  	if c.ifNoneMatch_ != "" {
  2977  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2978  	}
  2979  	var body io.Reader = nil
  2980  	c.urlParams_.Set("alt", alt)
  2981  	c.urlParams_.Set("prettyPrint", "false")
  2982  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  2983  	urls += "?" + c.urlParams_.Encode()
  2984  	req, err := http.NewRequest("GET", urls, body)
  2985  	if err != nil {
  2986  		return nil, err
  2987  	}
  2988  	req.Header = reqHeaders
  2989  	googleapi.Expand(req.URL, map[string]string{
  2990  		"name": c.name,
  2991  	})
  2992  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2993  }
  2994  
  2995  // Do executes the "accessapproval.projects.getAccessApprovalSettings" call.
  2996  // Any non-2xx status code is an error. Response headers are in either
  2997  // *AccessApprovalSettings.ServerResponse.Header or (if a response was returned
  2998  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2999  // check whether the returned error was because http.StatusNotModified was
  3000  // returned.
  3001  func (c *ProjectsGetAccessApprovalSettingsCall) Do(opts ...googleapi.CallOption) (*AccessApprovalSettings, error) {
  3002  	gensupport.SetOptions(c.urlParams_, opts...)
  3003  	res, err := c.doRequest("json")
  3004  	if res != nil && res.StatusCode == http.StatusNotModified {
  3005  		if res.Body != nil {
  3006  			res.Body.Close()
  3007  		}
  3008  		return nil, gensupport.WrapError(&googleapi.Error{
  3009  			Code:   res.StatusCode,
  3010  			Header: res.Header,
  3011  		})
  3012  	}
  3013  	if err != nil {
  3014  		return nil, err
  3015  	}
  3016  	defer googleapi.CloseBody(res)
  3017  	if err := googleapi.CheckResponse(res); err != nil {
  3018  		return nil, gensupport.WrapError(err)
  3019  	}
  3020  	ret := &AccessApprovalSettings{
  3021  		ServerResponse: googleapi.ServerResponse{
  3022  			Header:         res.Header,
  3023  			HTTPStatusCode: res.StatusCode,
  3024  		},
  3025  	}
  3026  	target := &ret
  3027  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3028  		return nil, err
  3029  	}
  3030  	return ret, nil
  3031  }
  3032  
  3033  type ProjectsGetServiceAccountCall struct {
  3034  	s            *Service
  3035  	name         string
  3036  	urlParams_   gensupport.URLParams
  3037  	ifNoneMatch_ string
  3038  	ctx_         context.Context
  3039  	header_      http.Header
  3040  }
  3041  
  3042  // GetServiceAccount: Retrieves the service account that is used by Access
  3043  // Approval to access KMS keys for signing approved approval requests.
  3044  //
  3045  // - name: Name of the AccessApprovalServiceAccount to retrieve.
  3046  func (r *ProjectsService) GetServiceAccount(name string) *ProjectsGetServiceAccountCall {
  3047  	c := &ProjectsGetServiceAccountCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3048  	c.name = name
  3049  	return c
  3050  }
  3051  
  3052  // Fields allows partial responses to be retrieved. See
  3053  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3054  // details.
  3055  func (c *ProjectsGetServiceAccountCall) Fields(s ...googleapi.Field) *ProjectsGetServiceAccountCall {
  3056  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3057  	return c
  3058  }
  3059  
  3060  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  3061  // object's ETag matches the given value. This is useful for getting updates
  3062  // only after the object has changed since the last request.
  3063  func (c *ProjectsGetServiceAccountCall) IfNoneMatch(entityTag string) *ProjectsGetServiceAccountCall {
  3064  	c.ifNoneMatch_ = entityTag
  3065  	return c
  3066  }
  3067  
  3068  // Context sets the context to be used in this call's Do method.
  3069  func (c *ProjectsGetServiceAccountCall) Context(ctx context.Context) *ProjectsGetServiceAccountCall {
  3070  	c.ctx_ = ctx
  3071  	return c
  3072  }
  3073  
  3074  // Header returns a http.Header that can be modified by the caller to add
  3075  // headers to the request.
  3076  func (c *ProjectsGetServiceAccountCall) Header() http.Header {
  3077  	if c.header_ == nil {
  3078  		c.header_ = make(http.Header)
  3079  	}
  3080  	return c.header_
  3081  }
  3082  
  3083  func (c *ProjectsGetServiceAccountCall) doRequest(alt string) (*http.Response, error) {
  3084  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3085  	if c.ifNoneMatch_ != "" {
  3086  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3087  	}
  3088  	var body io.Reader = nil
  3089  	c.urlParams_.Set("alt", alt)
  3090  	c.urlParams_.Set("prettyPrint", "false")
  3091  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  3092  	urls += "?" + c.urlParams_.Encode()
  3093  	req, err := http.NewRequest("GET", urls, body)
  3094  	if err != nil {
  3095  		return nil, err
  3096  	}
  3097  	req.Header = reqHeaders
  3098  	googleapi.Expand(req.URL, map[string]string{
  3099  		"name": c.name,
  3100  	})
  3101  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3102  }
  3103  
  3104  // Do executes the "accessapproval.projects.getServiceAccount" call.
  3105  // Any non-2xx status code is an error. Response headers are in either
  3106  // *AccessApprovalServiceAccount.ServerResponse.Header or (if a response was
  3107  // returned at all) in error.(*googleapi.Error).Header. Use
  3108  // googleapi.IsNotModified to check whether the returned error was because
  3109  // http.StatusNotModified was returned.
  3110  func (c *ProjectsGetServiceAccountCall) Do(opts ...googleapi.CallOption) (*AccessApprovalServiceAccount, error) {
  3111  	gensupport.SetOptions(c.urlParams_, opts...)
  3112  	res, err := c.doRequest("json")
  3113  	if res != nil && res.StatusCode == http.StatusNotModified {
  3114  		if res.Body != nil {
  3115  			res.Body.Close()
  3116  		}
  3117  		return nil, gensupport.WrapError(&googleapi.Error{
  3118  			Code:   res.StatusCode,
  3119  			Header: res.Header,
  3120  		})
  3121  	}
  3122  	if err != nil {
  3123  		return nil, err
  3124  	}
  3125  	defer googleapi.CloseBody(res)
  3126  	if err := googleapi.CheckResponse(res); err != nil {
  3127  		return nil, gensupport.WrapError(err)
  3128  	}
  3129  	ret := &AccessApprovalServiceAccount{
  3130  		ServerResponse: googleapi.ServerResponse{
  3131  			Header:         res.Header,
  3132  			HTTPStatusCode: res.StatusCode,
  3133  		},
  3134  	}
  3135  	target := &ret
  3136  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3137  		return nil, err
  3138  	}
  3139  	return ret, nil
  3140  }
  3141  
  3142  type ProjectsUpdateAccessApprovalSettingsCall struct {
  3143  	s                      *Service
  3144  	name                   string
  3145  	accessapprovalsettings *AccessApprovalSettings
  3146  	urlParams_             gensupport.URLParams
  3147  	ctx_                   context.Context
  3148  	header_                http.Header
  3149  }
  3150  
  3151  // UpdateAccessApprovalSettings: Updates the settings associated with a
  3152  // project, folder, or organization. Settings to update are determined by the
  3153  // value of field_mask.
  3154  //
  3155  //   - name: The resource name of the settings. Format is one of: *
  3156  //     "projects/{project}/accessApprovalSettings" *
  3157  //     "folders/{folder}/accessApprovalSettings" *
  3158  //     "organizations/{organization}/accessApprovalSettings".
  3159  func (r *ProjectsService) UpdateAccessApprovalSettings(name string, accessapprovalsettings *AccessApprovalSettings) *ProjectsUpdateAccessApprovalSettingsCall {
  3160  	c := &ProjectsUpdateAccessApprovalSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3161  	c.name = name
  3162  	c.accessapprovalsettings = accessapprovalsettings
  3163  	return c
  3164  }
  3165  
  3166  // UpdateMask sets the optional parameter "updateMask": The update mask applies
  3167  // to the settings. Only the top level fields of AccessApprovalSettings
  3168  // (notification_emails & enrolled_services) are supported. For each field, if
  3169  // it is included, the currently stored value will be entirely overwritten with
  3170  // the value of the field passed in this request. For the `FieldMask`
  3171  // definition, see
  3172  // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
  3173  // If this field is left unset, only the notification_emails field will be
  3174  // updated.
  3175  func (c *ProjectsUpdateAccessApprovalSettingsCall) UpdateMask(updateMask string) *ProjectsUpdateAccessApprovalSettingsCall {
  3176  	c.urlParams_.Set("updateMask", updateMask)
  3177  	return c
  3178  }
  3179  
  3180  // Fields allows partial responses to be retrieved. See
  3181  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3182  // details.
  3183  func (c *ProjectsUpdateAccessApprovalSettingsCall) Fields(s ...googleapi.Field) *ProjectsUpdateAccessApprovalSettingsCall {
  3184  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3185  	return c
  3186  }
  3187  
  3188  // Context sets the context to be used in this call's Do method.
  3189  func (c *ProjectsUpdateAccessApprovalSettingsCall) Context(ctx context.Context) *ProjectsUpdateAccessApprovalSettingsCall {
  3190  	c.ctx_ = ctx
  3191  	return c
  3192  }
  3193  
  3194  // Header returns a http.Header that can be modified by the caller to add
  3195  // headers to the request.
  3196  func (c *ProjectsUpdateAccessApprovalSettingsCall) Header() http.Header {
  3197  	if c.header_ == nil {
  3198  		c.header_ = make(http.Header)
  3199  	}
  3200  	return c.header_
  3201  }
  3202  
  3203  func (c *ProjectsUpdateAccessApprovalSettingsCall) doRequest(alt string) (*http.Response, error) {
  3204  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3205  	var body io.Reader = nil
  3206  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessapprovalsettings)
  3207  	if err != nil {
  3208  		return nil, err
  3209  	}
  3210  	c.urlParams_.Set("alt", alt)
  3211  	c.urlParams_.Set("prettyPrint", "false")
  3212  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  3213  	urls += "?" + c.urlParams_.Encode()
  3214  	req, err := http.NewRequest("PATCH", urls, body)
  3215  	if err != nil {
  3216  		return nil, err
  3217  	}
  3218  	req.Header = reqHeaders
  3219  	googleapi.Expand(req.URL, map[string]string{
  3220  		"name": c.name,
  3221  	})
  3222  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3223  }
  3224  
  3225  // Do executes the "accessapproval.projects.updateAccessApprovalSettings" call.
  3226  // Any non-2xx status code is an error. Response headers are in either
  3227  // *AccessApprovalSettings.ServerResponse.Header or (if a response was returned
  3228  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3229  // check whether the returned error was because http.StatusNotModified was
  3230  // returned.
  3231  func (c *ProjectsUpdateAccessApprovalSettingsCall) Do(opts ...googleapi.CallOption) (*AccessApprovalSettings, error) {
  3232  	gensupport.SetOptions(c.urlParams_, opts...)
  3233  	res, err := c.doRequest("json")
  3234  	if res != nil && res.StatusCode == http.StatusNotModified {
  3235  		if res.Body != nil {
  3236  			res.Body.Close()
  3237  		}
  3238  		return nil, gensupport.WrapError(&googleapi.Error{
  3239  			Code:   res.StatusCode,
  3240  			Header: res.Header,
  3241  		})
  3242  	}
  3243  	if err != nil {
  3244  		return nil, err
  3245  	}
  3246  	defer googleapi.CloseBody(res)
  3247  	if err := googleapi.CheckResponse(res); err != nil {
  3248  		return nil, gensupport.WrapError(err)
  3249  	}
  3250  	ret := &AccessApprovalSettings{
  3251  		ServerResponse: googleapi.ServerResponse{
  3252  			Header:         res.Header,
  3253  			HTTPStatusCode: res.StatusCode,
  3254  		},
  3255  	}
  3256  	target := &ret
  3257  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3258  		return nil, err
  3259  	}
  3260  	return ret, nil
  3261  }
  3262  
  3263  type ProjectsApprovalRequestsApproveCall struct {
  3264  	s                             *Service
  3265  	name                          string
  3266  	approveapprovalrequestmessage *ApproveApprovalRequestMessage
  3267  	urlParams_                    gensupport.URLParams
  3268  	ctx_                          context.Context
  3269  	header_                       http.Header
  3270  }
  3271  
  3272  // Approve: Approves a request and returns the updated ApprovalRequest. Returns
  3273  // NOT_FOUND if the request does not exist. Returns FAILED_PRECONDITION if the
  3274  // request exists but is not in a pending state.
  3275  //
  3276  // - name: Name of the approval request to approve.
  3277  func (r *ProjectsApprovalRequestsService) Approve(name string, approveapprovalrequestmessage *ApproveApprovalRequestMessage) *ProjectsApprovalRequestsApproveCall {
  3278  	c := &ProjectsApprovalRequestsApproveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3279  	c.name = name
  3280  	c.approveapprovalrequestmessage = approveapprovalrequestmessage
  3281  	return c
  3282  }
  3283  
  3284  // Fields allows partial responses to be retrieved. See
  3285  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3286  // details.
  3287  func (c *ProjectsApprovalRequestsApproveCall) Fields(s ...googleapi.Field) *ProjectsApprovalRequestsApproveCall {
  3288  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3289  	return c
  3290  }
  3291  
  3292  // Context sets the context to be used in this call's Do method.
  3293  func (c *ProjectsApprovalRequestsApproveCall) Context(ctx context.Context) *ProjectsApprovalRequestsApproveCall {
  3294  	c.ctx_ = ctx
  3295  	return c
  3296  }
  3297  
  3298  // Header returns a http.Header that can be modified by the caller to add
  3299  // headers to the request.
  3300  func (c *ProjectsApprovalRequestsApproveCall) Header() http.Header {
  3301  	if c.header_ == nil {
  3302  		c.header_ = make(http.Header)
  3303  	}
  3304  	return c.header_
  3305  }
  3306  
  3307  func (c *ProjectsApprovalRequestsApproveCall) doRequest(alt string) (*http.Response, error) {
  3308  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3309  	var body io.Reader = nil
  3310  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.approveapprovalrequestmessage)
  3311  	if err != nil {
  3312  		return nil, err
  3313  	}
  3314  	c.urlParams_.Set("alt", alt)
  3315  	c.urlParams_.Set("prettyPrint", "false")
  3316  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:approve")
  3317  	urls += "?" + c.urlParams_.Encode()
  3318  	req, err := http.NewRequest("POST", urls, body)
  3319  	if err != nil {
  3320  		return nil, err
  3321  	}
  3322  	req.Header = reqHeaders
  3323  	googleapi.Expand(req.URL, map[string]string{
  3324  		"name": c.name,
  3325  	})
  3326  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3327  }
  3328  
  3329  // Do executes the "accessapproval.projects.approvalRequests.approve" call.
  3330  // Any non-2xx status code is an error. Response headers are in either
  3331  // *ApprovalRequest.ServerResponse.Header or (if a response was returned at
  3332  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3333  // check whether the returned error was because http.StatusNotModified was
  3334  // returned.
  3335  func (c *ProjectsApprovalRequestsApproveCall) Do(opts ...googleapi.CallOption) (*ApprovalRequest, error) {
  3336  	gensupport.SetOptions(c.urlParams_, opts...)
  3337  	res, err := c.doRequest("json")
  3338  	if res != nil && res.StatusCode == http.StatusNotModified {
  3339  		if res.Body != nil {
  3340  			res.Body.Close()
  3341  		}
  3342  		return nil, gensupport.WrapError(&googleapi.Error{
  3343  			Code:   res.StatusCode,
  3344  			Header: res.Header,
  3345  		})
  3346  	}
  3347  	if err != nil {
  3348  		return nil, err
  3349  	}
  3350  	defer googleapi.CloseBody(res)
  3351  	if err := googleapi.CheckResponse(res); err != nil {
  3352  		return nil, gensupport.WrapError(err)
  3353  	}
  3354  	ret := &ApprovalRequest{
  3355  		ServerResponse: googleapi.ServerResponse{
  3356  			Header:         res.Header,
  3357  			HTTPStatusCode: res.StatusCode,
  3358  		},
  3359  	}
  3360  	target := &ret
  3361  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3362  		return nil, err
  3363  	}
  3364  	return ret, nil
  3365  }
  3366  
  3367  type ProjectsApprovalRequestsDismissCall struct {
  3368  	s                             *Service
  3369  	name                          string
  3370  	dismissapprovalrequestmessage *DismissApprovalRequestMessage
  3371  	urlParams_                    gensupport.URLParams
  3372  	ctx_                          context.Context
  3373  	header_                       http.Header
  3374  }
  3375  
  3376  // Dismiss: Dismisses a request. Returns the updated ApprovalRequest. NOTE:
  3377  // This does not deny access to the resource if another request has been made
  3378  // and approved. It is equivalent in effect to ignoring the request altogether.
  3379  // Returns NOT_FOUND if the request does not exist. Returns FAILED_PRECONDITION
  3380  // if the request exists but is not in a pending state.
  3381  //
  3382  // - name: Name of the ApprovalRequest to dismiss.
  3383  func (r *ProjectsApprovalRequestsService) Dismiss(name string, dismissapprovalrequestmessage *DismissApprovalRequestMessage) *ProjectsApprovalRequestsDismissCall {
  3384  	c := &ProjectsApprovalRequestsDismissCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3385  	c.name = name
  3386  	c.dismissapprovalrequestmessage = dismissapprovalrequestmessage
  3387  	return c
  3388  }
  3389  
  3390  // Fields allows partial responses to be retrieved. See
  3391  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3392  // details.
  3393  func (c *ProjectsApprovalRequestsDismissCall) Fields(s ...googleapi.Field) *ProjectsApprovalRequestsDismissCall {
  3394  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3395  	return c
  3396  }
  3397  
  3398  // Context sets the context to be used in this call's Do method.
  3399  func (c *ProjectsApprovalRequestsDismissCall) Context(ctx context.Context) *ProjectsApprovalRequestsDismissCall {
  3400  	c.ctx_ = ctx
  3401  	return c
  3402  }
  3403  
  3404  // Header returns a http.Header that can be modified by the caller to add
  3405  // headers to the request.
  3406  func (c *ProjectsApprovalRequestsDismissCall) Header() http.Header {
  3407  	if c.header_ == nil {
  3408  		c.header_ = make(http.Header)
  3409  	}
  3410  	return c.header_
  3411  }
  3412  
  3413  func (c *ProjectsApprovalRequestsDismissCall) doRequest(alt string) (*http.Response, error) {
  3414  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3415  	var body io.Reader = nil
  3416  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.dismissapprovalrequestmessage)
  3417  	if err != nil {
  3418  		return nil, err
  3419  	}
  3420  	c.urlParams_.Set("alt", alt)
  3421  	c.urlParams_.Set("prettyPrint", "false")
  3422  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:dismiss")
  3423  	urls += "?" + c.urlParams_.Encode()
  3424  	req, err := http.NewRequest("POST", urls, body)
  3425  	if err != nil {
  3426  		return nil, err
  3427  	}
  3428  	req.Header = reqHeaders
  3429  	googleapi.Expand(req.URL, map[string]string{
  3430  		"name": c.name,
  3431  	})
  3432  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3433  }
  3434  
  3435  // Do executes the "accessapproval.projects.approvalRequests.dismiss" call.
  3436  // Any non-2xx status code is an error. Response headers are in either
  3437  // *ApprovalRequest.ServerResponse.Header or (if a response was returned at
  3438  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3439  // check whether the returned error was because http.StatusNotModified was
  3440  // returned.
  3441  func (c *ProjectsApprovalRequestsDismissCall) Do(opts ...googleapi.CallOption) (*ApprovalRequest, error) {
  3442  	gensupport.SetOptions(c.urlParams_, opts...)
  3443  	res, err := c.doRequest("json")
  3444  	if res != nil && res.StatusCode == http.StatusNotModified {
  3445  		if res.Body != nil {
  3446  			res.Body.Close()
  3447  		}
  3448  		return nil, gensupport.WrapError(&googleapi.Error{
  3449  			Code:   res.StatusCode,
  3450  			Header: res.Header,
  3451  		})
  3452  	}
  3453  	if err != nil {
  3454  		return nil, err
  3455  	}
  3456  	defer googleapi.CloseBody(res)
  3457  	if err := googleapi.CheckResponse(res); err != nil {
  3458  		return nil, gensupport.WrapError(err)
  3459  	}
  3460  	ret := &ApprovalRequest{
  3461  		ServerResponse: googleapi.ServerResponse{
  3462  			Header:         res.Header,
  3463  			HTTPStatusCode: res.StatusCode,
  3464  		},
  3465  	}
  3466  	target := &ret
  3467  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3468  		return nil, err
  3469  	}
  3470  	return ret, nil
  3471  }
  3472  
  3473  type ProjectsApprovalRequestsGetCall struct {
  3474  	s            *Service
  3475  	name         string
  3476  	urlParams_   gensupport.URLParams
  3477  	ifNoneMatch_ string
  3478  	ctx_         context.Context
  3479  	header_      http.Header
  3480  }
  3481  
  3482  // Get: Gets an approval request. Returns NOT_FOUND if the request does not
  3483  // exist.
  3484  //
  3485  //   - name: The name of the approval request to retrieve. Format:
  3486  //     "{projects|folders|organizations}/{id}/approvalRequests/{approval_request}".
  3487  func (r *ProjectsApprovalRequestsService) Get(name string) *ProjectsApprovalRequestsGetCall {
  3488  	c := &ProjectsApprovalRequestsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3489  	c.name = name
  3490  	return c
  3491  }
  3492  
  3493  // Fields allows partial responses to be retrieved. See
  3494  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3495  // details.
  3496  func (c *ProjectsApprovalRequestsGetCall) Fields(s ...googleapi.Field) *ProjectsApprovalRequestsGetCall {
  3497  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3498  	return c
  3499  }
  3500  
  3501  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  3502  // object's ETag matches the given value. This is useful for getting updates
  3503  // only after the object has changed since the last request.
  3504  func (c *ProjectsApprovalRequestsGetCall) IfNoneMatch(entityTag string) *ProjectsApprovalRequestsGetCall {
  3505  	c.ifNoneMatch_ = entityTag
  3506  	return c
  3507  }
  3508  
  3509  // Context sets the context to be used in this call's Do method.
  3510  func (c *ProjectsApprovalRequestsGetCall) Context(ctx context.Context) *ProjectsApprovalRequestsGetCall {
  3511  	c.ctx_ = ctx
  3512  	return c
  3513  }
  3514  
  3515  // Header returns a http.Header that can be modified by the caller to add
  3516  // headers to the request.
  3517  func (c *ProjectsApprovalRequestsGetCall) Header() http.Header {
  3518  	if c.header_ == nil {
  3519  		c.header_ = make(http.Header)
  3520  	}
  3521  	return c.header_
  3522  }
  3523  
  3524  func (c *ProjectsApprovalRequestsGetCall) doRequest(alt string) (*http.Response, error) {
  3525  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3526  	if c.ifNoneMatch_ != "" {
  3527  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3528  	}
  3529  	var body io.Reader = nil
  3530  	c.urlParams_.Set("alt", alt)
  3531  	c.urlParams_.Set("prettyPrint", "false")
  3532  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  3533  	urls += "?" + c.urlParams_.Encode()
  3534  	req, err := http.NewRequest("GET", urls, body)
  3535  	if err != nil {
  3536  		return nil, err
  3537  	}
  3538  	req.Header = reqHeaders
  3539  	googleapi.Expand(req.URL, map[string]string{
  3540  		"name": c.name,
  3541  	})
  3542  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3543  }
  3544  
  3545  // Do executes the "accessapproval.projects.approvalRequests.get" call.
  3546  // Any non-2xx status code is an error. Response headers are in either
  3547  // *ApprovalRequest.ServerResponse.Header or (if a response was returned at
  3548  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3549  // check whether the returned error was because http.StatusNotModified was
  3550  // returned.
  3551  func (c *ProjectsApprovalRequestsGetCall) Do(opts ...googleapi.CallOption) (*ApprovalRequest, error) {
  3552  	gensupport.SetOptions(c.urlParams_, opts...)
  3553  	res, err := c.doRequest("json")
  3554  	if res != nil && res.StatusCode == http.StatusNotModified {
  3555  		if res.Body != nil {
  3556  			res.Body.Close()
  3557  		}
  3558  		return nil, gensupport.WrapError(&googleapi.Error{
  3559  			Code:   res.StatusCode,
  3560  			Header: res.Header,
  3561  		})
  3562  	}
  3563  	if err != nil {
  3564  		return nil, err
  3565  	}
  3566  	defer googleapi.CloseBody(res)
  3567  	if err := googleapi.CheckResponse(res); err != nil {
  3568  		return nil, gensupport.WrapError(err)
  3569  	}
  3570  	ret := &ApprovalRequest{
  3571  		ServerResponse: googleapi.ServerResponse{
  3572  			Header:         res.Header,
  3573  			HTTPStatusCode: res.StatusCode,
  3574  		},
  3575  	}
  3576  	target := &ret
  3577  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3578  		return nil, err
  3579  	}
  3580  	return ret, nil
  3581  }
  3582  
  3583  type ProjectsApprovalRequestsInvalidateCall struct {
  3584  	s                                *Service
  3585  	name                             string
  3586  	invalidateapprovalrequestmessage *InvalidateApprovalRequestMessage
  3587  	urlParams_                       gensupport.URLParams
  3588  	ctx_                             context.Context
  3589  	header_                          http.Header
  3590  }
  3591  
  3592  // Invalidate: Invalidates an existing ApprovalRequest. Returns the updated
  3593  // ApprovalRequest. NOTE: This does not deny access to the resource if another
  3594  // request has been made and approved. It only invalidates a single approval.
  3595  // Returns FAILED_PRECONDITION if the request exists but is not in an approved
  3596  // state.
  3597  //
  3598  // - name: Name of the ApprovalRequest to invalidate.
  3599  func (r *ProjectsApprovalRequestsService) Invalidate(name string, invalidateapprovalrequestmessage *InvalidateApprovalRequestMessage) *ProjectsApprovalRequestsInvalidateCall {
  3600  	c := &ProjectsApprovalRequestsInvalidateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3601  	c.name = name
  3602  	c.invalidateapprovalrequestmessage = invalidateapprovalrequestmessage
  3603  	return c
  3604  }
  3605  
  3606  // Fields allows partial responses to be retrieved. See
  3607  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3608  // details.
  3609  func (c *ProjectsApprovalRequestsInvalidateCall) Fields(s ...googleapi.Field) *ProjectsApprovalRequestsInvalidateCall {
  3610  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3611  	return c
  3612  }
  3613  
  3614  // Context sets the context to be used in this call's Do method.
  3615  func (c *ProjectsApprovalRequestsInvalidateCall) Context(ctx context.Context) *ProjectsApprovalRequestsInvalidateCall {
  3616  	c.ctx_ = ctx
  3617  	return c
  3618  }
  3619  
  3620  // Header returns a http.Header that can be modified by the caller to add
  3621  // headers to the request.
  3622  func (c *ProjectsApprovalRequestsInvalidateCall) Header() http.Header {
  3623  	if c.header_ == nil {
  3624  		c.header_ = make(http.Header)
  3625  	}
  3626  	return c.header_
  3627  }
  3628  
  3629  func (c *ProjectsApprovalRequestsInvalidateCall) doRequest(alt string) (*http.Response, error) {
  3630  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3631  	var body io.Reader = nil
  3632  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.invalidateapprovalrequestmessage)
  3633  	if err != nil {
  3634  		return nil, err
  3635  	}
  3636  	c.urlParams_.Set("alt", alt)
  3637  	c.urlParams_.Set("prettyPrint", "false")
  3638  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:invalidate")
  3639  	urls += "?" + c.urlParams_.Encode()
  3640  	req, err := http.NewRequest("POST", urls, body)
  3641  	if err != nil {
  3642  		return nil, err
  3643  	}
  3644  	req.Header = reqHeaders
  3645  	googleapi.Expand(req.URL, map[string]string{
  3646  		"name": c.name,
  3647  	})
  3648  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3649  }
  3650  
  3651  // Do executes the "accessapproval.projects.approvalRequests.invalidate" call.
  3652  // Any non-2xx status code is an error. Response headers are in either
  3653  // *ApprovalRequest.ServerResponse.Header or (if a response was returned at
  3654  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3655  // check whether the returned error was because http.StatusNotModified was
  3656  // returned.
  3657  func (c *ProjectsApprovalRequestsInvalidateCall) Do(opts ...googleapi.CallOption) (*ApprovalRequest, error) {
  3658  	gensupport.SetOptions(c.urlParams_, opts...)
  3659  	res, err := c.doRequest("json")
  3660  	if res != nil && res.StatusCode == http.StatusNotModified {
  3661  		if res.Body != nil {
  3662  			res.Body.Close()
  3663  		}
  3664  		return nil, gensupport.WrapError(&googleapi.Error{
  3665  			Code:   res.StatusCode,
  3666  			Header: res.Header,
  3667  		})
  3668  	}
  3669  	if err != nil {
  3670  		return nil, err
  3671  	}
  3672  	defer googleapi.CloseBody(res)
  3673  	if err := googleapi.CheckResponse(res); err != nil {
  3674  		return nil, gensupport.WrapError(err)
  3675  	}
  3676  	ret := &ApprovalRequest{
  3677  		ServerResponse: googleapi.ServerResponse{
  3678  			Header:         res.Header,
  3679  			HTTPStatusCode: res.StatusCode,
  3680  		},
  3681  	}
  3682  	target := &ret
  3683  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3684  		return nil, err
  3685  	}
  3686  	return ret, nil
  3687  }
  3688  
  3689  type ProjectsApprovalRequestsListCall struct {
  3690  	s            *Service
  3691  	parent       string
  3692  	urlParams_   gensupport.URLParams
  3693  	ifNoneMatch_ string
  3694  	ctx_         context.Context
  3695  	header_      http.Header
  3696  }
  3697  
  3698  // List: Lists approval requests associated with a project, folder, or
  3699  // organization. Approval requests can be filtered by state (pending, active,
  3700  // dismissed). The order is reverse chronological.
  3701  //
  3702  //   - parent: The parent resource. This may be "projects/{project}",
  3703  //     "folders/{folder}", or "organizations/{organization}".
  3704  func (r *ProjectsApprovalRequestsService) List(parent string) *ProjectsApprovalRequestsListCall {
  3705  	c := &ProjectsApprovalRequestsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3706  	c.parent = parent
  3707  	return c
  3708  }
  3709  
  3710  // Filter sets the optional parameter "filter": A filter on the type of
  3711  // approval requests to retrieve. Must be one of the following values: * [not
  3712  // set]: Requests that are pending or have active approvals. * ALL: All
  3713  // requests. * PENDING: Only pending requests. * ACTIVE: Only active (i.e.
  3714  // currently approved) requests. * DISMISSED: Only requests that have been
  3715  // dismissed, or requests that are not approved and past expiration. * EXPIRED:
  3716  // Only requests that have been approved, and the approval has expired. *
  3717  // HISTORY: Active, dismissed and expired requests.
  3718  func (c *ProjectsApprovalRequestsListCall) Filter(filter string) *ProjectsApprovalRequestsListCall {
  3719  	c.urlParams_.Set("filter", filter)
  3720  	return c
  3721  }
  3722  
  3723  // PageSize sets the optional parameter "pageSize": Requested page size.
  3724  func (c *ProjectsApprovalRequestsListCall) PageSize(pageSize int64) *ProjectsApprovalRequestsListCall {
  3725  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  3726  	return c
  3727  }
  3728  
  3729  // PageToken sets the optional parameter "pageToken": A token identifying the
  3730  // page of results to return.
  3731  func (c *ProjectsApprovalRequestsListCall) PageToken(pageToken string) *ProjectsApprovalRequestsListCall {
  3732  	c.urlParams_.Set("pageToken", pageToken)
  3733  	return c
  3734  }
  3735  
  3736  // Fields allows partial responses to be retrieved. See
  3737  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3738  // details.
  3739  func (c *ProjectsApprovalRequestsListCall) Fields(s ...googleapi.Field) *ProjectsApprovalRequestsListCall {
  3740  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3741  	return c
  3742  }
  3743  
  3744  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  3745  // object's ETag matches the given value. This is useful for getting updates
  3746  // only after the object has changed since the last request.
  3747  func (c *ProjectsApprovalRequestsListCall) IfNoneMatch(entityTag string) *ProjectsApprovalRequestsListCall {
  3748  	c.ifNoneMatch_ = entityTag
  3749  	return c
  3750  }
  3751  
  3752  // Context sets the context to be used in this call's Do method.
  3753  func (c *ProjectsApprovalRequestsListCall) Context(ctx context.Context) *ProjectsApprovalRequestsListCall {
  3754  	c.ctx_ = ctx
  3755  	return c
  3756  }
  3757  
  3758  // Header returns a http.Header that can be modified by the caller to add
  3759  // headers to the request.
  3760  func (c *ProjectsApprovalRequestsListCall) Header() http.Header {
  3761  	if c.header_ == nil {
  3762  		c.header_ = make(http.Header)
  3763  	}
  3764  	return c.header_
  3765  }
  3766  
  3767  func (c *ProjectsApprovalRequestsListCall) doRequest(alt string) (*http.Response, error) {
  3768  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3769  	if c.ifNoneMatch_ != "" {
  3770  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3771  	}
  3772  	var body io.Reader = nil
  3773  	c.urlParams_.Set("alt", alt)
  3774  	c.urlParams_.Set("prettyPrint", "false")
  3775  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/approvalRequests")
  3776  	urls += "?" + c.urlParams_.Encode()
  3777  	req, err := http.NewRequest("GET", urls, body)
  3778  	if err != nil {
  3779  		return nil, err
  3780  	}
  3781  	req.Header = reqHeaders
  3782  	googleapi.Expand(req.URL, map[string]string{
  3783  		"parent": c.parent,
  3784  	})
  3785  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3786  }
  3787  
  3788  // Do executes the "accessapproval.projects.approvalRequests.list" call.
  3789  // Any non-2xx status code is an error. Response headers are in either
  3790  // *ListApprovalRequestsResponse.ServerResponse.Header or (if a response was
  3791  // returned at all) in error.(*googleapi.Error).Header. Use
  3792  // googleapi.IsNotModified to check whether the returned error was because
  3793  // http.StatusNotModified was returned.
  3794  func (c *ProjectsApprovalRequestsListCall) Do(opts ...googleapi.CallOption) (*ListApprovalRequestsResponse, error) {
  3795  	gensupport.SetOptions(c.urlParams_, opts...)
  3796  	res, err := c.doRequest("json")
  3797  	if res != nil && res.StatusCode == http.StatusNotModified {
  3798  		if res.Body != nil {
  3799  			res.Body.Close()
  3800  		}
  3801  		return nil, gensupport.WrapError(&googleapi.Error{
  3802  			Code:   res.StatusCode,
  3803  			Header: res.Header,
  3804  		})
  3805  	}
  3806  	if err != nil {
  3807  		return nil, err
  3808  	}
  3809  	defer googleapi.CloseBody(res)
  3810  	if err := googleapi.CheckResponse(res); err != nil {
  3811  		return nil, gensupport.WrapError(err)
  3812  	}
  3813  	ret := &ListApprovalRequestsResponse{
  3814  		ServerResponse: googleapi.ServerResponse{
  3815  			Header:         res.Header,
  3816  			HTTPStatusCode: res.StatusCode,
  3817  		},
  3818  	}
  3819  	target := &ret
  3820  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3821  		return nil, err
  3822  	}
  3823  	return ret, nil
  3824  }
  3825  
  3826  // Pages invokes f for each page of results.
  3827  // A non-nil error returned from f will halt the iteration.
  3828  // The provided context supersedes any context provided to the Context method.
  3829  func (c *ProjectsApprovalRequestsListCall) Pages(ctx context.Context, f func(*ListApprovalRequestsResponse) error) error {
  3830  	c.ctx_ = ctx
  3831  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  3832  	for {
  3833  		x, err := c.Do()
  3834  		if err != nil {
  3835  			return err
  3836  		}
  3837  		if err := f(x); err != nil {
  3838  			return err
  3839  		}
  3840  		if x.NextPageToken == "" {
  3841  			return nil
  3842  		}
  3843  		c.PageToken(x.NextPageToken)
  3844  	}
  3845  }
  3846  

View as plain text