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 cloudfunctions provides access to the Cloud Functions API. 8 // 9 // For product documentation, see: https://cloud.google.com/functions 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/cloudfunctions/v1" 27 // ... 28 // ctx := context.Background() 29 // cloudfunctionsService, err := cloudfunctions.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 // cloudfunctionsService, err := cloudfunctions.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 // cloudfunctionsService, err := cloudfunctions.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 49 // 50 // See [google.golang.org/api/option.ClientOption] for details on options. 51 package cloudfunctions // import "google.golang.org/api/cloudfunctions/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 = "cloudfunctions:v1" 90 const apiName = "cloudfunctions" 91 const apiVersion = "v1" 92 const basePath = "https://cloudfunctions.googleapis.com/" 93 const basePathTemplate = "https://cloudfunctions.UNIVERSE_DOMAIN/" 94 const mtlsBasePath = "https://cloudfunctions.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.Operations = NewOperationsService(s) 139 s.Projects = NewProjectsService(s) 140 return s, nil 141 } 142 143 type Service struct { 144 client *http.Client 145 BasePath string // API endpoint base URL 146 UserAgent string // optional additional User-Agent fragment 147 148 Operations *OperationsService 149 150 Projects *ProjectsService 151 } 152 153 func (s *Service) userAgent() string { 154 if s.UserAgent == "" { 155 return googleapi.UserAgent 156 } 157 return googleapi.UserAgent + " " + s.UserAgent 158 } 159 160 func NewOperationsService(s *Service) *OperationsService { 161 rs := &OperationsService{s: s} 162 return rs 163 } 164 165 type OperationsService struct { 166 s *Service 167 } 168 169 func NewProjectsService(s *Service) *ProjectsService { 170 rs := &ProjectsService{s: s} 171 rs.Locations = NewProjectsLocationsService(s) 172 return rs 173 } 174 175 type ProjectsService struct { 176 s *Service 177 178 Locations *ProjectsLocationsService 179 } 180 181 func NewProjectsLocationsService(s *Service) *ProjectsLocationsService { 182 rs := &ProjectsLocationsService{s: s} 183 rs.Functions = NewProjectsLocationsFunctionsService(s) 184 return rs 185 } 186 187 type ProjectsLocationsService struct { 188 s *Service 189 190 Functions *ProjectsLocationsFunctionsService 191 } 192 193 func NewProjectsLocationsFunctionsService(s *Service) *ProjectsLocationsFunctionsService { 194 rs := &ProjectsLocationsFunctionsService{s: s} 195 return rs 196 } 197 198 type ProjectsLocationsFunctionsService struct { 199 s *Service 200 } 201 202 // AuditConfig: Specifies the audit configuration for a service. The 203 // configuration determines which permission types are logged, and what 204 // identities, if any, are exempted from logging. An AuditConfig must have one 205 // or more AuditLogConfigs. If there are AuditConfigs for both `allServices` 206 // and a specific service, the union of the two AuditConfigs is used for that 207 // service: the log_types specified in each AuditConfig are enabled, and the 208 // exempted_members in each AuditLogConfig are exempted. Example Policy with 209 // multiple AuditConfigs: { "audit_configs": [ { "service": "allServices", 210 // "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ 211 // "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" }, { "log_type": 212 // "ADMIN_READ" } ] }, { "service": "sampleservice.googleapis.com", 213 // "audit_log_configs": [ { "log_type": "DATA_READ" }, { "log_type": 214 // "DATA_WRITE", "exempted_members": [ "user:aliya@example.com" ] } ] } ] } For 215 // sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ 216 // logging. It also exempts `jose@example.com` from DATA_READ logging, and 217 // `aliya@example.com` from DATA_WRITE logging. 218 type AuditConfig struct { 219 // AuditLogConfigs: The configuration for logging of each type of permission. 220 AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"` 221 // Service: Specifies a service that will be enabled for audit logging. For 222 // example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` 223 // is a special value that covers all services. 224 Service string `json:"service,omitempty"` 225 // ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to 226 // unconditionally include in API requests. By default, fields with empty or 227 // default values are omitted from API requests. See 228 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 229 // details. 230 ForceSendFields []string `json:"-"` 231 // NullFields is a list of field names (e.g. "AuditLogConfigs") to include in 232 // API requests with the JSON null value. By default, fields with empty values 233 // are omitted from API requests. See 234 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 235 NullFields []string `json:"-"` 236 } 237 238 func (s *AuditConfig) MarshalJSON() ([]byte, error) { 239 type NoMethod AuditConfig 240 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 241 } 242 243 // AuditLogConfig: Provides the configuration for logging a type of 244 // permissions. Example: { "audit_log_configs": [ { "log_type": "DATA_READ", 245 // "exempted_members": [ "user:jose@example.com" ] }, { "log_type": 246 // "DATA_WRITE" } ] } This enables 'DATA_READ' and 'DATA_WRITE' logging, while 247 // exempting jose@example.com from DATA_READ logging. 248 type AuditLogConfig struct { 249 // ExemptedMembers: Specifies the identities that do not cause logging for this 250 // type of permission. Follows the same format of Binding.members. 251 ExemptedMembers []string `json:"exemptedMembers,omitempty"` 252 // LogType: The log type that this config enables. 253 // 254 // Possible values: 255 // "LOG_TYPE_UNSPECIFIED" - Default case. Should never be this. 256 // "ADMIN_READ" - Admin reads. Example: CloudIAM getIamPolicy 257 // "DATA_WRITE" - Data writes. Example: CloudSQL Users create 258 // "DATA_READ" - Data reads. Example: CloudSQL Users list 259 LogType string `json:"logType,omitempty"` 260 // ForceSendFields is a list of field names (e.g. "ExemptedMembers") to 261 // unconditionally include in API requests. By default, fields with empty or 262 // default values are omitted from API requests. See 263 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 264 // details. 265 ForceSendFields []string `json:"-"` 266 // NullFields is a list of field names (e.g. "ExemptedMembers") to include in 267 // API requests with the JSON null value. By default, fields with empty values 268 // are omitted from API requests. See 269 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 270 NullFields []string `json:"-"` 271 } 272 273 func (s *AuditLogConfig) MarshalJSON() ([]byte, error) { 274 type NoMethod AuditLogConfig 275 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 276 } 277 278 // AutomaticUpdatePolicy: Security patches are applied automatically to the 279 // runtime without requiring the function to be redeployed. 280 type AutomaticUpdatePolicy struct { 281 } 282 283 // Binding: Associates `members`, or principals, with a `role`. 284 type Binding struct { 285 // Condition: The condition that is associated with this binding. If the 286 // condition evaluates to `true`, then this binding applies to the current 287 // request. If the condition evaluates to `false`, then this binding does not 288 // apply to the current request. However, a different role binding might grant 289 // the same role to one or more of the principals in this binding. To learn 290 // which resources support conditions in their IAM policies, see the IAM 291 // documentation 292 // (https://cloud.google.com/iam/help/conditions/resource-policies). 293 Condition *Expr `json:"condition,omitempty"` 294 // Members: Specifies the principals requesting access for a Google Cloud 295 // resource. `members` can have the following values: * `allUsers`: A special 296 // identifier that represents anyone who is on the internet; with or without a 297 // Google account. * `allAuthenticatedUsers`: A special identifier that 298 // represents anyone who is authenticated with a Google account or a service 299 // account. Does not include identities that come from external identity 300 // providers (IdPs) through identity federation. * `user:{emailid}`: An email 301 // address that represents a specific Google account. For example, 302 // `alice@example.com` . * `serviceAccount:{emailid}`: An email address that 303 // represents a Google service account. For example, 304 // `my-other-app@appspot.gserviceaccount.com`. * 305 // `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An 306 // identifier for a Kubernetes service account 307 // (https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). 308 // For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * 309 // `group:{emailid}`: An email address that represents a Google group. For 310 // example, `admins@example.com`. * `domain:{domain}`: The G Suite domain 311 // (primary) that represents all the users of that domain. For example, 312 // `google.com` or `example.com`. * 313 // `principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/sub 314 // ject/{subject_attribute_value}`: A single identity in a workforce identity 315 // pool. * 316 // `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/ 317 // group/{group_id}`: All workforce identities in a group. * 318 // `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/ 319 // attribute.{attribute_name}/{attribute_value}`: All workforce identities with 320 // a specific attribute value. * 321 // `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/ 322 // *`: All identities in a workforce identity pool. * 323 // `principal://iam.googleapis.com/projects/{project_number}/locations/global/wo 324 // rkloadIdentityPools/{pool_id}/subject/{subject_attribute_value}`: A single 325 // identity in a workload identity pool. * 326 // `principalSet://iam.googleapis.com/projects/{project_number}/locations/global 327 // /workloadIdentityPools/{pool_id}/group/{group_id}`: A workload identity pool 328 // group. * 329 // `principalSet://iam.googleapis.com/projects/{project_number}/locations/global 330 // /workloadIdentityPools/{pool_id}/attribute.{attribute_name}/{attribute_value} 331 // `: All identities in a workload identity pool with a certain attribute. * 332 // `principalSet://iam.googleapis.com/projects/{project_number}/locations/global 333 // /workloadIdentityPools/{pool_id}/*`: All identities in a workload identity 334 // pool. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus 335 // unique identifier) representing a user that has been recently deleted. For 336 // example, `alice@example.com?uid=123456789012345678901`. If the user is 337 // recovered, this value reverts to `user:{emailid}` and the recovered user 338 // retains the role in the binding. * 339 // `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus 340 // unique identifier) representing a service account that has been recently 341 // deleted. For example, 342 // `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the 343 // service account is undeleted, this value reverts to 344 // `serviceAccount:{emailid}` and the undeleted service account retains the 345 // role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email 346 // address (plus unique identifier) representing a Google group that has been 347 // recently deleted. For example, 348 // `admins@example.com?uid=123456789012345678901`. If the group is recovered, 349 // this value reverts to `group:{emailid}` and the recovered group retains the 350 // role in the binding. * 351 // `deleted:principal://iam.googleapis.com/locations/global/workforcePools/{pool 352 // _id}/subject/{subject_attribute_value}`: Deleted single identity in a 353 // workforce identity pool. For example, 354 // `deleted:principal://iam.googleapis.com/locations/global/workforcePools/my-po 355 // ol-id/subject/my-subject-attribute-value`. 356 Members []string `json:"members,omitempty"` 357 // Role: Role that is assigned to the list of `members`, or principals. For 358 // example, `roles/viewer`, `roles/editor`, or `roles/owner`. For an overview 359 // of the IAM roles and permissions, see the IAM documentation 360 // (https://cloud.google.com/iam/docs/roles-overview). For a list of the 361 // available pre-defined roles, see here 362 // (https://cloud.google.com/iam/docs/understanding-roles). 363 Role string `json:"role,omitempty"` 364 // ForceSendFields is a list of field names (e.g. "Condition") to 365 // unconditionally include in API requests. By default, fields with empty or 366 // default values are omitted from API requests. See 367 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 368 // details. 369 ForceSendFields []string `json:"-"` 370 // NullFields is a list of field names (e.g. "Condition") to include in API 371 // requests with the JSON null value. By default, fields with empty values are 372 // omitted from API requests. See 373 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 374 NullFields []string `json:"-"` 375 } 376 377 func (s *Binding) MarshalJSON() ([]byte, error) { 378 type NoMethod Binding 379 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 380 } 381 382 // CallFunctionRequest: Request for the `CallFunction` method. 383 type CallFunctionRequest struct { 384 // Data: Required. Input to be passed to the function. 385 Data string `json:"data,omitempty"` 386 // ForceSendFields is a list of field names (e.g. "Data") to unconditionally 387 // include in API requests. By default, fields with empty or default values are 388 // omitted from API requests. See 389 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 390 // details. 391 ForceSendFields []string `json:"-"` 392 // NullFields is a list of field names (e.g. "Data") to include in API requests 393 // with the JSON null value. By default, fields with empty values are omitted 394 // from API requests. See 395 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 396 NullFields []string `json:"-"` 397 } 398 399 func (s *CallFunctionRequest) MarshalJSON() ([]byte, error) { 400 type NoMethod CallFunctionRequest 401 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 402 } 403 404 // CallFunctionResponse: Response of `CallFunction` method. 405 type CallFunctionResponse struct { 406 // Error: Either system or user-function generated error. Set if execution was 407 // not successful. 408 Error string `json:"error,omitempty"` 409 // ExecutionId: Execution id of function invocation. 410 ExecutionId string `json:"executionId,omitempty"` 411 // Result: Result populated for successful execution of synchronous function. 412 // Will not be populated if function does not return a result through context. 413 Result string `json:"result,omitempty"` 414 415 // ServerResponse contains the HTTP response code and headers from the server. 416 googleapi.ServerResponse `json:"-"` 417 // ForceSendFields is a list of field names (e.g. "Error") to unconditionally 418 // include in API requests. By default, fields with empty or default values are 419 // omitted from API requests. See 420 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 421 // details. 422 ForceSendFields []string `json:"-"` 423 // NullFields is a list of field names (e.g. "Error") to include in API 424 // requests with the JSON null value. By default, fields with empty values are 425 // omitted from API requests. See 426 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 427 NullFields []string `json:"-"` 428 } 429 430 func (s *CallFunctionResponse) MarshalJSON() ([]byte, error) { 431 type NoMethod CallFunctionResponse 432 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 433 } 434 435 // CloudFunction: Describes a Cloud Function that contains user computation 436 // executed in response to an event. It encapsulate function and triggers 437 // configurations. 438 type CloudFunction struct { 439 AutomaticUpdatePolicy *AutomaticUpdatePolicy `json:"automaticUpdatePolicy,omitempty"` 440 // AvailableMemoryMb: The amount of memory in MB available for a function. 441 // Defaults to 256MB. 442 AvailableMemoryMb int64 `json:"availableMemoryMb,omitempty"` 443 // BuildEnvironmentVariables: Build environment variables that shall be 444 // available during build time. 445 BuildEnvironmentVariables map[string]string `json:"buildEnvironmentVariables,omitempty"` 446 // BuildId: Output only. The Cloud Build ID of the latest successful deployment 447 // of the function. 448 BuildId string `json:"buildId,omitempty"` 449 // BuildName: Output only. The Cloud Build Name of the function deployment. 450 // `projects//locations//builds/`. 451 BuildName string `json:"buildName,omitempty"` 452 // BuildServiceAccount: Optional. A service account the user provides for use 453 // with Cloud Build. 454 BuildServiceAccount string `json:"buildServiceAccount,omitempty"` 455 // BuildWorkerPool: Name of the Cloud Build Custom Worker Pool that should be 456 // used to build the function. The format of this field is 457 // `projects/{project}/locations/{region}/workerPools/{workerPool}` where 458 // `{project}` and `{region}` are the project id and region respectively where 459 // the worker pool is defined and `{workerPool}` is the short name of the 460 // worker pool. If the project id is not the same as the function, then the 461 // Cloud Functions Service Agent 462 // (`service-@gcf-admin-robot.iam.gserviceaccount.com`) must be granted the 463 // role Cloud Build Custom Workers Builder 464 // (`roles/cloudbuild.customworkers.builder`) in the project. 465 BuildWorkerPool string `json:"buildWorkerPool,omitempty"` 466 // Description: User-provided description of a function. 467 Description string `json:"description,omitempty"` 468 // DockerRegistry: Docker Registry to use for this deployment. If unspecified, 469 // it defaults to `ARTIFACT_REGISTRY`. If `docker_repository` field is 470 // specified, this field should either be left unspecified or set to 471 // `ARTIFACT_REGISTRY`. 472 // 473 // Possible values: 474 // "DOCKER_REGISTRY_UNSPECIFIED" - Unspecified. 475 // "CONTAINER_REGISTRY" - Docker images will be stored in multi-regional 476 // Container Registry repositories named `gcf`. 477 // "ARTIFACT_REGISTRY" - Docker images will be stored in regional Artifact 478 // Registry repositories. By default, GCF will create and use repositories 479 // named `gcf-artifacts` in every region in which a function is deployed. But 480 // the repository to use can also be specified by the user using the 481 // `docker_repository` field. 482 DockerRegistry string `json:"dockerRegistry,omitempty"` 483 // DockerRepository: User-managed repository created in Artifact Registry to 484 // which the function's Docker image will be pushed after it is built by Cloud 485 // Build. May optionally be encrypted with a customer-managed encryption key 486 // (CMEK). If unspecified and `docker_registry` is not explicitly set to 487 // `CONTAINER_REGISTRY`, GCF will create and use a default Artifact Registry 488 // repository named 'gcf-artifacts' in the region. It must match the pattern 489 // `projects/{project}/locations/{location}/repositories/{repository}`. 490 // Cross-project repositories are not supported. Cross-location repositories 491 // are not supported. Repository format must be 'DOCKER'. 492 DockerRepository string `json:"dockerRepository,omitempty"` 493 // EntryPoint: The name of the function (as defined in source code) that will 494 // be executed. Defaults to the resource name suffix (ID of the function), if 495 // not specified. 496 EntryPoint string `json:"entryPoint,omitempty"` 497 // EnvironmentVariables: Environment variables that shall be available during 498 // function execution. 499 EnvironmentVariables map[string]string `json:"environmentVariables,omitempty"` 500 // EventTrigger: A source that fires events in response to a condition in 501 // another service. 502 EventTrigger *EventTrigger `json:"eventTrigger,omitempty"` 503 // HttpsTrigger: An HTTPS endpoint type of source that can be triggered via 504 // URL. 505 HttpsTrigger *HttpsTrigger `json:"httpsTrigger,omitempty"` 506 // IngressSettings: The ingress settings for the function, controlling what 507 // traffic can reach it. 508 // 509 // Possible values: 510 // "INGRESS_SETTINGS_UNSPECIFIED" - Unspecified. 511 // "ALLOW_ALL" - Allow HTTP traffic from public and private sources. 512 // "ALLOW_INTERNAL_ONLY" - Allow HTTP traffic from only private VPC sources. 513 // "ALLOW_INTERNAL_AND_GCLB" - Allow HTTP traffic from private VPC sources 514 // and through GCLB. 515 IngressSettings string `json:"ingressSettings,omitempty"` 516 // KmsKeyName: Resource name of a KMS crypto key (managed by the user) used to 517 // encrypt/decrypt function resources. It must match the pattern 518 // `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{cryp 519 // to_key}`. If specified, you must also provide an artifact registry 520 // repository using the `docker_repository` field that was created with the 521 // same KMS crypto key. The following service accounts need to be granted the 522 // role 'Cloud KMS CryptoKey Encrypter/Decrypter 523 // (roles/cloudkms.cryptoKeyEncrypterDecrypter)' on the 524 // Key/KeyRing/Project/Organization (least access preferred). 1. Google Cloud 525 // Functions service account 526 // (service-{project_number}@gcf-admin-robot.iam.gserviceaccount.com) - 527 // Required to protect the function's image. 2. Google Storage service account 528 // (service-{project_number}@gs-project-accounts.iam.gserviceaccount.com) - 529 // Required to protect the function's source code. If this service account does 530 // not exist, deploying a function without a KMS key or retrieving the service 531 // agent name provisions it. For more information, see 532 // https://cloud.google.com/storage/docs/projects#service-agents and 533 // https://cloud.google.com/storage/docs/getting-service-agent#gsutil. Google 534 // Cloud Functions delegates access to service agents to protect function 535 // resources in internal projects that are not accessible by the end user. 536 KmsKeyName string `json:"kmsKeyName,omitempty"` 537 // Labels: Labels associated with this Cloud Function. 538 Labels map[string]string `json:"labels,omitempty"` 539 // MaxInstances: The limit on the maximum number of function instances that may 540 // coexist at a given time. In some cases, such as rapid traffic surges, Cloud 541 // Functions may, for a short period of time, create more instances than the 542 // specified max instances limit. If your function cannot tolerate this 543 // temporary behavior, you may want to factor in a safety margin and set a 544 // lower max instances value than your function can tolerate. See the Max 545 // Instances (https://cloud.google.com/functions/docs/max-instances) Guide for 546 // more details. 547 MaxInstances int64 `json:"maxInstances,omitempty"` 548 // MinInstances: A lower bound for the number function instances that may 549 // coexist at a given time. 550 MinInstances int64 `json:"minInstances,omitempty"` 551 // Name: A user-defined name of the function. Function names must be unique 552 // globally and match pattern `projects/*/locations/*/functions/*` 553 Name string `json:"name,omitempty"` 554 // Network: Deprecated: use vpc_connector 555 Network string `json:"network,omitempty"` 556 OnDeployUpdatePolicy *OnDeployUpdatePolicy `json:"onDeployUpdatePolicy,omitempty"` 557 // Runtime: The runtime in which to run the function. Required when deploying a 558 // new function, optional when updating an existing function. For a complete 559 // list of possible choices, see the `gcloud` command reference 560 // (https://cloud.google.com/sdk/gcloud/reference/functions/deploy#--runtime). 561 Runtime string `json:"runtime,omitempty"` 562 // SecretEnvironmentVariables: Secret environment variables configuration. 563 SecretEnvironmentVariables []*SecretEnvVar `json:"secretEnvironmentVariables,omitempty"` 564 // SecretVolumes: Secret volumes configuration. 565 SecretVolumes []*SecretVolume `json:"secretVolumes,omitempty"` 566 // ServiceAccountEmail: The email of the function's service account. If empty, 567 // defaults to `{project_id}@appspot.gserviceaccount.com`. 568 ServiceAccountEmail string `json:"serviceAccountEmail,omitempty"` 569 // SourceArchiveUrl: The Google Cloud Storage URL, starting with `gs://`, 570 // pointing to the zip archive which contains the function. 571 SourceArchiveUrl string `json:"sourceArchiveUrl,omitempty"` 572 // SourceRepository: **Beta Feature** The source repository where a function is 573 // hosted. 574 SourceRepository *SourceRepository `json:"sourceRepository,omitempty"` 575 // SourceToken: Input only. An identifier for Firebase function sources. 576 // Disclaimer: This field is only supported for Firebase function deployments. 577 SourceToken string `json:"sourceToken,omitempty"` 578 // SourceUploadUrl: The Google Cloud Storage signed URL used for source 579 // uploading, generated by calling 580 // [google.cloud.functions.v1.GenerateUploadUrl]. The signature is validated on 581 // write methods (Create, Update) The signature is stripped from the Function 582 // object on read methods (Get, List) 583 SourceUploadUrl string `json:"sourceUploadUrl,omitempty"` 584 // Status: Output only. Status of the function deployment. 585 // 586 // Possible values: 587 // "CLOUD_FUNCTION_STATUS_UNSPECIFIED" - Not specified. Invalid state. 588 // "ACTIVE" - Function has been successfully deployed and is serving. 589 // "OFFLINE" - Function deployment failed and the function isn’t serving. 590 // "DEPLOY_IN_PROGRESS" - Function is being created or updated. 591 // "DELETE_IN_PROGRESS" - Function is being deleted. 592 // "UNKNOWN" - Function deployment failed and the function serving state is 593 // undefined. The function should be updated or deleted to move it out of this 594 // state. 595 Status string `json:"status,omitempty"` 596 // Timeout: The function execution timeout. Execution is considered failed and 597 // can be terminated if the function is not completed at the end of the timeout 598 // period. Defaults to 60 seconds. 599 Timeout string `json:"timeout,omitempty"` 600 // UpdateTime: Output only. The last update timestamp of a Cloud Function. 601 UpdateTime string `json:"updateTime,omitempty"` 602 // VersionId: Output only. The version identifier of the Cloud Function. Each 603 // deployment attempt results in a new version of a function being created. 604 VersionId int64 `json:"versionId,omitempty,string"` 605 // VpcConnector: The VPC Network Connector that this cloud function can connect 606 // to. It can be either the fully-qualified URI, or the short name of the 607 // network connector resource. The format of this field is 608 // `projects/*/locations/*/connectors/*` This field is mutually exclusive with 609 // `network` field and will eventually replace it. See the VPC documentation 610 // (https://cloud.google.com/compute/docs/vpc) for more information on 611 // connecting Cloud projects. 612 VpcConnector string `json:"vpcConnector,omitempty"` 613 // VpcConnectorEgressSettings: The egress settings for the connector, 614 // controlling what traffic is diverted through it. 615 // 616 // Possible values: 617 // "VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED" - Unspecified. 618 // "PRIVATE_RANGES_ONLY" - Use the VPC Access Connector only for private IP 619 // space from RFC1918. 620 // "ALL_TRAFFIC" - Force the use of VPC Access Connector for all egress 621 // traffic from the function. 622 VpcConnectorEgressSettings string `json:"vpcConnectorEgressSettings,omitempty"` 623 624 // ServerResponse contains the HTTP response code and headers from the server. 625 googleapi.ServerResponse `json:"-"` 626 // ForceSendFields is a list of field names (e.g. "AutomaticUpdatePolicy") to 627 // unconditionally include in API requests. By default, fields with empty or 628 // default values are omitted from API requests. See 629 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 630 // details. 631 ForceSendFields []string `json:"-"` 632 // NullFields is a list of field names (e.g. "AutomaticUpdatePolicy") to 633 // include in API requests with the JSON null value. By default, fields with 634 // empty values are omitted from API requests. See 635 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 636 NullFields []string `json:"-"` 637 } 638 639 func (s *CloudFunction) MarshalJSON() ([]byte, error) { 640 type NoMethod CloudFunction 641 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 642 } 643 644 // EventTrigger: Describes EventTrigger, used to request events be sent from 645 // another service. 646 type EventTrigger struct { 647 // EventType: Required. The type of event to observe. For example: 648 // `providers/cloud.storage/eventTypes/object.change` and 649 // `providers/cloud.pubsub/eventTypes/topic.publish`. Event types match pattern 650 // `providers/*/eventTypes/*.*`. The pattern contains: 1. namespace: For 651 // example, `cloud.storage` and `google.firebase.analytics`. 2. resource type: 652 // The type of resource on which event occurs. For example, the Google Cloud 653 // Storage API includes the type `object`. 3. action: The action that generates 654 // the event. For example, action for a Google Cloud Storage Object is 655 // 'change'. These parts are lower case. 656 EventType string `json:"eventType,omitempty"` 657 // FailurePolicy: Specifies policy for failed executions. 658 FailurePolicy *FailurePolicy `json:"failurePolicy,omitempty"` 659 // Resource: Required. The resource(s) from which to observe events, for 660 // example, `projects/_/buckets/myBucket`. Not all syntactically correct values 661 // are accepted by all services. For example: 1. The authorization model must 662 // support it. Google Cloud Functions only allows EventTriggers to be deployed 663 // that observe resources in the same project as the `CloudFunction`. 2. The 664 // resource type must match the pattern expected for an `event_type`. For 665 // example, an `EventTrigger` that has an `event_type` of 666 // "google.pubsub.topic.publish" should have a resource that matches Google 667 // Cloud Pub/Sub topics. Additionally, some services may support short names 668 // when creating an `EventTrigger`. These will always be returned in the 669 // normalized "long" format. See each *service's* documentation for supported 670 // formats. 671 Resource string `json:"resource,omitempty"` 672 // Service: The hostname of the service that should be observed. If no string 673 // is provided, the default service implementing the API will be used. For 674 // example, `storage.googleapis.com` is the default for all event types in the 675 // `google.storage` namespace. 676 Service string `json:"service,omitempty"` 677 // ForceSendFields is a list of field names (e.g. "EventType") to 678 // unconditionally include in API requests. By default, fields with empty or 679 // default values are omitted from API requests. See 680 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 681 // details. 682 ForceSendFields []string `json:"-"` 683 // NullFields is a list of field names (e.g. "EventType") to include in API 684 // requests with the JSON null value. By default, fields with empty values are 685 // omitted from API requests. See 686 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 687 NullFields []string `json:"-"` 688 } 689 690 func (s *EventTrigger) MarshalJSON() ([]byte, error) { 691 type NoMethod EventTrigger 692 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 693 } 694 695 // Expr: Represents a textual expression in the Common Expression Language 696 // (CEL) syntax. CEL is a C-like expression language. The syntax and semantics 697 // of CEL are documented at https://github.com/google/cel-spec. Example 698 // (Comparison): title: "Summary size limit" description: "Determines if a 699 // summary is less than 100 chars" expression: "document.summary.size() < 100" 700 // Example (Equality): title: "Requestor is owner" description: "Determines if 701 // requestor is the document owner" expression: "document.owner == 702 // request.auth.claims.email" Example (Logic): title: "Public documents" 703 // description: "Determine whether the document should be publicly visible" 704 // expression: "document.type != 'private' && document.type != 'internal'" 705 // Example (Data Manipulation): title: "Notification string" description: 706 // "Create a notification string with a timestamp." expression: "'New message 707 // received at ' + string(document.create_time)" The exact variables and 708 // functions that may be referenced within an expression are determined by the 709 // service that evaluates it. See the service documentation for additional 710 // information. 711 type Expr struct { 712 // Description: Optional. Description of the expression. This is a longer text 713 // which describes the expression, e.g. when hovered over it in a UI. 714 Description string `json:"description,omitempty"` 715 // Expression: Textual representation of an expression in Common Expression 716 // Language syntax. 717 Expression string `json:"expression,omitempty"` 718 // Location: Optional. String indicating the location of the expression for 719 // error reporting, e.g. a file name and a position in the file. 720 Location string `json:"location,omitempty"` 721 // Title: Optional. Title for the expression, i.e. a short string describing 722 // its purpose. This can be used e.g. in UIs which allow to enter the 723 // expression. 724 Title string `json:"title,omitempty"` 725 // ForceSendFields is a list of field names (e.g. "Description") to 726 // unconditionally include in API requests. By default, fields with empty or 727 // default values are omitted from API requests. See 728 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 729 // details. 730 ForceSendFields []string `json:"-"` 731 // NullFields is a list of field names (e.g. "Description") to include in API 732 // requests with the JSON null value. By default, fields with empty values are 733 // omitted from API requests. See 734 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 735 NullFields []string `json:"-"` 736 } 737 738 func (s *Expr) MarshalJSON() ([]byte, error) { 739 type NoMethod Expr 740 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 741 } 742 743 // FailurePolicy: Describes the policy in case of function's execution failure. 744 // If empty, then defaults to ignoring failures (i.e. not retrying them). 745 type FailurePolicy struct { 746 // Retry: If specified, then the function will be retried in case of a failure. 747 Retry *Retry `json:"retry,omitempty"` 748 // ForceSendFields is a list of field names (e.g. "Retry") to unconditionally 749 // include in API requests. By default, fields with empty or default values are 750 // omitted from API requests. See 751 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 752 // details. 753 ForceSendFields []string `json:"-"` 754 // NullFields is a list of field names (e.g. "Retry") to include in API 755 // requests with the JSON null value. By default, fields with empty values are 756 // omitted from API requests. See 757 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 758 NullFields []string `json:"-"` 759 } 760 761 func (s *FailurePolicy) MarshalJSON() ([]byte, error) { 762 type NoMethod FailurePolicy 763 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 764 } 765 766 // GenerateDownloadUrlRequest: Request of `GenerateDownloadUrl` method. 767 type GenerateDownloadUrlRequest struct { 768 // VersionId: The optional version of function. If not set, default, current 769 // version is used. 770 VersionId uint64 `json:"versionId,omitempty,string"` 771 // ForceSendFields is a list of field names (e.g. "VersionId") to 772 // unconditionally include in API requests. By default, fields with empty or 773 // default values are omitted from API requests. See 774 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 775 // details. 776 ForceSendFields []string `json:"-"` 777 // NullFields is a list of field names (e.g. "VersionId") to include in API 778 // requests with the JSON null value. By default, fields with empty values are 779 // omitted from API requests. See 780 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 781 NullFields []string `json:"-"` 782 } 783 784 func (s *GenerateDownloadUrlRequest) MarshalJSON() ([]byte, error) { 785 type NoMethod GenerateDownloadUrlRequest 786 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 787 } 788 789 // GenerateDownloadUrlResponse: Response of `GenerateDownloadUrl` method. 790 type GenerateDownloadUrlResponse struct { 791 // DownloadUrl: The generated Google Cloud Storage signed URL that should be 792 // used for function source code download. 793 DownloadUrl string `json:"downloadUrl,omitempty"` 794 795 // ServerResponse contains the HTTP response code and headers from the server. 796 googleapi.ServerResponse `json:"-"` 797 // ForceSendFields is a list of field names (e.g. "DownloadUrl") to 798 // unconditionally include in API requests. By default, fields with empty or 799 // default values are omitted from API requests. See 800 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 801 // details. 802 ForceSendFields []string `json:"-"` 803 // NullFields is a list of field names (e.g. "DownloadUrl") to include in API 804 // requests with the JSON null value. By default, fields with empty values are 805 // omitted from API requests. See 806 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 807 NullFields []string `json:"-"` 808 } 809 810 func (s *GenerateDownloadUrlResponse) MarshalJSON() ([]byte, error) { 811 type NoMethod GenerateDownloadUrlResponse 812 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 813 } 814 815 // GenerateUploadUrlRequest: Request of `GenerateSourceUploadUrl` method. 816 type GenerateUploadUrlRequest struct { 817 // KmsKeyName: Resource name of a KMS crypto key (managed by the user) used to 818 // encrypt/decrypt function source code objects in intermediate Cloud Storage 819 // buckets. When you generate an upload url and upload your source code, it 820 // gets copied to an intermediate Cloud Storage bucket. The source code is then 821 // copied to a versioned directory in the sources bucket in the consumer 822 // project during the function deployment. It must match the pattern 823 // `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{cryp 824 // to_key}`. The Google Cloud Functions service account 825 // (service-{project_number}@gcf-admin-robot.iam.gserviceaccount.com) must be 826 // granted the role 'Cloud KMS CryptoKey Encrypter/Decrypter 827 // (roles/cloudkms.cryptoKeyEncrypterDecrypter)' on the 828 // Key/KeyRing/Project/Organization (least access preferred). GCF will delegate 829 // access to the Google Storage service account in the internal project. 830 KmsKeyName string `json:"kmsKeyName,omitempty"` 831 // ForceSendFields is a list of field names (e.g. "KmsKeyName") to 832 // unconditionally include in API requests. By default, fields with empty or 833 // default values are omitted from API requests. See 834 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 835 // details. 836 ForceSendFields []string `json:"-"` 837 // NullFields is a list of field names (e.g. "KmsKeyName") to include in API 838 // requests with the JSON null value. By default, fields with empty values are 839 // omitted from API requests. See 840 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 841 NullFields []string `json:"-"` 842 } 843 844 func (s *GenerateUploadUrlRequest) MarshalJSON() ([]byte, error) { 845 type NoMethod GenerateUploadUrlRequest 846 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 847 } 848 849 // GenerateUploadUrlResponse: Response of `GenerateSourceUploadUrl` method. 850 type GenerateUploadUrlResponse struct { 851 // UploadUrl: The generated Google Cloud Storage signed URL that should be used 852 // for a function source code upload. The uploaded file should be a zip archive 853 // which contains a function. 854 UploadUrl string `json:"uploadUrl,omitempty"` 855 856 // ServerResponse contains the HTTP response code and headers from the server. 857 googleapi.ServerResponse `json:"-"` 858 // ForceSendFields is a list of field names (e.g. "UploadUrl") to 859 // unconditionally include in API requests. By default, fields with empty or 860 // default values are omitted from API requests. See 861 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 862 // details. 863 ForceSendFields []string `json:"-"` 864 // NullFields is a list of field names (e.g. "UploadUrl") to include in API 865 // requests with the JSON null value. By default, fields with empty values are 866 // omitted from API requests. See 867 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 868 NullFields []string `json:"-"` 869 } 870 871 func (s *GenerateUploadUrlResponse) MarshalJSON() ([]byte, error) { 872 type NoMethod GenerateUploadUrlResponse 873 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 874 } 875 876 // GoogleCloudFunctionsV2LocationMetadata: Extra GCF specific location 877 // information. 878 type GoogleCloudFunctionsV2LocationMetadata struct { 879 // Environments: The Cloud Function environments this location supports. 880 // 881 // Possible values: 882 // "ENVIRONMENT_UNSPECIFIED" - Unspecified 883 // "GEN_1" - Gen 1 884 // "GEN_2" - Gen 2 885 Environments []string `json:"environments,omitempty"` 886 // ForceSendFields is a list of field names (e.g. "Environments") to 887 // unconditionally include in API requests. By default, fields with empty or 888 // default values are omitted from API requests. See 889 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 890 // details. 891 ForceSendFields []string `json:"-"` 892 // NullFields is a list of field names (e.g. "Environments") to include in API 893 // requests with the JSON null value. By default, fields with empty values are 894 // omitted from API requests. See 895 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 896 NullFields []string `json:"-"` 897 } 898 899 func (s *GoogleCloudFunctionsV2LocationMetadata) MarshalJSON() ([]byte, error) { 900 type NoMethod GoogleCloudFunctionsV2LocationMetadata 901 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 902 } 903 904 // GoogleCloudFunctionsV2OperationMetadata: Represents the metadata of the 905 // long-running operation. 906 type GoogleCloudFunctionsV2OperationMetadata struct { 907 // ApiVersion: API version used to start the operation. 908 ApiVersion string `json:"apiVersion,omitempty"` 909 // CancelRequested: Identifies whether the user has requested cancellation of 910 // the operation. Operations that have successfully been cancelled have 911 // google.longrunning.Operation.error value with a google.rpc.Status.code of 1, 912 // corresponding to `Code.CANCELLED`. 913 CancelRequested bool `json:"cancelRequested,omitempty"` 914 // CreateTime: The time the operation was created. 915 CreateTime string `json:"createTime,omitempty"` 916 // EndTime: The time the operation finished running. 917 EndTime string `json:"endTime,omitempty"` 918 // OperationType: The operation type. 919 // 920 // Possible values: 921 // "OPERATIONTYPE_UNSPECIFIED" - Unspecified 922 // "CREATE_FUNCTION" - CreateFunction 923 // "UPDATE_FUNCTION" - UpdateFunction 924 // "DELETE_FUNCTION" - DeleteFunction 925 // "REDIRECT_FUNCTION_UPGRADE_TRAFFIC" - RedirectFunctionUpgradeTraffic 926 // "ROLLBACK_FUNCTION_UPGRADE_TRAFFIC" - RollbackFunctionUpgradeTraffic 927 // "SETUP_FUNCTION_UPGRADE_CONFIG" - SetupFunctionUpgradeConfig 928 // "ABORT_FUNCTION_UPGRADE" - AbortFunctionUpgrade 929 // "COMMIT_FUNCTION_UPGRADE" - CommitFunctionUpgrade 930 OperationType string `json:"operationType,omitempty"` 931 // RequestResource: The original request that started the operation. 932 RequestResource googleapi.RawMessage `json:"requestResource,omitempty"` 933 // SourceToken: An identifier for Firebase function sources. Disclaimer: This 934 // field is only supported for Firebase function deployments. 935 SourceToken string `json:"sourceToken,omitempty"` 936 // Stages: Mechanism for reporting in-progress stages 937 Stages []*GoogleCloudFunctionsV2Stage `json:"stages,omitempty"` 938 // StatusDetail: Human-readable status of the operation, if any. 939 StatusDetail string `json:"statusDetail,omitempty"` 940 // Target: Server-defined resource path for the target of the operation. 941 Target string `json:"target,omitempty"` 942 // Verb: Name of the verb executed by the operation. 943 Verb string `json:"verb,omitempty"` 944 // ForceSendFields is a list of field names (e.g. "ApiVersion") to 945 // unconditionally include in API requests. By default, fields with empty or 946 // default values are omitted from API requests. See 947 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 948 // details. 949 ForceSendFields []string `json:"-"` 950 // NullFields is a list of field names (e.g. "ApiVersion") to include in API 951 // requests with the JSON null value. By default, fields with empty values are 952 // omitted from API requests. See 953 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 954 NullFields []string `json:"-"` 955 } 956 957 func (s *GoogleCloudFunctionsV2OperationMetadata) MarshalJSON() ([]byte, error) { 958 type NoMethod GoogleCloudFunctionsV2OperationMetadata 959 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 960 } 961 962 // GoogleCloudFunctionsV2Stage: Each Stage of the deployment process 963 type GoogleCloudFunctionsV2Stage struct { 964 // Message: Message describing the Stage 965 Message string `json:"message,omitempty"` 966 // Name: Name of the Stage. This will be unique for each Stage. 967 // 968 // Possible values: 969 // "NAME_UNSPECIFIED" - Not specified. Invalid name. 970 // "ARTIFACT_REGISTRY" - Artifact Regsitry Stage 971 // "BUILD" - Build Stage 972 // "SERVICE" - Service Stage 973 // "TRIGGER" - Trigger Stage 974 // "SERVICE_ROLLBACK" - Service Rollback Stage 975 // "TRIGGER_ROLLBACK" - Trigger Rollback Stage 976 Name string `json:"name,omitempty"` 977 // Resource: Resource of the Stage 978 Resource string `json:"resource,omitempty"` 979 // ResourceUri: Link to the current Stage resource 980 ResourceUri string `json:"resourceUri,omitempty"` 981 // State: Current state of the Stage 982 // 983 // Possible values: 984 // "STATE_UNSPECIFIED" - Not specified. Invalid state. 985 // "NOT_STARTED" - Stage has not started. 986 // "IN_PROGRESS" - Stage is in progress. 987 // "COMPLETE" - Stage has completed. 988 State string `json:"state,omitempty"` 989 // StateMessages: State messages from the current Stage. 990 StateMessages []*GoogleCloudFunctionsV2StateMessage `json:"stateMessages,omitempty"` 991 // ForceSendFields is a list of field names (e.g. "Message") to unconditionally 992 // include in API requests. By default, fields with empty or default values are 993 // omitted from API requests. See 994 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 995 // details. 996 ForceSendFields []string `json:"-"` 997 // NullFields is a list of field names (e.g. "Message") to include in API 998 // requests with the JSON null value. By default, fields with empty values are 999 // omitted from API requests. See 1000 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1001 NullFields []string `json:"-"` 1002 } 1003 1004 func (s *GoogleCloudFunctionsV2Stage) MarshalJSON() ([]byte, error) { 1005 type NoMethod GoogleCloudFunctionsV2Stage 1006 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1007 } 1008 1009 // GoogleCloudFunctionsV2StateMessage: Informational messages about the state 1010 // of the Cloud Function or Operation. 1011 type GoogleCloudFunctionsV2StateMessage struct { 1012 // Message: The message. 1013 Message string `json:"message,omitempty"` 1014 // Severity: Severity of the state message. 1015 // 1016 // Possible values: 1017 // "SEVERITY_UNSPECIFIED" - Not specified. Invalid severity. 1018 // "ERROR" - ERROR-level severity. 1019 // "WARNING" - WARNING-level severity. 1020 // "INFO" - INFO-level severity. 1021 Severity string `json:"severity,omitempty"` 1022 // Type: One-word CamelCase type of the state message. 1023 Type string `json:"type,omitempty"` 1024 // ForceSendFields is a list of field names (e.g. "Message") to unconditionally 1025 // include in API requests. By default, fields with empty or default values are 1026 // omitted from API requests. See 1027 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1028 // details. 1029 ForceSendFields []string `json:"-"` 1030 // NullFields is a list of field names (e.g. "Message") to include in API 1031 // requests with the JSON null value. By default, fields with empty values are 1032 // omitted from API requests. See 1033 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1034 NullFields []string `json:"-"` 1035 } 1036 1037 func (s *GoogleCloudFunctionsV2StateMessage) MarshalJSON() ([]byte, error) { 1038 type NoMethod GoogleCloudFunctionsV2StateMessage 1039 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1040 } 1041 1042 // GoogleCloudFunctionsV2alphaLocationMetadata: Extra GCF specific location 1043 // information. 1044 type GoogleCloudFunctionsV2alphaLocationMetadata struct { 1045 // Environments: The Cloud Function environments this location supports. 1046 // 1047 // Possible values: 1048 // "ENVIRONMENT_UNSPECIFIED" - Unspecified 1049 // "GEN_1" - Gen 1 1050 // "GEN_2" - Gen 2 1051 Environments []string `json:"environments,omitempty"` 1052 // ForceSendFields is a list of field names (e.g. "Environments") to 1053 // unconditionally include in API requests. By default, fields with empty or 1054 // default values are omitted from API requests. See 1055 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1056 // details. 1057 ForceSendFields []string `json:"-"` 1058 // NullFields is a list of field names (e.g. "Environments") to include in API 1059 // requests with the JSON null value. By default, fields with empty values are 1060 // omitted from API requests. See 1061 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1062 NullFields []string `json:"-"` 1063 } 1064 1065 func (s *GoogleCloudFunctionsV2alphaLocationMetadata) MarshalJSON() ([]byte, error) { 1066 type NoMethod GoogleCloudFunctionsV2alphaLocationMetadata 1067 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1068 } 1069 1070 // GoogleCloudFunctionsV2alphaOperationMetadata: Represents the metadata of the 1071 // long-running operation. 1072 type GoogleCloudFunctionsV2alphaOperationMetadata struct { 1073 // ApiVersion: API version used to start the operation. 1074 ApiVersion string `json:"apiVersion,omitempty"` 1075 // CancelRequested: Identifies whether the user has requested cancellation of 1076 // the operation. Operations that have successfully been cancelled have 1077 // google.longrunning.Operation.error value with a google.rpc.Status.code of 1, 1078 // corresponding to `Code.CANCELLED`. 1079 CancelRequested bool `json:"cancelRequested,omitempty"` 1080 // CreateTime: The time the operation was created. 1081 CreateTime string `json:"createTime,omitempty"` 1082 // EndTime: The time the operation finished running. 1083 EndTime string `json:"endTime,omitempty"` 1084 // OperationType: The operation type. 1085 // 1086 // Possible values: 1087 // "OPERATIONTYPE_UNSPECIFIED" - Unspecified 1088 // "CREATE_FUNCTION" - CreateFunction 1089 // "UPDATE_FUNCTION" - UpdateFunction 1090 // "DELETE_FUNCTION" - DeleteFunction 1091 // "REDIRECT_FUNCTION_UPGRADE_TRAFFIC" - RedirectFunctionUpgradeTraffic 1092 // "ROLLBACK_FUNCTION_UPGRADE_TRAFFIC" - RollbackFunctionUpgradeTraffic 1093 // "SETUP_FUNCTION_UPGRADE_CONFIG" - SetupFunctionUpgradeConfig 1094 // "ABORT_FUNCTION_UPGRADE" - AbortFunctionUpgrade 1095 // "COMMIT_FUNCTION_UPGRADE" - CommitFunctionUpgrade 1096 OperationType string `json:"operationType,omitempty"` 1097 // RequestResource: The original request that started the operation. 1098 RequestResource googleapi.RawMessage `json:"requestResource,omitempty"` 1099 // SourceToken: An identifier for Firebase function sources. Disclaimer: This 1100 // field is only supported for Firebase function deployments. 1101 SourceToken string `json:"sourceToken,omitempty"` 1102 // Stages: Mechanism for reporting in-progress stages 1103 Stages []*GoogleCloudFunctionsV2alphaStage `json:"stages,omitempty"` 1104 // StatusDetail: Human-readable status of the operation, if any. 1105 StatusDetail string `json:"statusDetail,omitempty"` 1106 // Target: Server-defined resource path for the target of the operation. 1107 Target string `json:"target,omitempty"` 1108 // Verb: Name of the verb executed by the operation. 1109 Verb string `json:"verb,omitempty"` 1110 // ForceSendFields is a list of field names (e.g. "ApiVersion") to 1111 // unconditionally include in API requests. By default, fields with empty or 1112 // default values are omitted from API requests. See 1113 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1114 // details. 1115 ForceSendFields []string `json:"-"` 1116 // NullFields is a list of field names (e.g. "ApiVersion") to include in API 1117 // requests with the JSON null value. By default, fields with empty values are 1118 // omitted from API requests. See 1119 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1120 NullFields []string `json:"-"` 1121 } 1122 1123 func (s *GoogleCloudFunctionsV2alphaOperationMetadata) MarshalJSON() ([]byte, error) { 1124 type NoMethod GoogleCloudFunctionsV2alphaOperationMetadata 1125 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1126 } 1127 1128 // GoogleCloudFunctionsV2alphaStage: Each Stage of the deployment process 1129 type GoogleCloudFunctionsV2alphaStage struct { 1130 // Message: Message describing the Stage 1131 Message string `json:"message,omitempty"` 1132 // Name: Name of the Stage. This will be unique for each Stage. 1133 // 1134 // Possible values: 1135 // "NAME_UNSPECIFIED" - Not specified. Invalid name. 1136 // "ARTIFACT_REGISTRY" - Artifact Regsitry Stage 1137 // "BUILD" - Build Stage 1138 // "SERVICE" - Service Stage 1139 // "TRIGGER" - Trigger Stage 1140 // "SERVICE_ROLLBACK" - Service Rollback Stage 1141 // "TRIGGER_ROLLBACK" - Trigger Rollback Stage 1142 Name string `json:"name,omitempty"` 1143 // Resource: Resource of the Stage 1144 Resource string `json:"resource,omitempty"` 1145 // ResourceUri: Link to the current Stage resource 1146 ResourceUri string `json:"resourceUri,omitempty"` 1147 // State: Current state of the Stage 1148 // 1149 // Possible values: 1150 // "STATE_UNSPECIFIED" - Not specified. Invalid state. 1151 // "NOT_STARTED" - Stage has not started. 1152 // "IN_PROGRESS" - Stage is in progress. 1153 // "COMPLETE" - Stage has completed. 1154 State string `json:"state,omitempty"` 1155 // StateMessages: State messages from the current Stage. 1156 StateMessages []*GoogleCloudFunctionsV2alphaStateMessage `json:"stateMessages,omitempty"` 1157 // ForceSendFields is a list of field names (e.g. "Message") to unconditionally 1158 // include in API requests. By default, fields with empty or default values are 1159 // omitted from API requests. See 1160 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1161 // details. 1162 ForceSendFields []string `json:"-"` 1163 // NullFields is a list of field names (e.g. "Message") to include in API 1164 // requests with the JSON null value. By default, fields with empty values are 1165 // omitted from API requests. See 1166 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1167 NullFields []string `json:"-"` 1168 } 1169 1170 func (s *GoogleCloudFunctionsV2alphaStage) MarshalJSON() ([]byte, error) { 1171 type NoMethod GoogleCloudFunctionsV2alphaStage 1172 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1173 } 1174 1175 // GoogleCloudFunctionsV2alphaStateMessage: Informational messages about the 1176 // state of the Cloud Function or Operation. 1177 type GoogleCloudFunctionsV2alphaStateMessage struct { 1178 // Message: The message. 1179 Message string `json:"message,omitempty"` 1180 // Severity: Severity of the state message. 1181 // 1182 // Possible values: 1183 // "SEVERITY_UNSPECIFIED" - Not specified. Invalid severity. 1184 // "ERROR" - ERROR-level severity. 1185 // "WARNING" - WARNING-level severity. 1186 // "INFO" - INFO-level severity. 1187 Severity string `json:"severity,omitempty"` 1188 // Type: One-word CamelCase type of the state message. 1189 Type string `json:"type,omitempty"` 1190 // ForceSendFields is a list of field names (e.g. "Message") to unconditionally 1191 // include in API requests. By default, fields with empty or default values are 1192 // omitted from API requests. See 1193 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1194 // details. 1195 ForceSendFields []string `json:"-"` 1196 // NullFields is a list of field names (e.g. "Message") to include in API 1197 // requests with the JSON null value. By default, fields with empty values are 1198 // omitted from API requests. See 1199 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1200 NullFields []string `json:"-"` 1201 } 1202 1203 func (s *GoogleCloudFunctionsV2alphaStateMessage) MarshalJSON() ([]byte, error) { 1204 type NoMethod GoogleCloudFunctionsV2alphaStateMessage 1205 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1206 } 1207 1208 // GoogleCloudFunctionsV2betaLocationMetadata: Extra GCF specific location 1209 // information. 1210 type GoogleCloudFunctionsV2betaLocationMetadata struct { 1211 // Environments: The Cloud Function environments this location supports. 1212 // 1213 // Possible values: 1214 // "ENVIRONMENT_UNSPECIFIED" - Unspecified 1215 // "GEN_1" - Gen 1 1216 // "GEN_2" - Gen 2 1217 Environments []string `json:"environments,omitempty"` 1218 // ForceSendFields is a list of field names (e.g. "Environments") to 1219 // unconditionally include in API requests. By default, fields with empty or 1220 // default values are omitted from API requests. See 1221 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1222 // details. 1223 ForceSendFields []string `json:"-"` 1224 // NullFields is a list of field names (e.g. "Environments") to include in API 1225 // requests with the JSON null value. By default, fields with empty values are 1226 // omitted from API requests. See 1227 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1228 NullFields []string `json:"-"` 1229 } 1230 1231 func (s *GoogleCloudFunctionsV2betaLocationMetadata) MarshalJSON() ([]byte, error) { 1232 type NoMethod GoogleCloudFunctionsV2betaLocationMetadata 1233 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1234 } 1235 1236 // GoogleCloudFunctionsV2betaOperationMetadata: Represents the metadata of the 1237 // long-running operation. 1238 type GoogleCloudFunctionsV2betaOperationMetadata struct { 1239 // ApiVersion: API version used to start the operation. 1240 ApiVersion string `json:"apiVersion,omitempty"` 1241 // CancelRequested: Identifies whether the user has requested cancellation of 1242 // the operation. Operations that have successfully been cancelled have 1243 // google.longrunning.Operation.error value with a google.rpc.Status.code of 1, 1244 // corresponding to `Code.CANCELLED`. 1245 CancelRequested bool `json:"cancelRequested,omitempty"` 1246 // CreateTime: The time the operation was created. 1247 CreateTime string `json:"createTime,omitempty"` 1248 // EndTime: The time the operation finished running. 1249 EndTime string `json:"endTime,omitempty"` 1250 // OperationType: The operation type. 1251 // 1252 // Possible values: 1253 // "OPERATIONTYPE_UNSPECIFIED" - Unspecified 1254 // "CREATE_FUNCTION" - CreateFunction 1255 // "UPDATE_FUNCTION" - UpdateFunction 1256 // "DELETE_FUNCTION" - DeleteFunction 1257 // "REDIRECT_FUNCTION_UPGRADE_TRAFFIC" - RedirectFunctionUpgradeTraffic 1258 // "ROLLBACK_FUNCTION_UPGRADE_TRAFFIC" - RollbackFunctionUpgradeTraffic 1259 // "SETUP_FUNCTION_UPGRADE_CONFIG" - SetupFunctionUpgradeConfig 1260 // "ABORT_FUNCTION_UPGRADE" - AbortFunctionUpgrade 1261 // "COMMIT_FUNCTION_UPGRADE" - CommitFunctionUpgrade 1262 OperationType string `json:"operationType,omitempty"` 1263 // RequestResource: The original request that started the operation. 1264 RequestResource googleapi.RawMessage `json:"requestResource,omitempty"` 1265 // SourceToken: An identifier for Firebase function sources. Disclaimer: This 1266 // field is only supported for Firebase function deployments. 1267 SourceToken string `json:"sourceToken,omitempty"` 1268 // Stages: Mechanism for reporting in-progress stages 1269 Stages []*GoogleCloudFunctionsV2betaStage `json:"stages,omitempty"` 1270 // StatusDetail: Human-readable status of the operation, if any. 1271 StatusDetail string `json:"statusDetail,omitempty"` 1272 // Target: Server-defined resource path for the target of the operation. 1273 Target string `json:"target,omitempty"` 1274 // Verb: Name of the verb executed by the operation. 1275 Verb string `json:"verb,omitempty"` 1276 // ForceSendFields is a list of field names (e.g. "ApiVersion") to 1277 // unconditionally include in API requests. By default, fields with empty or 1278 // default values are omitted from API requests. See 1279 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1280 // details. 1281 ForceSendFields []string `json:"-"` 1282 // NullFields is a list of field names (e.g. "ApiVersion") to include in API 1283 // requests with the JSON null value. By default, fields with empty values are 1284 // omitted from API requests. See 1285 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1286 NullFields []string `json:"-"` 1287 } 1288 1289 func (s *GoogleCloudFunctionsV2betaOperationMetadata) MarshalJSON() ([]byte, error) { 1290 type NoMethod GoogleCloudFunctionsV2betaOperationMetadata 1291 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1292 } 1293 1294 // GoogleCloudFunctionsV2betaStage: Each Stage of the deployment process 1295 type GoogleCloudFunctionsV2betaStage struct { 1296 // Message: Message describing the Stage 1297 Message string `json:"message,omitempty"` 1298 // Name: Name of the Stage. This will be unique for each Stage. 1299 // 1300 // Possible values: 1301 // "NAME_UNSPECIFIED" - Not specified. Invalid name. 1302 // "ARTIFACT_REGISTRY" - Artifact Regsitry Stage 1303 // "BUILD" - Build Stage 1304 // "SERVICE" - Service Stage 1305 // "TRIGGER" - Trigger Stage 1306 // "SERVICE_ROLLBACK" - Service Rollback Stage 1307 // "TRIGGER_ROLLBACK" - Trigger Rollback Stage 1308 Name string `json:"name,omitempty"` 1309 // Resource: Resource of the Stage 1310 Resource string `json:"resource,omitempty"` 1311 // ResourceUri: Link to the current Stage resource 1312 ResourceUri string `json:"resourceUri,omitempty"` 1313 // State: Current state of the Stage 1314 // 1315 // Possible values: 1316 // "STATE_UNSPECIFIED" - Not specified. Invalid state. 1317 // "NOT_STARTED" - Stage has not started. 1318 // "IN_PROGRESS" - Stage is in progress. 1319 // "COMPLETE" - Stage has completed. 1320 State string `json:"state,omitempty"` 1321 // StateMessages: State messages from the current Stage. 1322 StateMessages []*GoogleCloudFunctionsV2betaStateMessage `json:"stateMessages,omitempty"` 1323 // ForceSendFields is a list of field names (e.g. "Message") to unconditionally 1324 // include in API requests. By default, fields with empty or default values are 1325 // omitted from API requests. See 1326 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1327 // details. 1328 ForceSendFields []string `json:"-"` 1329 // NullFields is a list of field names (e.g. "Message") to include in API 1330 // requests with the JSON null value. By default, fields with empty values are 1331 // omitted from API requests. See 1332 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1333 NullFields []string `json:"-"` 1334 } 1335 1336 func (s *GoogleCloudFunctionsV2betaStage) MarshalJSON() ([]byte, error) { 1337 type NoMethod GoogleCloudFunctionsV2betaStage 1338 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1339 } 1340 1341 // GoogleCloudFunctionsV2betaStateMessage: Informational messages about the 1342 // state of the Cloud Function or Operation. 1343 type GoogleCloudFunctionsV2betaStateMessage struct { 1344 // Message: The message. 1345 Message string `json:"message,omitempty"` 1346 // Severity: Severity of the state message. 1347 // 1348 // Possible values: 1349 // "SEVERITY_UNSPECIFIED" - Not specified. Invalid severity. 1350 // "ERROR" - ERROR-level severity. 1351 // "WARNING" - WARNING-level severity. 1352 // "INFO" - INFO-level severity. 1353 Severity string `json:"severity,omitempty"` 1354 // Type: One-word CamelCase type of the state message. 1355 Type string `json:"type,omitempty"` 1356 // ForceSendFields is a list of field names (e.g. "Message") to unconditionally 1357 // include in API requests. By default, fields with empty or default values are 1358 // omitted from API requests. See 1359 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1360 // details. 1361 ForceSendFields []string `json:"-"` 1362 // NullFields is a list of field names (e.g. "Message") to include in API 1363 // requests with the JSON null value. By default, fields with empty values are 1364 // omitted from API requests. See 1365 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1366 NullFields []string `json:"-"` 1367 } 1368 1369 func (s *GoogleCloudFunctionsV2betaStateMessage) MarshalJSON() ([]byte, error) { 1370 type NoMethod GoogleCloudFunctionsV2betaStateMessage 1371 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1372 } 1373 1374 // HttpsTrigger: Describes HttpsTrigger, could be used to connect web hooks to 1375 // function. 1376 type HttpsTrigger struct { 1377 // SecurityLevel: The security level for the function. 1378 // 1379 // Possible values: 1380 // "SECURITY_LEVEL_UNSPECIFIED" - Unspecified. 1381 // "SECURE_ALWAYS" - Requests for a URL that match this handler that do not 1382 // use HTTPS are automatically redirected to the HTTPS URL with the same path. 1383 // Query parameters are reserved for the redirect. 1384 // "SECURE_OPTIONAL" - Both HTTP and HTTPS requests with URLs that match the 1385 // handler succeed without redirects. The application can examine the request 1386 // to determine which protocol was used and respond accordingly. 1387 SecurityLevel string `json:"securityLevel,omitempty"` 1388 // Url: Output only. The deployed url for the function. 1389 Url string `json:"url,omitempty"` 1390 // ForceSendFields is a list of field names (e.g. "SecurityLevel") to 1391 // unconditionally include in API requests. By default, fields with empty or 1392 // default values are omitted from API requests. See 1393 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1394 // details. 1395 ForceSendFields []string `json:"-"` 1396 // NullFields is a list of field names (e.g. "SecurityLevel") to include in API 1397 // requests with the JSON null value. By default, fields with empty values are 1398 // omitted from API requests. See 1399 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1400 NullFields []string `json:"-"` 1401 } 1402 1403 func (s *HttpsTrigger) MarshalJSON() ([]byte, error) { 1404 type NoMethod HttpsTrigger 1405 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1406 } 1407 1408 // ListFunctionsResponse: Response for the `ListFunctions` method. 1409 type ListFunctionsResponse struct { 1410 // Functions: The functions that match the request. 1411 Functions []*CloudFunction `json:"functions,omitempty"` 1412 // NextPageToken: If not empty, indicates that there may be more functions that 1413 // match the request; this value should be passed in a new 1414 // google.cloud.functions.v1.ListFunctionsRequest to get more functions. 1415 NextPageToken string `json:"nextPageToken,omitempty"` 1416 // Unreachable: Locations that could not be reached. The response does not 1417 // include any functions from these locations. 1418 Unreachable []string `json:"unreachable,omitempty"` 1419 1420 // ServerResponse contains the HTTP response code and headers from the server. 1421 googleapi.ServerResponse `json:"-"` 1422 // ForceSendFields is a list of field names (e.g. "Functions") to 1423 // unconditionally include in API requests. By default, fields with empty or 1424 // default values are omitted from API requests. See 1425 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1426 // details. 1427 ForceSendFields []string `json:"-"` 1428 // NullFields is a list of field names (e.g. "Functions") to include in API 1429 // requests with the JSON null value. By default, fields with empty values are 1430 // omitted from API requests. See 1431 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1432 NullFields []string `json:"-"` 1433 } 1434 1435 func (s *ListFunctionsResponse) MarshalJSON() ([]byte, error) { 1436 type NoMethod ListFunctionsResponse 1437 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1438 } 1439 1440 // ListLocationsResponse: The response message for Locations.ListLocations. 1441 type ListLocationsResponse struct { 1442 // Locations: A list of locations that matches the specified filter in the 1443 // request. 1444 Locations []*Location `json:"locations,omitempty"` 1445 // NextPageToken: The standard List next-page token. 1446 NextPageToken string `json:"nextPageToken,omitempty"` 1447 1448 // ServerResponse contains the HTTP response code and headers from the server. 1449 googleapi.ServerResponse `json:"-"` 1450 // ForceSendFields is a list of field names (e.g. "Locations") to 1451 // unconditionally include in API requests. By default, fields with empty or 1452 // default values are omitted from API requests. See 1453 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1454 // details. 1455 ForceSendFields []string `json:"-"` 1456 // NullFields is a list of field names (e.g. "Locations") to include in API 1457 // requests with the JSON null value. By default, fields with empty values are 1458 // omitted from API requests. See 1459 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1460 NullFields []string `json:"-"` 1461 } 1462 1463 func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) { 1464 type NoMethod ListLocationsResponse 1465 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1466 } 1467 1468 // ListOperationsResponse: The response message for Operations.ListOperations. 1469 type ListOperationsResponse struct { 1470 // NextPageToken: The standard List next-page token. 1471 NextPageToken string `json:"nextPageToken,omitempty"` 1472 // Operations: A list of operations that matches the specified filter in the 1473 // request. 1474 Operations []*Operation `json:"operations,omitempty"` 1475 1476 // ServerResponse contains the HTTP response code and headers from the server. 1477 googleapi.ServerResponse `json:"-"` 1478 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 1479 // unconditionally include in API requests. By default, fields with empty or 1480 // default values are omitted from API requests. See 1481 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1482 // details. 1483 ForceSendFields []string `json:"-"` 1484 // NullFields is a list of field names (e.g. "NextPageToken") to include in API 1485 // requests with the JSON null value. By default, fields with empty values are 1486 // omitted from API requests. See 1487 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1488 NullFields []string `json:"-"` 1489 } 1490 1491 func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) { 1492 type NoMethod ListOperationsResponse 1493 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1494 } 1495 1496 // Location: A resource that represents a Google Cloud location. 1497 type Location struct { 1498 // DisplayName: The friendly name for this location, typically a nearby city 1499 // name. For example, "Tokyo". 1500 DisplayName string `json:"displayName,omitempty"` 1501 // Labels: Cross-service attributes for the location. For example 1502 // {"cloud.googleapis.com/region": "us-east1"} 1503 Labels map[string]string `json:"labels,omitempty"` 1504 // LocationId: The canonical id for this location. For example: "us-east1". 1505 LocationId string `json:"locationId,omitempty"` 1506 // Metadata: Service-specific metadata. For example the available capacity at 1507 // the given location. 1508 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 1509 // Name: Resource name for the location, which may vary between 1510 // implementations. For example: 1511 // "projects/example-project/locations/us-east1" 1512 Name string `json:"name,omitempty"` 1513 // ForceSendFields is a list of field names (e.g. "DisplayName") to 1514 // unconditionally include in API requests. By default, fields with empty or 1515 // default values are omitted from API requests. See 1516 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1517 // details. 1518 ForceSendFields []string `json:"-"` 1519 // NullFields is a list of field names (e.g. "DisplayName") to include in API 1520 // requests with the JSON null value. By default, fields with empty values are 1521 // omitted from API requests. See 1522 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1523 NullFields []string `json:"-"` 1524 } 1525 1526 func (s *Location) MarshalJSON() ([]byte, error) { 1527 type NoMethod Location 1528 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1529 } 1530 1531 // OnDeployUpdatePolicy: Security patches are only applied when a function is 1532 // redeployed. 1533 type OnDeployUpdatePolicy struct { 1534 // RuntimeVersion: Output only. contains the runtime version which was used 1535 // during latest function deployment. 1536 RuntimeVersion string `json:"runtimeVersion,omitempty"` 1537 // ForceSendFields is a list of field names (e.g. "RuntimeVersion") to 1538 // unconditionally include in API requests. By default, fields with empty or 1539 // default values are omitted from API requests. See 1540 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1541 // details. 1542 ForceSendFields []string `json:"-"` 1543 // NullFields is a list of field names (e.g. "RuntimeVersion") to include in 1544 // API requests with the JSON null value. By default, fields with empty values 1545 // are omitted from API requests. See 1546 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1547 NullFields []string `json:"-"` 1548 } 1549 1550 func (s *OnDeployUpdatePolicy) MarshalJSON() ([]byte, error) { 1551 type NoMethod OnDeployUpdatePolicy 1552 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1553 } 1554 1555 // Operation: This resource represents a long-running operation that is the 1556 // result of a network API call. 1557 type Operation struct { 1558 // Done: If the value is `false`, it means the operation is still in progress. 1559 // If `true`, the operation is completed, and either `error` or `response` is 1560 // available. 1561 Done bool `json:"done,omitempty"` 1562 // Error: The error result of the operation in case of failure or cancellation. 1563 Error *Status `json:"error,omitempty"` 1564 // Metadata: Service-specific metadata associated with the operation. It 1565 // typically contains progress information and common metadata such as create 1566 // time. Some services might not provide such metadata. Any method that returns 1567 // a long-running operation should document the metadata type, if any. 1568 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 1569 // Name: The server-assigned name, which is only unique within the same service 1570 // that originally returns it. If you use the default HTTP mapping, the `name` 1571 // should be a resource name ending with `operations/{unique_id}`. 1572 Name string `json:"name,omitempty"` 1573 // Response: The normal, successful response of the operation. If the original 1574 // method returns no data on success, such as `Delete`, the response is 1575 // `google.protobuf.Empty`. If the original method is standard 1576 // `Get`/`Create`/`Update`, the response should be the resource. For other 1577 // methods, the response should have the type `XxxResponse`, where `Xxx` is the 1578 // original method name. For example, if the original method name is 1579 // `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. 1580 Response googleapi.RawMessage `json:"response,omitempty"` 1581 1582 // ServerResponse contains the HTTP response code and headers from the server. 1583 googleapi.ServerResponse `json:"-"` 1584 // ForceSendFields is a list of field names (e.g. "Done") to unconditionally 1585 // include in API requests. By default, fields with empty or default values are 1586 // omitted from API requests. See 1587 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1588 // details. 1589 ForceSendFields []string `json:"-"` 1590 // NullFields is a list of field names (e.g. "Done") to include in API requests 1591 // with the JSON null value. By default, fields with empty values are omitted 1592 // from API requests. See 1593 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1594 NullFields []string `json:"-"` 1595 } 1596 1597 func (s *Operation) MarshalJSON() ([]byte, error) { 1598 type NoMethod Operation 1599 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1600 } 1601 1602 // OperationMetadataV1: Metadata describing an Operation 1603 type OperationMetadataV1 struct { 1604 // BuildId: The Cloud Build ID of the function created or updated by an API 1605 // call. This field is only populated for Create and Update operations. 1606 BuildId string `json:"buildId,omitempty"` 1607 // BuildName: The Cloud Build Name of the function deployment. This field is 1608 // only populated for Create and Update operations. 1609 // `projects//locations//builds/`. 1610 BuildName string `json:"buildName,omitempty"` 1611 // Request: The original request that started the operation. 1612 Request googleapi.RawMessage `json:"request,omitempty"` 1613 // SourceToken: An identifier for Firebase function sources. Disclaimer: This 1614 // field is only supported for Firebase function deployments. 1615 SourceToken string `json:"sourceToken,omitempty"` 1616 // Target: Target of the operation - for example 1617 // `projects/project-1/locations/region-1/functions/function-1` 1618 Target string `json:"target,omitempty"` 1619 // Type: Type of operation. 1620 // 1621 // Possible values: 1622 // "OPERATION_UNSPECIFIED" - Unknown operation type. 1623 // "CREATE_FUNCTION" - Triggered by CreateFunction call 1624 // "UPDATE_FUNCTION" - Triggered by UpdateFunction call 1625 // "DELETE_FUNCTION" - Triggered by DeleteFunction call. 1626 Type string `json:"type,omitempty"` 1627 // UpdateTime: The last update timestamp of the operation. 1628 UpdateTime string `json:"updateTime,omitempty"` 1629 // VersionId: Version id of the function created or updated by an API call. 1630 // This field is only populated for Create and Update operations. 1631 VersionId int64 `json:"versionId,omitempty,string"` 1632 // ForceSendFields is a list of field names (e.g. "BuildId") to unconditionally 1633 // include in API requests. By default, fields with empty or default values are 1634 // omitted from API requests. See 1635 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1636 // details. 1637 ForceSendFields []string `json:"-"` 1638 // NullFields is a list of field names (e.g. "BuildId") to include in API 1639 // requests with the JSON null value. By default, fields with empty values are 1640 // omitted from API requests. See 1641 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1642 NullFields []string `json:"-"` 1643 } 1644 1645 func (s *OperationMetadataV1) MarshalJSON() ([]byte, error) { 1646 type NoMethod OperationMetadataV1 1647 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1648 } 1649 1650 // Policy: An Identity and Access Management (IAM) policy, which specifies 1651 // access controls for Google Cloud resources. A `Policy` is a collection of 1652 // `bindings`. A `binding` binds one or more `members`, or principals, to a 1653 // single `role`. Principals can be user accounts, service accounts, Google 1654 // groups, and domains (such as G Suite). A `role` is a named list of 1655 // permissions; each `role` can be an IAM predefined role or a user-created 1656 // custom role. For some types of Google Cloud resources, a `binding` can also 1657 // specify a `condition`, which is a logical expression that allows access to a 1658 // resource only if the expression evaluates to `true`. A condition can add 1659 // constraints based on attributes of the request, the resource, or both. To 1660 // learn which resources support conditions in their IAM policies, see the IAM 1661 // documentation 1662 // (https://cloud.google.com/iam/help/conditions/resource-policies). **JSON 1663 // example:** ``` { "bindings": [ { "role": 1664 // "roles/resourcemanager.organizationAdmin", "members": [ 1665 // "user:mike@example.com", "group:admins@example.com", "domain:google.com", 1666 // "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": 1667 // "roles/resourcemanager.organizationViewer", "members": [ 1668 // "user:eve@example.com" ], "condition": { "title": "expirable access", 1669 // "description": "Does not grant access after Sep 2020", "expression": 1670 // "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": 1671 // "BwWWja0YfJA=", "version": 3 } ``` **YAML example:** ``` bindings: - 1672 // members: - user:mike@example.com - group:admins@example.com - 1673 // domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com 1674 // role: roles/resourcemanager.organizationAdmin - members: - 1675 // user:eve@example.com role: roles/resourcemanager.organizationViewer 1676 // condition: title: expirable access description: Does not grant access after 1677 // Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') 1678 // etag: BwWWja0YfJA= version: 3 ``` For a description of IAM and its features, 1679 // see the IAM documentation (https://cloud.google.com/iam/docs/). 1680 type Policy struct { 1681 // AuditConfigs: Specifies cloud audit logging configuration for this policy. 1682 AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"` 1683 // Bindings: Associates a list of `members`, or principals, with a `role`. 1684 // Optionally, may specify a `condition` that determines how and when the 1685 // `bindings` are applied. Each of the `bindings` must contain at least one 1686 // principal. The `bindings` in a `Policy` can refer to up to 1,500 principals; 1687 // up to 250 of these principals can be Google groups. Each occurrence of a 1688 // principal counts towards these limits. For example, if the `bindings` grant 1689 // 50 different roles to `user:alice@example.com`, and not to any other 1690 // principal, then you can add another 1,450 principals to the `bindings` in 1691 // the `Policy`. 1692 Bindings []*Binding `json:"bindings,omitempty"` 1693 // Etag: `etag` is used for optimistic concurrency control as a way to help 1694 // prevent simultaneous updates of a policy from overwriting each other. It is 1695 // strongly suggested that systems make use of the `etag` in the 1696 // read-modify-write cycle to perform policy updates in order to avoid race 1697 // conditions: An `etag` is returned in the response to `getIamPolicy`, and 1698 // systems are expected to put that etag in the request to `setIamPolicy` to 1699 // ensure that their change will be applied to the same version of the policy. 1700 // **Important:** If you use IAM Conditions, you must include the `etag` field 1701 // whenever you call `setIamPolicy`. If you omit this field, then IAM allows 1702 // you to overwrite a version `3` policy with a version `1` policy, and all of 1703 // the conditions in the version `3` policy are lost. 1704 Etag string `json:"etag,omitempty"` 1705 // Version: Specifies the format of the policy. Valid values are `0`, `1`, and 1706 // `3`. Requests that specify an invalid value are rejected. Any operation that 1707 // affects conditional role bindings must specify version `3`. This requirement 1708 // applies to the following operations: * Getting a policy that includes a 1709 // conditional role binding * Adding a conditional role binding to a policy * 1710 // Changing a conditional role binding in a policy * Removing any role binding, 1711 // with or without a condition, from a policy that includes conditions 1712 // **Important:** If you use IAM Conditions, you must include the `etag` field 1713 // whenever you call `setIamPolicy`. If you omit this field, then IAM allows 1714 // you to overwrite a version `3` policy with a version `1` policy, and all of 1715 // the conditions in the version `3` policy are lost. If a policy does not 1716 // include any conditions, operations on that policy may specify any valid 1717 // version or leave the field unset. To learn which resources support 1718 // conditions in their IAM policies, see the IAM documentation 1719 // (https://cloud.google.com/iam/help/conditions/resource-policies). 1720 Version int64 `json:"version,omitempty"` 1721 1722 // ServerResponse contains the HTTP response code and headers from the server. 1723 googleapi.ServerResponse `json:"-"` 1724 // ForceSendFields is a list of field names (e.g. "AuditConfigs") to 1725 // unconditionally include in API requests. By default, fields with empty or 1726 // default values are omitted from API requests. See 1727 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1728 // details. 1729 ForceSendFields []string `json:"-"` 1730 // NullFields is a list of field names (e.g. "AuditConfigs") to include in API 1731 // requests with the JSON null value. By default, fields with empty values are 1732 // omitted from API requests. See 1733 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1734 NullFields []string `json:"-"` 1735 } 1736 1737 func (s *Policy) MarshalJSON() ([]byte, error) { 1738 type NoMethod Policy 1739 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1740 } 1741 1742 // Retry: Describes the retry policy in case of function's execution failure. A 1743 // function execution will be retried on any failure. A failed execution will 1744 // be retried up to 7 days with an exponential backoff (capped at 10 seconds). 1745 // Retried execution is charged as any other execution. 1746 type Retry struct { 1747 } 1748 1749 // SecretEnvVar: Configuration for a secret environment variable. It has the 1750 // information necessary to fetch the secret value from secret manager and 1751 // expose it as an environment variable. 1752 type SecretEnvVar struct { 1753 // Key: Name of the environment variable. 1754 Key string `json:"key,omitempty"` 1755 // ProjectId: Project identifier (preferrably project number but can also be 1756 // the project ID) of the project that contains the secret. If not set, it will 1757 // be populated with the function's project assuming that the secret exists in 1758 // the same project as of the function. 1759 ProjectId string `json:"projectId,omitempty"` 1760 // Secret: Name of the secret in secret manager (not the full resource name). 1761 Secret string `json:"secret,omitempty"` 1762 // Version: Version of the secret (version number or the string 'latest'). It 1763 // is recommended to use a numeric version for secret environment variables as 1764 // any updates to the secret value is not reflected until new instances start. 1765 Version string `json:"version,omitempty"` 1766 // ForceSendFields is a list of field names (e.g. "Key") to unconditionally 1767 // include in API requests. By default, fields with empty or default values are 1768 // omitted from API requests. See 1769 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1770 // details. 1771 ForceSendFields []string `json:"-"` 1772 // NullFields is a list of field names (e.g. "Key") to include in API requests 1773 // with the JSON null value. By default, fields with empty values are omitted 1774 // from API requests. See 1775 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1776 NullFields []string `json:"-"` 1777 } 1778 1779 func (s *SecretEnvVar) MarshalJSON() ([]byte, error) { 1780 type NoMethod SecretEnvVar 1781 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1782 } 1783 1784 // SecretVersion: Configuration for a single version. 1785 type SecretVersion struct { 1786 // Path: Relative path of the file under the mount path where the secret value 1787 // for this version will be fetched and made available. For example, setting 1788 // the mount_path as '/etc/secrets' and path as `/secret_foo` would mount the 1789 // secret value file at `/etc/secrets/secret_foo`. 1790 Path string `json:"path,omitempty"` 1791 // Version: Version of the secret (version number or the string 'latest'). It 1792 // is preferable to use `latest` version with secret volumes as secret value 1793 // changes are reflected immediately. 1794 Version string `json:"version,omitempty"` 1795 // ForceSendFields is a list of field names (e.g. "Path") to unconditionally 1796 // include in API requests. By default, fields with empty or default values are 1797 // omitted from API requests. See 1798 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1799 // details. 1800 ForceSendFields []string `json:"-"` 1801 // NullFields is a list of field names (e.g. "Path") to include in API requests 1802 // with the JSON null value. By default, fields with empty values are omitted 1803 // from API requests. See 1804 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1805 NullFields []string `json:"-"` 1806 } 1807 1808 func (s *SecretVersion) MarshalJSON() ([]byte, error) { 1809 type NoMethod SecretVersion 1810 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1811 } 1812 1813 // SecretVolume: Configuration for a secret volume. It has the information 1814 // necessary to fetch the secret value from secret manager and make it 1815 // available as files mounted at the requested paths within the application 1816 // container. Secret value is not a part of the configuration. Every filesystem 1817 // read operation performs a lookup in secret manager to retrieve the secret 1818 // value. 1819 type SecretVolume struct { 1820 // MountPath: The path within the container to mount the secret volume. For 1821 // example, setting the mount_path as `/etc/secrets` would mount the secret 1822 // value files under the `/etc/secrets` directory. This directory will also be 1823 // completely shadowed and unavailable to mount any other secrets. Recommended 1824 // mount paths: /etc/secrets Restricted mount paths: /cloudsql, /dev/log, /pod, 1825 // /proc, /var/log 1826 MountPath string `json:"mountPath,omitempty"` 1827 // ProjectId: Project identifier (preferrably project number but can also be 1828 // the project ID) of the project that contains the secret. If not set, it will 1829 // be populated with the function's project assuming that the secret exists in 1830 // the same project as of the function. 1831 ProjectId string `json:"projectId,omitempty"` 1832 // Secret: Name of the secret in secret manager (not the full resource name). 1833 Secret string `json:"secret,omitempty"` 1834 // Versions: List of secret versions to mount for this secret. If empty, the 1835 // `latest` version of the secret will be made available in a file named after 1836 // the secret under the mount point. 1837 Versions []*SecretVersion `json:"versions,omitempty"` 1838 // ForceSendFields is a list of field names (e.g. "MountPath") to 1839 // unconditionally include in API requests. By default, fields with empty or 1840 // default values are omitted from API requests. See 1841 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1842 // details. 1843 ForceSendFields []string `json:"-"` 1844 // NullFields is a list of field names (e.g. "MountPath") to include in API 1845 // requests with the JSON null value. By default, fields with empty values are 1846 // omitted from API requests. See 1847 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1848 NullFields []string `json:"-"` 1849 } 1850 1851 func (s *SecretVolume) MarshalJSON() ([]byte, error) { 1852 type NoMethod SecretVolume 1853 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1854 } 1855 1856 // SetIamPolicyRequest: Request message for `SetIamPolicy` method. 1857 type SetIamPolicyRequest struct { 1858 // Policy: REQUIRED: The complete policy to be applied to the `resource`. The 1859 // size of the policy is limited to a few 10s of KB. An empty policy is a valid 1860 // policy but certain Google Cloud services (such as Projects) might reject 1861 // them. 1862 Policy *Policy `json:"policy,omitempty"` 1863 // UpdateMask: OPTIONAL: A FieldMask specifying which fields of the policy to 1864 // modify. Only the fields in the mask will be modified. If no mask is 1865 // provided, the following default mask is used: `paths: "bindings, etag" 1866 UpdateMask string `json:"updateMask,omitempty"` 1867 // ForceSendFields is a list of field names (e.g. "Policy") to unconditionally 1868 // include in API requests. By default, fields with empty or default values are 1869 // omitted from API requests. See 1870 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1871 // details. 1872 ForceSendFields []string `json:"-"` 1873 // NullFields is a list of field names (e.g. "Policy") to include in API 1874 // requests with the JSON null value. By default, fields with empty values are 1875 // omitted from API requests. See 1876 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1877 NullFields []string `json:"-"` 1878 } 1879 1880 func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) { 1881 type NoMethod SetIamPolicyRequest 1882 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1883 } 1884 1885 // SourceRepository: Describes SourceRepository, used to represent parameters 1886 // related to source repository where a function is hosted. 1887 type SourceRepository struct { 1888 // DeployedUrl: Output only. The URL pointing to the hosted repository where 1889 // the function were defined at the time of deployment. It always points to a 1890 // specific commit in the format described above. 1891 DeployedUrl string `json:"deployedUrl,omitempty"` 1892 // Url: The URL pointing to the hosted repository where the function is 1893 // defined. There are supported Cloud Source Repository URLs in the following 1894 // formats: To refer to a specific commit: 1895 // `https://source.developers.google.com/projects/*/repos/*/revisions/*/paths/*` 1896 // To refer to a moveable alias (branch): 1897 // `https://source.developers.google.com/projects/*/repos/*/moveable-aliases/*/p 1898 // aths/*` In particular, to refer to HEAD use `master` moveable alias. To 1899 // refer to a specific fixed alias (tag): 1900 // `https://source.developers.google.com/projects/*/repos/*/fixed-aliases/*/path 1901 // s/*` You may omit `paths/*` if you want to use the main directory. 1902 Url string `json:"url,omitempty"` 1903 // ForceSendFields is a list of field names (e.g. "DeployedUrl") to 1904 // unconditionally include in API requests. By default, fields with empty or 1905 // default values are omitted from API requests. See 1906 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1907 // details. 1908 ForceSendFields []string `json:"-"` 1909 // NullFields is a list of field names (e.g. "DeployedUrl") to include in API 1910 // requests with the JSON null value. By default, fields with empty values are 1911 // omitted from API requests. See 1912 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1913 NullFields []string `json:"-"` 1914 } 1915 1916 func (s *SourceRepository) MarshalJSON() ([]byte, error) { 1917 type NoMethod SourceRepository 1918 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1919 } 1920 1921 // Status: The `Status` type defines a logical error model that is suitable for 1922 // different programming environments, including REST APIs and RPC APIs. It is 1923 // used by gRPC (https://github.com/grpc). Each `Status` message contains three 1924 // pieces of data: error code, error message, and error details. You can find 1925 // out more about this error model and how to work with it in the API Design 1926 // Guide (https://cloud.google.com/apis/design/errors). 1927 type Status struct { 1928 // Code: The status code, which should be an enum value of google.rpc.Code. 1929 Code int64 `json:"code,omitempty"` 1930 // Details: A list of messages that carry the error details. There is a common 1931 // set of message types for APIs to use. 1932 Details []googleapi.RawMessage `json:"details,omitempty"` 1933 // Message: A developer-facing error message, which should be in English. Any 1934 // user-facing error message should be localized and sent in the 1935 // google.rpc.Status.details field, or localized by the client. 1936 Message string `json:"message,omitempty"` 1937 // ForceSendFields is a list of field names (e.g. "Code") to unconditionally 1938 // include in API requests. By default, fields with empty or default values are 1939 // omitted from API requests. See 1940 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1941 // details. 1942 ForceSendFields []string `json:"-"` 1943 // NullFields is a list of field names (e.g. "Code") to include in API requests 1944 // with the JSON null value. By default, fields with empty values are omitted 1945 // from API requests. See 1946 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1947 NullFields []string `json:"-"` 1948 } 1949 1950 func (s *Status) MarshalJSON() ([]byte, error) { 1951 type NoMethod Status 1952 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1953 } 1954 1955 // TestIamPermissionsRequest: Request message for `TestIamPermissions` method. 1956 type TestIamPermissionsRequest struct { 1957 // Permissions: The set of permissions to check for the `resource`. Permissions 1958 // with wildcards (such as `*` or `storage.*`) are not allowed. For more 1959 // information see IAM Overview 1960 // (https://cloud.google.com/iam/docs/overview#permissions). 1961 Permissions []string `json:"permissions,omitempty"` 1962 // ForceSendFields is a list of field names (e.g. "Permissions") to 1963 // unconditionally include in API requests. By default, fields with empty or 1964 // default values are omitted from API requests. See 1965 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1966 // details. 1967 ForceSendFields []string `json:"-"` 1968 // NullFields is a list of field names (e.g. "Permissions") to include in API 1969 // requests with the JSON null value. By default, fields with empty values are 1970 // omitted from API requests. See 1971 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1972 NullFields []string `json:"-"` 1973 } 1974 1975 func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) { 1976 type NoMethod TestIamPermissionsRequest 1977 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1978 } 1979 1980 // TestIamPermissionsResponse: Response message for `TestIamPermissions` 1981 // method. 1982 type TestIamPermissionsResponse struct { 1983 // Permissions: A subset of `TestPermissionsRequest.permissions` that the 1984 // caller is allowed. 1985 Permissions []string `json:"permissions,omitempty"` 1986 1987 // ServerResponse contains the HTTP response code and headers from the server. 1988 googleapi.ServerResponse `json:"-"` 1989 // ForceSendFields is a list of field names (e.g. "Permissions") to 1990 // unconditionally include in API requests. By default, fields with empty or 1991 // default values are omitted from API requests. See 1992 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1993 // details. 1994 ForceSendFields []string `json:"-"` 1995 // NullFields is a list of field names (e.g. "Permissions") to include in API 1996 // requests with the JSON null value. By default, fields with empty values are 1997 // omitted from API requests. See 1998 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1999 NullFields []string `json:"-"` 2000 } 2001 2002 func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) { 2003 type NoMethod TestIamPermissionsResponse 2004 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2005 } 2006 2007 type OperationsGetCall struct { 2008 s *Service 2009 name string 2010 urlParams_ gensupport.URLParams 2011 ifNoneMatch_ string 2012 ctx_ context.Context 2013 header_ http.Header 2014 } 2015 2016 // Get: Gets the latest state of a long-running operation. Clients can use this 2017 // method to poll the operation result at intervals as recommended by the API 2018 // service. 2019 // 2020 // - name: The name of the operation resource. 2021 func (r *OperationsService) Get(name string) *OperationsGetCall { 2022 c := &OperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2023 c.name = name 2024 return c 2025 } 2026 2027 // Fields allows partial responses to be retrieved. See 2028 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2029 // details. 2030 func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall { 2031 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2032 return c 2033 } 2034 2035 // IfNoneMatch sets an optional parameter which makes the operation fail if the 2036 // object's ETag matches the given value. This is useful for getting updates 2037 // only after the object has changed since the last request. 2038 func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall { 2039 c.ifNoneMatch_ = entityTag 2040 return c 2041 } 2042 2043 // Context sets the context to be used in this call's Do method. 2044 func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall { 2045 c.ctx_ = ctx 2046 return c 2047 } 2048 2049 // Header returns a http.Header that can be modified by the caller to add 2050 // headers to the request. 2051 func (c *OperationsGetCall) Header() http.Header { 2052 if c.header_ == nil { 2053 c.header_ = make(http.Header) 2054 } 2055 return c.header_ 2056 } 2057 2058 func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { 2059 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 2060 if c.ifNoneMatch_ != "" { 2061 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2062 } 2063 var body io.Reader = nil 2064 c.urlParams_.Set("alt", alt) 2065 c.urlParams_.Set("prettyPrint", "false") 2066 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 2067 urls += "?" + c.urlParams_.Encode() 2068 req, err := http.NewRequest("GET", urls, body) 2069 if err != nil { 2070 return nil, err 2071 } 2072 req.Header = reqHeaders 2073 googleapi.Expand(req.URL, map[string]string{ 2074 "name": c.name, 2075 }) 2076 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2077 } 2078 2079 // Do executes the "cloudfunctions.operations.get" call. 2080 // Any non-2xx status code is an error. Response headers are in either 2081 // *Operation.ServerResponse.Header or (if a response was returned at all) in 2082 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2083 // whether the returned error was because http.StatusNotModified was returned. 2084 func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 2085 gensupport.SetOptions(c.urlParams_, opts...) 2086 res, err := c.doRequest("json") 2087 if res != nil && res.StatusCode == http.StatusNotModified { 2088 if res.Body != nil { 2089 res.Body.Close() 2090 } 2091 return nil, gensupport.WrapError(&googleapi.Error{ 2092 Code: res.StatusCode, 2093 Header: res.Header, 2094 }) 2095 } 2096 if err != nil { 2097 return nil, err 2098 } 2099 defer googleapi.CloseBody(res) 2100 if err := googleapi.CheckResponse(res); err != nil { 2101 return nil, gensupport.WrapError(err) 2102 } 2103 ret := &Operation{ 2104 ServerResponse: googleapi.ServerResponse{ 2105 Header: res.Header, 2106 HTTPStatusCode: res.StatusCode, 2107 }, 2108 } 2109 target := &ret 2110 if err := gensupport.DecodeResponse(target, res); err != nil { 2111 return nil, err 2112 } 2113 return ret, nil 2114 } 2115 2116 type OperationsListCall struct { 2117 s *Service 2118 urlParams_ gensupport.URLParams 2119 ifNoneMatch_ string 2120 ctx_ context.Context 2121 header_ http.Header 2122 } 2123 2124 // List: Lists operations that match the specified filter in the request. If 2125 // the server doesn't support this method, it returns `UNIMPLEMENTED`. 2126 func (r *OperationsService) List() *OperationsListCall { 2127 c := &OperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2128 return c 2129 } 2130 2131 // Filter sets the optional parameter "filter": The standard list filter. 2132 func (c *OperationsListCall) Filter(filter string) *OperationsListCall { 2133 c.urlParams_.Set("filter", filter) 2134 return c 2135 } 2136 2137 // Name sets the optional parameter "name": The name of the operation's parent 2138 // resource. 2139 func (c *OperationsListCall) Name(name string) *OperationsListCall { 2140 c.urlParams_.Set("name", name) 2141 return c 2142 } 2143 2144 // PageSize sets the optional parameter "pageSize": The standard list page 2145 // size. 2146 func (c *OperationsListCall) PageSize(pageSize int64) *OperationsListCall { 2147 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 2148 return c 2149 } 2150 2151 // PageToken sets the optional parameter "pageToken": The standard list page 2152 // token. 2153 func (c *OperationsListCall) PageToken(pageToken string) *OperationsListCall { 2154 c.urlParams_.Set("pageToken", pageToken) 2155 return c 2156 } 2157 2158 // Fields allows partial responses to be retrieved. See 2159 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2160 // details. 2161 func (c *OperationsListCall) Fields(s ...googleapi.Field) *OperationsListCall { 2162 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2163 return c 2164 } 2165 2166 // IfNoneMatch sets an optional parameter which makes the operation fail if the 2167 // object's ETag matches the given value. This is useful for getting updates 2168 // only after the object has changed since the last request. 2169 func (c *OperationsListCall) IfNoneMatch(entityTag string) *OperationsListCall { 2170 c.ifNoneMatch_ = entityTag 2171 return c 2172 } 2173 2174 // Context sets the context to be used in this call's Do method. 2175 func (c *OperationsListCall) Context(ctx context.Context) *OperationsListCall { 2176 c.ctx_ = ctx 2177 return c 2178 } 2179 2180 // Header returns a http.Header that can be modified by the caller to add 2181 // headers to the request. 2182 func (c *OperationsListCall) Header() http.Header { 2183 if c.header_ == nil { 2184 c.header_ = make(http.Header) 2185 } 2186 return c.header_ 2187 } 2188 2189 func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) { 2190 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 2191 if c.ifNoneMatch_ != "" { 2192 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2193 } 2194 var body io.Reader = nil 2195 c.urlParams_.Set("alt", alt) 2196 c.urlParams_.Set("prettyPrint", "false") 2197 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/operations") 2198 urls += "?" + c.urlParams_.Encode() 2199 req, err := http.NewRequest("GET", urls, body) 2200 if err != nil { 2201 return nil, err 2202 } 2203 req.Header = reqHeaders 2204 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2205 } 2206 2207 // Do executes the "cloudfunctions.operations.list" call. 2208 // Any non-2xx status code is an error. Response headers are in either 2209 // *ListOperationsResponse.ServerResponse.Header or (if a response was returned 2210 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2211 // check whether the returned error was because http.StatusNotModified was 2212 // returned. 2213 func (c *OperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) { 2214 gensupport.SetOptions(c.urlParams_, opts...) 2215 res, err := c.doRequest("json") 2216 if res != nil && res.StatusCode == http.StatusNotModified { 2217 if res.Body != nil { 2218 res.Body.Close() 2219 } 2220 return nil, gensupport.WrapError(&googleapi.Error{ 2221 Code: res.StatusCode, 2222 Header: res.Header, 2223 }) 2224 } 2225 if err != nil { 2226 return nil, err 2227 } 2228 defer googleapi.CloseBody(res) 2229 if err := googleapi.CheckResponse(res); err != nil { 2230 return nil, gensupport.WrapError(err) 2231 } 2232 ret := &ListOperationsResponse{ 2233 ServerResponse: googleapi.ServerResponse{ 2234 Header: res.Header, 2235 HTTPStatusCode: res.StatusCode, 2236 }, 2237 } 2238 target := &ret 2239 if err := gensupport.DecodeResponse(target, res); err != nil { 2240 return nil, err 2241 } 2242 return ret, nil 2243 } 2244 2245 // Pages invokes f for each page of results. 2246 // A non-nil error returned from f will halt the iteration. 2247 // The provided context supersedes any context provided to the Context method. 2248 func (c *OperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error { 2249 c.ctx_ = ctx 2250 defer c.PageToken(c.urlParams_.Get("pageToken")) 2251 for { 2252 x, err := c.Do() 2253 if err != nil { 2254 return err 2255 } 2256 if err := f(x); err != nil { 2257 return err 2258 } 2259 if x.NextPageToken == "" { 2260 return nil 2261 } 2262 c.PageToken(x.NextPageToken) 2263 } 2264 } 2265 2266 type ProjectsLocationsListCall struct { 2267 s *Service 2268 name string 2269 urlParams_ gensupport.URLParams 2270 ifNoneMatch_ string 2271 ctx_ context.Context 2272 header_ http.Header 2273 } 2274 2275 // List: Lists information about the supported locations for this service. 2276 // 2277 // - name: The resource that owns the locations collection, if applicable. 2278 func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall { 2279 c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2280 c.name = name 2281 return c 2282 } 2283 2284 // Filter sets the optional parameter "filter": A filter to narrow down results 2285 // to a preferred subset. The filtering language accepts strings like 2286 // "displayName=tokyo", and is documented in more detail in AIP-160 2287 // (https://google.aip.dev/160). 2288 func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall { 2289 c.urlParams_.Set("filter", filter) 2290 return c 2291 } 2292 2293 // PageSize sets the optional parameter "pageSize": The maximum number of 2294 // results to return. If not set, the service selects a default. 2295 func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall { 2296 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 2297 return c 2298 } 2299 2300 // PageToken sets the optional parameter "pageToken": A page token received 2301 // from the `next_page_token` field in the response. Send that page token to 2302 // receive the subsequent page. 2303 func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall { 2304 c.urlParams_.Set("pageToken", pageToken) 2305 return c 2306 } 2307 2308 // Fields allows partial responses to be retrieved. See 2309 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2310 // details. 2311 func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall { 2312 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2313 return c 2314 } 2315 2316 // IfNoneMatch sets an optional parameter which makes the operation fail if the 2317 // object's ETag matches the given value. This is useful for getting updates 2318 // only after the object has changed since the last request. 2319 func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall { 2320 c.ifNoneMatch_ = entityTag 2321 return c 2322 } 2323 2324 // Context sets the context to be used in this call's Do method. 2325 func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall { 2326 c.ctx_ = ctx 2327 return c 2328 } 2329 2330 // Header returns a http.Header that can be modified by the caller to add 2331 // headers to the request. 2332 func (c *ProjectsLocationsListCall) Header() http.Header { 2333 if c.header_ == nil { 2334 c.header_ = make(http.Header) 2335 } 2336 return c.header_ 2337 } 2338 2339 func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) { 2340 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 2341 if c.ifNoneMatch_ != "" { 2342 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2343 } 2344 var body io.Reader = nil 2345 c.urlParams_.Set("alt", alt) 2346 c.urlParams_.Set("prettyPrint", "false") 2347 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") 2348 urls += "?" + c.urlParams_.Encode() 2349 req, err := http.NewRequest("GET", urls, body) 2350 if err != nil { 2351 return nil, err 2352 } 2353 req.Header = reqHeaders 2354 googleapi.Expand(req.URL, map[string]string{ 2355 "name": c.name, 2356 }) 2357 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2358 } 2359 2360 // Do executes the "cloudfunctions.projects.locations.list" call. 2361 // Any non-2xx status code is an error. Response headers are in either 2362 // *ListLocationsResponse.ServerResponse.Header or (if a response was returned 2363 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2364 // check whether the returned error was because http.StatusNotModified was 2365 // returned. 2366 func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) { 2367 gensupport.SetOptions(c.urlParams_, opts...) 2368 res, err := c.doRequest("json") 2369 if res != nil && res.StatusCode == http.StatusNotModified { 2370 if res.Body != nil { 2371 res.Body.Close() 2372 } 2373 return nil, gensupport.WrapError(&googleapi.Error{ 2374 Code: res.StatusCode, 2375 Header: res.Header, 2376 }) 2377 } 2378 if err != nil { 2379 return nil, err 2380 } 2381 defer googleapi.CloseBody(res) 2382 if err := googleapi.CheckResponse(res); err != nil { 2383 return nil, gensupport.WrapError(err) 2384 } 2385 ret := &ListLocationsResponse{ 2386 ServerResponse: googleapi.ServerResponse{ 2387 Header: res.Header, 2388 HTTPStatusCode: res.StatusCode, 2389 }, 2390 } 2391 target := &ret 2392 if err := gensupport.DecodeResponse(target, res); err != nil { 2393 return nil, err 2394 } 2395 return ret, nil 2396 } 2397 2398 // Pages invokes f for each page of results. 2399 // A non-nil error returned from f will halt the iteration. 2400 // The provided context supersedes any context provided to the Context method. 2401 func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error { 2402 c.ctx_ = ctx 2403 defer c.PageToken(c.urlParams_.Get("pageToken")) 2404 for { 2405 x, err := c.Do() 2406 if err != nil { 2407 return err 2408 } 2409 if err := f(x); err != nil { 2410 return err 2411 } 2412 if x.NextPageToken == "" { 2413 return nil 2414 } 2415 c.PageToken(x.NextPageToken) 2416 } 2417 } 2418 2419 type ProjectsLocationsFunctionsCallCall struct { 2420 s *Service 2421 name string 2422 callfunctionrequest *CallFunctionRequest 2423 urlParams_ gensupport.URLParams 2424 ctx_ context.Context 2425 header_ http.Header 2426 } 2427 2428 // Call: Synchronously invokes a deployed Cloud Function. To be used for 2429 // testing purposes as very limited traffic is allowed. For more information on 2430 // the actual limits, refer to Rate Limits 2431 // (https://cloud.google.com/functions/quotas#rate_limits). 2432 // 2433 // - name: The name of the function to be called. 2434 func (r *ProjectsLocationsFunctionsService) Call(name string, callfunctionrequest *CallFunctionRequest) *ProjectsLocationsFunctionsCallCall { 2435 c := &ProjectsLocationsFunctionsCallCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2436 c.name = name 2437 c.callfunctionrequest = callfunctionrequest 2438 return c 2439 } 2440 2441 // Fields allows partial responses to be retrieved. See 2442 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2443 // details. 2444 func (c *ProjectsLocationsFunctionsCallCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsCallCall { 2445 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2446 return c 2447 } 2448 2449 // Context sets the context to be used in this call's Do method. 2450 func (c *ProjectsLocationsFunctionsCallCall) Context(ctx context.Context) *ProjectsLocationsFunctionsCallCall { 2451 c.ctx_ = ctx 2452 return c 2453 } 2454 2455 // Header returns a http.Header that can be modified by the caller to add 2456 // headers to the request. 2457 func (c *ProjectsLocationsFunctionsCallCall) Header() http.Header { 2458 if c.header_ == nil { 2459 c.header_ = make(http.Header) 2460 } 2461 return c.header_ 2462 } 2463 2464 func (c *ProjectsLocationsFunctionsCallCall) doRequest(alt string) (*http.Response, error) { 2465 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 2466 var body io.Reader = nil 2467 body, err := googleapi.WithoutDataWrapper.JSONReader(c.callfunctionrequest) 2468 if err != nil { 2469 return nil, err 2470 } 2471 c.urlParams_.Set("alt", alt) 2472 c.urlParams_.Set("prettyPrint", "false") 2473 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:call") 2474 urls += "?" + c.urlParams_.Encode() 2475 req, err := http.NewRequest("POST", urls, body) 2476 if err != nil { 2477 return nil, err 2478 } 2479 req.Header = reqHeaders 2480 googleapi.Expand(req.URL, map[string]string{ 2481 "name": c.name, 2482 }) 2483 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2484 } 2485 2486 // Do executes the "cloudfunctions.projects.locations.functions.call" call. 2487 // Any non-2xx status code is an error. Response headers are in either 2488 // *CallFunctionResponse.ServerResponse.Header or (if a response was returned 2489 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2490 // check whether the returned error was because http.StatusNotModified was 2491 // returned. 2492 func (c *ProjectsLocationsFunctionsCallCall) Do(opts ...googleapi.CallOption) (*CallFunctionResponse, error) { 2493 gensupport.SetOptions(c.urlParams_, opts...) 2494 res, err := c.doRequest("json") 2495 if res != nil && res.StatusCode == http.StatusNotModified { 2496 if res.Body != nil { 2497 res.Body.Close() 2498 } 2499 return nil, gensupport.WrapError(&googleapi.Error{ 2500 Code: res.StatusCode, 2501 Header: res.Header, 2502 }) 2503 } 2504 if err != nil { 2505 return nil, err 2506 } 2507 defer googleapi.CloseBody(res) 2508 if err := googleapi.CheckResponse(res); err != nil { 2509 return nil, gensupport.WrapError(err) 2510 } 2511 ret := &CallFunctionResponse{ 2512 ServerResponse: googleapi.ServerResponse{ 2513 Header: res.Header, 2514 HTTPStatusCode: res.StatusCode, 2515 }, 2516 } 2517 target := &ret 2518 if err := gensupport.DecodeResponse(target, res); err != nil { 2519 return nil, err 2520 } 2521 return ret, nil 2522 } 2523 2524 type ProjectsLocationsFunctionsCreateCall struct { 2525 s *Service 2526 location string 2527 cloudfunction *CloudFunction 2528 urlParams_ gensupport.URLParams 2529 ctx_ context.Context 2530 header_ http.Header 2531 } 2532 2533 // Create: Creates a new function. If a function with the given name already 2534 // exists in the specified project, the long running operation will return 2535 // `ALREADY_EXISTS` error. 2536 // 2537 // - location: The project and location in which the function should be 2538 // created, specified in the format `projects/*/locations/*`. 2539 func (r *ProjectsLocationsFunctionsService) Create(location string, cloudfunction *CloudFunction) *ProjectsLocationsFunctionsCreateCall { 2540 c := &ProjectsLocationsFunctionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2541 c.location = location 2542 c.cloudfunction = cloudfunction 2543 return c 2544 } 2545 2546 // Fields allows partial responses to be retrieved. See 2547 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2548 // details. 2549 func (c *ProjectsLocationsFunctionsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsCreateCall { 2550 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2551 return c 2552 } 2553 2554 // Context sets the context to be used in this call's Do method. 2555 func (c *ProjectsLocationsFunctionsCreateCall) Context(ctx context.Context) *ProjectsLocationsFunctionsCreateCall { 2556 c.ctx_ = ctx 2557 return c 2558 } 2559 2560 // Header returns a http.Header that can be modified by the caller to add 2561 // headers to the request. 2562 func (c *ProjectsLocationsFunctionsCreateCall) Header() http.Header { 2563 if c.header_ == nil { 2564 c.header_ = make(http.Header) 2565 } 2566 return c.header_ 2567 } 2568 2569 func (c *ProjectsLocationsFunctionsCreateCall) doRequest(alt string) (*http.Response, error) { 2570 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 2571 var body io.Reader = nil 2572 body, err := googleapi.WithoutDataWrapper.JSONReader(c.cloudfunction) 2573 if err != nil { 2574 return nil, err 2575 } 2576 c.urlParams_.Set("alt", alt) 2577 c.urlParams_.Set("prettyPrint", "false") 2578 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+location}/functions") 2579 urls += "?" + c.urlParams_.Encode() 2580 req, err := http.NewRequest("POST", urls, body) 2581 if err != nil { 2582 return nil, err 2583 } 2584 req.Header = reqHeaders 2585 googleapi.Expand(req.URL, map[string]string{ 2586 "location": c.location, 2587 }) 2588 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2589 } 2590 2591 // Do executes the "cloudfunctions.projects.locations.functions.create" call. 2592 // Any non-2xx status code is an error. Response headers are in either 2593 // *Operation.ServerResponse.Header or (if a response was returned at all) in 2594 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2595 // whether the returned error was because http.StatusNotModified was returned. 2596 func (c *ProjectsLocationsFunctionsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 2597 gensupport.SetOptions(c.urlParams_, opts...) 2598 res, err := c.doRequest("json") 2599 if res != nil && res.StatusCode == http.StatusNotModified { 2600 if res.Body != nil { 2601 res.Body.Close() 2602 } 2603 return nil, gensupport.WrapError(&googleapi.Error{ 2604 Code: res.StatusCode, 2605 Header: res.Header, 2606 }) 2607 } 2608 if err != nil { 2609 return nil, err 2610 } 2611 defer googleapi.CloseBody(res) 2612 if err := googleapi.CheckResponse(res); err != nil { 2613 return nil, gensupport.WrapError(err) 2614 } 2615 ret := &Operation{ 2616 ServerResponse: googleapi.ServerResponse{ 2617 Header: res.Header, 2618 HTTPStatusCode: res.StatusCode, 2619 }, 2620 } 2621 target := &ret 2622 if err := gensupport.DecodeResponse(target, res); err != nil { 2623 return nil, err 2624 } 2625 return ret, nil 2626 } 2627 2628 type ProjectsLocationsFunctionsDeleteCall struct { 2629 s *Service 2630 name string 2631 urlParams_ gensupport.URLParams 2632 ctx_ context.Context 2633 header_ http.Header 2634 } 2635 2636 // Delete: Deletes a function with the given name from the specified project. 2637 // If the given function is used by some trigger, the trigger will be updated 2638 // to remove this function. 2639 // 2640 // - name: The name of the function which should be deleted. 2641 func (r *ProjectsLocationsFunctionsService) Delete(name string) *ProjectsLocationsFunctionsDeleteCall { 2642 c := &ProjectsLocationsFunctionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2643 c.name = name 2644 return c 2645 } 2646 2647 // Fields allows partial responses to be retrieved. See 2648 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2649 // details. 2650 func (c *ProjectsLocationsFunctionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsDeleteCall { 2651 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2652 return c 2653 } 2654 2655 // Context sets the context to be used in this call's Do method. 2656 func (c *ProjectsLocationsFunctionsDeleteCall) Context(ctx context.Context) *ProjectsLocationsFunctionsDeleteCall { 2657 c.ctx_ = ctx 2658 return c 2659 } 2660 2661 // Header returns a http.Header that can be modified by the caller to add 2662 // headers to the request. 2663 func (c *ProjectsLocationsFunctionsDeleteCall) Header() http.Header { 2664 if c.header_ == nil { 2665 c.header_ = make(http.Header) 2666 } 2667 return c.header_ 2668 } 2669 2670 func (c *ProjectsLocationsFunctionsDeleteCall) doRequest(alt string) (*http.Response, error) { 2671 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 2672 var body io.Reader = nil 2673 c.urlParams_.Set("alt", alt) 2674 c.urlParams_.Set("prettyPrint", "false") 2675 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 2676 urls += "?" + c.urlParams_.Encode() 2677 req, err := http.NewRequest("DELETE", urls, body) 2678 if err != nil { 2679 return nil, err 2680 } 2681 req.Header = reqHeaders 2682 googleapi.Expand(req.URL, map[string]string{ 2683 "name": c.name, 2684 }) 2685 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2686 } 2687 2688 // Do executes the "cloudfunctions.projects.locations.functions.delete" call. 2689 // Any non-2xx status code is an error. Response headers are in either 2690 // *Operation.ServerResponse.Header or (if a response was returned at all) in 2691 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2692 // whether the returned error was because http.StatusNotModified was returned. 2693 func (c *ProjectsLocationsFunctionsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 2694 gensupport.SetOptions(c.urlParams_, opts...) 2695 res, err := c.doRequest("json") 2696 if res != nil && res.StatusCode == http.StatusNotModified { 2697 if res.Body != nil { 2698 res.Body.Close() 2699 } 2700 return nil, gensupport.WrapError(&googleapi.Error{ 2701 Code: res.StatusCode, 2702 Header: res.Header, 2703 }) 2704 } 2705 if err != nil { 2706 return nil, err 2707 } 2708 defer googleapi.CloseBody(res) 2709 if err := googleapi.CheckResponse(res); err != nil { 2710 return nil, gensupport.WrapError(err) 2711 } 2712 ret := &Operation{ 2713 ServerResponse: googleapi.ServerResponse{ 2714 Header: res.Header, 2715 HTTPStatusCode: res.StatusCode, 2716 }, 2717 } 2718 target := &ret 2719 if err := gensupport.DecodeResponse(target, res); err != nil { 2720 return nil, err 2721 } 2722 return ret, nil 2723 } 2724 2725 type ProjectsLocationsFunctionsGenerateDownloadUrlCall struct { 2726 s *Service 2727 name string 2728 generatedownloadurlrequest *GenerateDownloadUrlRequest 2729 urlParams_ gensupport.URLParams 2730 ctx_ context.Context 2731 header_ http.Header 2732 } 2733 2734 // GenerateDownloadUrl: Returns a signed URL for downloading deployed function 2735 // source code. The URL is only valid for a limited period and should be used 2736 // within minutes after generation. For more information about the signed URL 2737 // usage see: https://cloud.google.com/storage/docs/access-control/signed-urls 2738 // 2739 // - name: The name of function for which source code Google Cloud Storage 2740 // signed URL should be generated. 2741 func (r *ProjectsLocationsFunctionsService) GenerateDownloadUrl(name string, generatedownloadurlrequest *GenerateDownloadUrlRequest) *ProjectsLocationsFunctionsGenerateDownloadUrlCall { 2742 c := &ProjectsLocationsFunctionsGenerateDownloadUrlCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2743 c.name = name 2744 c.generatedownloadurlrequest = generatedownloadurlrequest 2745 return c 2746 } 2747 2748 // Fields allows partial responses to be retrieved. See 2749 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2750 // details. 2751 func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsGenerateDownloadUrlCall { 2752 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2753 return c 2754 } 2755 2756 // Context sets the context to be used in this call's Do method. 2757 func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Context(ctx context.Context) *ProjectsLocationsFunctionsGenerateDownloadUrlCall { 2758 c.ctx_ = ctx 2759 return c 2760 } 2761 2762 // Header returns a http.Header that can be modified by the caller to add 2763 // headers to the request. 2764 func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Header() http.Header { 2765 if c.header_ == nil { 2766 c.header_ = make(http.Header) 2767 } 2768 return c.header_ 2769 } 2770 2771 func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) doRequest(alt string) (*http.Response, error) { 2772 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 2773 var body io.Reader = nil 2774 body, err := googleapi.WithoutDataWrapper.JSONReader(c.generatedownloadurlrequest) 2775 if err != nil { 2776 return nil, err 2777 } 2778 c.urlParams_.Set("alt", alt) 2779 c.urlParams_.Set("prettyPrint", "false") 2780 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:generateDownloadUrl") 2781 urls += "?" + c.urlParams_.Encode() 2782 req, err := http.NewRequest("POST", urls, body) 2783 if err != nil { 2784 return nil, err 2785 } 2786 req.Header = reqHeaders 2787 googleapi.Expand(req.URL, map[string]string{ 2788 "name": c.name, 2789 }) 2790 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2791 } 2792 2793 // Do executes the "cloudfunctions.projects.locations.functions.generateDownloadUrl" call. 2794 // Any non-2xx status code is an error. Response headers are in either 2795 // *GenerateDownloadUrlResponse.ServerResponse.Header or (if a response was 2796 // returned at all) in error.(*googleapi.Error).Header. Use 2797 // googleapi.IsNotModified to check whether the returned error was because 2798 // http.StatusNotModified was returned. 2799 func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Do(opts ...googleapi.CallOption) (*GenerateDownloadUrlResponse, error) { 2800 gensupport.SetOptions(c.urlParams_, opts...) 2801 res, err := c.doRequest("json") 2802 if res != nil && res.StatusCode == http.StatusNotModified { 2803 if res.Body != nil { 2804 res.Body.Close() 2805 } 2806 return nil, gensupport.WrapError(&googleapi.Error{ 2807 Code: res.StatusCode, 2808 Header: res.Header, 2809 }) 2810 } 2811 if err != nil { 2812 return nil, err 2813 } 2814 defer googleapi.CloseBody(res) 2815 if err := googleapi.CheckResponse(res); err != nil { 2816 return nil, gensupport.WrapError(err) 2817 } 2818 ret := &GenerateDownloadUrlResponse{ 2819 ServerResponse: googleapi.ServerResponse{ 2820 Header: res.Header, 2821 HTTPStatusCode: res.StatusCode, 2822 }, 2823 } 2824 target := &ret 2825 if err := gensupport.DecodeResponse(target, res); err != nil { 2826 return nil, err 2827 } 2828 return ret, nil 2829 } 2830 2831 type ProjectsLocationsFunctionsGenerateUploadUrlCall struct { 2832 s *Service 2833 parent string 2834 generateuploadurlrequest *GenerateUploadUrlRequest 2835 urlParams_ gensupport.URLParams 2836 ctx_ context.Context 2837 header_ http.Header 2838 } 2839 2840 // GenerateUploadUrl: Returns a signed URL for uploading a function source 2841 // code. For more information about the signed URL usage see: 2842 // https://cloud.google.com/storage/docs/access-control/signed-urls. Once the 2843 // function source code upload is complete, the used signed URL should be 2844 // provided in CreateFunction or UpdateFunction request as a reference to the 2845 // function source code. When uploading source code to the generated signed 2846 // URL, please follow these restrictions: * Source file type should be a zip 2847 // file. * Source file size should not exceed 100MB limit. * No credentials 2848 // should be attached - the signed URLs provide access to the target bucket 2849 // using internal service identity; if credentials were attached, the identity 2850 // from the credentials would be used, but that identity does not have 2851 // permissions to upload files to the URL. When making a HTTP PUT request, 2852 // these two headers need to be specified: * `content-type: application/zip` * 2853 // `x-goog-content-length-range: 0,104857600` And this header SHOULD NOT be 2854 // specified: * `Authorization: Bearer YOUR_TOKEN` 2855 // 2856 // - parent: The project and location in which the Google Cloud Storage signed 2857 // URL should be generated, specified in the format `projects/*/locations/*`. 2858 func (r *ProjectsLocationsFunctionsService) GenerateUploadUrl(parent string, generateuploadurlrequest *GenerateUploadUrlRequest) *ProjectsLocationsFunctionsGenerateUploadUrlCall { 2859 c := &ProjectsLocationsFunctionsGenerateUploadUrlCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2860 c.parent = parent 2861 c.generateuploadurlrequest = generateuploadurlrequest 2862 return c 2863 } 2864 2865 // Fields allows partial responses to be retrieved. See 2866 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2867 // details. 2868 func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsGenerateUploadUrlCall { 2869 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2870 return c 2871 } 2872 2873 // Context sets the context to be used in this call's Do method. 2874 func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Context(ctx context.Context) *ProjectsLocationsFunctionsGenerateUploadUrlCall { 2875 c.ctx_ = ctx 2876 return c 2877 } 2878 2879 // Header returns a http.Header that can be modified by the caller to add 2880 // headers to the request. 2881 func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Header() http.Header { 2882 if c.header_ == nil { 2883 c.header_ = make(http.Header) 2884 } 2885 return c.header_ 2886 } 2887 2888 func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) doRequest(alt string) (*http.Response, error) { 2889 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 2890 var body io.Reader = nil 2891 body, err := googleapi.WithoutDataWrapper.JSONReader(c.generateuploadurlrequest) 2892 if err != nil { 2893 return nil, err 2894 } 2895 c.urlParams_.Set("alt", alt) 2896 c.urlParams_.Set("prettyPrint", "false") 2897 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/functions:generateUploadUrl") 2898 urls += "?" + c.urlParams_.Encode() 2899 req, err := http.NewRequest("POST", urls, body) 2900 if err != nil { 2901 return nil, err 2902 } 2903 req.Header = reqHeaders 2904 googleapi.Expand(req.URL, map[string]string{ 2905 "parent": c.parent, 2906 }) 2907 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2908 } 2909 2910 // Do executes the "cloudfunctions.projects.locations.functions.generateUploadUrl" call. 2911 // Any non-2xx status code is an error. Response headers are in either 2912 // *GenerateUploadUrlResponse.ServerResponse.Header or (if a response was 2913 // returned at all) in error.(*googleapi.Error).Header. Use 2914 // googleapi.IsNotModified to check whether the returned error was because 2915 // http.StatusNotModified was returned. 2916 func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Do(opts ...googleapi.CallOption) (*GenerateUploadUrlResponse, error) { 2917 gensupport.SetOptions(c.urlParams_, opts...) 2918 res, err := c.doRequest("json") 2919 if res != nil && res.StatusCode == http.StatusNotModified { 2920 if res.Body != nil { 2921 res.Body.Close() 2922 } 2923 return nil, gensupport.WrapError(&googleapi.Error{ 2924 Code: res.StatusCode, 2925 Header: res.Header, 2926 }) 2927 } 2928 if err != nil { 2929 return nil, err 2930 } 2931 defer googleapi.CloseBody(res) 2932 if err := googleapi.CheckResponse(res); err != nil { 2933 return nil, gensupport.WrapError(err) 2934 } 2935 ret := &GenerateUploadUrlResponse{ 2936 ServerResponse: googleapi.ServerResponse{ 2937 Header: res.Header, 2938 HTTPStatusCode: res.StatusCode, 2939 }, 2940 } 2941 target := &ret 2942 if err := gensupport.DecodeResponse(target, res); err != nil { 2943 return nil, err 2944 } 2945 return ret, nil 2946 } 2947 2948 type ProjectsLocationsFunctionsGetCall struct { 2949 s *Service 2950 name string 2951 urlParams_ gensupport.URLParams 2952 ifNoneMatch_ string 2953 ctx_ context.Context 2954 header_ http.Header 2955 } 2956 2957 // Get: Returns a function with the given name from the requested project. 2958 // 2959 // - name: The name of the function which details should be obtained. 2960 func (r *ProjectsLocationsFunctionsService) Get(name string) *ProjectsLocationsFunctionsGetCall { 2961 c := &ProjectsLocationsFunctionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2962 c.name = name 2963 return c 2964 } 2965 2966 // VersionId sets the optional parameter "versionId": The optional version of 2967 // the function whose details should be obtained. The version of a 1st Gen 2968 // function is an integer that starts from 1 and gets incremented on 2969 // redeployments. Each deployment creates a config version of the underlying 2970 // function. GCF may keep historical configs for old versions. This field can 2971 // be specified to fetch the historical configs. Leave it blank or set to 0 to 2972 // get the latest version of the function. 2973 func (c *ProjectsLocationsFunctionsGetCall) VersionId(versionId int64) *ProjectsLocationsFunctionsGetCall { 2974 c.urlParams_.Set("versionId", fmt.Sprint(versionId)) 2975 return c 2976 } 2977 2978 // Fields allows partial responses to be retrieved. See 2979 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2980 // details. 2981 func (c *ProjectsLocationsFunctionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsGetCall { 2982 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2983 return c 2984 } 2985 2986 // IfNoneMatch sets an optional parameter which makes the operation fail if the 2987 // object's ETag matches the given value. This is useful for getting updates 2988 // only after the object has changed since the last request. 2989 func (c *ProjectsLocationsFunctionsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsFunctionsGetCall { 2990 c.ifNoneMatch_ = entityTag 2991 return c 2992 } 2993 2994 // Context sets the context to be used in this call's Do method. 2995 func (c *ProjectsLocationsFunctionsGetCall) Context(ctx context.Context) *ProjectsLocationsFunctionsGetCall { 2996 c.ctx_ = ctx 2997 return c 2998 } 2999 3000 // Header returns a http.Header that can be modified by the caller to add 3001 // headers to the request. 3002 func (c *ProjectsLocationsFunctionsGetCall) Header() http.Header { 3003 if c.header_ == nil { 3004 c.header_ = make(http.Header) 3005 } 3006 return c.header_ 3007 } 3008 3009 func (c *ProjectsLocationsFunctionsGetCall) doRequest(alt string) (*http.Response, error) { 3010 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 3011 if c.ifNoneMatch_ != "" { 3012 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3013 } 3014 var body io.Reader = nil 3015 c.urlParams_.Set("alt", alt) 3016 c.urlParams_.Set("prettyPrint", "false") 3017 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 3018 urls += "?" + c.urlParams_.Encode() 3019 req, err := http.NewRequest("GET", urls, body) 3020 if err != nil { 3021 return nil, err 3022 } 3023 req.Header = reqHeaders 3024 googleapi.Expand(req.URL, map[string]string{ 3025 "name": c.name, 3026 }) 3027 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3028 } 3029 3030 // Do executes the "cloudfunctions.projects.locations.functions.get" call. 3031 // Any non-2xx status code is an error. Response headers are in either 3032 // *CloudFunction.ServerResponse.Header or (if a response was returned at all) 3033 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 3034 // whether the returned error was because http.StatusNotModified was returned. 3035 func (c *ProjectsLocationsFunctionsGetCall) Do(opts ...googleapi.CallOption) (*CloudFunction, error) { 3036 gensupport.SetOptions(c.urlParams_, opts...) 3037 res, err := c.doRequest("json") 3038 if res != nil && res.StatusCode == http.StatusNotModified { 3039 if res.Body != nil { 3040 res.Body.Close() 3041 } 3042 return nil, gensupport.WrapError(&googleapi.Error{ 3043 Code: res.StatusCode, 3044 Header: res.Header, 3045 }) 3046 } 3047 if err != nil { 3048 return nil, err 3049 } 3050 defer googleapi.CloseBody(res) 3051 if err := googleapi.CheckResponse(res); err != nil { 3052 return nil, gensupport.WrapError(err) 3053 } 3054 ret := &CloudFunction{ 3055 ServerResponse: googleapi.ServerResponse{ 3056 Header: res.Header, 3057 HTTPStatusCode: res.StatusCode, 3058 }, 3059 } 3060 target := &ret 3061 if err := gensupport.DecodeResponse(target, res); err != nil { 3062 return nil, err 3063 } 3064 return ret, nil 3065 } 3066 3067 type ProjectsLocationsFunctionsGetIamPolicyCall struct { 3068 s *Service 3069 resource string 3070 urlParams_ gensupport.URLParams 3071 ifNoneMatch_ string 3072 ctx_ context.Context 3073 header_ http.Header 3074 } 3075 3076 // GetIamPolicy: Gets the IAM access control policy for a function. Returns an 3077 // empty policy if the function exists and does not have a policy set. 3078 // 3079 // - resource: REQUIRED: The resource for which the policy is being requested. 3080 // See Resource names (https://cloud.google.com/apis/design/resource_names) 3081 // for the appropriate value for this field. 3082 func (r *ProjectsLocationsFunctionsService) GetIamPolicy(resource string) *ProjectsLocationsFunctionsGetIamPolicyCall { 3083 c := &ProjectsLocationsFunctionsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3084 c.resource = resource 3085 return c 3086 } 3087 3088 // OptionsRequestedPolicyVersion sets the optional parameter 3089 // "options.requestedPolicyVersion": The maximum policy version that will be 3090 // used to format the policy. Valid values are 0, 1, and 3. Requests specifying 3091 // an invalid value will be rejected. Requests for policies with any 3092 // conditional role bindings must specify version 3. Policies with no 3093 // conditional role bindings may specify any valid value or leave the field 3094 // unset. The policy in the response might use the policy version that you 3095 // specified, or it might use a lower policy version. For example, if you 3096 // specify version 3, but the policy has no conditional role bindings, the 3097 // response uses version 1. To learn which resources support conditions in 3098 // their IAM policies, see the IAM documentation 3099 // (https://cloud.google.com/iam/help/conditions/resource-policies). 3100 func (c *ProjectsLocationsFunctionsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsFunctionsGetIamPolicyCall { 3101 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) 3102 return c 3103 } 3104 3105 // Fields allows partial responses to be retrieved. See 3106 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3107 // details. 3108 func (c *ProjectsLocationsFunctionsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsGetIamPolicyCall { 3109 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3110 return c 3111 } 3112 3113 // IfNoneMatch sets an optional parameter which makes the operation fail if the 3114 // object's ETag matches the given value. This is useful for getting updates 3115 // only after the object has changed since the last request. 3116 func (c *ProjectsLocationsFunctionsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsFunctionsGetIamPolicyCall { 3117 c.ifNoneMatch_ = entityTag 3118 return c 3119 } 3120 3121 // Context sets the context to be used in this call's Do method. 3122 func (c *ProjectsLocationsFunctionsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsFunctionsGetIamPolicyCall { 3123 c.ctx_ = ctx 3124 return c 3125 } 3126 3127 // Header returns a http.Header that can be modified by the caller to add 3128 // headers to the request. 3129 func (c *ProjectsLocationsFunctionsGetIamPolicyCall) Header() http.Header { 3130 if c.header_ == nil { 3131 c.header_ = make(http.Header) 3132 } 3133 return c.header_ 3134 } 3135 3136 func (c *ProjectsLocationsFunctionsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 3137 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 3138 if c.ifNoneMatch_ != "" { 3139 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3140 } 3141 var body io.Reader = nil 3142 c.urlParams_.Set("alt", alt) 3143 c.urlParams_.Set("prettyPrint", "false") 3144 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") 3145 urls += "?" + c.urlParams_.Encode() 3146 req, err := http.NewRequest("GET", urls, body) 3147 if err != nil { 3148 return nil, err 3149 } 3150 req.Header = reqHeaders 3151 googleapi.Expand(req.URL, map[string]string{ 3152 "resource": c.resource, 3153 }) 3154 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3155 } 3156 3157 // Do executes the "cloudfunctions.projects.locations.functions.getIamPolicy" call. 3158 // Any non-2xx status code is an error. Response headers are in either 3159 // *Policy.ServerResponse.Header or (if a response was returned at all) in 3160 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 3161 // whether the returned error was because http.StatusNotModified was returned. 3162 func (c *ProjectsLocationsFunctionsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 3163 gensupport.SetOptions(c.urlParams_, opts...) 3164 res, err := c.doRequest("json") 3165 if res != nil && res.StatusCode == http.StatusNotModified { 3166 if res.Body != nil { 3167 res.Body.Close() 3168 } 3169 return nil, gensupport.WrapError(&googleapi.Error{ 3170 Code: res.StatusCode, 3171 Header: res.Header, 3172 }) 3173 } 3174 if err != nil { 3175 return nil, err 3176 } 3177 defer googleapi.CloseBody(res) 3178 if err := googleapi.CheckResponse(res); err != nil { 3179 return nil, gensupport.WrapError(err) 3180 } 3181 ret := &Policy{ 3182 ServerResponse: googleapi.ServerResponse{ 3183 Header: res.Header, 3184 HTTPStatusCode: res.StatusCode, 3185 }, 3186 } 3187 target := &ret 3188 if err := gensupport.DecodeResponse(target, res); err != nil { 3189 return nil, err 3190 } 3191 return ret, nil 3192 } 3193 3194 type ProjectsLocationsFunctionsListCall struct { 3195 s *Service 3196 parent string 3197 urlParams_ gensupport.URLParams 3198 ifNoneMatch_ string 3199 ctx_ context.Context 3200 header_ http.Header 3201 } 3202 3203 // List: Returns a list of functions that belong to the requested project. 3204 // 3205 // - parent: The project and location from which the function should be listed, 3206 // specified in the format `projects/*/locations/*` If you want to list 3207 // functions in all locations, use "-" in place of a location. When listing 3208 // functions in all locations, if one or more location(s) are unreachable, 3209 // the response will contain functions from all reachable locations along 3210 // with the names of any unreachable locations. 3211 func (r *ProjectsLocationsFunctionsService) List(parent string) *ProjectsLocationsFunctionsListCall { 3212 c := &ProjectsLocationsFunctionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3213 c.parent = parent 3214 return c 3215 } 3216 3217 // PageSize sets the optional parameter "pageSize": Maximum number of functions 3218 // to return per call. 3219 func (c *ProjectsLocationsFunctionsListCall) PageSize(pageSize int64) *ProjectsLocationsFunctionsListCall { 3220 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 3221 return c 3222 } 3223 3224 // PageToken sets the optional parameter "pageToken": The value returned by the 3225 // last `ListFunctionsResponse`; indicates that this is a continuation of a 3226 // prior `ListFunctions` call, and that the system should return the next page 3227 // of data. 3228 func (c *ProjectsLocationsFunctionsListCall) PageToken(pageToken string) *ProjectsLocationsFunctionsListCall { 3229 c.urlParams_.Set("pageToken", pageToken) 3230 return c 3231 } 3232 3233 // Fields allows partial responses to be retrieved. See 3234 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3235 // details. 3236 func (c *ProjectsLocationsFunctionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsListCall { 3237 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3238 return c 3239 } 3240 3241 // IfNoneMatch sets an optional parameter which makes the operation fail if the 3242 // object's ETag matches the given value. This is useful for getting updates 3243 // only after the object has changed since the last request. 3244 func (c *ProjectsLocationsFunctionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsFunctionsListCall { 3245 c.ifNoneMatch_ = entityTag 3246 return c 3247 } 3248 3249 // Context sets the context to be used in this call's Do method. 3250 func (c *ProjectsLocationsFunctionsListCall) Context(ctx context.Context) *ProjectsLocationsFunctionsListCall { 3251 c.ctx_ = ctx 3252 return c 3253 } 3254 3255 // Header returns a http.Header that can be modified by the caller to add 3256 // headers to the request. 3257 func (c *ProjectsLocationsFunctionsListCall) Header() http.Header { 3258 if c.header_ == nil { 3259 c.header_ = make(http.Header) 3260 } 3261 return c.header_ 3262 } 3263 3264 func (c *ProjectsLocationsFunctionsListCall) doRequest(alt string) (*http.Response, error) { 3265 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 3266 if c.ifNoneMatch_ != "" { 3267 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3268 } 3269 var body io.Reader = nil 3270 c.urlParams_.Set("alt", alt) 3271 c.urlParams_.Set("prettyPrint", "false") 3272 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/functions") 3273 urls += "?" + c.urlParams_.Encode() 3274 req, err := http.NewRequest("GET", urls, body) 3275 if err != nil { 3276 return nil, err 3277 } 3278 req.Header = reqHeaders 3279 googleapi.Expand(req.URL, map[string]string{ 3280 "parent": c.parent, 3281 }) 3282 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3283 } 3284 3285 // Do executes the "cloudfunctions.projects.locations.functions.list" call. 3286 // Any non-2xx status code is an error. Response headers are in either 3287 // *ListFunctionsResponse.ServerResponse.Header or (if a response was returned 3288 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3289 // check whether the returned error was because http.StatusNotModified was 3290 // returned. 3291 func (c *ProjectsLocationsFunctionsListCall) Do(opts ...googleapi.CallOption) (*ListFunctionsResponse, error) { 3292 gensupport.SetOptions(c.urlParams_, opts...) 3293 res, err := c.doRequest("json") 3294 if res != nil && res.StatusCode == http.StatusNotModified { 3295 if res.Body != nil { 3296 res.Body.Close() 3297 } 3298 return nil, gensupport.WrapError(&googleapi.Error{ 3299 Code: res.StatusCode, 3300 Header: res.Header, 3301 }) 3302 } 3303 if err != nil { 3304 return nil, err 3305 } 3306 defer googleapi.CloseBody(res) 3307 if err := googleapi.CheckResponse(res); err != nil { 3308 return nil, gensupport.WrapError(err) 3309 } 3310 ret := &ListFunctionsResponse{ 3311 ServerResponse: googleapi.ServerResponse{ 3312 Header: res.Header, 3313 HTTPStatusCode: res.StatusCode, 3314 }, 3315 } 3316 target := &ret 3317 if err := gensupport.DecodeResponse(target, res); err != nil { 3318 return nil, err 3319 } 3320 return ret, nil 3321 } 3322 3323 // Pages invokes f for each page of results. 3324 // A non-nil error returned from f will halt the iteration. 3325 // The provided context supersedes any context provided to the Context method. 3326 func (c *ProjectsLocationsFunctionsListCall) Pages(ctx context.Context, f func(*ListFunctionsResponse) error) error { 3327 c.ctx_ = ctx 3328 defer c.PageToken(c.urlParams_.Get("pageToken")) 3329 for { 3330 x, err := c.Do() 3331 if err != nil { 3332 return err 3333 } 3334 if err := f(x); err != nil { 3335 return err 3336 } 3337 if x.NextPageToken == "" { 3338 return nil 3339 } 3340 c.PageToken(x.NextPageToken) 3341 } 3342 } 3343 3344 type ProjectsLocationsFunctionsPatchCall struct { 3345 s *Service 3346 name string 3347 cloudfunction *CloudFunction 3348 urlParams_ gensupport.URLParams 3349 ctx_ context.Context 3350 header_ http.Header 3351 } 3352 3353 // Patch: Updates existing function. 3354 // 3355 // - name: A user-defined name of the function. Function names must be unique 3356 // globally and match pattern `projects/*/locations/*/functions/*`. 3357 func (r *ProjectsLocationsFunctionsService) Patch(name string, cloudfunction *CloudFunction) *ProjectsLocationsFunctionsPatchCall { 3358 c := &ProjectsLocationsFunctionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3359 c.name = name 3360 c.cloudfunction = cloudfunction 3361 return c 3362 } 3363 3364 // UpdateMask sets the optional parameter "updateMask": Required. The list of 3365 // fields in `CloudFunction` that have to be updated. 3366 func (c *ProjectsLocationsFunctionsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsFunctionsPatchCall { 3367 c.urlParams_.Set("updateMask", updateMask) 3368 return c 3369 } 3370 3371 // Fields allows partial responses to be retrieved. See 3372 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3373 // details. 3374 func (c *ProjectsLocationsFunctionsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsPatchCall { 3375 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3376 return c 3377 } 3378 3379 // Context sets the context to be used in this call's Do method. 3380 func (c *ProjectsLocationsFunctionsPatchCall) Context(ctx context.Context) *ProjectsLocationsFunctionsPatchCall { 3381 c.ctx_ = ctx 3382 return c 3383 } 3384 3385 // Header returns a http.Header that can be modified by the caller to add 3386 // headers to the request. 3387 func (c *ProjectsLocationsFunctionsPatchCall) Header() http.Header { 3388 if c.header_ == nil { 3389 c.header_ = make(http.Header) 3390 } 3391 return c.header_ 3392 } 3393 3394 func (c *ProjectsLocationsFunctionsPatchCall) doRequest(alt string) (*http.Response, error) { 3395 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 3396 var body io.Reader = nil 3397 body, err := googleapi.WithoutDataWrapper.JSONReader(c.cloudfunction) 3398 if err != nil { 3399 return nil, err 3400 } 3401 c.urlParams_.Set("alt", alt) 3402 c.urlParams_.Set("prettyPrint", "false") 3403 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 3404 urls += "?" + c.urlParams_.Encode() 3405 req, err := http.NewRequest("PATCH", urls, body) 3406 if err != nil { 3407 return nil, err 3408 } 3409 req.Header = reqHeaders 3410 googleapi.Expand(req.URL, map[string]string{ 3411 "name": c.name, 3412 }) 3413 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3414 } 3415 3416 // Do executes the "cloudfunctions.projects.locations.functions.patch" call. 3417 // Any non-2xx status code is an error. Response headers are in either 3418 // *Operation.ServerResponse.Header or (if a response was returned at all) in 3419 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 3420 // whether the returned error was because http.StatusNotModified was returned. 3421 func (c *ProjectsLocationsFunctionsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 3422 gensupport.SetOptions(c.urlParams_, opts...) 3423 res, err := c.doRequest("json") 3424 if res != nil && res.StatusCode == http.StatusNotModified { 3425 if res.Body != nil { 3426 res.Body.Close() 3427 } 3428 return nil, gensupport.WrapError(&googleapi.Error{ 3429 Code: res.StatusCode, 3430 Header: res.Header, 3431 }) 3432 } 3433 if err != nil { 3434 return nil, err 3435 } 3436 defer googleapi.CloseBody(res) 3437 if err := googleapi.CheckResponse(res); err != nil { 3438 return nil, gensupport.WrapError(err) 3439 } 3440 ret := &Operation{ 3441 ServerResponse: googleapi.ServerResponse{ 3442 Header: res.Header, 3443 HTTPStatusCode: res.StatusCode, 3444 }, 3445 } 3446 target := &ret 3447 if err := gensupport.DecodeResponse(target, res); err != nil { 3448 return nil, err 3449 } 3450 return ret, nil 3451 } 3452 3453 type ProjectsLocationsFunctionsSetIamPolicyCall struct { 3454 s *Service 3455 resource string 3456 setiampolicyrequest *SetIamPolicyRequest 3457 urlParams_ gensupport.URLParams 3458 ctx_ context.Context 3459 header_ http.Header 3460 } 3461 3462 // SetIamPolicy: Sets the IAM access control policy on the specified function. 3463 // Replaces any existing policy. 3464 // 3465 // - resource: REQUIRED: The resource for which the policy is being specified. 3466 // See Resource names (https://cloud.google.com/apis/design/resource_names) 3467 // for the appropriate value for this field. 3468 func (r *ProjectsLocationsFunctionsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsFunctionsSetIamPolicyCall { 3469 c := &ProjectsLocationsFunctionsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3470 c.resource = resource 3471 c.setiampolicyrequest = setiampolicyrequest 3472 return c 3473 } 3474 3475 // Fields allows partial responses to be retrieved. See 3476 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3477 // details. 3478 func (c *ProjectsLocationsFunctionsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsSetIamPolicyCall { 3479 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3480 return c 3481 } 3482 3483 // Context sets the context to be used in this call's Do method. 3484 func (c *ProjectsLocationsFunctionsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsFunctionsSetIamPolicyCall { 3485 c.ctx_ = ctx 3486 return c 3487 } 3488 3489 // Header returns a http.Header that can be modified by the caller to add 3490 // headers to the request. 3491 func (c *ProjectsLocationsFunctionsSetIamPolicyCall) Header() http.Header { 3492 if c.header_ == nil { 3493 c.header_ = make(http.Header) 3494 } 3495 return c.header_ 3496 } 3497 3498 func (c *ProjectsLocationsFunctionsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 3499 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 3500 var body io.Reader = nil 3501 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) 3502 if err != nil { 3503 return nil, err 3504 } 3505 c.urlParams_.Set("alt", alt) 3506 c.urlParams_.Set("prettyPrint", "false") 3507 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy") 3508 urls += "?" + c.urlParams_.Encode() 3509 req, err := http.NewRequest("POST", urls, body) 3510 if err != nil { 3511 return nil, err 3512 } 3513 req.Header = reqHeaders 3514 googleapi.Expand(req.URL, map[string]string{ 3515 "resource": c.resource, 3516 }) 3517 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3518 } 3519 3520 // Do executes the "cloudfunctions.projects.locations.functions.setIamPolicy" call. 3521 // Any non-2xx status code is an error. Response headers are in either 3522 // *Policy.ServerResponse.Header or (if a response was returned at all) in 3523 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 3524 // whether the returned error was because http.StatusNotModified was returned. 3525 func (c *ProjectsLocationsFunctionsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 3526 gensupport.SetOptions(c.urlParams_, opts...) 3527 res, err := c.doRequest("json") 3528 if res != nil && res.StatusCode == http.StatusNotModified { 3529 if res.Body != nil { 3530 res.Body.Close() 3531 } 3532 return nil, gensupport.WrapError(&googleapi.Error{ 3533 Code: res.StatusCode, 3534 Header: res.Header, 3535 }) 3536 } 3537 if err != nil { 3538 return nil, err 3539 } 3540 defer googleapi.CloseBody(res) 3541 if err := googleapi.CheckResponse(res); err != nil { 3542 return nil, gensupport.WrapError(err) 3543 } 3544 ret := &Policy{ 3545 ServerResponse: googleapi.ServerResponse{ 3546 Header: res.Header, 3547 HTTPStatusCode: res.StatusCode, 3548 }, 3549 } 3550 target := &ret 3551 if err := gensupport.DecodeResponse(target, res); err != nil { 3552 return nil, err 3553 } 3554 return ret, nil 3555 } 3556 3557 type ProjectsLocationsFunctionsTestIamPermissionsCall struct { 3558 s *Service 3559 resource string 3560 testiampermissionsrequest *TestIamPermissionsRequest 3561 urlParams_ gensupport.URLParams 3562 ctx_ context.Context 3563 header_ http.Header 3564 } 3565 3566 // TestIamPermissions: Tests the specified permissions against the IAM access 3567 // control policy for a function. If the function does not exist, this will 3568 // return an empty set of permissions, not a NOT_FOUND error. 3569 // 3570 // - resource: REQUIRED: The resource for which the policy detail is being 3571 // requested. See Resource names 3572 // (https://cloud.google.com/apis/design/resource_names) for the appropriate 3573 // value for this field. 3574 func (r *ProjectsLocationsFunctionsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsFunctionsTestIamPermissionsCall { 3575 c := &ProjectsLocationsFunctionsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3576 c.resource = resource 3577 c.testiampermissionsrequest = testiampermissionsrequest 3578 return c 3579 } 3580 3581 // Fields allows partial responses to be retrieved. See 3582 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3583 // details. 3584 func (c *ProjectsLocationsFunctionsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsTestIamPermissionsCall { 3585 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3586 return c 3587 } 3588 3589 // Context sets the context to be used in this call's Do method. 3590 func (c *ProjectsLocationsFunctionsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsFunctionsTestIamPermissionsCall { 3591 c.ctx_ = ctx 3592 return c 3593 } 3594 3595 // Header returns a http.Header that can be modified by the caller to add 3596 // headers to the request. 3597 func (c *ProjectsLocationsFunctionsTestIamPermissionsCall) Header() http.Header { 3598 if c.header_ == nil { 3599 c.header_ = make(http.Header) 3600 } 3601 return c.header_ 3602 } 3603 3604 func (c *ProjectsLocationsFunctionsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 3605 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 3606 var body io.Reader = nil 3607 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) 3608 if err != nil { 3609 return nil, err 3610 } 3611 c.urlParams_.Set("alt", alt) 3612 c.urlParams_.Set("prettyPrint", "false") 3613 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions") 3614 urls += "?" + c.urlParams_.Encode() 3615 req, err := http.NewRequest("POST", urls, body) 3616 if err != nil { 3617 return nil, err 3618 } 3619 req.Header = reqHeaders 3620 googleapi.Expand(req.URL, map[string]string{ 3621 "resource": c.resource, 3622 }) 3623 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3624 } 3625 3626 // Do executes the "cloudfunctions.projects.locations.functions.testIamPermissions" call. 3627 // Any non-2xx status code is an error. Response headers are in either 3628 // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was 3629 // returned at all) in error.(*googleapi.Error).Header. Use 3630 // googleapi.IsNotModified to check whether the returned error was because 3631 // http.StatusNotModified was returned. 3632 func (c *ProjectsLocationsFunctionsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { 3633 gensupport.SetOptions(c.urlParams_, opts...) 3634 res, err := c.doRequest("json") 3635 if res != nil && res.StatusCode == http.StatusNotModified { 3636 if res.Body != nil { 3637 res.Body.Close() 3638 } 3639 return nil, gensupport.WrapError(&googleapi.Error{ 3640 Code: res.StatusCode, 3641 Header: res.Header, 3642 }) 3643 } 3644 if err != nil { 3645 return nil, err 3646 } 3647 defer googleapi.CloseBody(res) 3648 if err := googleapi.CheckResponse(res); err != nil { 3649 return nil, gensupport.WrapError(err) 3650 } 3651 ret := &TestIamPermissionsResponse{ 3652 ServerResponse: googleapi.ServerResponse{ 3653 Header: res.Header, 3654 HTTPStatusCode: res.StatusCode, 3655 }, 3656 } 3657 target := &ret 3658 if err := gensupport.DecodeResponse(target, res); err != nil { 3659 return nil, err 3660 } 3661 return ret, nil 3662 } 3663