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/v2" 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/v2" 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:v2" 90 const apiName = "cloudfunctions" 91 const apiVersion = "v2" 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.Projects = NewProjectsService(s) 139 return s, nil 140 } 141 142 type Service struct { 143 client *http.Client 144 BasePath string // API endpoint base URL 145 UserAgent string // optional additional User-Agent fragment 146 147 Projects *ProjectsService 148 } 149 150 func (s *Service) userAgent() string { 151 if s.UserAgent == "" { 152 return googleapi.UserAgent 153 } 154 return googleapi.UserAgent + " " + s.UserAgent 155 } 156 157 func NewProjectsService(s *Service) *ProjectsService { 158 rs := &ProjectsService{s: s} 159 rs.Locations = NewProjectsLocationsService(s) 160 return rs 161 } 162 163 type ProjectsService struct { 164 s *Service 165 166 Locations *ProjectsLocationsService 167 } 168 169 func NewProjectsLocationsService(s *Service) *ProjectsLocationsService { 170 rs := &ProjectsLocationsService{s: s} 171 rs.Functions = NewProjectsLocationsFunctionsService(s) 172 rs.Operations = NewProjectsLocationsOperationsService(s) 173 rs.Runtimes = NewProjectsLocationsRuntimesService(s) 174 return rs 175 } 176 177 type ProjectsLocationsService struct { 178 s *Service 179 180 Functions *ProjectsLocationsFunctionsService 181 182 Operations *ProjectsLocationsOperationsService 183 184 Runtimes *ProjectsLocationsRuntimesService 185 } 186 187 func NewProjectsLocationsFunctionsService(s *Service) *ProjectsLocationsFunctionsService { 188 rs := &ProjectsLocationsFunctionsService{s: s} 189 return rs 190 } 191 192 type ProjectsLocationsFunctionsService struct { 193 s *Service 194 } 195 196 func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService { 197 rs := &ProjectsLocationsOperationsService{s: s} 198 return rs 199 } 200 201 type ProjectsLocationsOperationsService struct { 202 s *Service 203 } 204 205 func NewProjectsLocationsRuntimesService(s *Service) *ProjectsLocationsRuntimesService { 206 rs := &ProjectsLocationsRuntimesService{s: s} 207 return rs 208 } 209 210 type ProjectsLocationsRuntimesService struct { 211 s *Service 212 } 213 214 // AbortFunctionUpgradeRequest: Request for the `AbortFunctionUpgrade` method. 215 type AbortFunctionUpgradeRequest struct { 216 } 217 218 // AuditConfig: Specifies the audit configuration for a service. The 219 // configuration determines which permission types are logged, and what 220 // identities, if any, are exempted from logging. An AuditConfig must have one 221 // or more AuditLogConfigs. If there are AuditConfigs for both `allServices` 222 // and a specific service, the union of the two AuditConfigs is used for that 223 // service: the log_types specified in each AuditConfig are enabled, and the 224 // exempted_members in each AuditLogConfig are exempted. Example Policy with 225 // multiple AuditConfigs: { "audit_configs": [ { "service": "allServices", 226 // "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ 227 // "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" }, { "log_type": 228 // "ADMIN_READ" } ] }, { "service": "sampleservice.googleapis.com", 229 // "audit_log_configs": [ { "log_type": "DATA_READ" }, { "log_type": 230 // "DATA_WRITE", "exempted_members": [ "user:aliya@example.com" ] } ] } ] } For 231 // sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ 232 // logging. It also exempts `jose@example.com` from DATA_READ logging, and 233 // `aliya@example.com` from DATA_WRITE logging. 234 type AuditConfig struct { 235 // AuditLogConfigs: The configuration for logging of each type of permission. 236 AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"` 237 // Service: Specifies a service that will be enabled for audit logging. For 238 // example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` 239 // is a special value that covers all services. 240 Service string `json:"service,omitempty"` 241 // ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to 242 // unconditionally include in API requests. By default, fields with empty or 243 // default values are omitted from API requests. See 244 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 245 // details. 246 ForceSendFields []string `json:"-"` 247 // NullFields is a list of field names (e.g. "AuditLogConfigs") to include in 248 // API requests with the JSON null value. By default, fields with empty values 249 // are omitted from API requests. See 250 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 251 NullFields []string `json:"-"` 252 } 253 254 func (s *AuditConfig) MarshalJSON() ([]byte, error) { 255 type NoMethod AuditConfig 256 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 257 } 258 259 // AuditLogConfig: Provides the configuration for logging a type of 260 // permissions. Example: { "audit_log_configs": [ { "log_type": "DATA_READ", 261 // "exempted_members": [ "user:jose@example.com" ] }, { "log_type": 262 // "DATA_WRITE" } ] } This enables 'DATA_READ' and 'DATA_WRITE' logging, while 263 // exempting jose@example.com from DATA_READ logging. 264 type AuditLogConfig struct { 265 // ExemptedMembers: Specifies the identities that do not cause logging for this 266 // type of permission. Follows the same format of Binding.members. 267 ExemptedMembers []string `json:"exemptedMembers,omitempty"` 268 // LogType: The log type that this config enables. 269 // 270 // Possible values: 271 // "LOG_TYPE_UNSPECIFIED" - Default case. Should never be this. 272 // "ADMIN_READ" - Admin reads. Example: CloudIAM getIamPolicy 273 // "DATA_WRITE" - Data writes. Example: CloudSQL Users create 274 // "DATA_READ" - Data reads. Example: CloudSQL Users list 275 LogType string `json:"logType,omitempty"` 276 // ForceSendFields is a list of field names (e.g. "ExemptedMembers") to 277 // unconditionally include in API requests. By default, fields with empty or 278 // default values are omitted from API requests. See 279 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 280 // details. 281 ForceSendFields []string `json:"-"` 282 // NullFields is a list of field names (e.g. "ExemptedMembers") to include in 283 // API requests with the JSON null value. By default, fields with empty values 284 // are omitted from API requests. See 285 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 286 NullFields []string `json:"-"` 287 } 288 289 func (s *AuditLogConfig) MarshalJSON() ([]byte, error) { 290 type NoMethod AuditLogConfig 291 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 292 } 293 294 // AutomaticUpdatePolicy: Security patches are applied automatically to the 295 // runtime without requiring the function to be redeployed. 296 type AutomaticUpdatePolicy struct { 297 } 298 299 // Binding: Associates `members`, or principals, with a `role`. 300 type Binding struct { 301 // Condition: The condition that is associated with this binding. If the 302 // condition evaluates to `true`, then this binding applies to the current 303 // request. If the condition evaluates to `false`, then this binding does not 304 // apply to the current request. However, a different role binding might grant 305 // the same role to one or more of the principals in this binding. To learn 306 // which resources support conditions in their IAM policies, see the IAM 307 // documentation 308 // (https://cloud.google.com/iam/help/conditions/resource-policies). 309 Condition *Expr `json:"condition,omitempty"` 310 // Members: Specifies the principals requesting access for a Google Cloud 311 // resource. `members` can have the following values: * `allUsers`: A special 312 // identifier that represents anyone who is on the internet; with or without a 313 // Google account. * `allAuthenticatedUsers`: A special identifier that 314 // represents anyone who is authenticated with a Google account or a service 315 // account. Does not include identities that come from external identity 316 // providers (IdPs) through identity federation. * `user:{emailid}`: An email 317 // address that represents a specific Google account. For example, 318 // `alice@example.com` . * `serviceAccount:{emailid}`: An email address that 319 // represents a Google service account. For example, 320 // `my-other-app@appspot.gserviceaccount.com`. * 321 // `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An 322 // identifier for a Kubernetes service account 323 // (https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). 324 // For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * 325 // `group:{emailid}`: An email address that represents a Google group. For 326 // example, `admins@example.com`. * `domain:{domain}`: The G Suite domain 327 // (primary) that represents all the users of that domain. For example, 328 // `google.com` or `example.com`. * 329 // `principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/sub 330 // ject/{subject_attribute_value}`: A single identity in a workforce identity 331 // pool. * 332 // `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/ 333 // group/{group_id}`: All workforce identities in a group. * 334 // `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/ 335 // attribute.{attribute_name}/{attribute_value}`: All workforce identities with 336 // a specific attribute value. * 337 // `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/ 338 // *`: All identities in a workforce identity pool. * 339 // `principal://iam.googleapis.com/projects/{project_number}/locations/global/wo 340 // rkloadIdentityPools/{pool_id}/subject/{subject_attribute_value}`: A single 341 // identity in a workload identity pool. * 342 // `principalSet://iam.googleapis.com/projects/{project_number}/locations/global 343 // /workloadIdentityPools/{pool_id}/group/{group_id}`: A workload identity pool 344 // group. * 345 // `principalSet://iam.googleapis.com/projects/{project_number}/locations/global 346 // /workloadIdentityPools/{pool_id}/attribute.{attribute_name}/{attribute_value} 347 // `: All identities in a workload identity pool with a certain attribute. * 348 // `principalSet://iam.googleapis.com/projects/{project_number}/locations/global 349 // /workloadIdentityPools/{pool_id}/*`: All identities in a workload identity 350 // pool. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus 351 // unique identifier) representing a user that has been recently deleted. For 352 // example, `alice@example.com?uid=123456789012345678901`. If the user is 353 // recovered, this value reverts to `user:{emailid}` and the recovered user 354 // retains the role in the binding. * 355 // `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus 356 // unique identifier) representing a service account that has been recently 357 // deleted. For example, 358 // `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the 359 // service account is undeleted, this value reverts to 360 // `serviceAccount:{emailid}` and the undeleted service account retains the 361 // role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email 362 // address (plus unique identifier) representing a Google group that has been 363 // recently deleted. For example, 364 // `admins@example.com?uid=123456789012345678901`. If the group is recovered, 365 // this value reverts to `group:{emailid}` and the recovered group retains the 366 // role in the binding. * 367 // `deleted:principal://iam.googleapis.com/locations/global/workforcePools/{pool 368 // _id}/subject/{subject_attribute_value}`: Deleted single identity in a 369 // workforce identity pool. For example, 370 // `deleted:principal://iam.googleapis.com/locations/global/workforcePools/my-po 371 // ol-id/subject/my-subject-attribute-value`. 372 Members []string `json:"members,omitempty"` 373 // Role: Role that is assigned to the list of `members`, or principals. For 374 // example, `roles/viewer`, `roles/editor`, or `roles/owner`. For an overview 375 // of the IAM roles and permissions, see the IAM documentation 376 // (https://cloud.google.com/iam/docs/roles-overview). For a list of the 377 // available pre-defined roles, see here 378 // (https://cloud.google.com/iam/docs/understanding-roles). 379 Role string `json:"role,omitempty"` 380 // ForceSendFields is a list of field names (e.g. "Condition") to 381 // unconditionally include in API requests. By default, fields with empty or 382 // default values are omitted from API requests. See 383 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 384 // details. 385 ForceSendFields []string `json:"-"` 386 // NullFields is a list of field names (e.g. "Condition") to include in API 387 // requests with the JSON null value. By default, fields with empty values are 388 // omitted from API requests. See 389 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 390 NullFields []string `json:"-"` 391 } 392 393 func (s *Binding) MarshalJSON() ([]byte, error) { 394 type NoMethod Binding 395 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 396 } 397 398 // BuildConfig: Describes the Build step of the function that builds a 399 // container from the given source. 400 type BuildConfig struct { 401 AutomaticUpdatePolicy *AutomaticUpdatePolicy `json:"automaticUpdatePolicy,omitempty"` 402 // Build: Output only. The Cloud Build name of the latest successful deployment 403 // of the function. 404 Build string `json:"build,omitempty"` 405 // DockerRegistry: Docker Registry to use for this deployment. This 406 // configuration is only applicable to 1st Gen functions, 2nd Gen functions can 407 // only use Artifact Registry. If unspecified, it defaults to 408 // `ARTIFACT_REGISTRY`. If `docker_repository` field is specified, this field 409 // should either be left unspecified or set to `ARTIFACT_REGISTRY`. 410 // 411 // Possible values: 412 // "DOCKER_REGISTRY_UNSPECIFIED" - Unspecified. 413 // "CONTAINER_REGISTRY" - Docker images will be stored in multi-regional 414 // Container Registry repositories named `gcf`. 415 // "ARTIFACT_REGISTRY" - Docker images will be stored in regional Artifact 416 // Registry repositories. By default, GCF will create and use repositories 417 // named `gcf-artifacts` in every region in which a function is deployed. But 418 // the repository to use can also be specified by the user using the 419 // `docker_repository` field. 420 DockerRegistry string `json:"dockerRegistry,omitempty"` 421 // DockerRepository: Repository in Artifact Registry to which the function 422 // docker image will be pushed after it is built by Cloud Build. If specified 423 // by user, it is created and managed by user with a customer managed 424 // encryption key. Otherwise, GCF will create and use a repository named 425 // 'gcf-artifacts' for every deployed region. It must match the pattern 426 // `projects/{project}/locations/{location}/repositories/{repository}`. 427 // Cross-project repositories are not supported. Cross-location repositories 428 // are not supported. Repository format must be 'DOCKER'. 429 DockerRepository string `json:"dockerRepository,omitempty"` 430 // EntryPoint: The name of the function (as defined in source code) that will 431 // be executed. Defaults to the resource name suffix, if not specified. For 432 // backward compatibility, if function with given name is not found, then the 433 // system will try to use function named "function". For Node.js this is name 434 // of a function exported by the module specified in `source_location`. 435 EntryPoint string `json:"entryPoint,omitempty"` 436 // EnvironmentVariables: User-provided build-time environment variables for the 437 // function 438 EnvironmentVariables map[string]string `json:"environmentVariables,omitempty"` 439 OnDeployUpdatePolicy *OnDeployUpdatePolicy `json:"onDeployUpdatePolicy,omitempty"` 440 // Runtime: The runtime in which to run the function. Required when deploying a 441 // new function, optional when updating an existing function. For a complete 442 // list of possible choices, see the `gcloud` command reference 443 // (https://cloud.google.com/sdk/gcloud/reference/functions/deploy#--runtime). 444 Runtime string `json:"runtime,omitempty"` 445 // ServiceAccount: [Preview] Service account to be used for building the 446 // container 447 ServiceAccount string `json:"serviceAccount,omitempty"` 448 // Source: The location of the function source code. 449 Source *Source `json:"source,omitempty"` 450 // SourceProvenance: Output only. A permanent fixed identifier for source. 451 SourceProvenance *SourceProvenance `json:"sourceProvenance,omitempty"` 452 // SourceToken: An identifier for Firebase function sources. Disclaimer: This 453 // field is only supported for Firebase function deployments. 454 SourceToken string `json:"sourceToken,omitempty"` 455 // WorkerPool: Name of the Cloud Build Custom Worker Pool that should be used 456 // 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 the 459 // worker pool is defined and {workerPool} is the short name of the worker 460 // pool. If the project id is not the same as the function, then the Cloud 461 // Functions Service Agent (service-@gcf-admin-robot.iam.gserviceaccount.com) 462 // must be granted the role Cloud Build Custom Workers Builder 463 // (roles/cloudbuild.customworkers.builder) in the project. 464 WorkerPool string `json:"workerPool,omitempty"` 465 // ForceSendFields is a list of field names (e.g. "AutomaticUpdatePolicy") to 466 // unconditionally include in API requests. By default, fields with empty or 467 // default values are omitted from API requests. See 468 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 469 // details. 470 ForceSendFields []string `json:"-"` 471 // NullFields is a list of field names (e.g. "AutomaticUpdatePolicy") to 472 // include in API requests with the JSON null value. By default, fields with 473 // empty values are omitted from API requests. See 474 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 475 NullFields []string `json:"-"` 476 } 477 478 func (s *BuildConfig) MarshalJSON() ([]byte, error) { 479 type NoMethod BuildConfig 480 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 481 } 482 483 // CommitFunctionUpgradeRequest: Request for the `CommitFunctionUpgrade` 484 // method. 485 type CommitFunctionUpgradeRequest struct { 486 } 487 488 // Date: Represents a whole or partial calendar date, such as a birthday. The 489 // time of day and time zone are either specified elsewhere or are 490 // insignificant. The date is relative to the Gregorian Calendar. This can 491 // represent one of the following: * A full date, with non-zero year, month, 492 // and day values. * A month and day, with a zero year (for example, an 493 // anniversary). * A year on its own, with a zero month and a zero day. * A 494 // year and month, with a zero day (for example, a credit card expiration 495 // date). Related types: * google.type.TimeOfDay * google.type.DateTime * 496 // google.protobuf.Timestamp 497 type Date struct { 498 // Day: Day of a month. Must be from 1 to 31 and valid for the year and month, 499 // or 0 to specify a year by itself or a year and month where the day isn't 500 // significant. 501 Day int64 `json:"day,omitempty"` 502 // Month: Month of a year. Must be from 1 to 12, or 0 to specify a year without 503 // a month and day. 504 Month int64 `json:"month,omitempty"` 505 // Year: Year of the date. Must be from 1 to 9999, or 0 to specify a date 506 // without a year. 507 Year int64 `json:"year,omitempty"` 508 // ForceSendFields is a list of field names (e.g. "Day") to unconditionally 509 // include in API requests. By default, fields with empty or default values are 510 // omitted from API requests. See 511 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 512 // details. 513 ForceSendFields []string `json:"-"` 514 // NullFields is a list of field names (e.g. "Day") to include in API requests 515 // with the JSON null value. By default, fields with empty values are omitted 516 // from API requests. See 517 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 518 NullFields []string `json:"-"` 519 } 520 521 func (s *Date) MarshalJSON() ([]byte, error) { 522 type NoMethod Date 523 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 524 } 525 526 // EventFilter: Filters events based on exact matches on the CloudEvents 527 // attributes. 528 type EventFilter struct { 529 // Attribute: Required. The name of a CloudEvents attribute. 530 Attribute string `json:"attribute,omitempty"` 531 // Operator: Optional. The operator used for matching the events with the value 532 // of the filter. If not specified, only events that have an exact key-value 533 // pair specified in the filter are matched. The only allowed value is 534 // `match-path-pattern`. 535 Operator string `json:"operator,omitempty"` 536 // Value: Required. The value for the attribute. 537 Value string `json:"value,omitempty"` 538 // ForceSendFields is a list of field names (e.g. "Attribute") to 539 // unconditionally include in API requests. By default, fields with empty or 540 // default values are omitted from API requests. See 541 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 542 // details. 543 ForceSendFields []string `json:"-"` 544 // NullFields is a list of field names (e.g. "Attribute") to include in API 545 // requests with the JSON null value. By default, fields with empty values are 546 // omitted from API requests. See 547 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 548 NullFields []string `json:"-"` 549 } 550 551 func (s *EventFilter) MarshalJSON() ([]byte, error) { 552 type NoMethod EventFilter 553 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 554 } 555 556 // EventTrigger: Describes EventTrigger, used to request events to be sent from 557 // another service. 558 type EventTrigger struct { 559 // Channel: Optional. The name of the channel associated with the trigger in 560 // `projects/{project}/locations/{location}/channels/{channel}` format. You 561 // must provide a channel to receive events from Eventarc SaaS partners. 562 Channel string `json:"channel,omitempty"` 563 // EventFilters: Criteria used to filter events. 564 EventFilters []*EventFilter `json:"eventFilters,omitempty"` 565 // EventType: Required. The type of event to observe. For example: 566 // `google.cloud.audit.log.v1.written` or 567 // `google.cloud.pubsub.topic.v1.messagePublished`. 568 EventType string `json:"eventType,omitempty"` 569 // PubsubTopic: Optional. The name of a Pub/Sub topic in the same project that 570 // will be used as the transport topic for the event delivery. Format: 571 // `projects/{project}/topics/{topic}`. This is only valid for events of type 572 // `google.cloud.pubsub.topic.v1.messagePublished`. The topic provided here 573 // will not be deleted at function deletion. 574 PubsubTopic string `json:"pubsubTopic,omitempty"` 575 // RetryPolicy: Optional. If unset, then defaults to ignoring failures (i.e. 576 // not retrying them). 577 // 578 // Possible values: 579 // "RETRY_POLICY_UNSPECIFIED" - Not specified. 580 // "RETRY_POLICY_DO_NOT_RETRY" - Do not retry. 581 // "RETRY_POLICY_RETRY" - Retry on any failure, retry up to 7 days with an 582 // exponential backoff (capped at 10 seconds). 583 RetryPolicy string `json:"retryPolicy,omitempty"` 584 // Service: Optional. The hostname of the service that 1st Gen function should 585 // be observed. If no string is provided, the default service implementing the 586 // API will be used. For example, `storage.googleapis.com` is the default for 587 // all event types in the `google.storage` namespace. The field is only 588 // applicable to 1st Gen functions. 589 Service string `json:"service,omitempty"` 590 // ServiceAccountEmail: Optional. The email of the trigger's service account. 591 // The service account must have permission to invoke Cloud Run services, the 592 // permission is `run.routes.invoke`. If empty, defaults to the Compute Engine 593 // default service account: 594 // `{project_number}-compute@developer.gserviceaccount.com`. 595 ServiceAccountEmail string `json:"serviceAccountEmail,omitempty"` 596 // Trigger: Output only. The resource name of the Eventarc trigger. The format 597 // of this field is `projects/{project}/locations/{region}/triggers/{trigger}`. 598 Trigger string `json:"trigger,omitempty"` 599 // TriggerRegion: The region that the trigger will be in. The trigger will only 600 // receive events originating in this region. It can be the same region as the 601 // function, a different region or multi-region, or the global region. If not 602 // provided, defaults to the same region as the function. 603 TriggerRegion string `json:"triggerRegion,omitempty"` 604 // ForceSendFields is a list of field names (e.g. "Channel") to unconditionally 605 // include in API requests. By default, fields with empty or default values are 606 // omitted from API requests. See 607 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 608 // details. 609 ForceSendFields []string `json:"-"` 610 // NullFields is a list of field names (e.g. "Channel") to include in API 611 // requests with the JSON null value. By default, fields with empty values are 612 // omitted from API requests. See 613 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 614 NullFields []string `json:"-"` 615 } 616 617 func (s *EventTrigger) MarshalJSON() ([]byte, error) { 618 type NoMethod EventTrigger 619 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 620 } 621 622 // Expr: Represents a textual expression in the Common Expression Language 623 // (CEL) syntax. CEL is a C-like expression language. The syntax and semantics 624 // of CEL are documented at https://github.com/google/cel-spec. Example 625 // (Comparison): title: "Summary size limit" description: "Determines if a 626 // summary is less than 100 chars" expression: "document.summary.size() < 100" 627 // Example (Equality): title: "Requestor is owner" description: "Determines if 628 // requestor is the document owner" expression: "document.owner == 629 // request.auth.claims.email" Example (Logic): title: "Public documents" 630 // description: "Determine whether the document should be publicly visible" 631 // expression: "document.type != 'private' && document.type != 'internal'" 632 // Example (Data Manipulation): title: "Notification string" description: 633 // "Create a notification string with a timestamp." expression: "'New message 634 // received at ' + string(document.create_time)" The exact variables and 635 // functions that may be referenced within an expression are determined by the 636 // service that evaluates it. See the service documentation for additional 637 // information. 638 type Expr struct { 639 // Description: Optional. Description of the expression. This is a longer text 640 // which describes the expression, e.g. when hovered over it in a UI. 641 Description string `json:"description,omitempty"` 642 // Expression: Textual representation of an expression in Common Expression 643 // Language syntax. 644 Expression string `json:"expression,omitempty"` 645 // Location: Optional. String indicating the location of the expression for 646 // error reporting, e.g. a file name and a position in the file. 647 Location string `json:"location,omitempty"` 648 // Title: Optional. Title for the expression, i.e. a short string describing 649 // its purpose. This can be used e.g. in UIs which allow to enter the 650 // expression. 651 Title string `json:"title,omitempty"` 652 // ForceSendFields is a list of field names (e.g. "Description") to 653 // unconditionally include in API requests. By default, fields with empty or 654 // default values are omitted from API requests. See 655 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 656 // details. 657 ForceSendFields []string `json:"-"` 658 // NullFields is a list of field names (e.g. "Description") to include in API 659 // requests with the JSON null value. By default, fields with empty values are 660 // omitted from API requests. See 661 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 662 NullFields []string `json:"-"` 663 } 664 665 func (s *Expr) MarshalJSON() ([]byte, error) { 666 type NoMethod Expr 667 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 668 } 669 670 // Function: Describes a Cloud Function that contains user computation executed 671 // in response to an event. It encapsulates function and trigger 672 // configurations. 673 type Function struct { 674 // BuildConfig: Describes the Build step of the function that builds a 675 // container from the given source. 676 BuildConfig *BuildConfig `json:"buildConfig,omitempty"` 677 // CreateTime: Output only. The create timestamp of a Cloud Function. This is 678 // only applicable to 2nd Gen functions. 679 CreateTime string `json:"createTime,omitempty"` 680 // Description: User-provided description of a function. 681 Description string `json:"description,omitempty"` 682 // Environment: Describe whether the function is 1st Gen or 2nd Gen. 683 // 684 // Possible values: 685 // "ENVIRONMENT_UNSPECIFIED" - Unspecified 686 // "GEN_1" - Gen 1 687 // "GEN_2" - Gen 2 688 Environment string `json:"environment,omitempty"` 689 // EventTrigger: An Eventarc trigger managed by Google Cloud Functions that 690 // fires events in response to a condition in another service. 691 EventTrigger *EventTrigger `json:"eventTrigger,omitempty"` 692 // KmsKeyName: [Preview] Resource name of a KMS crypto key (managed by the 693 // user) used to encrypt/decrypt function resources. It must match the pattern 694 // `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{cryp 695 // to_key}`. 696 KmsKeyName string `json:"kmsKeyName,omitempty"` 697 // Labels: Labels associated with this Cloud Function. 698 Labels map[string]string `json:"labels,omitempty"` 699 // Name: A user-defined name of the function. Function names must be unique 700 // globally and match pattern `projects/*/locations/*/functions/*` 701 Name string `json:"name,omitempty"` 702 // SatisfiesPzs: Output only. Reserved for future use. 703 SatisfiesPzs bool `json:"satisfiesPzs,omitempty"` 704 // ServiceConfig: Describes the Service being deployed. Currently deploys 705 // services to Cloud Run (fully managed). 706 ServiceConfig *ServiceConfig `json:"serviceConfig,omitempty"` 707 // State: Output only. State of the function. 708 // 709 // Possible values: 710 // "STATE_UNSPECIFIED" - Not specified. Invalid state. 711 // "ACTIVE" - Function has been successfully deployed and is serving. 712 // "FAILED" - Function deployment failed and the function is not serving. 713 // "DEPLOYING" - Function is being created or updated. 714 // "DELETING" - Function is being deleted. 715 // "UNKNOWN" - Function deployment failed and the function serving state is 716 // undefined. The function should be updated or deleted to move it out of this 717 // state. 718 State string `json:"state,omitempty"` 719 // StateMessages: Output only. State Messages for this Cloud Function. 720 StateMessages []*GoogleCloudFunctionsV2StateMessage `json:"stateMessages,omitempty"` 721 // UpdateTime: Output only. The last update timestamp of a Cloud Function. 722 UpdateTime string `json:"updateTime,omitempty"` 723 // UpgradeInfo: Output only. UpgradeInfo for this Cloud Function 724 UpgradeInfo *UpgradeInfo `json:"upgradeInfo,omitempty"` 725 // Url: Output only. The deployed url for the function. 726 Url string `json:"url,omitempty"` 727 728 // ServerResponse contains the HTTP response code and headers from the server. 729 googleapi.ServerResponse `json:"-"` 730 // ForceSendFields is a list of field names (e.g. "BuildConfig") to 731 // unconditionally include in API requests. By default, fields with empty or 732 // default values are omitted from API requests. See 733 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 734 // details. 735 ForceSendFields []string `json:"-"` 736 // NullFields is a list of field names (e.g. "BuildConfig") to include in API 737 // requests with the JSON null value. By default, fields with empty values are 738 // omitted from API requests. See 739 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 740 NullFields []string `json:"-"` 741 } 742 743 func (s *Function) MarshalJSON() ([]byte, error) { 744 type NoMethod Function 745 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 746 } 747 748 // GenerateDownloadUrlRequest: Request of `GenerateDownloadUrl` method. 749 type GenerateDownloadUrlRequest struct { 750 } 751 752 // GenerateDownloadUrlResponse: Response of `GenerateDownloadUrl` method. 753 type GenerateDownloadUrlResponse struct { 754 // DownloadUrl: The generated Google Cloud Storage signed URL that should be 755 // used for function source code download. 756 DownloadUrl string `json:"downloadUrl,omitempty"` 757 758 // ServerResponse contains the HTTP response code and headers from the server. 759 googleapi.ServerResponse `json:"-"` 760 // ForceSendFields is a list of field names (e.g. "DownloadUrl") to 761 // unconditionally include in API requests. By default, fields with empty or 762 // default values are omitted from API requests. See 763 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 764 // details. 765 ForceSendFields []string `json:"-"` 766 // NullFields is a list of field names (e.g. "DownloadUrl") to include in API 767 // requests with the JSON null value. By default, fields with empty values are 768 // omitted from API requests. See 769 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 770 NullFields []string `json:"-"` 771 } 772 773 func (s *GenerateDownloadUrlResponse) MarshalJSON() ([]byte, error) { 774 type NoMethod GenerateDownloadUrlResponse 775 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 776 } 777 778 // GenerateUploadUrlRequest: Request of `GenerateSourceUploadUrl` method. 779 type GenerateUploadUrlRequest struct { 780 // Environment: The function environment the generated upload url will be used 781 // for. The upload url for 2nd Gen functions can also be used for 1st gen 782 // functions, but not vice versa. If not specified, 2nd generation-style upload 783 // URLs are generated. 784 // 785 // Possible values: 786 // "ENVIRONMENT_UNSPECIFIED" - Unspecified 787 // "GEN_1" - Gen 1 788 // "GEN_2" - Gen 2 789 Environment string `json:"environment,omitempty"` 790 // KmsKeyName: [Preview] Resource name of a KMS crypto key (managed by the 791 // user) used to encrypt/decrypt function source code objects in intermediate 792 // Cloud Storage buckets. When you generate an upload url and upload your 793 // source code, it gets copied to an intermediate Cloud Storage bucket. The 794 // source code is then copied to a versioned directory in the sources bucket in 795 // the consumer project during the function deployment. It must match the 796 // pattern 797 // `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{cryp 798 // to_key}`. The Google Cloud Functions service account 799 // (service-{project_number}@gcf-admin-robot.iam.gserviceaccount.com) must be 800 // granted the role 'Cloud KMS CryptoKey Encrypter/Decrypter 801 // (roles/cloudkms.cryptoKeyEncrypterDecrypter)' on the 802 // Key/KeyRing/Project/Organization (least access preferred). 803 KmsKeyName string `json:"kmsKeyName,omitempty"` 804 // ForceSendFields is a list of field names (e.g. "Environment") to 805 // unconditionally include in API requests. By default, fields with empty or 806 // default values are omitted from API requests. See 807 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 808 // details. 809 ForceSendFields []string `json:"-"` 810 // NullFields is a list of field names (e.g. "Environment") to include in API 811 // requests with the JSON null value. By default, fields with empty values are 812 // omitted from API requests. See 813 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 814 NullFields []string `json:"-"` 815 } 816 817 func (s *GenerateUploadUrlRequest) MarshalJSON() ([]byte, error) { 818 type NoMethod GenerateUploadUrlRequest 819 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 820 } 821 822 // GenerateUploadUrlResponse: Response of `GenerateSourceUploadUrl` method. 823 type GenerateUploadUrlResponse struct { 824 // StorageSource: The location of the source code in the upload bucket. Once 825 // the archive is uploaded using the `upload_url` use this field to set the 826 // `function.build_config.source.storage_source` during CreateFunction and 827 // UpdateFunction. Generation defaults to 0, as Cloud Storage provides a new 828 // generation only upon uploading a new object or version of an object. 829 StorageSource *StorageSource `json:"storageSource,omitempty"` 830 // UploadUrl: The generated Google Cloud Storage signed URL that should be used 831 // for a function source code upload. The uploaded file should be a zip archive 832 // which contains a function. 833 UploadUrl string `json:"uploadUrl,omitempty"` 834 835 // ServerResponse contains the HTTP response code and headers from the server. 836 googleapi.ServerResponse `json:"-"` 837 // ForceSendFields is a list of field names (e.g. "StorageSource") to 838 // unconditionally include in API requests. By default, fields with empty or 839 // default values are omitted from API requests. See 840 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 841 // details. 842 ForceSendFields []string `json:"-"` 843 // NullFields is a list of field names (e.g. "StorageSource") to include in API 844 // requests with the JSON null value. By default, fields with empty values are 845 // omitted from API requests. See 846 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 847 NullFields []string `json:"-"` 848 } 849 850 func (s *GenerateUploadUrlResponse) MarshalJSON() ([]byte, error) { 851 type NoMethod GenerateUploadUrlResponse 852 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 853 } 854 855 // GoogleCloudFunctionsV2LocationMetadata: Extra GCF specific location 856 // information. 857 type GoogleCloudFunctionsV2LocationMetadata struct { 858 // Environments: The Cloud Function environments this location supports. 859 // 860 // Possible values: 861 // "ENVIRONMENT_UNSPECIFIED" - Unspecified 862 // "GEN_1" - Gen 1 863 // "GEN_2" - Gen 2 864 Environments []string `json:"environments,omitempty"` 865 // ForceSendFields is a list of field names (e.g. "Environments") to 866 // unconditionally include in API requests. By default, fields with empty or 867 // default values are omitted from API requests. See 868 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 869 // details. 870 ForceSendFields []string `json:"-"` 871 // NullFields is a list of field names (e.g. "Environments") to include in API 872 // requests with the JSON null value. By default, fields with empty values are 873 // omitted from API requests. See 874 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 875 NullFields []string `json:"-"` 876 } 877 878 func (s *GoogleCloudFunctionsV2LocationMetadata) MarshalJSON() ([]byte, error) { 879 type NoMethod GoogleCloudFunctionsV2LocationMetadata 880 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 881 } 882 883 // GoogleCloudFunctionsV2OperationMetadata: Represents the metadata of the 884 // long-running operation. 885 type GoogleCloudFunctionsV2OperationMetadata struct { 886 // ApiVersion: API version used to start the operation. 887 ApiVersion string `json:"apiVersion,omitempty"` 888 // CancelRequested: Identifies whether the user has requested cancellation of 889 // the operation. Operations that have successfully been cancelled have 890 // google.longrunning.Operation.error value with a google.rpc.Status.code of 1, 891 // corresponding to `Code.CANCELLED`. 892 CancelRequested bool `json:"cancelRequested,omitempty"` 893 // CreateTime: The time the operation was created. 894 CreateTime string `json:"createTime,omitempty"` 895 // EndTime: The time the operation finished running. 896 EndTime string `json:"endTime,omitempty"` 897 // OperationType: The operation type. 898 // 899 // Possible values: 900 // "OPERATIONTYPE_UNSPECIFIED" - Unspecified 901 // "CREATE_FUNCTION" - CreateFunction 902 // "UPDATE_FUNCTION" - UpdateFunction 903 // "DELETE_FUNCTION" - DeleteFunction 904 // "REDIRECT_FUNCTION_UPGRADE_TRAFFIC" - RedirectFunctionUpgradeTraffic 905 // "ROLLBACK_FUNCTION_UPGRADE_TRAFFIC" - RollbackFunctionUpgradeTraffic 906 // "SETUP_FUNCTION_UPGRADE_CONFIG" - SetupFunctionUpgradeConfig 907 // "ABORT_FUNCTION_UPGRADE" - AbortFunctionUpgrade 908 // "COMMIT_FUNCTION_UPGRADE" - CommitFunctionUpgrade 909 OperationType string `json:"operationType,omitempty"` 910 // RequestResource: The original request that started the operation. 911 RequestResource googleapi.RawMessage `json:"requestResource,omitempty"` 912 // SourceToken: An identifier for Firebase function sources. Disclaimer: This 913 // field is only supported for Firebase function deployments. 914 SourceToken string `json:"sourceToken,omitempty"` 915 // Stages: Mechanism for reporting in-progress stages 916 Stages []*GoogleCloudFunctionsV2Stage `json:"stages,omitempty"` 917 // StatusDetail: Human-readable status of the operation, if any. 918 StatusDetail string `json:"statusDetail,omitempty"` 919 // Target: Server-defined resource path for the target of the operation. 920 Target string `json:"target,omitempty"` 921 // Verb: Name of the verb executed by the operation. 922 Verb string `json:"verb,omitempty"` 923 // ForceSendFields is a list of field names (e.g. "ApiVersion") to 924 // unconditionally include in API requests. By default, fields with empty or 925 // default values are omitted from API requests. See 926 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 927 // details. 928 ForceSendFields []string `json:"-"` 929 // NullFields is a list of field names (e.g. "ApiVersion") to include in API 930 // requests with the JSON null value. By default, fields with empty values are 931 // omitted from API requests. See 932 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 933 NullFields []string `json:"-"` 934 } 935 936 func (s *GoogleCloudFunctionsV2OperationMetadata) MarshalJSON() ([]byte, error) { 937 type NoMethod GoogleCloudFunctionsV2OperationMetadata 938 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 939 } 940 941 // GoogleCloudFunctionsV2Stage: Each Stage of the deployment process 942 type GoogleCloudFunctionsV2Stage struct { 943 // Message: Message describing the Stage 944 Message string `json:"message,omitempty"` 945 // Name: Name of the Stage. This will be unique for each Stage. 946 // 947 // Possible values: 948 // "NAME_UNSPECIFIED" - Not specified. Invalid name. 949 // "ARTIFACT_REGISTRY" - Artifact Regsitry Stage 950 // "BUILD" - Build Stage 951 // "SERVICE" - Service Stage 952 // "TRIGGER" - Trigger Stage 953 // "SERVICE_ROLLBACK" - Service Rollback Stage 954 // "TRIGGER_ROLLBACK" - Trigger Rollback Stage 955 Name string `json:"name,omitempty"` 956 // Resource: Resource of the Stage 957 Resource string `json:"resource,omitempty"` 958 // ResourceUri: Link to the current Stage resource 959 ResourceUri string `json:"resourceUri,omitempty"` 960 // State: Current state of the Stage 961 // 962 // Possible values: 963 // "STATE_UNSPECIFIED" - Not specified. Invalid state. 964 // "NOT_STARTED" - Stage has not started. 965 // "IN_PROGRESS" - Stage is in progress. 966 // "COMPLETE" - Stage has completed. 967 State string `json:"state,omitempty"` 968 // StateMessages: State messages from the current Stage. 969 StateMessages []*GoogleCloudFunctionsV2StateMessage `json:"stateMessages,omitempty"` 970 // ForceSendFields is a list of field names (e.g. "Message") to unconditionally 971 // include in API requests. By default, fields with empty or default values are 972 // omitted from API requests. See 973 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 974 // details. 975 ForceSendFields []string `json:"-"` 976 // NullFields is a list of field names (e.g. "Message") to include in API 977 // requests with the JSON null value. By default, fields with empty values are 978 // omitted from API requests. See 979 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 980 NullFields []string `json:"-"` 981 } 982 983 func (s *GoogleCloudFunctionsV2Stage) MarshalJSON() ([]byte, error) { 984 type NoMethod GoogleCloudFunctionsV2Stage 985 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 986 } 987 988 // GoogleCloudFunctionsV2StateMessage: Informational messages about the state 989 // of the Cloud Function or Operation. 990 type GoogleCloudFunctionsV2StateMessage struct { 991 // Message: The message. 992 Message string `json:"message,omitempty"` 993 // Severity: Severity of the state message. 994 // 995 // Possible values: 996 // "SEVERITY_UNSPECIFIED" - Not specified. Invalid severity. 997 // "ERROR" - ERROR-level severity. 998 // "WARNING" - WARNING-level severity. 999 // "INFO" - INFO-level severity. 1000 Severity string `json:"severity,omitempty"` 1001 // Type: One-word CamelCase type of the state message. 1002 Type string `json:"type,omitempty"` 1003 // ForceSendFields is a list of field names (e.g. "Message") to unconditionally 1004 // include in API requests. By default, fields with empty or default values are 1005 // omitted from API requests. See 1006 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1007 // details. 1008 ForceSendFields []string `json:"-"` 1009 // NullFields is a list of field names (e.g. "Message") to include in API 1010 // requests with the JSON null value. By default, fields with empty values are 1011 // omitted from API requests. See 1012 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1013 NullFields []string `json:"-"` 1014 } 1015 1016 func (s *GoogleCloudFunctionsV2StateMessage) MarshalJSON() ([]byte, error) { 1017 type NoMethod GoogleCloudFunctionsV2StateMessage 1018 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1019 } 1020 1021 // GoogleCloudFunctionsV2alphaLocationMetadata: Extra GCF specific location 1022 // information. 1023 type GoogleCloudFunctionsV2alphaLocationMetadata struct { 1024 // Environments: The Cloud Function environments this location supports. 1025 // 1026 // Possible values: 1027 // "ENVIRONMENT_UNSPECIFIED" - Unspecified 1028 // "GEN_1" - Gen 1 1029 // "GEN_2" - Gen 2 1030 Environments []string `json:"environments,omitempty"` 1031 // ForceSendFields is a list of field names (e.g. "Environments") to 1032 // unconditionally include in API requests. By default, fields with empty or 1033 // default values are omitted from API requests. See 1034 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1035 // details. 1036 ForceSendFields []string `json:"-"` 1037 // NullFields is a list of field names (e.g. "Environments") to include in API 1038 // requests with the JSON null value. By default, fields with empty values are 1039 // omitted from API requests. See 1040 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1041 NullFields []string `json:"-"` 1042 } 1043 1044 func (s *GoogleCloudFunctionsV2alphaLocationMetadata) MarshalJSON() ([]byte, error) { 1045 type NoMethod GoogleCloudFunctionsV2alphaLocationMetadata 1046 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1047 } 1048 1049 // GoogleCloudFunctionsV2alphaOperationMetadata: Represents the metadata of the 1050 // long-running operation. 1051 type GoogleCloudFunctionsV2alphaOperationMetadata struct { 1052 // ApiVersion: API version used to start the operation. 1053 ApiVersion string `json:"apiVersion,omitempty"` 1054 // CancelRequested: Identifies whether the user has requested cancellation of 1055 // the operation. Operations that have successfully been cancelled have 1056 // google.longrunning.Operation.error value with a google.rpc.Status.code of 1, 1057 // corresponding to `Code.CANCELLED`. 1058 CancelRequested bool `json:"cancelRequested,omitempty"` 1059 // CreateTime: The time the operation was created. 1060 CreateTime string `json:"createTime,omitempty"` 1061 // EndTime: The time the operation finished running. 1062 EndTime string `json:"endTime,omitempty"` 1063 // OperationType: The operation type. 1064 // 1065 // Possible values: 1066 // "OPERATIONTYPE_UNSPECIFIED" - Unspecified 1067 // "CREATE_FUNCTION" - CreateFunction 1068 // "UPDATE_FUNCTION" - UpdateFunction 1069 // "DELETE_FUNCTION" - DeleteFunction 1070 // "REDIRECT_FUNCTION_UPGRADE_TRAFFIC" - RedirectFunctionUpgradeTraffic 1071 // "ROLLBACK_FUNCTION_UPGRADE_TRAFFIC" - RollbackFunctionUpgradeTraffic 1072 // "SETUP_FUNCTION_UPGRADE_CONFIG" - SetupFunctionUpgradeConfig 1073 // "ABORT_FUNCTION_UPGRADE" - AbortFunctionUpgrade 1074 // "COMMIT_FUNCTION_UPGRADE" - CommitFunctionUpgrade 1075 OperationType string `json:"operationType,omitempty"` 1076 // RequestResource: The original request that started the operation. 1077 RequestResource googleapi.RawMessage `json:"requestResource,omitempty"` 1078 // SourceToken: An identifier for Firebase function sources. Disclaimer: This 1079 // field is only supported for Firebase function deployments. 1080 SourceToken string `json:"sourceToken,omitempty"` 1081 // Stages: Mechanism for reporting in-progress stages 1082 Stages []*GoogleCloudFunctionsV2alphaStage `json:"stages,omitempty"` 1083 // StatusDetail: Human-readable status of the operation, if any. 1084 StatusDetail string `json:"statusDetail,omitempty"` 1085 // Target: Server-defined resource path for the target of the operation. 1086 Target string `json:"target,omitempty"` 1087 // Verb: Name of the verb executed by the operation. 1088 Verb string `json:"verb,omitempty"` 1089 // ForceSendFields is a list of field names (e.g. "ApiVersion") to 1090 // unconditionally include in API requests. By default, fields with empty or 1091 // default values are omitted from API requests. See 1092 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1093 // details. 1094 ForceSendFields []string `json:"-"` 1095 // NullFields is a list of field names (e.g. "ApiVersion") to include in API 1096 // requests with the JSON null value. By default, fields with empty values are 1097 // omitted from API requests. See 1098 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1099 NullFields []string `json:"-"` 1100 } 1101 1102 func (s *GoogleCloudFunctionsV2alphaOperationMetadata) MarshalJSON() ([]byte, error) { 1103 type NoMethod GoogleCloudFunctionsV2alphaOperationMetadata 1104 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1105 } 1106 1107 // GoogleCloudFunctionsV2alphaStage: Each Stage of the deployment process 1108 type GoogleCloudFunctionsV2alphaStage struct { 1109 // Message: Message describing the Stage 1110 Message string `json:"message,omitempty"` 1111 // Name: Name of the Stage. This will be unique for each Stage. 1112 // 1113 // Possible values: 1114 // "NAME_UNSPECIFIED" - Not specified. Invalid name. 1115 // "ARTIFACT_REGISTRY" - Artifact Regsitry Stage 1116 // "BUILD" - Build Stage 1117 // "SERVICE" - Service Stage 1118 // "TRIGGER" - Trigger Stage 1119 // "SERVICE_ROLLBACK" - Service Rollback Stage 1120 // "TRIGGER_ROLLBACK" - Trigger Rollback Stage 1121 Name string `json:"name,omitempty"` 1122 // Resource: Resource of the Stage 1123 Resource string `json:"resource,omitempty"` 1124 // ResourceUri: Link to the current Stage resource 1125 ResourceUri string `json:"resourceUri,omitempty"` 1126 // State: Current state of the Stage 1127 // 1128 // Possible values: 1129 // "STATE_UNSPECIFIED" - Not specified. Invalid state. 1130 // "NOT_STARTED" - Stage has not started. 1131 // "IN_PROGRESS" - Stage is in progress. 1132 // "COMPLETE" - Stage has completed. 1133 State string `json:"state,omitempty"` 1134 // StateMessages: State messages from the current Stage. 1135 StateMessages []*GoogleCloudFunctionsV2alphaStateMessage `json:"stateMessages,omitempty"` 1136 // ForceSendFields is a list of field names (e.g. "Message") to unconditionally 1137 // include in API requests. By default, fields with empty or default values are 1138 // omitted from API requests. See 1139 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1140 // details. 1141 ForceSendFields []string `json:"-"` 1142 // NullFields is a list of field names (e.g. "Message") to include in API 1143 // requests with the JSON null value. By default, fields with empty values are 1144 // omitted from API requests. See 1145 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1146 NullFields []string `json:"-"` 1147 } 1148 1149 func (s *GoogleCloudFunctionsV2alphaStage) MarshalJSON() ([]byte, error) { 1150 type NoMethod GoogleCloudFunctionsV2alphaStage 1151 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1152 } 1153 1154 // GoogleCloudFunctionsV2alphaStateMessage: Informational messages about the 1155 // state of the Cloud Function or Operation. 1156 type GoogleCloudFunctionsV2alphaStateMessage struct { 1157 // Message: The message. 1158 Message string `json:"message,omitempty"` 1159 // Severity: Severity of the state message. 1160 // 1161 // Possible values: 1162 // "SEVERITY_UNSPECIFIED" - Not specified. Invalid severity. 1163 // "ERROR" - ERROR-level severity. 1164 // "WARNING" - WARNING-level severity. 1165 // "INFO" - INFO-level severity. 1166 Severity string `json:"severity,omitempty"` 1167 // Type: One-word CamelCase type of the state message. 1168 Type string `json:"type,omitempty"` 1169 // ForceSendFields is a list of field names (e.g. "Message") to unconditionally 1170 // include in API requests. By default, fields with empty or default values are 1171 // omitted from API requests. See 1172 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1173 // details. 1174 ForceSendFields []string `json:"-"` 1175 // NullFields is a list of field names (e.g. "Message") to include in API 1176 // requests with the JSON null value. By default, fields with empty values are 1177 // omitted from API requests. See 1178 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1179 NullFields []string `json:"-"` 1180 } 1181 1182 func (s *GoogleCloudFunctionsV2alphaStateMessage) MarshalJSON() ([]byte, error) { 1183 type NoMethod GoogleCloudFunctionsV2alphaStateMessage 1184 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1185 } 1186 1187 // GoogleCloudFunctionsV2betaLocationMetadata: Extra GCF specific location 1188 // information. 1189 type GoogleCloudFunctionsV2betaLocationMetadata struct { 1190 // Environments: The Cloud Function environments this location supports. 1191 // 1192 // Possible values: 1193 // "ENVIRONMENT_UNSPECIFIED" - Unspecified 1194 // "GEN_1" - Gen 1 1195 // "GEN_2" - Gen 2 1196 Environments []string `json:"environments,omitempty"` 1197 // ForceSendFields is a list of field names (e.g. "Environments") to 1198 // unconditionally include in API requests. By default, fields with empty or 1199 // default values are omitted from API requests. See 1200 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1201 // details. 1202 ForceSendFields []string `json:"-"` 1203 // NullFields is a list of field names (e.g. "Environments") to include in API 1204 // requests with the JSON null value. By default, fields with empty values are 1205 // omitted from API requests. See 1206 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1207 NullFields []string `json:"-"` 1208 } 1209 1210 func (s *GoogleCloudFunctionsV2betaLocationMetadata) MarshalJSON() ([]byte, error) { 1211 type NoMethod GoogleCloudFunctionsV2betaLocationMetadata 1212 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1213 } 1214 1215 // GoogleCloudFunctionsV2betaOperationMetadata: Represents the metadata of the 1216 // long-running operation. 1217 type GoogleCloudFunctionsV2betaOperationMetadata struct { 1218 // ApiVersion: API version used to start the operation. 1219 ApiVersion string `json:"apiVersion,omitempty"` 1220 // CancelRequested: Identifies whether the user has requested cancellation of 1221 // the operation. Operations that have successfully been cancelled have 1222 // google.longrunning.Operation.error value with a google.rpc.Status.code of 1, 1223 // corresponding to `Code.CANCELLED`. 1224 CancelRequested bool `json:"cancelRequested,omitempty"` 1225 // CreateTime: The time the operation was created. 1226 CreateTime string `json:"createTime,omitempty"` 1227 // EndTime: The time the operation finished running. 1228 EndTime string `json:"endTime,omitempty"` 1229 // OperationType: The operation type. 1230 // 1231 // Possible values: 1232 // "OPERATIONTYPE_UNSPECIFIED" - Unspecified 1233 // "CREATE_FUNCTION" - CreateFunction 1234 // "UPDATE_FUNCTION" - UpdateFunction 1235 // "DELETE_FUNCTION" - DeleteFunction 1236 // "REDIRECT_FUNCTION_UPGRADE_TRAFFIC" - RedirectFunctionUpgradeTraffic 1237 // "ROLLBACK_FUNCTION_UPGRADE_TRAFFIC" - RollbackFunctionUpgradeTraffic 1238 // "SETUP_FUNCTION_UPGRADE_CONFIG" - SetupFunctionUpgradeConfig 1239 // "ABORT_FUNCTION_UPGRADE" - AbortFunctionUpgrade 1240 // "COMMIT_FUNCTION_UPGRADE" - CommitFunctionUpgrade 1241 OperationType string `json:"operationType,omitempty"` 1242 // RequestResource: The original request that started the operation. 1243 RequestResource googleapi.RawMessage `json:"requestResource,omitempty"` 1244 // SourceToken: An identifier for Firebase function sources. Disclaimer: This 1245 // field is only supported for Firebase function deployments. 1246 SourceToken string `json:"sourceToken,omitempty"` 1247 // Stages: Mechanism for reporting in-progress stages 1248 Stages []*GoogleCloudFunctionsV2betaStage `json:"stages,omitempty"` 1249 // StatusDetail: Human-readable status of the operation, if any. 1250 StatusDetail string `json:"statusDetail,omitempty"` 1251 // Target: Server-defined resource path for the target of the operation. 1252 Target string `json:"target,omitempty"` 1253 // Verb: Name of the verb executed by the operation. 1254 Verb string `json:"verb,omitempty"` 1255 // ForceSendFields is a list of field names (e.g. "ApiVersion") to 1256 // unconditionally include in API requests. By default, fields with empty or 1257 // default values are omitted from API requests. See 1258 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1259 // details. 1260 ForceSendFields []string `json:"-"` 1261 // NullFields is a list of field names (e.g. "ApiVersion") to include in API 1262 // requests with the JSON null value. By default, fields with empty values are 1263 // omitted from API requests. See 1264 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1265 NullFields []string `json:"-"` 1266 } 1267 1268 func (s *GoogleCloudFunctionsV2betaOperationMetadata) MarshalJSON() ([]byte, error) { 1269 type NoMethod GoogleCloudFunctionsV2betaOperationMetadata 1270 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1271 } 1272 1273 // GoogleCloudFunctionsV2betaStage: Each Stage of the deployment process 1274 type GoogleCloudFunctionsV2betaStage struct { 1275 // Message: Message describing the Stage 1276 Message string `json:"message,omitempty"` 1277 // Name: Name of the Stage. This will be unique for each Stage. 1278 // 1279 // Possible values: 1280 // "NAME_UNSPECIFIED" - Not specified. Invalid name. 1281 // "ARTIFACT_REGISTRY" - Artifact Regsitry Stage 1282 // "BUILD" - Build Stage 1283 // "SERVICE" - Service Stage 1284 // "TRIGGER" - Trigger Stage 1285 // "SERVICE_ROLLBACK" - Service Rollback Stage 1286 // "TRIGGER_ROLLBACK" - Trigger Rollback Stage 1287 Name string `json:"name,omitempty"` 1288 // Resource: Resource of the Stage 1289 Resource string `json:"resource,omitempty"` 1290 // ResourceUri: Link to the current Stage resource 1291 ResourceUri string `json:"resourceUri,omitempty"` 1292 // State: Current state of the Stage 1293 // 1294 // Possible values: 1295 // "STATE_UNSPECIFIED" - Not specified. Invalid state. 1296 // "NOT_STARTED" - Stage has not started. 1297 // "IN_PROGRESS" - Stage is in progress. 1298 // "COMPLETE" - Stage has completed. 1299 State string `json:"state,omitempty"` 1300 // StateMessages: State messages from the current Stage. 1301 StateMessages []*GoogleCloudFunctionsV2betaStateMessage `json:"stateMessages,omitempty"` 1302 // ForceSendFields is a list of field names (e.g. "Message") to unconditionally 1303 // include in API requests. By default, fields with empty or default values are 1304 // omitted from API requests. See 1305 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1306 // details. 1307 ForceSendFields []string `json:"-"` 1308 // NullFields is a list of field names (e.g. "Message") to include in API 1309 // requests with the JSON null value. By default, fields with empty values are 1310 // omitted from API requests. See 1311 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1312 NullFields []string `json:"-"` 1313 } 1314 1315 func (s *GoogleCloudFunctionsV2betaStage) MarshalJSON() ([]byte, error) { 1316 type NoMethod GoogleCloudFunctionsV2betaStage 1317 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1318 } 1319 1320 // GoogleCloudFunctionsV2betaStateMessage: Informational messages about the 1321 // state of the Cloud Function or Operation. 1322 type GoogleCloudFunctionsV2betaStateMessage struct { 1323 // Message: The message. 1324 Message string `json:"message,omitempty"` 1325 // Severity: Severity of the state message. 1326 // 1327 // Possible values: 1328 // "SEVERITY_UNSPECIFIED" - Not specified. Invalid severity. 1329 // "ERROR" - ERROR-level severity. 1330 // "WARNING" - WARNING-level severity. 1331 // "INFO" - INFO-level severity. 1332 Severity string `json:"severity,omitempty"` 1333 // Type: One-word CamelCase type of the state message. 1334 Type string `json:"type,omitempty"` 1335 // ForceSendFields is a list of field names (e.g. "Message") to unconditionally 1336 // include in API requests. By default, fields with empty or default values are 1337 // omitted from API requests. See 1338 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1339 // details. 1340 ForceSendFields []string `json:"-"` 1341 // NullFields is a list of field names (e.g. "Message") to include in API 1342 // requests with the JSON null value. By default, fields with empty values are 1343 // omitted from API requests. See 1344 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1345 NullFields []string `json:"-"` 1346 } 1347 1348 func (s *GoogleCloudFunctionsV2betaStateMessage) MarshalJSON() ([]byte, error) { 1349 type NoMethod GoogleCloudFunctionsV2betaStateMessage 1350 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1351 } 1352 1353 // ListFunctionsResponse: Response for the `ListFunctions` method. 1354 type ListFunctionsResponse struct { 1355 // Functions: The functions that match the request. 1356 Functions []*Function `json:"functions,omitempty"` 1357 // NextPageToken: A token, which can be sent as `page_token` to retrieve the 1358 // next page. If this field is omitted, there are no subsequent pages. 1359 NextPageToken string `json:"nextPageToken,omitempty"` 1360 // Unreachable: Locations that could not be reached. The response does not 1361 // include any functions from these locations. 1362 Unreachable []string `json:"unreachable,omitempty"` 1363 1364 // ServerResponse contains the HTTP response code and headers from the server. 1365 googleapi.ServerResponse `json:"-"` 1366 // ForceSendFields is a list of field names (e.g. "Functions") to 1367 // unconditionally include in API requests. By default, fields with empty or 1368 // default values are omitted from API requests. See 1369 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1370 // details. 1371 ForceSendFields []string `json:"-"` 1372 // NullFields is a list of field names (e.g. "Functions") to include in API 1373 // requests with the JSON null value. By default, fields with empty values are 1374 // omitted from API requests. See 1375 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1376 NullFields []string `json:"-"` 1377 } 1378 1379 func (s *ListFunctionsResponse) MarshalJSON() ([]byte, error) { 1380 type NoMethod ListFunctionsResponse 1381 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1382 } 1383 1384 // ListLocationsResponse: The response message for Locations.ListLocations. 1385 type ListLocationsResponse struct { 1386 // Locations: A list of locations that matches the specified filter in the 1387 // request. 1388 Locations []*Location `json:"locations,omitempty"` 1389 // NextPageToken: The standard List next-page token. 1390 NextPageToken string `json:"nextPageToken,omitempty"` 1391 1392 // ServerResponse contains the HTTP response code and headers from the server. 1393 googleapi.ServerResponse `json:"-"` 1394 // ForceSendFields is a list of field names (e.g. "Locations") to 1395 // unconditionally include in API requests. By default, fields with empty or 1396 // default values are omitted from API requests. See 1397 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1398 // details. 1399 ForceSendFields []string `json:"-"` 1400 // NullFields is a list of field names (e.g. "Locations") to include in API 1401 // requests with the JSON null value. By default, fields with empty values are 1402 // omitted from API requests. See 1403 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1404 NullFields []string `json:"-"` 1405 } 1406 1407 func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) { 1408 type NoMethod ListLocationsResponse 1409 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1410 } 1411 1412 // ListOperationsResponse: The response message for Operations.ListOperations. 1413 type ListOperationsResponse struct { 1414 // NextPageToken: The standard List next-page token. 1415 NextPageToken string `json:"nextPageToken,omitempty"` 1416 // Operations: A list of operations that matches the specified filter in the 1417 // request. 1418 Operations []*Operation `json:"operations,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. "NextPageToken") 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. "NextPageToken") 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 *ListOperationsResponse) MarshalJSON() ([]byte, error) { 1436 type NoMethod ListOperationsResponse 1437 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1438 } 1439 1440 // ListRuntimesResponse: Response for the `ListRuntimes` method. 1441 type ListRuntimesResponse struct { 1442 // Runtimes: The runtimes that match the request. 1443 Runtimes []*Runtime `json:"runtimes,omitempty"` 1444 1445 // ServerResponse contains the HTTP response code and headers from the server. 1446 googleapi.ServerResponse `json:"-"` 1447 // ForceSendFields is a list of field names (e.g. "Runtimes") to 1448 // unconditionally include in API requests. By default, fields with empty or 1449 // default values are omitted from API requests. See 1450 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1451 // details. 1452 ForceSendFields []string `json:"-"` 1453 // NullFields is a list of field names (e.g. "Runtimes") to include in API 1454 // requests with the JSON null value. By default, fields with empty values are 1455 // omitted from API requests. See 1456 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1457 NullFields []string `json:"-"` 1458 } 1459 1460 func (s *ListRuntimesResponse) MarshalJSON() ([]byte, error) { 1461 type NoMethod ListRuntimesResponse 1462 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1463 } 1464 1465 // Location: A resource that represents a Google Cloud location. 1466 type Location struct { 1467 // DisplayName: The friendly name for this location, typically a nearby city 1468 // name. For example, "Tokyo". 1469 DisplayName string `json:"displayName,omitempty"` 1470 // Labels: Cross-service attributes for the location. For example 1471 // {"cloud.googleapis.com/region": "us-east1"} 1472 Labels map[string]string `json:"labels,omitempty"` 1473 // LocationId: The canonical id for this location. For example: "us-east1". 1474 LocationId string `json:"locationId,omitempty"` 1475 // Metadata: Service-specific metadata. For example the available capacity at 1476 // the given location. 1477 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 1478 // Name: Resource name for the location, which may vary between 1479 // implementations. For example: 1480 // "projects/example-project/locations/us-east1" 1481 Name string `json:"name,omitempty"` 1482 // ForceSendFields is a list of field names (e.g. "DisplayName") to 1483 // unconditionally include in API requests. By default, fields with empty or 1484 // default values are omitted from API requests. See 1485 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1486 // details. 1487 ForceSendFields []string `json:"-"` 1488 // NullFields is a list of field names (e.g. "DisplayName") to include in API 1489 // requests with the JSON null value. By default, fields with empty values are 1490 // omitted from API requests. See 1491 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1492 NullFields []string `json:"-"` 1493 } 1494 1495 func (s *Location) MarshalJSON() ([]byte, error) { 1496 type NoMethod Location 1497 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1498 } 1499 1500 // OnDeployUpdatePolicy: Security patches are only applied when a function is 1501 // redeployed. 1502 type OnDeployUpdatePolicy struct { 1503 // RuntimeVersion: Output only. contains the runtime version which was used 1504 // during latest function deployment. 1505 RuntimeVersion string `json:"runtimeVersion,omitempty"` 1506 // ForceSendFields is a list of field names (e.g. "RuntimeVersion") to 1507 // unconditionally include in API requests. By default, fields with empty or 1508 // default values are omitted from API requests. See 1509 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1510 // details. 1511 ForceSendFields []string `json:"-"` 1512 // NullFields is a list of field names (e.g. "RuntimeVersion") to include in 1513 // API requests with the JSON null value. By default, fields with empty values 1514 // are omitted from API requests. See 1515 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1516 NullFields []string `json:"-"` 1517 } 1518 1519 func (s *OnDeployUpdatePolicy) MarshalJSON() ([]byte, error) { 1520 type NoMethod OnDeployUpdatePolicy 1521 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1522 } 1523 1524 // Operation: This resource represents a long-running operation that is the 1525 // result of a network API call. 1526 type Operation struct { 1527 // Done: If the value is `false`, it means the operation is still in progress. 1528 // If `true`, the operation is completed, and either `error` or `response` is 1529 // available. 1530 Done bool `json:"done,omitempty"` 1531 // Error: The error result of the operation in case of failure or cancellation. 1532 Error *Status `json:"error,omitempty"` 1533 // Metadata: Service-specific metadata associated with the operation. It 1534 // typically contains progress information and common metadata such as create 1535 // time. Some services might not provide such metadata. Any method that returns 1536 // a long-running operation should document the metadata type, if any. 1537 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 1538 // Name: The server-assigned name, which is only unique within the same service 1539 // that originally returns it. If you use the default HTTP mapping, the `name` 1540 // should be a resource name ending with `operations/{unique_id}`. 1541 Name string `json:"name,omitempty"` 1542 // Response: The normal, successful response of the operation. If the original 1543 // method returns no data on success, such as `Delete`, the response is 1544 // `google.protobuf.Empty`. If the original method is standard 1545 // `Get`/`Create`/`Update`, the response should be the resource. For other 1546 // methods, the response should have the type `XxxResponse`, where `Xxx` is the 1547 // original method name. For example, if the original method name is 1548 // `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. 1549 Response googleapi.RawMessage `json:"response,omitempty"` 1550 1551 // ServerResponse contains the HTTP response code and headers from the server. 1552 googleapi.ServerResponse `json:"-"` 1553 // ForceSendFields is a list of field names (e.g. "Done") to unconditionally 1554 // include in API requests. By default, fields with empty or default values are 1555 // omitted from API requests. See 1556 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1557 // details. 1558 ForceSendFields []string `json:"-"` 1559 // NullFields is a list of field names (e.g. "Done") to include in API requests 1560 // with the JSON null value. By default, fields with empty values are omitted 1561 // from API requests. See 1562 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1563 NullFields []string `json:"-"` 1564 } 1565 1566 func (s *Operation) MarshalJSON() ([]byte, error) { 1567 type NoMethod Operation 1568 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1569 } 1570 1571 // OperationMetadataV1: Metadata describing an Operation 1572 type OperationMetadataV1 struct { 1573 // BuildId: The Cloud Build ID of the function created or updated by an API 1574 // call. This field is only populated for Create and Update operations. 1575 BuildId string `json:"buildId,omitempty"` 1576 // BuildName: The Cloud Build Name of the function deployment. This field is 1577 // only populated for Create and Update operations. 1578 // `projects//locations//builds/`. 1579 BuildName string `json:"buildName,omitempty"` 1580 // Request: The original request that started the operation. 1581 Request googleapi.RawMessage `json:"request,omitempty"` 1582 // SourceToken: An identifier for Firebase function sources. Disclaimer: This 1583 // field is only supported for Firebase function deployments. 1584 SourceToken string `json:"sourceToken,omitempty"` 1585 // Target: Target of the operation - for example 1586 // `projects/project-1/locations/region-1/functions/function-1` 1587 Target string `json:"target,omitempty"` 1588 // Type: Type of operation. 1589 // 1590 // Possible values: 1591 // "OPERATION_UNSPECIFIED" - Unknown operation type. 1592 // "CREATE_FUNCTION" - Triggered by CreateFunction call 1593 // "UPDATE_FUNCTION" - Triggered by UpdateFunction call 1594 // "DELETE_FUNCTION" - Triggered by DeleteFunction call. 1595 Type string `json:"type,omitempty"` 1596 // UpdateTime: The last update timestamp of the operation. 1597 UpdateTime string `json:"updateTime,omitempty"` 1598 // VersionId: Version id of the function created or updated by an API call. 1599 // This field is only populated for Create and Update operations. 1600 VersionId int64 `json:"versionId,omitempty,string"` 1601 // ForceSendFields is a list of field names (e.g. "BuildId") to unconditionally 1602 // include in API requests. By default, fields with empty or default values are 1603 // omitted from API requests. See 1604 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1605 // details. 1606 ForceSendFields []string `json:"-"` 1607 // NullFields is a list of field names (e.g. "BuildId") to include in API 1608 // requests with the JSON null value. By default, fields with empty values are 1609 // omitted from API requests. See 1610 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1611 NullFields []string `json:"-"` 1612 } 1613 1614 func (s *OperationMetadataV1) MarshalJSON() ([]byte, error) { 1615 type NoMethod OperationMetadataV1 1616 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1617 } 1618 1619 // Policy: An Identity and Access Management (IAM) policy, which specifies 1620 // access controls for Google Cloud resources. A `Policy` is a collection of 1621 // `bindings`. A `binding` binds one or more `members`, or principals, to a 1622 // single `role`. Principals can be user accounts, service accounts, Google 1623 // groups, and domains (such as G Suite). A `role` is a named list of 1624 // permissions; each `role` can be an IAM predefined role or a user-created 1625 // custom role. For some types of Google Cloud resources, a `binding` can also 1626 // specify a `condition`, which is a logical expression that allows access to a 1627 // resource only if the expression evaluates to `true`. A condition can add 1628 // constraints based on attributes of the request, the resource, or both. To 1629 // learn which resources support conditions in their IAM policies, see the IAM 1630 // documentation 1631 // (https://cloud.google.com/iam/help/conditions/resource-policies). **JSON 1632 // example:** ``` { "bindings": [ { "role": 1633 // "roles/resourcemanager.organizationAdmin", "members": [ 1634 // "user:mike@example.com", "group:admins@example.com", "domain:google.com", 1635 // "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": 1636 // "roles/resourcemanager.organizationViewer", "members": [ 1637 // "user:eve@example.com" ], "condition": { "title": "expirable access", 1638 // "description": "Does not grant access after Sep 2020", "expression": 1639 // "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": 1640 // "BwWWja0YfJA=", "version": 3 } ``` **YAML example:** ``` bindings: - 1641 // members: - user:mike@example.com - group:admins@example.com - 1642 // domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com 1643 // role: roles/resourcemanager.organizationAdmin - members: - 1644 // user:eve@example.com role: roles/resourcemanager.organizationViewer 1645 // condition: title: expirable access description: Does not grant access after 1646 // Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') 1647 // etag: BwWWja0YfJA= version: 3 ``` For a description of IAM and its features, 1648 // see the IAM documentation (https://cloud.google.com/iam/docs/). 1649 type Policy struct { 1650 // AuditConfigs: Specifies cloud audit logging configuration for this policy. 1651 AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"` 1652 // Bindings: Associates a list of `members`, or principals, with a `role`. 1653 // Optionally, may specify a `condition` that determines how and when the 1654 // `bindings` are applied. Each of the `bindings` must contain at least one 1655 // principal. The `bindings` in a `Policy` can refer to up to 1,500 principals; 1656 // up to 250 of these principals can be Google groups. Each occurrence of a 1657 // principal counts towards these limits. For example, if the `bindings` grant 1658 // 50 different roles to `user:alice@example.com`, and not to any other 1659 // principal, then you can add another 1,450 principals to the `bindings` in 1660 // the `Policy`. 1661 Bindings []*Binding `json:"bindings,omitempty"` 1662 // Etag: `etag` is used for optimistic concurrency control as a way to help 1663 // prevent simultaneous updates of a policy from overwriting each other. It is 1664 // strongly suggested that systems make use of the `etag` in the 1665 // read-modify-write cycle to perform policy updates in order to avoid race 1666 // conditions: An `etag` is returned in the response to `getIamPolicy`, and 1667 // systems are expected to put that etag in the request to `setIamPolicy` to 1668 // ensure that their change will be applied to the same version of the policy. 1669 // **Important:** If you use IAM Conditions, you must include the `etag` field 1670 // whenever you call `setIamPolicy`. If you omit this field, then IAM allows 1671 // you to overwrite a version `3` policy with a version `1` policy, and all of 1672 // the conditions in the version `3` policy are lost. 1673 Etag string `json:"etag,omitempty"` 1674 // Version: Specifies the format of the policy. Valid values are `0`, `1`, and 1675 // `3`. Requests that specify an invalid value are rejected. Any operation that 1676 // affects conditional role bindings must specify version `3`. This requirement 1677 // applies to the following operations: * Getting a policy that includes a 1678 // conditional role binding * Adding a conditional role binding to a policy * 1679 // Changing a conditional role binding in a policy * Removing any role binding, 1680 // with or without a condition, from a policy that includes conditions 1681 // **Important:** If you use IAM Conditions, you must include the `etag` field 1682 // whenever you call `setIamPolicy`. If you omit this field, then IAM allows 1683 // you to overwrite a version `3` policy with a version `1` policy, and all of 1684 // the conditions in the version `3` policy are lost. If a policy does not 1685 // include any conditions, operations on that policy may specify any valid 1686 // version or leave the field unset. To learn which resources support 1687 // conditions in their IAM policies, see the IAM documentation 1688 // (https://cloud.google.com/iam/help/conditions/resource-policies). 1689 Version int64 `json:"version,omitempty"` 1690 1691 // ServerResponse contains the HTTP response code and headers from the server. 1692 googleapi.ServerResponse `json:"-"` 1693 // ForceSendFields is a list of field names (e.g. "AuditConfigs") to 1694 // unconditionally include in API requests. By default, fields with empty or 1695 // default values are omitted from API requests. See 1696 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1697 // details. 1698 ForceSendFields []string `json:"-"` 1699 // NullFields is a list of field names (e.g. "AuditConfigs") to include in API 1700 // requests with the JSON null value. By default, fields with empty values are 1701 // omitted from API requests. See 1702 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1703 NullFields []string `json:"-"` 1704 } 1705 1706 func (s *Policy) MarshalJSON() ([]byte, error) { 1707 type NoMethod Policy 1708 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1709 } 1710 1711 // RedirectFunctionUpgradeTrafficRequest: Request for the 1712 // `RedirectFunctionUpgradeTraffic` method. 1713 type RedirectFunctionUpgradeTrafficRequest struct { 1714 } 1715 1716 // RepoSource: Location of the source in a Google Cloud Source Repository. 1717 type RepoSource struct { 1718 // BranchName: Regex matching branches to build. The syntax of the regular 1719 // expressions accepted is the syntax accepted by RE2 and described at 1720 // https://github.com/google/re2/wiki/Syntax 1721 BranchName string `json:"branchName,omitempty"` 1722 // CommitSha: Explicit commit SHA to build. 1723 CommitSha string `json:"commitSha,omitempty"` 1724 // Dir: Directory, relative to the source root, in which to run the build. This 1725 // must be a relative path. If a step's `dir` is specified and is an absolute 1726 // path, this value is ignored for that step's execution. eg. helloworld (no 1727 // leading slash allowed) 1728 Dir string `json:"dir,omitempty"` 1729 // ProjectId: ID of the project that owns the Cloud Source Repository. If 1730 // omitted, the project ID requesting the build is assumed. 1731 ProjectId string `json:"projectId,omitempty"` 1732 // RepoName: Name of the Cloud Source Repository. 1733 RepoName string `json:"repoName,omitempty"` 1734 // TagName: Regex matching tags to build. The syntax of the regular expressions 1735 // accepted is the syntax accepted by RE2 and described at 1736 // https://github.com/google/re2/wiki/Syntax 1737 TagName string `json:"tagName,omitempty"` 1738 // ForceSendFields is a list of field names (e.g. "BranchName") to 1739 // unconditionally include in API requests. By default, fields with empty or 1740 // default values are omitted from API requests. See 1741 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1742 // details. 1743 ForceSendFields []string `json:"-"` 1744 // NullFields is a list of field names (e.g. "BranchName") to include in API 1745 // requests with the JSON null value. By default, fields with empty values are 1746 // omitted from API requests. See 1747 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1748 NullFields []string `json:"-"` 1749 } 1750 1751 func (s *RepoSource) MarshalJSON() ([]byte, error) { 1752 type NoMethod RepoSource 1753 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1754 } 1755 1756 // RollbackFunctionUpgradeTrafficRequest: Request for the 1757 // `RollbackFunctionUpgradeTraffic` method. 1758 type RollbackFunctionUpgradeTrafficRequest struct { 1759 } 1760 1761 // Runtime: Describes a runtime and any special information (e.g., deprecation 1762 // status) related to it. 1763 type Runtime struct { 1764 // DecommissionDate: Decommission date for the runtime. 1765 DecommissionDate *Date `json:"decommissionDate,omitempty"` 1766 // DeprecationDate: Deprecation date for the runtime. 1767 DeprecationDate *Date `json:"deprecationDate,omitempty"` 1768 // DisplayName: The user facing name, eg 'Go 1.13', 'Node.js 12', etc. 1769 DisplayName string `json:"displayName,omitempty"` 1770 // Environment: The environment for the runtime. 1771 // 1772 // Possible values: 1773 // "ENVIRONMENT_UNSPECIFIED" - Unspecified 1774 // "GEN_1" - Gen 1 1775 // "GEN_2" - Gen 2 1776 Environment string `json:"environment,omitempty"` 1777 // Name: The name of the runtime, e.g., 'go113', 'nodejs12', etc. 1778 Name string `json:"name,omitempty"` 1779 // Stage: The stage of life this runtime is in, e.g., BETA, GA, etc. 1780 // 1781 // Possible values: 1782 // "RUNTIME_STAGE_UNSPECIFIED" - Not specified. 1783 // "DEVELOPMENT" - The runtime is in development. 1784 // "ALPHA" - The runtime is in the Alpha stage. 1785 // "BETA" - The runtime is in the Beta stage. 1786 // "GA" - The runtime is generally available. 1787 // "DEPRECATED" - The runtime is deprecated. 1788 // "DECOMMISSIONED" - The runtime is no longer supported. 1789 Stage string `json:"stage,omitempty"` 1790 // Warnings: Warning messages, e.g., a deprecation warning. 1791 Warnings []string `json:"warnings,omitempty"` 1792 // ForceSendFields is a list of field names (e.g. "DecommissionDate") to 1793 // unconditionally include in API requests. By default, fields with empty or 1794 // default values are omitted from API requests. See 1795 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1796 // details. 1797 ForceSendFields []string `json:"-"` 1798 // NullFields is a list of field names (e.g. "DecommissionDate") to include in 1799 // API requests with the JSON null value. By default, fields with empty values 1800 // are omitted from API requests. See 1801 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1802 NullFields []string `json:"-"` 1803 } 1804 1805 func (s *Runtime) MarshalJSON() ([]byte, error) { 1806 type NoMethod Runtime 1807 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1808 } 1809 1810 // SecretEnvVar: Configuration for a secret environment variable. It has the 1811 // information necessary to fetch the secret value from secret manager and 1812 // expose it as an environment variable. 1813 type SecretEnvVar struct { 1814 // Key: Name of the environment variable. 1815 Key string `json:"key,omitempty"` 1816 // ProjectId: Project identifier (preferably project number but can also be the 1817 // project ID) of the project that contains the secret. If not set, it is 1818 // assumed that the secret is in the same project as the function. 1819 ProjectId string `json:"projectId,omitempty"` 1820 // Secret: Name of the secret in secret manager (not the full resource name). 1821 Secret string `json:"secret,omitempty"` 1822 // Version: Version of the secret (version number or the string 'latest'). It 1823 // is recommended to use a numeric version for secret environment variables as 1824 // any updates to the secret value is not reflected until new instances start. 1825 Version string `json:"version,omitempty"` 1826 // ForceSendFields is a list of field names (e.g. "Key") to unconditionally 1827 // include in API requests. By default, fields with empty or default values are 1828 // omitted from API requests. See 1829 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1830 // details. 1831 ForceSendFields []string `json:"-"` 1832 // NullFields is a list of field names (e.g. "Key") to include in API requests 1833 // with the JSON null value. By default, fields with empty values are omitted 1834 // from API requests. See 1835 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1836 NullFields []string `json:"-"` 1837 } 1838 1839 func (s *SecretEnvVar) MarshalJSON() ([]byte, error) { 1840 type NoMethod SecretEnvVar 1841 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1842 } 1843 1844 // SecretVersion: Configuration for a single version. 1845 type SecretVersion struct { 1846 // Path: Relative path of the file under the mount path where the secret value 1847 // for this version will be fetched and made available. For example, setting 1848 // the mount_path as '/etc/secrets' and path as `secret_foo` would mount the 1849 // secret value file at `/etc/secrets/secret_foo`. 1850 Path string `json:"path,omitempty"` 1851 // Version: Version of the secret (version number or the string 'latest'). It 1852 // is preferable to use `latest` version with secret volumes as secret value 1853 // changes are reflected immediately. 1854 Version string `json:"version,omitempty"` 1855 // ForceSendFields is a list of field names (e.g. "Path") to unconditionally 1856 // include in API requests. By default, fields with empty or default values are 1857 // omitted from API requests. See 1858 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1859 // details. 1860 ForceSendFields []string `json:"-"` 1861 // NullFields is a list of field names (e.g. "Path") to include in API requests 1862 // with the JSON null value. By default, fields with empty values are omitted 1863 // from API requests. See 1864 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1865 NullFields []string `json:"-"` 1866 } 1867 1868 func (s *SecretVersion) MarshalJSON() ([]byte, error) { 1869 type NoMethod SecretVersion 1870 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1871 } 1872 1873 // SecretVolume: Configuration for a secret volume. It has the information 1874 // necessary to fetch the secret value from secret manager and make it 1875 // available as files mounted at the requested paths within the application 1876 // container. 1877 type SecretVolume struct { 1878 // MountPath: The path within the container to mount the secret volume. For 1879 // example, setting the mount_path as `/etc/secrets` would mount the secret 1880 // value files under the `/etc/secrets` directory. This directory will also be 1881 // completely shadowed and unavailable to mount any other secrets. Recommended 1882 // mount path: /etc/secrets 1883 MountPath string `json:"mountPath,omitempty"` 1884 // ProjectId: Project identifier (preferably project number but can also be the 1885 // project ID) of the project that contains the secret. If not set, it is 1886 // assumed that the secret is in the same project as the function. 1887 ProjectId string `json:"projectId,omitempty"` 1888 // Secret: Name of the secret in secret manager (not the full resource name). 1889 Secret string `json:"secret,omitempty"` 1890 // Versions: List of secret versions to mount for this secret. If empty, the 1891 // `latest` version of the secret will be made available in a file named after 1892 // the secret under the mount point. 1893 Versions []*SecretVersion `json:"versions,omitempty"` 1894 // ForceSendFields is a list of field names (e.g. "MountPath") to 1895 // unconditionally include in API requests. By default, fields with empty or 1896 // default values are omitted from API requests. See 1897 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1898 // details. 1899 ForceSendFields []string `json:"-"` 1900 // NullFields is a list of field names (e.g. "MountPath") to include in API 1901 // requests with the JSON null value. By default, fields with empty values are 1902 // omitted from API requests. See 1903 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1904 NullFields []string `json:"-"` 1905 } 1906 1907 func (s *SecretVolume) MarshalJSON() ([]byte, error) { 1908 type NoMethod SecretVolume 1909 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1910 } 1911 1912 // ServiceConfig: Describes the Service being deployed. Currently Supported : 1913 // Cloud Run (fully managed). 1914 type ServiceConfig struct { 1915 // AllTrafficOnLatestRevision: Whether 100% of traffic is routed to the latest 1916 // revision. On CreateFunction and UpdateFunction, when set to true, the 1917 // revision being deployed will serve 100% of traffic, ignoring any traffic 1918 // split settings, if any. On GetFunction, true will be returned if the latest 1919 // revision is serving 100% of traffic. 1920 AllTrafficOnLatestRevision bool `json:"allTrafficOnLatestRevision,omitempty"` 1921 // AvailableCpu: The number of CPUs used in a single container instance. 1922 // Default value is calculated from available memory. Supports the same values 1923 // as Cloud Run, see 1924 // https://cloud.google.com/run/docs/reference/rest/v1/Container#resourcerequirements 1925 // Example: "1" indicates 1 vCPU 1926 AvailableCpu string `json:"availableCpu,omitempty"` 1927 // AvailableMemory: The amount of memory available for a function. Defaults to 1928 // 256M. Supported units are k, M, G, Mi, Gi. If no unit is supplied the value 1929 // is interpreted as bytes. See 1930 // https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go 1931 // a full description. 1932 AvailableMemory string `json:"availableMemory,omitempty"` 1933 // EnvironmentVariables: Environment variables that shall be available during 1934 // function execution. 1935 EnvironmentVariables map[string]string `json:"environmentVariables,omitempty"` 1936 // IngressSettings: The ingress settings for the function, controlling what 1937 // traffic can reach it. 1938 // 1939 // Possible values: 1940 // "INGRESS_SETTINGS_UNSPECIFIED" - Unspecified. 1941 // "ALLOW_ALL" - Allow HTTP traffic from public and private sources. 1942 // "ALLOW_INTERNAL_ONLY" - Allow HTTP traffic from only private VPC sources. 1943 // "ALLOW_INTERNAL_AND_GCLB" - Allow HTTP traffic from private VPC sources 1944 // and through GCLB. 1945 IngressSettings string `json:"ingressSettings,omitempty"` 1946 // MaxInstanceCount: The limit on the maximum number of function instances that 1947 // may coexist at a given time. In some cases, such as rapid traffic surges, 1948 // Cloud Functions may, for a short period of time, create more instances than 1949 // the specified max instances limit. If your function cannot tolerate this 1950 // temporary behavior, you may want to factor in a safety margin and set a 1951 // lower max instances value than your function can tolerate. See the Max 1952 // Instances (https://cloud.google.com/functions/docs/max-instances) Guide for 1953 // more details. 1954 MaxInstanceCount int64 `json:"maxInstanceCount,omitempty"` 1955 // MaxInstanceRequestConcurrency: Sets the maximum number of concurrent 1956 // requests that each instance can receive. Defaults to 1. 1957 MaxInstanceRequestConcurrency int64 `json:"maxInstanceRequestConcurrency,omitempty"` 1958 // MinInstanceCount: The limit on the minimum number of function instances that 1959 // may coexist at a given time. Function instances are kept in idle state for a 1960 // short period after they finished executing the request to reduce cold start 1961 // time for subsequent requests. Setting a minimum instance count will ensure 1962 // that the given number of instances are kept running in idle state always. 1963 // This can help with cold start times when jump in incoming request count 1964 // occurs after the idle instance would have been stopped in the default case. 1965 MinInstanceCount int64 `json:"minInstanceCount,omitempty"` 1966 // Revision: Output only. The name of service revision. 1967 Revision string `json:"revision,omitempty"` 1968 // SecretEnvironmentVariables: Secret environment variables configuration. 1969 SecretEnvironmentVariables []*SecretEnvVar `json:"secretEnvironmentVariables,omitempty"` 1970 // SecretVolumes: Secret volumes configuration. 1971 SecretVolumes []*SecretVolume `json:"secretVolumes,omitempty"` 1972 // SecurityLevel: Security level configure whether the function only accepts 1973 // https. This configuration is only applicable to 1st Gen functions with Http 1974 // trigger. By default https is optional for 1st Gen functions; 2nd Gen 1975 // functions are https ONLY. 1976 // 1977 // Possible values: 1978 // "SECURITY_LEVEL_UNSPECIFIED" - Unspecified. 1979 // "SECURE_ALWAYS" - Requests for a URL that match this handler that do not 1980 // use HTTPS are automatically redirected to the HTTPS URL with the same path. 1981 // Query parameters are reserved for the redirect. 1982 // "SECURE_OPTIONAL" - Both HTTP and HTTPS requests with URLs that match the 1983 // handler succeed without redirects. The application can examine the request 1984 // to determine which protocol was used and respond accordingly. 1985 SecurityLevel string `json:"securityLevel,omitempty"` 1986 // Service: Output only. Name of the service associated with a Function. The 1987 // format of this field is 1988 // `projects/{project}/locations/{region}/services/{service}` 1989 Service string `json:"service,omitempty"` 1990 // ServiceAccountEmail: The email of the service's service account. If empty, 1991 // defaults to `{project_number}-compute@developer.gserviceaccount.com`. 1992 ServiceAccountEmail string `json:"serviceAccountEmail,omitempty"` 1993 // TimeoutSeconds: The function execution timeout. Execution is considered 1994 // failed and can be terminated if the function is not completed at the end of 1995 // the timeout period. Defaults to 60 seconds. 1996 TimeoutSeconds int64 `json:"timeoutSeconds,omitempty"` 1997 // Uri: Output only. URI of the Service deployed. 1998 Uri string `json:"uri,omitempty"` 1999 // VpcConnector: The Serverless VPC Access connector that this cloud function 2000 // can connect to. The format of this field is 2001 // `projects/*/locations/*/connectors/*`. 2002 VpcConnector string `json:"vpcConnector,omitempty"` 2003 // VpcConnectorEgressSettings: The egress settings for the connector, 2004 // controlling what traffic is diverted through it. 2005 // 2006 // Possible values: 2007 // "VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED" - Unspecified. 2008 // "PRIVATE_RANGES_ONLY" - Use the VPC Access Connector only for private IP 2009 // space from RFC1918. 2010 // "ALL_TRAFFIC" - Force the use of VPC Access Connector for all egress 2011 // traffic from the function. 2012 VpcConnectorEgressSettings string `json:"vpcConnectorEgressSettings,omitempty"` 2013 // ForceSendFields is a list of field names (e.g. "AllTrafficOnLatestRevision") 2014 // to unconditionally include in API requests. By default, fields with empty or 2015 // default values are omitted from API requests. See 2016 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2017 // details. 2018 ForceSendFields []string `json:"-"` 2019 // NullFields is a list of field names (e.g. "AllTrafficOnLatestRevision") to 2020 // include in API requests with the JSON null value. By default, fields with 2021 // empty values are omitted from API requests. See 2022 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2023 NullFields []string `json:"-"` 2024 } 2025 2026 func (s *ServiceConfig) MarshalJSON() ([]byte, error) { 2027 type NoMethod ServiceConfig 2028 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2029 } 2030 2031 // SetIamPolicyRequest: Request message for `SetIamPolicy` method. 2032 type SetIamPolicyRequest struct { 2033 // Policy: REQUIRED: The complete policy to be applied to the `resource`. The 2034 // size of the policy is limited to a few 10s of KB. An empty policy is a valid 2035 // policy but certain Google Cloud services (such as Projects) might reject 2036 // them. 2037 Policy *Policy `json:"policy,omitempty"` 2038 // UpdateMask: OPTIONAL: A FieldMask specifying which fields of the policy to 2039 // modify. Only the fields in the mask will be modified. If no mask is 2040 // provided, the following default mask is used: `paths: "bindings, etag" 2041 UpdateMask string `json:"updateMask,omitempty"` 2042 // ForceSendFields is a list of field names (e.g. "Policy") to unconditionally 2043 // include in API requests. By default, fields with empty or default values are 2044 // omitted from API requests. See 2045 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2046 // details. 2047 ForceSendFields []string `json:"-"` 2048 // NullFields is a list of field names (e.g. "Policy") to include in API 2049 // requests with the JSON null value. By default, fields with empty values are 2050 // omitted from API requests. See 2051 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2052 NullFields []string `json:"-"` 2053 } 2054 2055 func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) { 2056 type NoMethod SetIamPolicyRequest 2057 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2058 } 2059 2060 // SetupFunctionUpgradeConfigRequest: Request for the 2061 // `SetupFunctionUpgradeConfig` method. 2062 type SetupFunctionUpgradeConfigRequest struct { 2063 } 2064 2065 // Source: The location of the function source code. 2066 type Source struct { 2067 // GitUri: If provided, get the source from GitHub repository. This option is 2068 // valid only for GCF 1st Gen function. Example: https://github.com///blob// 2069 GitUri string `json:"gitUri,omitempty"` 2070 // RepoSource: If provided, get the source from this location in a Cloud Source 2071 // Repository. 2072 RepoSource *RepoSource `json:"repoSource,omitempty"` 2073 // StorageSource: If provided, get the source from this location in Google 2074 // Cloud Storage. 2075 StorageSource *StorageSource `json:"storageSource,omitempty"` 2076 // ForceSendFields is a list of field names (e.g. "GitUri") to unconditionally 2077 // include in API requests. By default, fields with empty or default values are 2078 // omitted from API requests. See 2079 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2080 // details. 2081 ForceSendFields []string `json:"-"` 2082 // NullFields is a list of field names (e.g. "GitUri") to include in API 2083 // requests with the JSON null value. By default, fields with empty values are 2084 // omitted from API requests. See 2085 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2086 NullFields []string `json:"-"` 2087 } 2088 2089 func (s *Source) MarshalJSON() ([]byte, error) { 2090 type NoMethod Source 2091 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2092 } 2093 2094 // SourceProvenance: Provenance of the source. Ways to find the original 2095 // source, or verify that some source was used for this build. 2096 type SourceProvenance struct { 2097 // GitUri: A copy of the build's `source.git_uri`, if exists, with any commits 2098 // resolved. 2099 GitUri string `json:"gitUri,omitempty"` 2100 // ResolvedRepoSource: A copy of the build's `source.repo_source`, if exists, 2101 // with any revisions resolved. 2102 ResolvedRepoSource *RepoSource `json:"resolvedRepoSource,omitempty"` 2103 // ResolvedStorageSource: A copy of the build's `source.storage_source`, if 2104 // exists, with any generations resolved. 2105 ResolvedStorageSource *StorageSource `json:"resolvedStorageSource,omitempty"` 2106 // ForceSendFields is a list of field names (e.g. "GitUri") to unconditionally 2107 // include in API requests. By default, fields with empty or default values are 2108 // omitted from API requests. See 2109 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2110 // details. 2111 ForceSendFields []string `json:"-"` 2112 // NullFields is a list of field names (e.g. "GitUri") to include in API 2113 // requests with the JSON null value. By default, fields with empty values are 2114 // omitted from API requests. See 2115 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2116 NullFields []string `json:"-"` 2117 } 2118 2119 func (s *SourceProvenance) MarshalJSON() ([]byte, error) { 2120 type NoMethod SourceProvenance 2121 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2122 } 2123 2124 // Status: The `Status` type defines a logical error model that is suitable for 2125 // different programming environments, including REST APIs and RPC APIs. It is 2126 // used by gRPC (https://github.com/grpc). Each `Status` message contains three 2127 // pieces of data: error code, error message, and error details. You can find 2128 // out more about this error model and how to work with it in the API Design 2129 // Guide (https://cloud.google.com/apis/design/errors). 2130 type Status struct { 2131 // Code: The status code, which should be an enum value of google.rpc.Code. 2132 Code int64 `json:"code,omitempty"` 2133 // Details: A list of messages that carry the error details. There is a common 2134 // set of message types for APIs to use. 2135 Details []googleapi.RawMessage `json:"details,omitempty"` 2136 // Message: A developer-facing error message, which should be in English. Any 2137 // user-facing error message should be localized and sent in the 2138 // google.rpc.Status.details field, or localized by the client. 2139 Message string `json:"message,omitempty"` 2140 // ForceSendFields is a list of field names (e.g. "Code") to unconditionally 2141 // include in API requests. By default, fields with empty or default values are 2142 // omitted from API requests. See 2143 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2144 // details. 2145 ForceSendFields []string `json:"-"` 2146 // NullFields is a list of field names (e.g. "Code") to include in API requests 2147 // with the JSON null value. By default, fields with empty values are omitted 2148 // from API requests. See 2149 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2150 NullFields []string `json:"-"` 2151 } 2152 2153 func (s *Status) MarshalJSON() ([]byte, error) { 2154 type NoMethod Status 2155 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2156 } 2157 2158 // StorageSource: Location of the source in an archive file in Google Cloud 2159 // Storage. 2160 type StorageSource struct { 2161 // Bucket: Google Cloud Storage bucket containing the source (see Bucket Name 2162 // Requirements 2163 // (https://cloud.google.com/storage/docs/bucket-naming#requirements)). 2164 Bucket string `json:"bucket,omitempty"` 2165 // Generation: Google Cloud Storage generation for the object. If the 2166 // generation is omitted, the latest generation will be used. 2167 Generation int64 `json:"generation,omitempty,string"` 2168 // Object: Google Cloud Storage object containing the source. This object must 2169 // be a gzipped archive file (`.tar.gz`) containing source to build. 2170 Object string `json:"object,omitempty"` 2171 // ForceSendFields is a list of field names (e.g. "Bucket") to unconditionally 2172 // include in API requests. By default, fields with empty or default values are 2173 // omitted from API requests. See 2174 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2175 // details. 2176 ForceSendFields []string `json:"-"` 2177 // NullFields is a list of field names (e.g. "Bucket") to include in API 2178 // requests with the JSON null value. By default, fields with empty values are 2179 // omitted from API requests. See 2180 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2181 NullFields []string `json:"-"` 2182 } 2183 2184 func (s *StorageSource) MarshalJSON() ([]byte, error) { 2185 type NoMethod StorageSource 2186 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2187 } 2188 2189 // TestIamPermissionsRequest: Request message for `TestIamPermissions` method. 2190 type TestIamPermissionsRequest struct { 2191 // Permissions: The set of permissions to check for the `resource`. Permissions 2192 // with wildcards (such as `*` or `storage.*`) are not allowed. For more 2193 // information see IAM Overview 2194 // (https://cloud.google.com/iam/docs/overview#permissions). 2195 Permissions []string `json:"permissions,omitempty"` 2196 // ForceSendFields is a list of field names (e.g. "Permissions") to 2197 // unconditionally include in API requests. By default, fields with empty or 2198 // default values are omitted from API requests. See 2199 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2200 // details. 2201 ForceSendFields []string `json:"-"` 2202 // NullFields is a list of field names (e.g. "Permissions") to include in API 2203 // requests with the JSON null value. By default, fields with empty values are 2204 // omitted from API requests. See 2205 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2206 NullFields []string `json:"-"` 2207 } 2208 2209 func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) { 2210 type NoMethod TestIamPermissionsRequest 2211 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2212 } 2213 2214 // TestIamPermissionsResponse: Response message for `TestIamPermissions` 2215 // method. 2216 type TestIamPermissionsResponse struct { 2217 // Permissions: A subset of `TestPermissionsRequest.permissions` that the 2218 // caller is allowed. 2219 Permissions []string `json:"permissions,omitempty"` 2220 2221 // ServerResponse contains the HTTP response code and headers from the server. 2222 googleapi.ServerResponse `json:"-"` 2223 // ForceSendFields is a list of field names (e.g. "Permissions") to 2224 // unconditionally include in API requests. By default, fields with empty or 2225 // default values are omitted from API requests. See 2226 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2227 // details. 2228 ForceSendFields []string `json:"-"` 2229 // NullFields is a list of field names (e.g. "Permissions") to include in API 2230 // requests with the JSON null value. By default, fields with empty values are 2231 // omitted from API requests. See 2232 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2233 NullFields []string `json:"-"` 2234 } 2235 2236 func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) { 2237 type NoMethod TestIamPermissionsResponse 2238 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2239 } 2240 2241 // UpgradeInfo: Information related to: * A function's eligibility for 1st Gen 2242 // to 2nd Gen migration * Current state of migration for function undergoing 2243 // migration. 2244 type UpgradeInfo struct { 2245 // BuildConfig: Describes the Build step of the function that builds a 2246 // container to prepare for 2nd gen upgrade. 2247 BuildConfig *BuildConfig `json:"buildConfig,omitempty"` 2248 // EventTrigger: Describes the Event trigger which has been setup to prepare 2249 // for 2nd gen upgrade. 2250 EventTrigger *EventTrigger `json:"eventTrigger,omitempty"` 2251 // ServiceConfig: Describes the Cloud Run service which has been setup to 2252 // prepare for 2nd gen upgrade. 2253 ServiceConfig *ServiceConfig `json:"serviceConfig,omitempty"` 2254 // UpgradeState: UpgradeState of the function 2255 // 2256 // Possible values: 2257 // "UPGRADE_STATE_UNSPECIFIED" - Unspecified state. Most functions are in 2258 // this upgrade state. 2259 // "ELIGIBLE_FOR_2ND_GEN_UPGRADE" - Functions in this state are eligible for 2260 // 1st Gen -> 2nd Gen upgrade. 2261 // "UPGRADE_OPERATION_IN_PROGRESS" - An upgrade related operation is in 2262 // progress. 2263 // "SETUP_FUNCTION_UPGRADE_CONFIG_SUCCESSFUL" - SetupFunctionUpgradeConfig 2264 // API was successful and a 2nd Gen function has been created based on 1st Gen 2265 // function instance. 2266 // "SETUP_FUNCTION_UPGRADE_CONFIG_ERROR" - SetupFunctionUpgradeConfig API was 2267 // un-successful. 2268 // "ABORT_FUNCTION_UPGRADE_ERROR" - AbortFunctionUpgrade API was 2269 // un-successful. 2270 // "REDIRECT_FUNCTION_UPGRADE_TRAFFIC_SUCCESSFUL" - 2271 // RedirectFunctionUpgradeTraffic API was successful and traffic is served by 2272 // 2nd Gen function stack. 2273 // "REDIRECT_FUNCTION_UPGRADE_TRAFFIC_ERROR" - RedirectFunctionUpgradeTraffic 2274 // API was un-successful. 2275 // "ROLLBACK_FUNCTION_UPGRADE_TRAFFIC_ERROR" - RollbackFunctionUpgradeTraffic 2276 // API was un-successful. 2277 // "COMMIT_FUNCTION_UPGRADE_ERROR" - CommitFunctionUpgrade API was 2278 // un-successful. 2279 UpgradeState string `json:"upgradeState,omitempty"` 2280 // ForceSendFields is a list of field names (e.g. "BuildConfig") to 2281 // unconditionally include in API requests. By default, fields with empty or 2282 // default values are omitted from API requests. See 2283 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2284 // details. 2285 ForceSendFields []string `json:"-"` 2286 // NullFields is a list of field names (e.g. "BuildConfig") to include in API 2287 // requests with the JSON null value. By default, fields with empty values are 2288 // omitted from API requests. See 2289 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2290 NullFields []string `json:"-"` 2291 } 2292 2293 func (s *UpgradeInfo) MarshalJSON() ([]byte, error) { 2294 type NoMethod UpgradeInfo 2295 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2296 } 2297 2298 type ProjectsLocationsListCall struct { 2299 s *Service 2300 name string 2301 urlParams_ gensupport.URLParams 2302 ifNoneMatch_ string 2303 ctx_ context.Context 2304 header_ http.Header 2305 } 2306 2307 // List: Lists information about the supported locations for this service. 2308 // 2309 // - name: The resource that owns the locations collection, if applicable. 2310 func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall { 2311 c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2312 c.name = name 2313 return c 2314 } 2315 2316 // Filter sets the optional parameter "filter": A filter to narrow down results 2317 // to a preferred subset. The filtering language accepts strings like 2318 // "displayName=tokyo", and is documented in more detail in AIP-160 2319 // (https://google.aip.dev/160). 2320 func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall { 2321 c.urlParams_.Set("filter", filter) 2322 return c 2323 } 2324 2325 // PageSize sets the optional parameter "pageSize": The maximum number of 2326 // results to return. If not set, the service selects a default. 2327 func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall { 2328 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 2329 return c 2330 } 2331 2332 // PageToken sets the optional parameter "pageToken": A page token received 2333 // from the `next_page_token` field in the response. Send that page token to 2334 // receive the subsequent page. 2335 func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall { 2336 c.urlParams_.Set("pageToken", pageToken) 2337 return c 2338 } 2339 2340 // Fields allows partial responses to be retrieved. See 2341 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2342 // details. 2343 func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall { 2344 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2345 return c 2346 } 2347 2348 // IfNoneMatch sets an optional parameter which makes the operation fail if the 2349 // object's ETag matches the given value. This is useful for getting updates 2350 // only after the object has changed since the last request. 2351 func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall { 2352 c.ifNoneMatch_ = entityTag 2353 return c 2354 } 2355 2356 // Context sets the context to be used in this call's Do method. 2357 func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall { 2358 c.ctx_ = ctx 2359 return c 2360 } 2361 2362 // Header returns a http.Header that can be modified by the caller to add 2363 // headers to the request. 2364 func (c *ProjectsLocationsListCall) Header() http.Header { 2365 if c.header_ == nil { 2366 c.header_ = make(http.Header) 2367 } 2368 return c.header_ 2369 } 2370 2371 func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) { 2372 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 2373 if c.ifNoneMatch_ != "" { 2374 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2375 } 2376 var body io.Reader = nil 2377 c.urlParams_.Set("alt", alt) 2378 c.urlParams_.Set("prettyPrint", "false") 2379 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations") 2380 urls += "?" + c.urlParams_.Encode() 2381 req, err := http.NewRequest("GET", urls, body) 2382 if err != nil { 2383 return nil, err 2384 } 2385 req.Header = reqHeaders 2386 googleapi.Expand(req.URL, map[string]string{ 2387 "name": c.name, 2388 }) 2389 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2390 } 2391 2392 // Do executes the "cloudfunctions.projects.locations.list" call. 2393 // Any non-2xx status code is an error. Response headers are in either 2394 // *ListLocationsResponse.ServerResponse.Header or (if a response was returned 2395 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2396 // check whether the returned error was because http.StatusNotModified was 2397 // returned. 2398 func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) { 2399 gensupport.SetOptions(c.urlParams_, opts...) 2400 res, err := c.doRequest("json") 2401 if res != nil && res.StatusCode == http.StatusNotModified { 2402 if res.Body != nil { 2403 res.Body.Close() 2404 } 2405 return nil, gensupport.WrapError(&googleapi.Error{ 2406 Code: res.StatusCode, 2407 Header: res.Header, 2408 }) 2409 } 2410 if err != nil { 2411 return nil, err 2412 } 2413 defer googleapi.CloseBody(res) 2414 if err := googleapi.CheckResponse(res); err != nil { 2415 return nil, gensupport.WrapError(err) 2416 } 2417 ret := &ListLocationsResponse{ 2418 ServerResponse: googleapi.ServerResponse{ 2419 Header: res.Header, 2420 HTTPStatusCode: res.StatusCode, 2421 }, 2422 } 2423 target := &ret 2424 if err := gensupport.DecodeResponse(target, res); err != nil { 2425 return nil, err 2426 } 2427 return ret, nil 2428 } 2429 2430 // Pages invokes f for each page of results. 2431 // A non-nil error returned from f will halt the iteration. 2432 // The provided context supersedes any context provided to the Context method. 2433 func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error { 2434 c.ctx_ = ctx 2435 defer c.PageToken(c.urlParams_.Get("pageToken")) 2436 for { 2437 x, err := c.Do() 2438 if err != nil { 2439 return err 2440 } 2441 if err := f(x); err != nil { 2442 return err 2443 } 2444 if x.NextPageToken == "" { 2445 return nil 2446 } 2447 c.PageToken(x.NextPageToken) 2448 } 2449 } 2450 2451 type ProjectsLocationsFunctionsAbortFunctionUpgradeCall struct { 2452 s *Service 2453 name string 2454 abortfunctionupgraderequest *AbortFunctionUpgradeRequest 2455 urlParams_ gensupport.URLParams 2456 ctx_ context.Context 2457 header_ http.Header 2458 } 2459 2460 // AbortFunctionUpgrade: Aborts generation upgrade process for a function with 2461 // the given name from the specified project. Deletes all 2nd Gen copy related 2462 // configuration and resources which were created during the upgrade process. 2463 // 2464 // - name: The name of the function for which upgrade should be aborted. 2465 func (r *ProjectsLocationsFunctionsService) AbortFunctionUpgrade(name string, abortfunctionupgraderequest *AbortFunctionUpgradeRequest) *ProjectsLocationsFunctionsAbortFunctionUpgradeCall { 2466 c := &ProjectsLocationsFunctionsAbortFunctionUpgradeCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2467 c.name = name 2468 c.abortfunctionupgraderequest = abortfunctionupgraderequest 2469 return c 2470 } 2471 2472 // Fields allows partial responses to be retrieved. See 2473 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2474 // details. 2475 func (c *ProjectsLocationsFunctionsAbortFunctionUpgradeCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsAbortFunctionUpgradeCall { 2476 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2477 return c 2478 } 2479 2480 // Context sets the context to be used in this call's Do method. 2481 func (c *ProjectsLocationsFunctionsAbortFunctionUpgradeCall) Context(ctx context.Context) *ProjectsLocationsFunctionsAbortFunctionUpgradeCall { 2482 c.ctx_ = ctx 2483 return c 2484 } 2485 2486 // Header returns a http.Header that can be modified by the caller to add 2487 // headers to the request. 2488 func (c *ProjectsLocationsFunctionsAbortFunctionUpgradeCall) Header() http.Header { 2489 if c.header_ == nil { 2490 c.header_ = make(http.Header) 2491 } 2492 return c.header_ 2493 } 2494 2495 func (c *ProjectsLocationsFunctionsAbortFunctionUpgradeCall) doRequest(alt string) (*http.Response, error) { 2496 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 2497 var body io.Reader = nil 2498 body, err := googleapi.WithoutDataWrapper.JSONReader(c.abortfunctionupgraderequest) 2499 if err != nil { 2500 return nil, err 2501 } 2502 c.urlParams_.Set("alt", alt) 2503 c.urlParams_.Set("prettyPrint", "false") 2504 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:abortFunctionUpgrade") 2505 urls += "?" + c.urlParams_.Encode() 2506 req, err := http.NewRequest("POST", urls, body) 2507 if err != nil { 2508 return nil, err 2509 } 2510 req.Header = reqHeaders 2511 googleapi.Expand(req.URL, map[string]string{ 2512 "name": c.name, 2513 }) 2514 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2515 } 2516 2517 // Do executes the "cloudfunctions.projects.locations.functions.abortFunctionUpgrade" call. 2518 // Any non-2xx status code is an error. Response headers are in either 2519 // *Operation.ServerResponse.Header or (if a response was returned at all) in 2520 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2521 // whether the returned error was because http.StatusNotModified was returned. 2522 func (c *ProjectsLocationsFunctionsAbortFunctionUpgradeCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 2523 gensupport.SetOptions(c.urlParams_, opts...) 2524 res, err := c.doRequest("json") 2525 if res != nil && res.StatusCode == http.StatusNotModified { 2526 if res.Body != nil { 2527 res.Body.Close() 2528 } 2529 return nil, gensupport.WrapError(&googleapi.Error{ 2530 Code: res.StatusCode, 2531 Header: res.Header, 2532 }) 2533 } 2534 if err != nil { 2535 return nil, err 2536 } 2537 defer googleapi.CloseBody(res) 2538 if err := googleapi.CheckResponse(res); err != nil { 2539 return nil, gensupport.WrapError(err) 2540 } 2541 ret := &Operation{ 2542 ServerResponse: googleapi.ServerResponse{ 2543 Header: res.Header, 2544 HTTPStatusCode: res.StatusCode, 2545 }, 2546 } 2547 target := &ret 2548 if err := gensupport.DecodeResponse(target, res); err != nil { 2549 return nil, err 2550 } 2551 return ret, nil 2552 } 2553 2554 type ProjectsLocationsFunctionsCommitFunctionUpgradeCall struct { 2555 s *Service 2556 name string 2557 commitfunctionupgraderequest *CommitFunctionUpgradeRequest 2558 urlParams_ gensupport.URLParams 2559 ctx_ context.Context 2560 header_ http.Header 2561 } 2562 2563 // CommitFunctionUpgrade: Finalizes the upgrade after which function upgrade 2564 // can not be rolled back. This is the last step of the multi step process to 2565 // upgrade 1st Gen functions to 2nd Gen. Deletes all original 1st Gen related 2566 // configuration and resources. 2567 // 2568 // - name: The name of the function for which upgrade should be finalized. 2569 func (r *ProjectsLocationsFunctionsService) CommitFunctionUpgrade(name string, commitfunctionupgraderequest *CommitFunctionUpgradeRequest) *ProjectsLocationsFunctionsCommitFunctionUpgradeCall { 2570 c := &ProjectsLocationsFunctionsCommitFunctionUpgradeCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2571 c.name = name 2572 c.commitfunctionupgraderequest = commitfunctionupgraderequest 2573 return c 2574 } 2575 2576 // Fields allows partial responses to be retrieved. See 2577 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2578 // details. 2579 func (c *ProjectsLocationsFunctionsCommitFunctionUpgradeCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsCommitFunctionUpgradeCall { 2580 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2581 return c 2582 } 2583 2584 // Context sets the context to be used in this call's Do method. 2585 func (c *ProjectsLocationsFunctionsCommitFunctionUpgradeCall) Context(ctx context.Context) *ProjectsLocationsFunctionsCommitFunctionUpgradeCall { 2586 c.ctx_ = ctx 2587 return c 2588 } 2589 2590 // Header returns a http.Header that can be modified by the caller to add 2591 // headers to the request. 2592 func (c *ProjectsLocationsFunctionsCommitFunctionUpgradeCall) Header() http.Header { 2593 if c.header_ == nil { 2594 c.header_ = make(http.Header) 2595 } 2596 return c.header_ 2597 } 2598 2599 func (c *ProjectsLocationsFunctionsCommitFunctionUpgradeCall) doRequest(alt string) (*http.Response, error) { 2600 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 2601 var body io.Reader = nil 2602 body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitfunctionupgraderequest) 2603 if err != nil { 2604 return nil, err 2605 } 2606 c.urlParams_.Set("alt", alt) 2607 c.urlParams_.Set("prettyPrint", "false") 2608 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:commitFunctionUpgrade") 2609 urls += "?" + c.urlParams_.Encode() 2610 req, err := http.NewRequest("POST", urls, body) 2611 if err != nil { 2612 return nil, err 2613 } 2614 req.Header = reqHeaders 2615 googleapi.Expand(req.URL, map[string]string{ 2616 "name": c.name, 2617 }) 2618 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2619 } 2620 2621 // Do executes the "cloudfunctions.projects.locations.functions.commitFunctionUpgrade" call. 2622 // Any non-2xx status code is an error. Response headers are in either 2623 // *Operation.ServerResponse.Header or (if a response was returned at all) in 2624 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2625 // whether the returned error was because http.StatusNotModified was returned. 2626 func (c *ProjectsLocationsFunctionsCommitFunctionUpgradeCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 2627 gensupport.SetOptions(c.urlParams_, opts...) 2628 res, err := c.doRequest("json") 2629 if res != nil && res.StatusCode == http.StatusNotModified { 2630 if res.Body != nil { 2631 res.Body.Close() 2632 } 2633 return nil, gensupport.WrapError(&googleapi.Error{ 2634 Code: res.StatusCode, 2635 Header: res.Header, 2636 }) 2637 } 2638 if err != nil { 2639 return nil, err 2640 } 2641 defer googleapi.CloseBody(res) 2642 if err := googleapi.CheckResponse(res); err != nil { 2643 return nil, gensupport.WrapError(err) 2644 } 2645 ret := &Operation{ 2646 ServerResponse: googleapi.ServerResponse{ 2647 Header: res.Header, 2648 HTTPStatusCode: res.StatusCode, 2649 }, 2650 } 2651 target := &ret 2652 if err := gensupport.DecodeResponse(target, res); err != nil { 2653 return nil, err 2654 } 2655 return ret, nil 2656 } 2657 2658 type ProjectsLocationsFunctionsCreateCall struct { 2659 s *Service 2660 parent string 2661 function *Function 2662 urlParams_ gensupport.URLParams 2663 ctx_ context.Context 2664 header_ http.Header 2665 } 2666 2667 // Create: Creates a new function. If a function with the given name already 2668 // exists in the specified project, the long running operation will return 2669 // `ALREADY_EXISTS` error. 2670 // 2671 // - parent: The project and location in which the function should be created, 2672 // specified in the format `projects/*/locations/*`. 2673 func (r *ProjectsLocationsFunctionsService) Create(parent string, function *Function) *ProjectsLocationsFunctionsCreateCall { 2674 c := &ProjectsLocationsFunctionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2675 c.parent = parent 2676 c.function = function 2677 return c 2678 } 2679 2680 // FunctionId sets the optional parameter "functionId": The ID to use for the 2681 // function, which will become the final component of the function's resource 2682 // name. This value should be 4-63 characters, and valid characters are /a-z-/. 2683 func (c *ProjectsLocationsFunctionsCreateCall) FunctionId(functionId string) *ProjectsLocationsFunctionsCreateCall { 2684 c.urlParams_.Set("functionId", functionId) 2685 return c 2686 } 2687 2688 // Fields allows partial responses to be retrieved. See 2689 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2690 // details. 2691 func (c *ProjectsLocationsFunctionsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsCreateCall { 2692 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2693 return c 2694 } 2695 2696 // Context sets the context to be used in this call's Do method. 2697 func (c *ProjectsLocationsFunctionsCreateCall) Context(ctx context.Context) *ProjectsLocationsFunctionsCreateCall { 2698 c.ctx_ = ctx 2699 return c 2700 } 2701 2702 // Header returns a http.Header that can be modified by the caller to add 2703 // headers to the request. 2704 func (c *ProjectsLocationsFunctionsCreateCall) Header() http.Header { 2705 if c.header_ == nil { 2706 c.header_ = make(http.Header) 2707 } 2708 return c.header_ 2709 } 2710 2711 func (c *ProjectsLocationsFunctionsCreateCall) doRequest(alt string) (*http.Response, error) { 2712 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 2713 var body io.Reader = nil 2714 body, err := googleapi.WithoutDataWrapper.JSONReader(c.function) 2715 if err != nil { 2716 return nil, err 2717 } 2718 c.urlParams_.Set("alt", alt) 2719 c.urlParams_.Set("prettyPrint", "false") 2720 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/functions") 2721 urls += "?" + c.urlParams_.Encode() 2722 req, err := http.NewRequest("POST", urls, body) 2723 if err != nil { 2724 return nil, err 2725 } 2726 req.Header = reqHeaders 2727 googleapi.Expand(req.URL, map[string]string{ 2728 "parent": c.parent, 2729 }) 2730 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2731 } 2732 2733 // Do executes the "cloudfunctions.projects.locations.functions.create" call. 2734 // Any non-2xx status code is an error. Response headers are in either 2735 // *Operation.ServerResponse.Header or (if a response was returned at all) in 2736 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2737 // whether the returned error was because http.StatusNotModified was returned. 2738 func (c *ProjectsLocationsFunctionsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 2739 gensupport.SetOptions(c.urlParams_, opts...) 2740 res, err := c.doRequest("json") 2741 if res != nil && res.StatusCode == http.StatusNotModified { 2742 if res.Body != nil { 2743 res.Body.Close() 2744 } 2745 return nil, gensupport.WrapError(&googleapi.Error{ 2746 Code: res.StatusCode, 2747 Header: res.Header, 2748 }) 2749 } 2750 if err != nil { 2751 return nil, err 2752 } 2753 defer googleapi.CloseBody(res) 2754 if err := googleapi.CheckResponse(res); err != nil { 2755 return nil, gensupport.WrapError(err) 2756 } 2757 ret := &Operation{ 2758 ServerResponse: googleapi.ServerResponse{ 2759 Header: res.Header, 2760 HTTPStatusCode: res.StatusCode, 2761 }, 2762 } 2763 target := &ret 2764 if err := gensupport.DecodeResponse(target, res); err != nil { 2765 return nil, err 2766 } 2767 return ret, nil 2768 } 2769 2770 type ProjectsLocationsFunctionsDeleteCall struct { 2771 s *Service 2772 name string 2773 urlParams_ gensupport.URLParams 2774 ctx_ context.Context 2775 header_ http.Header 2776 } 2777 2778 // Delete: Deletes a function with the given name from the specified project. 2779 // If the given function is used by some trigger, the trigger will be updated 2780 // to remove this function. 2781 // 2782 // - name: The name of the function which should be deleted. 2783 func (r *ProjectsLocationsFunctionsService) Delete(name string) *ProjectsLocationsFunctionsDeleteCall { 2784 c := &ProjectsLocationsFunctionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2785 c.name = name 2786 return c 2787 } 2788 2789 // Fields allows partial responses to be retrieved. See 2790 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2791 // details. 2792 func (c *ProjectsLocationsFunctionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsDeleteCall { 2793 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2794 return c 2795 } 2796 2797 // Context sets the context to be used in this call's Do method. 2798 func (c *ProjectsLocationsFunctionsDeleteCall) Context(ctx context.Context) *ProjectsLocationsFunctionsDeleteCall { 2799 c.ctx_ = ctx 2800 return c 2801 } 2802 2803 // Header returns a http.Header that can be modified by the caller to add 2804 // headers to the request. 2805 func (c *ProjectsLocationsFunctionsDeleteCall) Header() http.Header { 2806 if c.header_ == nil { 2807 c.header_ = make(http.Header) 2808 } 2809 return c.header_ 2810 } 2811 2812 func (c *ProjectsLocationsFunctionsDeleteCall) doRequest(alt string) (*http.Response, error) { 2813 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 2814 var body io.Reader = nil 2815 c.urlParams_.Set("alt", alt) 2816 c.urlParams_.Set("prettyPrint", "false") 2817 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") 2818 urls += "?" + c.urlParams_.Encode() 2819 req, err := http.NewRequest("DELETE", urls, body) 2820 if err != nil { 2821 return nil, err 2822 } 2823 req.Header = reqHeaders 2824 googleapi.Expand(req.URL, map[string]string{ 2825 "name": c.name, 2826 }) 2827 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2828 } 2829 2830 // Do executes the "cloudfunctions.projects.locations.functions.delete" call. 2831 // Any non-2xx status code is an error. Response headers are in either 2832 // *Operation.ServerResponse.Header or (if a response was returned at all) in 2833 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2834 // whether the returned error was because http.StatusNotModified was returned. 2835 func (c *ProjectsLocationsFunctionsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 2836 gensupport.SetOptions(c.urlParams_, opts...) 2837 res, err := c.doRequest("json") 2838 if res != nil && res.StatusCode == http.StatusNotModified { 2839 if res.Body != nil { 2840 res.Body.Close() 2841 } 2842 return nil, gensupport.WrapError(&googleapi.Error{ 2843 Code: res.StatusCode, 2844 Header: res.Header, 2845 }) 2846 } 2847 if err != nil { 2848 return nil, err 2849 } 2850 defer googleapi.CloseBody(res) 2851 if err := googleapi.CheckResponse(res); err != nil { 2852 return nil, gensupport.WrapError(err) 2853 } 2854 ret := &Operation{ 2855 ServerResponse: googleapi.ServerResponse{ 2856 Header: res.Header, 2857 HTTPStatusCode: res.StatusCode, 2858 }, 2859 } 2860 target := &ret 2861 if err := gensupport.DecodeResponse(target, res); err != nil { 2862 return nil, err 2863 } 2864 return ret, nil 2865 } 2866 2867 type ProjectsLocationsFunctionsGenerateDownloadUrlCall struct { 2868 s *Service 2869 name string 2870 generatedownloadurlrequest *GenerateDownloadUrlRequest 2871 urlParams_ gensupport.URLParams 2872 ctx_ context.Context 2873 header_ http.Header 2874 } 2875 2876 // GenerateDownloadUrl: Returns a signed URL for downloading deployed function 2877 // source code. The URL is only valid for a limited period and should be used 2878 // within 30 minutes of generation. For more information about the signed URL 2879 // usage see: https://cloud.google.com/storage/docs/access-control/signed-urls 2880 // 2881 // - name: The name of function for which source code Google Cloud Storage 2882 // signed URL should be generated. 2883 func (r *ProjectsLocationsFunctionsService) GenerateDownloadUrl(name string, generatedownloadurlrequest *GenerateDownloadUrlRequest) *ProjectsLocationsFunctionsGenerateDownloadUrlCall { 2884 c := &ProjectsLocationsFunctionsGenerateDownloadUrlCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2885 c.name = name 2886 c.generatedownloadurlrequest = generatedownloadurlrequest 2887 return c 2888 } 2889 2890 // Fields allows partial responses to be retrieved. See 2891 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2892 // details. 2893 func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsGenerateDownloadUrlCall { 2894 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2895 return c 2896 } 2897 2898 // Context sets the context to be used in this call's Do method. 2899 func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Context(ctx context.Context) *ProjectsLocationsFunctionsGenerateDownloadUrlCall { 2900 c.ctx_ = ctx 2901 return c 2902 } 2903 2904 // Header returns a http.Header that can be modified by the caller to add 2905 // headers to the request. 2906 func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Header() http.Header { 2907 if c.header_ == nil { 2908 c.header_ = make(http.Header) 2909 } 2910 return c.header_ 2911 } 2912 2913 func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) doRequest(alt string) (*http.Response, error) { 2914 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 2915 var body io.Reader = nil 2916 body, err := googleapi.WithoutDataWrapper.JSONReader(c.generatedownloadurlrequest) 2917 if err != nil { 2918 return nil, err 2919 } 2920 c.urlParams_.Set("alt", alt) 2921 c.urlParams_.Set("prettyPrint", "false") 2922 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:generateDownloadUrl") 2923 urls += "?" + c.urlParams_.Encode() 2924 req, err := http.NewRequest("POST", urls, body) 2925 if err != nil { 2926 return nil, err 2927 } 2928 req.Header = reqHeaders 2929 googleapi.Expand(req.URL, map[string]string{ 2930 "name": c.name, 2931 }) 2932 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2933 } 2934 2935 // Do executes the "cloudfunctions.projects.locations.functions.generateDownloadUrl" call. 2936 // Any non-2xx status code is an error. Response headers are in either 2937 // *GenerateDownloadUrlResponse.ServerResponse.Header or (if a response was 2938 // returned at all) in error.(*googleapi.Error).Header. Use 2939 // googleapi.IsNotModified to check whether the returned error was because 2940 // http.StatusNotModified was returned. 2941 func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Do(opts ...googleapi.CallOption) (*GenerateDownloadUrlResponse, error) { 2942 gensupport.SetOptions(c.urlParams_, opts...) 2943 res, err := c.doRequest("json") 2944 if res != nil && res.StatusCode == http.StatusNotModified { 2945 if res.Body != nil { 2946 res.Body.Close() 2947 } 2948 return nil, gensupport.WrapError(&googleapi.Error{ 2949 Code: res.StatusCode, 2950 Header: res.Header, 2951 }) 2952 } 2953 if err != nil { 2954 return nil, err 2955 } 2956 defer googleapi.CloseBody(res) 2957 if err := googleapi.CheckResponse(res); err != nil { 2958 return nil, gensupport.WrapError(err) 2959 } 2960 ret := &GenerateDownloadUrlResponse{ 2961 ServerResponse: googleapi.ServerResponse{ 2962 Header: res.Header, 2963 HTTPStatusCode: res.StatusCode, 2964 }, 2965 } 2966 target := &ret 2967 if err := gensupport.DecodeResponse(target, res); err != nil { 2968 return nil, err 2969 } 2970 return ret, nil 2971 } 2972 2973 type ProjectsLocationsFunctionsGenerateUploadUrlCall struct { 2974 s *Service 2975 parent string 2976 generateuploadurlrequest *GenerateUploadUrlRequest 2977 urlParams_ gensupport.URLParams 2978 ctx_ context.Context 2979 header_ http.Header 2980 } 2981 2982 // GenerateUploadUrl: Returns a signed URL for uploading a function source 2983 // code. For more information about the signed URL usage see: 2984 // https://cloud.google.com/storage/docs/access-control/signed-urls. Once the 2985 // function source code upload is complete, the used signed URL should be 2986 // provided in CreateFunction or UpdateFunction request as a reference to the 2987 // function source code. When uploading source code to the generated signed 2988 // URL, please follow these restrictions: * Source file type should be a zip 2989 // file. * No credentials should be attached - the signed URLs provide access 2990 // to the target bucket using internal service identity; if credentials were 2991 // attached, the identity from the credentials would be used, but that identity 2992 // does not have permissions to upload files to the URL. When making a HTTP PUT 2993 // request, specify this header: * `content-type: application/zip` Do not 2994 // specify this header: * `Authorization: Bearer YOUR_TOKEN` 2995 // 2996 // - parent: The project and location in which the Google Cloud Storage signed 2997 // URL should be generated, specified in the format `projects/*/locations/*`. 2998 func (r *ProjectsLocationsFunctionsService) GenerateUploadUrl(parent string, generateuploadurlrequest *GenerateUploadUrlRequest) *ProjectsLocationsFunctionsGenerateUploadUrlCall { 2999 c := &ProjectsLocationsFunctionsGenerateUploadUrlCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3000 c.parent = parent 3001 c.generateuploadurlrequest = generateuploadurlrequest 3002 return c 3003 } 3004 3005 // Fields allows partial responses to be retrieved. See 3006 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3007 // details. 3008 func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsGenerateUploadUrlCall { 3009 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3010 return c 3011 } 3012 3013 // Context sets the context to be used in this call's Do method. 3014 func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Context(ctx context.Context) *ProjectsLocationsFunctionsGenerateUploadUrlCall { 3015 c.ctx_ = ctx 3016 return c 3017 } 3018 3019 // Header returns a http.Header that can be modified by the caller to add 3020 // headers to the request. 3021 func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Header() http.Header { 3022 if c.header_ == nil { 3023 c.header_ = make(http.Header) 3024 } 3025 return c.header_ 3026 } 3027 3028 func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) doRequest(alt string) (*http.Response, error) { 3029 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 3030 var body io.Reader = nil 3031 body, err := googleapi.WithoutDataWrapper.JSONReader(c.generateuploadurlrequest) 3032 if err != nil { 3033 return nil, err 3034 } 3035 c.urlParams_.Set("alt", alt) 3036 c.urlParams_.Set("prettyPrint", "false") 3037 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/functions:generateUploadUrl") 3038 urls += "?" + c.urlParams_.Encode() 3039 req, err := http.NewRequest("POST", urls, body) 3040 if err != nil { 3041 return nil, err 3042 } 3043 req.Header = reqHeaders 3044 googleapi.Expand(req.URL, map[string]string{ 3045 "parent": c.parent, 3046 }) 3047 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3048 } 3049 3050 // Do executes the "cloudfunctions.projects.locations.functions.generateUploadUrl" call. 3051 // Any non-2xx status code is an error. Response headers are in either 3052 // *GenerateUploadUrlResponse.ServerResponse.Header or (if a response was 3053 // returned at all) in error.(*googleapi.Error).Header. Use 3054 // googleapi.IsNotModified to check whether the returned error was because 3055 // http.StatusNotModified was returned. 3056 func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Do(opts ...googleapi.CallOption) (*GenerateUploadUrlResponse, error) { 3057 gensupport.SetOptions(c.urlParams_, opts...) 3058 res, err := c.doRequest("json") 3059 if res != nil && res.StatusCode == http.StatusNotModified { 3060 if res.Body != nil { 3061 res.Body.Close() 3062 } 3063 return nil, gensupport.WrapError(&googleapi.Error{ 3064 Code: res.StatusCode, 3065 Header: res.Header, 3066 }) 3067 } 3068 if err != nil { 3069 return nil, err 3070 } 3071 defer googleapi.CloseBody(res) 3072 if err := googleapi.CheckResponse(res); err != nil { 3073 return nil, gensupport.WrapError(err) 3074 } 3075 ret := &GenerateUploadUrlResponse{ 3076 ServerResponse: googleapi.ServerResponse{ 3077 Header: res.Header, 3078 HTTPStatusCode: res.StatusCode, 3079 }, 3080 } 3081 target := &ret 3082 if err := gensupport.DecodeResponse(target, res); err != nil { 3083 return nil, err 3084 } 3085 return ret, nil 3086 } 3087 3088 type ProjectsLocationsFunctionsGetCall struct { 3089 s *Service 3090 name string 3091 urlParams_ gensupport.URLParams 3092 ifNoneMatch_ string 3093 ctx_ context.Context 3094 header_ http.Header 3095 } 3096 3097 // Get: Returns a function with the given name from the requested project. 3098 // 3099 // - name: The name of the function which details should be obtained. 3100 func (r *ProjectsLocationsFunctionsService) Get(name string) *ProjectsLocationsFunctionsGetCall { 3101 c := &ProjectsLocationsFunctionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3102 c.name = name 3103 return c 3104 } 3105 3106 // Revision sets the optional parameter "revision": The optional version of the 3107 // 1st gen function whose details should be obtained. The version of a 1st gen 3108 // function is an integer that starts from 1 and gets incremented on 3109 // redeployments. GCF may keep historical configs for old versions of 1st gen 3110 // function. This field can be specified to fetch the historical configs. This 3111 // field is valid only for GCF 1st gen function. 3112 func (c *ProjectsLocationsFunctionsGetCall) Revision(revision string) *ProjectsLocationsFunctionsGetCall { 3113 c.urlParams_.Set("revision", revision) 3114 return c 3115 } 3116 3117 // Fields allows partial responses to be retrieved. See 3118 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3119 // details. 3120 func (c *ProjectsLocationsFunctionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsGetCall { 3121 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3122 return c 3123 } 3124 3125 // IfNoneMatch sets an optional parameter which makes the operation fail if the 3126 // object's ETag matches the given value. This is useful for getting updates 3127 // only after the object has changed since the last request. 3128 func (c *ProjectsLocationsFunctionsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsFunctionsGetCall { 3129 c.ifNoneMatch_ = entityTag 3130 return c 3131 } 3132 3133 // Context sets the context to be used in this call's Do method. 3134 func (c *ProjectsLocationsFunctionsGetCall) Context(ctx context.Context) *ProjectsLocationsFunctionsGetCall { 3135 c.ctx_ = ctx 3136 return c 3137 } 3138 3139 // Header returns a http.Header that can be modified by the caller to add 3140 // headers to the request. 3141 func (c *ProjectsLocationsFunctionsGetCall) Header() http.Header { 3142 if c.header_ == nil { 3143 c.header_ = make(http.Header) 3144 } 3145 return c.header_ 3146 } 3147 3148 func (c *ProjectsLocationsFunctionsGetCall) doRequest(alt string) (*http.Response, error) { 3149 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 3150 if c.ifNoneMatch_ != "" { 3151 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3152 } 3153 var body io.Reader = nil 3154 c.urlParams_.Set("alt", alt) 3155 c.urlParams_.Set("prettyPrint", "false") 3156 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") 3157 urls += "?" + c.urlParams_.Encode() 3158 req, err := http.NewRequest("GET", urls, body) 3159 if err != nil { 3160 return nil, err 3161 } 3162 req.Header = reqHeaders 3163 googleapi.Expand(req.URL, map[string]string{ 3164 "name": c.name, 3165 }) 3166 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3167 } 3168 3169 // Do executes the "cloudfunctions.projects.locations.functions.get" call. 3170 // Any non-2xx status code is an error. Response headers are in either 3171 // *Function.ServerResponse.Header or (if a response was returned at all) in 3172 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 3173 // whether the returned error was because http.StatusNotModified was returned. 3174 func (c *ProjectsLocationsFunctionsGetCall) Do(opts ...googleapi.CallOption) (*Function, error) { 3175 gensupport.SetOptions(c.urlParams_, opts...) 3176 res, err := c.doRequest("json") 3177 if res != nil && res.StatusCode == http.StatusNotModified { 3178 if res.Body != nil { 3179 res.Body.Close() 3180 } 3181 return nil, gensupport.WrapError(&googleapi.Error{ 3182 Code: res.StatusCode, 3183 Header: res.Header, 3184 }) 3185 } 3186 if err != nil { 3187 return nil, err 3188 } 3189 defer googleapi.CloseBody(res) 3190 if err := googleapi.CheckResponse(res); err != nil { 3191 return nil, gensupport.WrapError(err) 3192 } 3193 ret := &Function{ 3194 ServerResponse: googleapi.ServerResponse{ 3195 Header: res.Header, 3196 HTTPStatusCode: res.StatusCode, 3197 }, 3198 } 3199 target := &ret 3200 if err := gensupport.DecodeResponse(target, res); err != nil { 3201 return nil, err 3202 } 3203 return ret, nil 3204 } 3205 3206 type ProjectsLocationsFunctionsGetIamPolicyCall struct { 3207 s *Service 3208 resource string 3209 urlParams_ gensupport.URLParams 3210 ifNoneMatch_ string 3211 ctx_ context.Context 3212 header_ http.Header 3213 } 3214 3215 // GetIamPolicy: Gets the access control policy for a resource. Returns an 3216 // empty policy if the resource exists and does not have a policy set. 3217 // 3218 // - resource: REQUIRED: The resource for which the policy is being requested. 3219 // See Resource names (https://cloud.google.com/apis/design/resource_names) 3220 // for the appropriate value for this field. 3221 func (r *ProjectsLocationsFunctionsService) GetIamPolicy(resource string) *ProjectsLocationsFunctionsGetIamPolicyCall { 3222 c := &ProjectsLocationsFunctionsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3223 c.resource = resource 3224 return c 3225 } 3226 3227 // OptionsRequestedPolicyVersion sets the optional parameter 3228 // "options.requestedPolicyVersion": The maximum policy version that will be 3229 // used to format the policy. Valid values are 0, 1, and 3. Requests specifying 3230 // an invalid value will be rejected. Requests for policies with any 3231 // conditional role bindings must specify version 3. Policies with no 3232 // conditional role bindings may specify any valid value or leave the field 3233 // unset. The policy in the response might use the policy version that you 3234 // specified, or it might use a lower policy version. For example, if you 3235 // specify version 3, but the policy has no conditional role bindings, the 3236 // response uses version 1. To learn which resources support conditions in 3237 // their IAM policies, see the IAM documentation 3238 // (https://cloud.google.com/iam/help/conditions/resource-policies). 3239 func (c *ProjectsLocationsFunctionsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsFunctionsGetIamPolicyCall { 3240 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) 3241 return c 3242 } 3243 3244 // Fields allows partial responses to be retrieved. See 3245 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3246 // details. 3247 func (c *ProjectsLocationsFunctionsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsGetIamPolicyCall { 3248 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3249 return c 3250 } 3251 3252 // IfNoneMatch sets an optional parameter which makes the operation fail if the 3253 // object's ETag matches the given value. This is useful for getting updates 3254 // only after the object has changed since the last request. 3255 func (c *ProjectsLocationsFunctionsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsFunctionsGetIamPolicyCall { 3256 c.ifNoneMatch_ = entityTag 3257 return c 3258 } 3259 3260 // Context sets the context to be used in this call's Do method. 3261 func (c *ProjectsLocationsFunctionsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsFunctionsGetIamPolicyCall { 3262 c.ctx_ = ctx 3263 return c 3264 } 3265 3266 // Header returns a http.Header that can be modified by the caller to add 3267 // headers to the request. 3268 func (c *ProjectsLocationsFunctionsGetIamPolicyCall) Header() http.Header { 3269 if c.header_ == nil { 3270 c.header_ = make(http.Header) 3271 } 3272 return c.header_ 3273 } 3274 3275 func (c *ProjectsLocationsFunctionsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 3276 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 3277 if c.ifNoneMatch_ != "" { 3278 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3279 } 3280 var body io.Reader = nil 3281 c.urlParams_.Set("alt", alt) 3282 c.urlParams_.Set("prettyPrint", "false") 3283 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+resource}:getIamPolicy") 3284 urls += "?" + c.urlParams_.Encode() 3285 req, err := http.NewRequest("GET", urls, body) 3286 if err != nil { 3287 return nil, err 3288 } 3289 req.Header = reqHeaders 3290 googleapi.Expand(req.URL, map[string]string{ 3291 "resource": c.resource, 3292 }) 3293 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3294 } 3295 3296 // Do executes the "cloudfunctions.projects.locations.functions.getIamPolicy" call. 3297 // Any non-2xx status code is an error. Response headers are in either 3298 // *Policy.ServerResponse.Header or (if a response was returned at all) in 3299 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 3300 // whether the returned error was because http.StatusNotModified was returned. 3301 func (c *ProjectsLocationsFunctionsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 3302 gensupport.SetOptions(c.urlParams_, opts...) 3303 res, err := c.doRequest("json") 3304 if res != nil && res.StatusCode == http.StatusNotModified { 3305 if res.Body != nil { 3306 res.Body.Close() 3307 } 3308 return nil, gensupport.WrapError(&googleapi.Error{ 3309 Code: res.StatusCode, 3310 Header: res.Header, 3311 }) 3312 } 3313 if err != nil { 3314 return nil, err 3315 } 3316 defer googleapi.CloseBody(res) 3317 if err := googleapi.CheckResponse(res); err != nil { 3318 return nil, gensupport.WrapError(err) 3319 } 3320 ret := &Policy{ 3321 ServerResponse: googleapi.ServerResponse{ 3322 Header: res.Header, 3323 HTTPStatusCode: res.StatusCode, 3324 }, 3325 } 3326 target := &ret 3327 if err := gensupport.DecodeResponse(target, res); err != nil { 3328 return nil, err 3329 } 3330 return ret, nil 3331 } 3332 3333 type ProjectsLocationsFunctionsListCall struct { 3334 s *Service 3335 parent string 3336 urlParams_ gensupport.URLParams 3337 ifNoneMatch_ string 3338 ctx_ context.Context 3339 header_ http.Header 3340 } 3341 3342 // List: Returns a list of functions that belong to the requested project. 3343 // 3344 // - parent: The project and location from which the function should be listed, 3345 // specified in the format `projects/*/locations/*` If you want to list 3346 // functions in all locations, use "-" in place of a location. When listing 3347 // functions in all locations, if one or more location(s) are unreachable, 3348 // the response will contain functions from all reachable locations along 3349 // with the names of any unreachable locations. 3350 func (r *ProjectsLocationsFunctionsService) List(parent string) *ProjectsLocationsFunctionsListCall { 3351 c := &ProjectsLocationsFunctionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3352 c.parent = parent 3353 return c 3354 } 3355 3356 // Filter sets the optional parameter "filter": The filter for Functions that 3357 // match the filter expression, following the syntax outlined in 3358 // https://google.aip.dev/160. 3359 func (c *ProjectsLocationsFunctionsListCall) Filter(filter string) *ProjectsLocationsFunctionsListCall { 3360 c.urlParams_.Set("filter", filter) 3361 return c 3362 } 3363 3364 // OrderBy sets the optional parameter "orderBy": The sorting order of the 3365 // resources returned. Value should be a comma separated list of fields. The 3366 // default sorting oder is ascending. See https://google.aip.dev/132#ordering. 3367 func (c *ProjectsLocationsFunctionsListCall) OrderBy(orderBy string) *ProjectsLocationsFunctionsListCall { 3368 c.urlParams_.Set("orderBy", orderBy) 3369 return c 3370 } 3371 3372 // PageSize sets the optional parameter "pageSize": Maximum number of functions 3373 // to return per call. The largest allowed page_size is 1,000, if the page_size 3374 // is omitted or specified as greater than 1,000 then it will be replaced as 3375 // 1,000. The size of the list response can be less than specified when used 3376 // with filters. 3377 func (c *ProjectsLocationsFunctionsListCall) PageSize(pageSize int64) *ProjectsLocationsFunctionsListCall { 3378 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 3379 return c 3380 } 3381 3382 // PageToken sets the optional parameter "pageToken": The value returned by the 3383 // last `ListFunctionsResponse`; indicates that this is a continuation of a 3384 // prior `ListFunctions` call, and that the system should return the next page 3385 // of data. 3386 func (c *ProjectsLocationsFunctionsListCall) PageToken(pageToken string) *ProjectsLocationsFunctionsListCall { 3387 c.urlParams_.Set("pageToken", pageToken) 3388 return c 3389 } 3390 3391 // Fields allows partial responses to be retrieved. See 3392 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3393 // details. 3394 func (c *ProjectsLocationsFunctionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsListCall { 3395 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3396 return c 3397 } 3398 3399 // IfNoneMatch sets an optional parameter which makes the operation fail if the 3400 // object's ETag matches the given value. This is useful for getting updates 3401 // only after the object has changed since the last request. 3402 func (c *ProjectsLocationsFunctionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsFunctionsListCall { 3403 c.ifNoneMatch_ = entityTag 3404 return c 3405 } 3406 3407 // Context sets the context to be used in this call's Do method. 3408 func (c *ProjectsLocationsFunctionsListCall) Context(ctx context.Context) *ProjectsLocationsFunctionsListCall { 3409 c.ctx_ = ctx 3410 return c 3411 } 3412 3413 // Header returns a http.Header that can be modified by the caller to add 3414 // headers to the request. 3415 func (c *ProjectsLocationsFunctionsListCall) Header() http.Header { 3416 if c.header_ == nil { 3417 c.header_ = make(http.Header) 3418 } 3419 return c.header_ 3420 } 3421 3422 func (c *ProjectsLocationsFunctionsListCall) doRequest(alt string) (*http.Response, error) { 3423 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 3424 if c.ifNoneMatch_ != "" { 3425 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3426 } 3427 var body io.Reader = nil 3428 c.urlParams_.Set("alt", alt) 3429 c.urlParams_.Set("prettyPrint", "false") 3430 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/functions") 3431 urls += "?" + c.urlParams_.Encode() 3432 req, err := http.NewRequest("GET", urls, body) 3433 if err != nil { 3434 return nil, err 3435 } 3436 req.Header = reqHeaders 3437 googleapi.Expand(req.URL, map[string]string{ 3438 "parent": c.parent, 3439 }) 3440 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3441 } 3442 3443 // Do executes the "cloudfunctions.projects.locations.functions.list" call. 3444 // Any non-2xx status code is an error. Response headers are in either 3445 // *ListFunctionsResponse.ServerResponse.Header or (if a response was returned 3446 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3447 // check whether the returned error was because http.StatusNotModified was 3448 // returned. 3449 func (c *ProjectsLocationsFunctionsListCall) Do(opts ...googleapi.CallOption) (*ListFunctionsResponse, error) { 3450 gensupport.SetOptions(c.urlParams_, opts...) 3451 res, err := c.doRequest("json") 3452 if res != nil && res.StatusCode == http.StatusNotModified { 3453 if res.Body != nil { 3454 res.Body.Close() 3455 } 3456 return nil, gensupport.WrapError(&googleapi.Error{ 3457 Code: res.StatusCode, 3458 Header: res.Header, 3459 }) 3460 } 3461 if err != nil { 3462 return nil, err 3463 } 3464 defer googleapi.CloseBody(res) 3465 if err := googleapi.CheckResponse(res); err != nil { 3466 return nil, gensupport.WrapError(err) 3467 } 3468 ret := &ListFunctionsResponse{ 3469 ServerResponse: googleapi.ServerResponse{ 3470 Header: res.Header, 3471 HTTPStatusCode: res.StatusCode, 3472 }, 3473 } 3474 target := &ret 3475 if err := gensupport.DecodeResponse(target, res); err != nil { 3476 return nil, err 3477 } 3478 return ret, nil 3479 } 3480 3481 // Pages invokes f for each page of results. 3482 // A non-nil error returned from f will halt the iteration. 3483 // The provided context supersedes any context provided to the Context method. 3484 func (c *ProjectsLocationsFunctionsListCall) Pages(ctx context.Context, f func(*ListFunctionsResponse) error) error { 3485 c.ctx_ = ctx 3486 defer c.PageToken(c.urlParams_.Get("pageToken")) 3487 for { 3488 x, err := c.Do() 3489 if err != nil { 3490 return err 3491 } 3492 if err := f(x); err != nil { 3493 return err 3494 } 3495 if x.NextPageToken == "" { 3496 return nil 3497 } 3498 c.PageToken(x.NextPageToken) 3499 } 3500 } 3501 3502 type ProjectsLocationsFunctionsPatchCall struct { 3503 s *Service 3504 name string 3505 function *Function 3506 urlParams_ gensupport.URLParams 3507 ctx_ context.Context 3508 header_ http.Header 3509 } 3510 3511 // Patch: Updates existing function. 3512 // 3513 // - name: A user-defined name of the function. Function names must be unique 3514 // globally and match pattern `projects/*/locations/*/functions/*`. 3515 func (r *ProjectsLocationsFunctionsService) Patch(name string, function *Function) *ProjectsLocationsFunctionsPatchCall { 3516 c := &ProjectsLocationsFunctionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3517 c.name = name 3518 c.function = function 3519 return c 3520 } 3521 3522 // UpdateMask sets the optional parameter "updateMask": The list of fields to 3523 // be updated. If no field mask is provided, all provided fields in the request 3524 // will be updated. 3525 func (c *ProjectsLocationsFunctionsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsFunctionsPatchCall { 3526 c.urlParams_.Set("updateMask", updateMask) 3527 return c 3528 } 3529 3530 // Fields allows partial responses to be retrieved. See 3531 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3532 // details. 3533 func (c *ProjectsLocationsFunctionsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsPatchCall { 3534 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3535 return c 3536 } 3537 3538 // Context sets the context to be used in this call's Do method. 3539 func (c *ProjectsLocationsFunctionsPatchCall) Context(ctx context.Context) *ProjectsLocationsFunctionsPatchCall { 3540 c.ctx_ = ctx 3541 return c 3542 } 3543 3544 // Header returns a http.Header that can be modified by the caller to add 3545 // headers to the request. 3546 func (c *ProjectsLocationsFunctionsPatchCall) Header() http.Header { 3547 if c.header_ == nil { 3548 c.header_ = make(http.Header) 3549 } 3550 return c.header_ 3551 } 3552 3553 func (c *ProjectsLocationsFunctionsPatchCall) doRequest(alt string) (*http.Response, error) { 3554 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 3555 var body io.Reader = nil 3556 body, err := googleapi.WithoutDataWrapper.JSONReader(c.function) 3557 if err != nil { 3558 return nil, err 3559 } 3560 c.urlParams_.Set("alt", alt) 3561 c.urlParams_.Set("prettyPrint", "false") 3562 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") 3563 urls += "?" + c.urlParams_.Encode() 3564 req, err := http.NewRequest("PATCH", urls, body) 3565 if err != nil { 3566 return nil, err 3567 } 3568 req.Header = reqHeaders 3569 googleapi.Expand(req.URL, map[string]string{ 3570 "name": c.name, 3571 }) 3572 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3573 } 3574 3575 // Do executes the "cloudfunctions.projects.locations.functions.patch" call. 3576 // Any non-2xx status code is an error. Response headers are in either 3577 // *Operation.ServerResponse.Header or (if a response was returned at all) in 3578 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 3579 // whether the returned error was because http.StatusNotModified was returned. 3580 func (c *ProjectsLocationsFunctionsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 3581 gensupport.SetOptions(c.urlParams_, opts...) 3582 res, err := c.doRequest("json") 3583 if res != nil && res.StatusCode == http.StatusNotModified { 3584 if res.Body != nil { 3585 res.Body.Close() 3586 } 3587 return nil, gensupport.WrapError(&googleapi.Error{ 3588 Code: res.StatusCode, 3589 Header: res.Header, 3590 }) 3591 } 3592 if err != nil { 3593 return nil, err 3594 } 3595 defer googleapi.CloseBody(res) 3596 if err := googleapi.CheckResponse(res); err != nil { 3597 return nil, gensupport.WrapError(err) 3598 } 3599 ret := &Operation{ 3600 ServerResponse: googleapi.ServerResponse{ 3601 Header: res.Header, 3602 HTTPStatusCode: res.StatusCode, 3603 }, 3604 } 3605 target := &ret 3606 if err := gensupport.DecodeResponse(target, res); err != nil { 3607 return nil, err 3608 } 3609 return ret, nil 3610 } 3611 3612 type ProjectsLocationsFunctionsRedirectFunctionUpgradeTrafficCall struct { 3613 s *Service 3614 name string 3615 redirectfunctionupgradetrafficrequest *RedirectFunctionUpgradeTrafficRequest 3616 urlParams_ gensupport.URLParams 3617 ctx_ context.Context 3618 header_ http.Header 3619 } 3620 3621 // RedirectFunctionUpgradeTraffic: Changes the traffic target of a function 3622 // from the original 1st Gen function to the 2nd Gen copy. This is the second 3623 // step of the multi step process to upgrade 1st Gen functions to 2nd Gen. 3624 // After this operation, all new traffic will be served by 2nd Gen copy. 3625 // 3626 // - name: The name of the function for which traffic target should be changed 3627 // to 2nd Gen from 1st Gen. 3628 func (r *ProjectsLocationsFunctionsService) RedirectFunctionUpgradeTraffic(name string, redirectfunctionupgradetrafficrequest *RedirectFunctionUpgradeTrafficRequest) *ProjectsLocationsFunctionsRedirectFunctionUpgradeTrafficCall { 3629 c := &ProjectsLocationsFunctionsRedirectFunctionUpgradeTrafficCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3630 c.name = name 3631 c.redirectfunctionupgradetrafficrequest = redirectfunctionupgradetrafficrequest 3632 return c 3633 } 3634 3635 // Fields allows partial responses to be retrieved. See 3636 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3637 // details. 3638 func (c *ProjectsLocationsFunctionsRedirectFunctionUpgradeTrafficCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsRedirectFunctionUpgradeTrafficCall { 3639 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3640 return c 3641 } 3642 3643 // Context sets the context to be used in this call's Do method. 3644 func (c *ProjectsLocationsFunctionsRedirectFunctionUpgradeTrafficCall) Context(ctx context.Context) *ProjectsLocationsFunctionsRedirectFunctionUpgradeTrafficCall { 3645 c.ctx_ = ctx 3646 return c 3647 } 3648 3649 // Header returns a http.Header that can be modified by the caller to add 3650 // headers to the request. 3651 func (c *ProjectsLocationsFunctionsRedirectFunctionUpgradeTrafficCall) Header() http.Header { 3652 if c.header_ == nil { 3653 c.header_ = make(http.Header) 3654 } 3655 return c.header_ 3656 } 3657 3658 func (c *ProjectsLocationsFunctionsRedirectFunctionUpgradeTrafficCall) doRequest(alt string) (*http.Response, error) { 3659 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 3660 var body io.Reader = nil 3661 body, err := googleapi.WithoutDataWrapper.JSONReader(c.redirectfunctionupgradetrafficrequest) 3662 if err != nil { 3663 return nil, err 3664 } 3665 c.urlParams_.Set("alt", alt) 3666 c.urlParams_.Set("prettyPrint", "false") 3667 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:redirectFunctionUpgradeTraffic") 3668 urls += "?" + c.urlParams_.Encode() 3669 req, err := http.NewRequest("POST", urls, body) 3670 if err != nil { 3671 return nil, err 3672 } 3673 req.Header = reqHeaders 3674 googleapi.Expand(req.URL, map[string]string{ 3675 "name": c.name, 3676 }) 3677 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3678 } 3679 3680 // Do executes the "cloudfunctions.projects.locations.functions.redirectFunctionUpgradeTraffic" call. 3681 // Any non-2xx status code is an error. Response headers are in either 3682 // *Operation.ServerResponse.Header or (if a response was returned at all) in 3683 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 3684 // whether the returned error was because http.StatusNotModified was returned. 3685 func (c *ProjectsLocationsFunctionsRedirectFunctionUpgradeTrafficCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 3686 gensupport.SetOptions(c.urlParams_, opts...) 3687 res, err := c.doRequest("json") 3688 if res != nil && res.StatusCode == http.StatusNotModified { 3689 if res.Body != nil { 3690 res.Body.Close() 3691 } 3692 return nil, gensupport.WrapError(&googleapi.Error{ 3693 Code: res.StatusCode, 3694 Header: res.Header, 3695 }) 3696 } 3697 if err != nil { 3698 return nil, err 3699 } 3700 defer googleapi.CloseBody(res) 3701 if err := googleapi.CheckResponse(res); err != nil { 3702 return nil, gensupport.WrapError(err) 3703 } 3704 ret := &Operation{ 3705 ServerResponse: googleapi.ServerResponse{ 3706 Header: res.Header, 3707 HTTPStatusCode: res.StatusCode, 3708 }, 3709 } 3710 target := &ret 3711 if err := gensupport.DecodeResponse(target, res); err != nil { 3712 return nil, err 3713 } 3714 return ret, nil 3715 } 3716 3717 type ProjectsLocationsFunctionsRollbackFunctionUpgradeTrafficCall struct { 3718 s *Service 3719 name string 3720 rollbackfunctionupgradetrafficrequest *RollbackFunctionUpgradeTrafficRequest 3721 urlParams_ gensupport.URLParams 3722 ctx_ context.Context 3723 header_ http.Header 3724 } 3725 3726 // RollbackFunctionUpgradeTraffic: Reverts the traffic target of a function 3727 // from the 2nd Gen copy to the original 1st Gen function. After this 3728 // operation, all new traffic would be served by the 1st Gen. 3729 // 3730 // - name: The name of the function for which traffic target should be changed 3731 // back to 1st Gen from 2nd Gen. 3732 func (r *ProjectsLocationsFunctionsService) RollbackFunctionUpgradeTraffic(name string, rollbackfunctionupgradetrafficrequest *RollbackFunctionUpgradeTrafficRequest) *ProjectsLocationsFunctionsRollbackFunctionUpgradeTrafficCall { 3733 c := &ProjectsLocationsFunctionsRollbackFunctionUpgradeTrafficCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3734 c.name = name 3735 c.rollbackfunctionupgradetrafficrequest = rollbackfunctionupgradetrafficrequest 3736 return c 3737 } 3738 3739 // Fields allows partial responses to be retrieved. See 3740 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3741 // details. 3742 func (c *ProjectsLocationsFunctionsRollbackFunctionUpgradeTrafficCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsRollbackFunctionUpgradeTrafficCall { 3743 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3744 return c 3745 } 3746 3747 // Context sets the context to be used in this call's Do method. 3748 func (c *ProjectsLocationsFunctionsRollbackFunctionUpgradeTrafficCall) Context(ctx context.Context) *ProjectsLocationsFunctionsRollbackFunctionUpgradeTrafficCall { 3749 c.ctx_ = ctx 3750 return c 3751 } 3752 3753 // Header returns a http.Header that can be modified by the caller to add 3754 // headers to the request. 3755 func (c *ProjectsLocationsFunctionsRollbackFunctionUpgradeTrafficCall) Header() http.Header { 3756 if c.header_ == nil { 3757 c.header_ = make(http.Header) 3758 } 3759 return c.header_ 3760 } 3761 3762 func (c *ProjectsLocationsFunctionsRollbackFunctionUpgradeTrafficCall) doRequest(alt string) (*http.Response, error) { 3763 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 3764 var body io.Reader = nil 3765 body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbackfunctionupgradetrafficrequest) 3766 if err != nil { 3767 return nil, err 3768 } 3769 c.urlParams_.Set("alt", alt) 3770 c.urlParams_.Set("prettyPrint", "false") 3771 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:rollbackFunctionUpgradeTraffic") 3772 urls += "?" + c.urlParams_.Encode() 3773 req, err := http.NewRequest("POST", urls, body) 3774 if err != nil { 3775 return nil, err 3776 } 3777 req.Header = reqHeaders 3778 googleapi.Expand(req.URL, map[string]string{ 3779 "name": c.name, 3780 }) 3781 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3782 } 3783 3784 // Do executes the "cloudfunctions.projects.locations.functions.rollbackFunctionUpgradeTraffic" call. 3785 // Any non-2xx status code is an error. Response headers are in either 3786 // *Operation.ServerResponse.Header or (if a response was returned at all) in 3787 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 3788 // whether the returned error was because http.StatusNotModified was returned. 3789 func (c *ProjectsLocationsFunctionsRollbackFunctionUpgradeTrafficCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 3790 gensupport.SetOptions(c.urlParams_, opts...) 3791 res, err := c.doRequest("json") 3792 if res != nil && res.StatusCode == http.StatusNotModified { 3793 if res.Body != nil { 3794 res.Body.Close() 3795 } 3796 return nil, gensupport.WrapError(&googleapi.Error{ 3797 Code: res.StatusCode, 3798 Header: res.Header, 3799 }) 3800 } 3801 if err != nil { 3802 return nil, err 3803 } 3804 defer googleapi.CloseBody(res) 3805 if err := googleapi.CheckResponse(res); err != nil { 3806 return nil, gensupport.WrapError(err) 3807 } 3808 ret := &Operation{ 3809 ServerResponse: googleapi.ServerResponse{ 3810 Header: res.Header, 3811 HTTPStatusCode: res.StatusCode, 3812 }, 3813 } 3814 target := &ret 3815 if err := gensupport.DecodeResponse(target, res); err != nil { 3816 return nil, err 3817 } 3818 return ret, nil 3819 } 3820 3821 type ProjectsLocationsFunctionsSetIamPolicyCall struct { 3822 s *Service 3823 resource string 3824 setiampolicyrequest *SetIamPolicyRequest 3825 urlParams_ gensupport.URLParams 3826 ctx_ context.Context 3827 header_ http.Header 3828 } 3829 3830 // SetIamPolicy: Sets the access control policy on the specified resource. 3831 // Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, 3832 // and `PERMISSION_DENIED` errors. 3833 // 3834 // - resource: REQUIRED: The resource for which the policy is being specified. 3835 // See Resource names (https://cloud.google.com/apis/design/resource_names) 3836 // for the appropriate value for this field. 3837 func (r *ProjectsLocationsFunctionsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsFunctionsSetIamPolicyCall { 3838 c := &ProjectsLocationsFunctionsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3839 c.resource = resource 3840 c.setiampolicyrequest = setiampolicyrequest 3841 return c 3842 } 3843 3844 // Fields allows partial responses to be retrieved. See 3845 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3846 // details. 3847 func (c *ProjectsLocationsFunctionsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsSetIamPolicyCall { 3848 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3849 return c 3850 } 3851 3852 // Context sets the context to be used in this call's Do method. 3853 func (c *ProjectsLocationsFunctionsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsFunctionsSetIamPolicyCall { 3854 c.ctx_ = ctx 3855 return c 3856 } 3857 3858 // Header returns a http.Header that can be modified by the caller to add 3859 // headers to the request. 3860 func (c *ProjectsLocationsFunctionsSetIamPolicyCall) Header() http.Header { 3861 if c.header_ == nil { 3862 c.header_ = make(http.Header) 3863 } 3864 return c.header_ 3865 } 3866 3867 func (c *ProjectsLocationsFunctionsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 3868 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 3869 var body io.Reader = nil 3870 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) 3871 if err != nil { 3872 return nil, err 3873 } 3874 c.urlParams_.Set("alt", alt) 3875 c.urlParams_.Set("prettyPrint", "false") 3876 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+resource}:setIamPolicy") 3877 urls += "?" + c.urlParams_.Encode() 3878 req, err := http.NewRequest("POST", urls, body) 3879 if err != nil { 3880 return nil, err 3881 } 3882 req.Header = reqHeaders 3883 googleapi.Expand(req.URL, map[string]string{ 3884 "resource": c.resource, 3885 }) 3886 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3887 } 3888 3889 // Do executes the "cloudfunctions.projects.locations.functions.setIamPolicy" call. 3890 // Any non-2xx status code is an error. Response headers are in either 3891 // *Policy.ServerResponse.Header or (if a response was returned at all) in 3892 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 3893 // whether the returned error was because http.StatusNotModified was returned. 3894 func (c *ProjectsLocationsFunctionsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 3895 gensupport.SetOptions(c.urlParams_, opts...) 3896 res, err := c.doRequest("json") 3897 if res != nil && res.StatusCode == http.StatusNotModified { 3898 if res.Body != nil { 3899 res.Body.Close() 3900 } 3901 return nil, gensupport.WrapError(&googleapi.Error{ 3902 Code: res.StatusCode, 3903 Header: res.Header, 3904 }) 3905 } 3906 if err != nil { 3907 return nil, err 3908 } 3909 defer googleapi.CloseBody(res) 3910 if err := googleapi.CheckResponse(res); err != nil { 3911 return nil, gensupport.WrapError(err) 3912 } 3913 ret := &Policy{ 3914 ServerResponse: googleapi.ServerResponse{ 3915 Header: res.Header, 3916 HTTPStatusCode: res.StatusCode, 3917 }, 3918 } 3919 target := &ret 3920 if err := gensupport.DecodeResponse(target, res); err != nil { 3921 return nil, err 3922 } 3923 return ret, nil 3924 } 3925 3926 type ProjectsLocationsFunctionsSetupFunctionUpgradeConfigCall struct { 3927 s *Service 3928 name string 3929 setupfunctionupgradeconfigrequest *SetupFunctionUpgradeConfigRequest 3930 urlParams_ gensupport.URLParams 3931 ctx_ context.Context 3932 header_ http.Header 3933 } 3934 3935 // SetupFunctionUpgradeConfig: Creates a 2nd Gen copy of the function 3936 // configuration based on the 1st Gen function with the given name. This is the 3937 // first step of the multi step process to upgrade 1st Gen functions to 2nd 3938 // Gen. Only 2nd Gen configuration is setup as part of this request and traffic 3939 // continues to be served by 1st Gen. 3940 // 3941 // - name: The name of the function which should have configuration copied for 3942 // upgrade. 3943 func (r *ProjectsLocationsFunctionsService) SetupFunctionUpgradeConfig(name string, setupfunctionupgradeconfigrequest *SetupFunctionUpgradeConfigRequest) *ProjectsLocationsFunctionsSetupFunctionUpgradeConfigCall { 3944 c := &ProjectsLocationsFunctionsSetupFunctionUpgradeConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3945 c.name = name 3946 c.setupfunctionupgradeconfigrequest = setupfunctionupgradeconfigrequest 3947 return c 3948 } 3949 3950 // Fields allows partial responses to be retrieved. See 3951 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3952 // details. 3953 func (c *ProjectsLocationsFunctionsSetupFunctionUpgradeConfigCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsSetupFunctionUpgradeConfigCall { 3954 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3955 return c 3956 } 3957 3958 // Context sets the context to be used in this call's Do method. 3959 func (c *ProjectsLocationsFunctionsSetupFunctionUpgradeConfigCall) Context(ctx context.Context) *ProjectsLocationsFunctionsSetupFunctionUpgradeConfigCall { 3960 c.ctx_ = ctx 3961 return c 3962 } 3963 3964 // Header returns a http.Header that can be modified by the caller to add 3965 // headers to the request. 3966 func (c *ProjectsLocationsFunctionsSetupFunctionUpgradeConfigCall) Header() http.Header { 3967 if c.header_ == nil { 3968 c.header_ = make(http.Header) 3969 } 3970 return c.header_ 3971 } 3972 3973 func (c *ProjectsLocationsFunctionsSetupFunctionUpgradeConfigCall) doRequest(alt string) (*http.Response, error) { 3974 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 3975 var body io.Reader = nil 3976 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setupfunctionupgradeconfigrequest) 3977 if err != nil { 3978 return nil, err 3979 } 3980 c.urlParams_.Set("alt", alt) 3981 c.urlParams_.Set("prettyPrint", "false") 3982 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:setupFunctionUpgradeConfig") 3983 urls += "?" + c.urlParams_.Encode() 3984 req, err := http.NewRequest("POST", urls, body) 3985 if err != nil { 3986 return nil, err 3987 } 3988 req.Header = reqHeaders 3989 googleapi.Expand(req.URL, map[string]string{ 3990 "name": c.name, 3991 }) 3992 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3993 } 3994 3995 // Do executes the "cloudfunctions.projects.locations.functions.setupFunctionUpgradeConfig" call. 3996 // Any non-2xx status code is an error. Response headers are in either 3997 // *Operation.ServerResponse.Header or (if a response was returned at all) in 3998 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 3999 // whether the returned error was because http.StatusNotModified was returned. 4000 func (c *ProjectsLocationsFunctionsSetupFunctionUpgradeConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4001 gensupport.SetOptions(c.urlParams_, opts...) 4002 res, err := c.doRequest("json") 4003 if res != nil && res.StatusCode == http.StatusNotModified { 4004 if res.Body != nil { 4005 res.Body.Close() 4006 } 4007 return nil, gensupport.WrapError(&googleapi.Error{ 4008 Code: res.StatusCode, 4009 Header: res.Header, 4010 }) 4011 } 4012 if err != nil { 4013 return nil, err 4014 } 4015 defer googleapi.CloseBody(res) 4016 if err := googleapi.CheckResponse(res); err != nil { 4017 return nil, gensupport.WrapError(err) 4018 } 4019 ret := &Operation{ 4020 ServerResponse: googleapi.ServerResponse{ 4021 Header: res.Header, 4022 HTTPStatusCode: res.StatusCode, 4023 }, 4024 } 4025 target := &ret 4026 if err := gensupport.DecodeResponse(target, res); err != nil { 4027 return nil, err 4028 } 4029 return ret, nil 4030 } 4031 4032 type ProjectsLocationsFunctionsTestIamPermissionsCall struct { 4033 s *Service 4034 resource string 4035 testiampermissionsrequest *TestIamPermissionsRequest 4036 urlParams_ gensupport.URLParams 4037 ctx_ context.Context 4038 header_ http.Header 4039 } 4040 4041 // TestIamPermissions: Returns permissions that a caller has on the specified 4042 // resource. If the resource does not exist, this will return an empty set of 4043 // permissions, not a `NOT_FOUND` error. Note: This operation is designed to be 4044 // used for building permission-aware UIs and command-line tools, not for 4045 // authorization checking. This operation may "fail open" without warning. 4046 // 4047 // - resource: REQUIRED: The resource for which the policy detail is being 4048 // requested. See Resource names 4049 // (https://cloud.google.com/apis/design/resource_names) for the appropriate 4050 // value for this field. 4051 func (r *ProjectsLocationsFunctionsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsFunctionsTestIamPermissionsCall { 4052 c := &ProjectsLocationsFunctionsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4053 c.resource = resource 4054 c.testiampermissionsrequest = testiampermissionsrequest 4055 return c 4056 } 4057 4058 // Fields allows partial responses to be retrieved. See 4059 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 4060 // details. 4061 func (c *ProjectsLocationsFunctionsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsTestIamPermissionsCall { 4062 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4063 return c 4064 } 4065 4066 // Context sets the context to be used in this call's Do method. 4067 func (c *ProjectsLocationsFunctionsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsFunctionsTestIamPermissionsCall { 4068 c.ctx_ = ctx 4069 return c 4070 } 4071 4072 // Header returns a http.Header that can be modified by the caller to add 4073 // headers to the request. 4074 func (c *ProjectsLocationsFunctionsTestIamPermissionsCall) Header() http.Header { 4075 if c.header_ == nil { 4076 c.header_ = make(http.Header) 4077 } 4078 return c.header_ 4079 } 4080 4081 func (c *ProjectsLocationsFunctionsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 4082 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 4083 var body io.Reader = nil 4084 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) 4085 if err != nil { 4086 return nil, err 4087 } 4088 c.urlParams_.Set("alt", alt) 4089 c.urlParams_.Set("prettyPrint", "false") 4090 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+resource}:testIamPermissions") 4091 urls += "?" + c.urlParams_.Encode() 4092 req, err := http.NewRequest("POST", urls, body) 4093 if err != nil { 4094 return nil, err 4095 } 4096 req.Header = reqHeaders 4097 googleapi.Expand(req.URL, map[string]string{ 4098 "resource": c.resource, 4099 }) 4100 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4101 } 4102 4103 // Do executes the "cloudfunctions.projects.locations.functions.testIamPermissions" call. 4104 // Any non-2xx status code is an error. Response headers are in either 4105 // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was 4106 // returned at all) in error.(*googleapi.Error).Header. Use 4107 // googleapi.IsNotModified to check whether the returned error was because 4108 // http.StatusNotModified was returned. 4109 func (c *ProjectsLocationsFunctionsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { 4110 gensupport.SetOptions(c.urlParams_, opts...) 4111 res, err := c.doRequest("json") 4112 if res != nil && res.StatusCode == http.StatusNotModified { 4113 if res.Body != nil { 4114 res.Body.Close() 4115 } 4116 return nil, gensupport.WrapError(&googleapi.Error{ 4117 Code: res.StatusCode, 4118 Header: res.Header, 4119 }) 4120 } 4121 if err != nil { 4122 return nil, err 4123 } 4124 defer googleapi.CloseBody(res) 4125 if err := googleapi.CheckResponse(res); err != nil { 4126 return nil, gensupport.WrapError(err) 4127 } 4128 ret := &TestIamPermissionsResponse{ 4129 ServerResponse: googleapi.ServerResponse{ 4130 Header: res.Header, 4131 HTTPStatusCode: res.StatusCode, 4132 }, 4133 } 4134 target := &ret 4135 if err := gensupport.DecodeResponse(target, res); err != nil { 4136 return nil, err 4137 } 4138 return ret, nil 4139 } 4140 4141 type ProjectsLocationsOperationsGetCall struct { 4142 s *Service 4143 name string 4144 urlParams_ gensupport.URLParams 4145 ifNoneMatch_ string 4146 ctx_ context.Context 4147 header_ http.Header 4148 } 4149 4150 // Get: Gets the latest state of a long-running operation. Clients can use this 4151 // method to poll the operation result at intervals as recommended by the API 4152 // service. 4153 // 4154 // - name: The name of the operation resource. 4155 func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall { 4156 c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4157 c.name = name 4158 return c 4159 } 4160 4161 // Fields allows partial responses to be retrieved. See 4162 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 4163 // details. 4164 func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall { 4165 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4166 return c 4167 } 4168 4169 // IfNoneMatch sets an optional parameter which makes the operation fail if the 4170 // object's ETag matches the given value. This is useful for getting updates 4171 // only after the object has changed since the last request. 4172 func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall { 4173 c.ifNoneMatch_ = entityTag 4174 return c 4175 } 4176 4177 // Context sets the context to be used in this call's Do method. 4178 func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall { 4179 c.ctx_ = ctx 4180 return c 4181 } 4182 4183 // Header returns a http.Header that can be modified by the caller to add 4184 // headers to the request. 4185 func (c *ProjectsLocationsOperationsGetCall) Header() http.Header { 4186 if c.header_ == nil { 4187 c.header_ = make(http.Header) 4188 } 4189 return c.header_ 4190 } 4191 4192 func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) { 4193 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 4194 if c.ifNoneMatch_ != "" { 4195 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4196 } 4197 var body io.Reader = nil 4198 c.urlParams_.Set("alt", alt) 4199 c.urlParams_.Set("prettyPrint", "false") 4200 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") 4201 urls += "?" + c.urlParams_.Encode() 4202 req, err := http.NewRequest("GET", urls, body) 4203 if err != nil { 4204 return nil, err 4205 } 4206 req.Header = reqHeaders 4207 googleapi.Expand(req.URL, map[string]string{ 4208 "name": c.name, 4209 }) 4210 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4211 } 4212 4213 // Do executes the "cloudfunctions.projects.locations.operations.get" call. 4214 // Any non-2xx status code is an error. Response headers are in either 4215 // *Operation.ServerResponse.Header or (if a response was returned at all) in 4216 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 4217 // whether the returned error was because http.StatusNotModified was returned. 4218 func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4219 gensupport.SetOptions(c.urlParams_, opts...) 4220 res, err := c.doRequest("json") 4221 if res != nil && res.StatusCode == http.StatusNotModified { 4222 if res.Body != nil { 4223 res.Body.Close() 4224 } 4225 return nil, gensupport.WrapError(&googleapi.Error{ 4226 Code: res.StatusCode, 4227 Header: res.Header, 4228 }) 4229 } 4230 if err != nil { 4231 return nil, err 4232 } 4233 defer googleapi.CloseBody(res) 4234 if err := googleapi.CheckResponse(res); err != nil { 4235 return nil, gensupport.WrapError(err) 4236 } 4237 ret := &Operation{ 4238 ServerResponse: googleapi.ServerResponse{ 4239 Header: res.Header, 4240 HTTPStatusCode: res.StatusCode, 4241 }, 4242 } 4243 target := &ret 4244 if err := gensupport.DecodeResponse(target, res); err != nil { 4245 return nil, err 4246 } 4247 return ret, nil 4248 } 4249 4250 type ProjectsLocationsOperationsListCall struct { 4251 s *Service 4252 name string 4253 urlParams_ gensupport.URLParams 4254 ifNoneMatch_ string 4255 ctx_ context.Context 4256 header_ http.Header 4257 } 4258 4259 // List: Lists operations that match the specified filter in the request. If 4260 // the server doesn't support this method, it returns `UNIMPLEMENTED`. 4261 // 4262 // - name: The name of the operation's parent resource. 4263 func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall { 4264 c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4265 c.name = name 4266 return c 4267 } 4268 4269 // Filter sets the optional parameter "filter": The standard list filter. 4270 func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall { 4271 c.urlParams_.Set("filter", filter) 4272 return c 4273 } 4274 4275 // PageSize sets the optional parameter "pageSize": The standard list page 4276 // size. 4277 func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall { 4278 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 4279 return c 4280 } 4281 4282 // PageToken sets the optional parameter "pageToken": The standard list page 4283 // token. 4284 func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall { 4285 c.urlParams_.Set("pageToken", pageToken) 4286 return c 4287 } 4288 4289 // Fields allows partial responses to be retrieved. See 4290 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 4291 // details. 4292 func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall { 4293 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4294 return c 4295 } 4296 4297 // IfNoneMatch sets an optional parameter which makes the operation fail if the 4298 // object's ETag matches the given value. This is useful for getting updates 4299 // only after the object has changed since the last request. 4300 func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall { 4301 c.ifNoneMatch_ = entityTag 4302 return c 4303 } 4304 4305 // Context sets the context to be used in this call's Do method. 4306 func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall { 4307 c.ctx_ = ctx 4308 return c 4309 } 4310 4311 // Header returns a http.Header that can be modified by the caller to add 4312 // headers to the request. 4313 func (c *ProjectsLocationsOperationsListCall) Header() http.Header { 4314 if c.header_ == nil { 4315 c.header_ = make(http.Header) 4316 } 4317 return c.header_ 4318 } 4319 4320 func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) { 4321 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 4322 if c.ifNoneMatch_ != "" { 4323 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4324 } 4325 var body io.Reader = nil 4326 c.urlParams_.Set("alt", alt) 4327 c.urlParams_.Set("prettyPrint", "false") 4328 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/operations") 4329 urls += "?" + c.urlParams_.Encode() 4330 req, err := http.NewRequest("GET", urls, body) 4331 if err != nil { 4332 return nil, err 4333 } 4334 req.Header = reqHeaders 4335 googleapi.Expand(req.URL, map[string]string{ 4336 "name": c.name, 4337 }) 4338 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4339 } 4340 4341 // Do executes the "cloudfunctions.projects.locations.operations.list" call. 4342 // Any non-2xx status code is an error. Response headers are in either 4343 // *ListOperationsResponse.ServerResponse.Header or (if a response was returned 4344 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4345 // check whether the returned error was because http.StatusNotModified was 4346 // returned. 4347 func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) { 4348 gensupport.SetOptions(c.urlParams_, opts...) 4349 res, err := c.doRequest("json") 4350 if res != nil && res.StatusCode == http.StatusNotModified { 4351 if res.Body != nil { 4352 res.Body.Close() 4353 } 4354 return nil, gensupport.WrapError(&googleapi.Error{ 4355 Code: res.StatusCode, 4356 Header: res.Header, 4357 }) 4358 } 4359 if err != nil { 4360 return nil, err 4361 } 4362 defer googleapi.CloseBody(res) 4363 if err := googleapi.CheckResponse(res); err != nil { 4364 return nil, gensupport.WrapError(err) 4365 } 4366 ret := &ListOperationsResponse{ 4367 ServerResponse: googleapi.ServerResponse{ 4368 Header: res.Header, 4369 HTTPStatusCode: res.StatusCode, 4370 }, 4371 } 4372 target := &ret 4373 if err := gensupport.DecodeResponse(target, res); err != nil { 4374 return nil, err 4375 } 4376 return ret, nil 4377 } 4378 4379 // Pages invokes f for each page of results. 4380 // A non-nil error returned from f will halt the iteration. 4381 // The provided context supersedes any context provided to the Context method. 4382 func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error { 4383 c.ctx_ = ctx 4384 defer c.PageToken(c.urlParams_.Get("pageToken")) 4385 for { 4386 x, err := c.Do() 4387 if err != nil { 4388 return err 4389 } 4390 if err := f(x); err != nil { 4391 return err 4392 } 4393 if x.NextPageToken == "" { 4394 return nil 4395 } 4396 c.PageToken(x.NextPageToken) 4397 } 4398 } 4399 4400 type ProjectsLocationsRuntimesListCall struct { 4401 s *Service 4402 parent string 4403 urlParams_ gensupport.URLParams 4404 ifNoneMatch_ string 4405 ctx_ context.Context 4406 header_ http.Header 4407 } 4408 4409 // List: Returns a list of runtimes that are supported for the requested 4410 // project. 4411 // 4412 // - parent: The project and location from which the runtimes should be listed, 4413 // specified in the format `projects/*/locations/*`. 4414 func (r *ProjectsLocationsRuntimesService) List(parent string) *ProjectsLocationsRuntimesListCall { 4415 c := &ProjectsLocationsRuntimesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4416 c.parent = parent 4417 return c 4418 } 4419 4420 // Filter sets the optional parameter "filter": The filter for Runtimes that 4421 // match the filter expression, following the syntax outlined in 4422 // https://google.aip.dev/160. 4423 func (c *ProjectsLocationsRuntimesListCall) Filter(filter string) *ProjectsLocationsRuntimesListCall { 4424 c.urlParams_.Set("filter", filter) 4425 return c 4426 } 4427 4428 // Fields allows partial responses to be retrieved. See 4429 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 4430 // details. 4431 func (c *ProjectsLocationsRuntimesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsRuntimesListCall { 4432 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4433 return c 4434 } 4435 4436 // IfNoneMatch sets an optional parameter which makes the operation fail if the 4437 // object's ETag matches the given value. This is useful for getting updates 4438 // only after the object has changed since the last request. 4439 func (c *ProjectsLocationsRuntimesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsRuntimesListCall { 4440 c.ifNoneMatch_ = entityTag 4441 return c 4442 } 4443 4444 // Context sets the context to be used in this call's Do method. 4445 func (c *ProjectsLocationsRuntimesListCall) Context(ctx context.Context) *ProjectsLocationsRuntimesListCall { 4446 c.ctx_ = ctx 4447 return c 4448 } 4449 4450 // Header returns a http.Header that can be modified by the caller to add 4451 // headers to the request. 4452 func (c *ProjectsLocationsRuntimesListCall) Header() http.Header { 4453 if c.header_ == nil { 4454 c.header_ = make(http.Header) 4455 } 4456 return c.header_ 4457 } 4458 4459 func (c *ProjectsLocationsRuntimesListCall) doRequest(alt string) (*http.Response, error) { 4460 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 4461 if c.ifNoneMatch_ != "" { 4462 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4463 } 4464 var body io.Reader = nil 4465 c.urlParams_.Set("alt", alt) 4466 c.urlParams_.Set("prettyPrint", "false") 4467 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/runtimes") 4468 urls += "?" + c.urlParams_.Encode() 4469 req, err := http.NewRequest("GET", urls, body) 4470 if err != nil { 4471 return nil, err 4472 } 4473 req.Header = reqHeaders 4474 googleapi.Expand(req.URL, map[string]string{ 4475 "parent": c.parent, 4476 }) 4477 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4478 } 4479 4480 // Do executes the "cloudfunctions.projects.locations.runtimes.list" call. 4481 // Any non-2xx status code is an error. Response headers are in either 4482 // *ListRuntimesResponse.ServerResponse.Header or (if a response was returned 4483 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4484 // check whether the returned error was because http.StatusNotModified was 4485 // returned. 4486 func (c *ProjectsLocationsRuntimesListCall) Do(opts ...googleapi.CallOption) (*ListRuntimesResponse, error) { 4487 gensupport.SetOptions(c.urlParams_, opts...) 4488 res, err := c.doRequest("json") 4489 if res != nil && res.StatusCode == http.StatusNotModified { 4490 if res.Body != nil { 4491 res.Body.Close() 4492 } 4493 return nil, gensupport.WrapError(&googleapi.Error{ 4494 Code: res.StatusCode, 4495 Header: res.Header, 4496 }) 4497 } 4498 if err != nil { 4499 return nil, err 4500 } 4501 defer googleapi.CloseBody(res) 4502 if err := googleapi.CheckResponse(res); err != nil { 4503 return nil, gensupport.WrapError(err) 4504 } 4505 ret := &ListRuntimesResponse{ 4506 ServerResponse: googleapi.ServerResponse{ 4507 Header: res.Header, 4508 HTTPStatusCode: res.StatusCode, 4509 }, 4510 } 4511 target := &ret 4512 if err := gensupport.DecodeResponse(target, res); err != nil { 4513 return nil, err 4514 } 4515 return ret, nil 4516 } 4517