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 firebasehosting provides access to the Firebase Hosting API. 8 // 9 // For product documentation, see: https://firebase.google.com/docs/hosting/ 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/firebasehosting/v1" 27 // ... 28 // ctx := context.Background() 29 // firebasehostingService, err := firebasehosting.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 // By default, all available scopes (see "Constants") are used to authenticate. 38 // To restrict scopes, use [google.golang.org/api/option.WithScopes]: 39 // 40 // firebasehostingService, err := firebasehosting.NewService(ctx, option.WithScopes(firebasehosting.FirebaseScope)) 41 // 42 // To use an API key for authentication (note: some APIs do not support API 43 // keys), use [google.golang.org/api/option.WithAPIKey]: 44 // 45 // firebasehostingService, err := firebasehosting.NewService(ctx, option.WithAPIKey("AIza...")) 46 // 47 // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth 48 // flow, use [google.golang.org/api/option.WithTokenSource]: 49 // 50 // config := &oauth2.Config{...} 51 // // ... 52 // token, err := config.Exchange(ctx, ...) 53 // firebasehostingService, err := firebasehosting.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 54 // 55 // See [google.golang.org/api/option.ClientOption] for details on options. 56 package firebasehosting // import "google.golang.org/api/firebasehosting/v1" 57 58 import ( 59 "bytes" 60 "context" 61 "encoding/json" 62 "errors" 63 "fmt" 64 "io" 65 "net/http" 66 "net/url" 67 "strconv" 68 "strings" 69 70 googleapi "google.golang.org/api/googleapi" 71 internal "google.golang.org/api/internal" 72 gensupport "google.golang.org/api/internal/gensupport" 73 option "google.golang.org/api/option" 74 internaloption "google.golang.org/api/option/internaloption" 75 htransport "google.golang.org/api/transport/http" 76 ) 77 78 // Always reference these packages, just in case the auto-generated code 79 // below doesn't. 80 var _ = bytes.NewBuffer 81 var _ = strconv.Itoa 82 var _ = fmt.Sprintf 83 var _ = json.NewDecoder 84 var _ = io.Copy 85 var _ = url.Parse 86 var _ = gensupport.MarshalJSON 87 var _ = googleapi.Version 88 var _ = errors.New 89 var _ = strings.Replace 90 var _ = context.Canceled 91 var _ = internaloption.WithDefaultEndpoint 92 var _ = internal.Version 93 94 const apiId = "firebasehosting:v1" 95 const apiName = "firebasehosting" 96 const apiVersion = "v1" 97 const basePath = "https://firebasehosting.googleapis.com/" 98 const basePathTemplate = "https://firebasehosting.UNIVERSE_DOMAIN/" 99 const mtlsBasePath = "https://firebasehosting.mtls.googleapis.com/" 100 101 // OAuth2 scopes used by this API. 102 const ( 103 // See, edit, configure, and delete your Google Cloud data and see the email 104 // address for your Google Account. 105 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 106 107 // View and administer all your Firebase data and settings 108 FirebaseScope = "https://www.googleapis.com/auth/firebase" 109 ) 110 111 // NewService creates a new Service. 112 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 113 scopesOption := internaloption.WithDefaultScopes( 114 "https://www.googleapis.com/auth/cloud-platform", 115 "https://www.googleapis.com/auth/firebase", 116 ) 117 // NOTE: prepend, so we don't override user-specified scopes. 118 opts = append([]option.ClientOption{scopesOption}, opts...) 119 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 120 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate)) 121 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 122 opts = append(opts, internaloption.EnableNewAuthLibrary()) 123 client, endpoint, err := htransport.NewClient(ctx, opts...) 124 if err != nil { 125 return nil, err 126 } 127 s, err := New(client) 128 if err != nil { 129 return nil, err 130 } 131 if endpoint != "" { 132 s.BasePath = endpoint 133 } 134 return s, nil 135 } 136 137 // New creates a new Service. It uses the provided http.Client for requests. 138 // 139 // Deprecated: please use NewService instead. 140 // To provide a custom HTTP client, use option.WithHTTPClient. 141 // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 142 func New(client *http.Client) (*Service, error) { 143 if client == nil { 144 return nil, errors.New("client is nil") 145 } 146 s := &Service{client: client, BasePath: basePath} 147 s.Operations = NewOperationsService(s) 148 s.Projects = NewProjectsService(s) 149 return s, nil 150 } 151 152 type Service struct { 153 client *http.Client 154 BasePath string // API endpoint base URL 155 UserAgent string // optional additional User-Agent fragment 156 157 Operations *OperationsService 158 159 Projects *ProjectsService 160 } 161 162 func (s *Service) userAgent() string { 163 if s.UserAgent == "" { 164 return googleapi.UserAgent 165 } 166 return googleapi.UserAgent + " " + s.UserAgent 167 } 168 169 func NewOperationsService(s *Service) *OperationsService { 170 rs := &OperationsService{s: s} 171 return rs 172 } 173 174 type OperationsService struct { 175 s *Service 176 } 177 178 func NewProjectsService(s *Service) *ProjectsService { 179 rs := &ProjectsService{s: s} 180 rs.Sites = NewProjectsSitesService(s) 181 return rs 182 } 183 184 type ProjectsService struct { 185 s *Service 186 187 Sites *ProjectsSitesService 188 } 189 190 func NewProjectsSitesService(s *Service) *ProjectsSitesService { 191 rs := &ProjectsSitesService{s: s} 192 rs.CustomDomains = NewProjectsSitesCustomDomainsService(s) 193 return rs 194 } 195 196 type ProjectsSitesService struct { 197 s *Service 198 199 CustomDomains *ProjectsSitesCustomDomainsService 200 } 201 202 func NewProjectsSitesCustomDomainsService(s *Service) *ProjectsSitesCustomDomainsService { 203 rs := &ProjectsSitesCustomDomainsService{s: s} 204 rs.Operations = NewProjectsSitesCustomDomainsOperationsService(s) 205 return rs 206 } 207 208 type ProjectsSitesCustomDomainsService struct { 209 s *Service 210 211 Operations *ProjectsSitesCustomDomainsOperationsService 212 } 213 214 func NewProjectsSitesCustomDomainsOperationsService(s *Service) *ProjectsSitesCustomDomainsOperationsService { 215 rs := &ProjectsSitesCustomDomainsOperationsService{s: s} 216 return rs 217 } 218 219 type ProjectsSitesCustomDomainsOperationsService struct { 220 s *Service 221 } 222 223 // CancelOperationRequest: The request message for Operations.CancelOperation. 224 type CancelOperationRequest struct { 225 } 226 227 // CertVerification: A set of ACME challenges you can use to allow Hosting to 228 // create an SSL certificate for your domain name before directing traffic to 229 // Hosting servers. Use either the DNS or HTTP challenge; it's not necessary to 230 // provide both. 231 type CertVerification struct { 232 // Dns: Output only. A `TXT` record to add to your DNS records that confirms 233 // your intent to let Hosting create an SSL cert for your domain name. 234 Dns *DnsUpdates `json:"dns,omitempty"` 235 // Http: Output only. A file to add to your existing, non-Hosting hosting 236 // service that confirms your intent to let Hosting create an SSL cert for your 237 // domain name. 238 Http *HttpUpdate `json:"http,omitempty"` 239 // ForceSendFields is a list of field names (e.g. "Dns") to unconditionally 240 // include in API requests. By default, fields with empty or default values are 241 // omitted from API requests. See 242 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 243 // details. 244 ForceSendFields []string `json:"-"` 245 // NullFields is a list of field names (e.g. "Dns") to include in API requests 246 // with the JSON null value. By default, fields with empty values are omitted 247 // from API requests. See 248 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 249 NullFields []string `json:"-"` 250 } 251 252 func (s *CertVerification) MarshalJSON() ([]byte, error) { 253 type NoMethod CertVerification 254 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 255 } 256 257 // CustomDomainMetadata: Metadata associated with a`CustomDomain` operation. 258 type CustomDomainMetadata struct { 259 // CertState: The `CertState` of the domain name's SSL certificate. 260 // 261 // Possible values: 262 // "CERT_STATE_UNSPECIFIED" - The certificate's state is unspecified. The 263 // message is invalid if this is unspecified. 264 // "CERT_PREPARING" - The initial state of every certificate, represents 265 // Hosting's intent to create a certificate, before requests to a Certificate 266 // Authority are made. 267 // "CERT_VALIDATING" - Hosting is validating whether a domain name's DNS 268 // records are in a state that allow certificate creation on its behalf. 269 // "CERT_PROPAGATING" - The certificate was recently created, and needs time 270 // to propagate in Hosting's CDN. 271 // "CERT_ACTIVE" - The certificate is active, providing secure connections 272 // for the domain names it represents. 273 // "CERT_EXPIRING_SOON" - The certificate is expiring, all domain names on it 274 // will be given new certificates. 275 // "CERT_EXPIRED" - The certificate has expired. Hosting can no longer serve 276 // secure content on your domain name. 277 CertState string `json:"certState,omitempty"` 278 // HostState: The `HostState` of the domain name this `CustomDomain` refers to. 279 // 280 // Possible values: 281 // "HOST_STATE_UNSPECIFIED" - Your custom domain's host state is unspecified. 282 // The message is invalid if this is unspecified. 283 // "HOST_UNHOSTED" - Your custom domain's domain name isn't associated with 284 // any IP addresses. 285 // "HOST_UNREACHABLE" - Your custom domain's domain name can't be reached. 286 // Hosting services' DNS queries to find your domain name's IP addresses 287 // resulted in errors. See your `CustomDomain` object's `issues` field for more 288 // details. 289 // "HOST_MISMATCH" - Your custom domain's domain name has IP addresses that 290 // don't ultimately resolve to Hosting. 291 // "HOST_CONFLICT" - Your custom domain's domain name has IP addresses that 292 // resolve to both Hosting and other services. To ensure consistent results, 293 // remove `A` and `AAAA` records related to non-Hosting services. 294 // "HOST_ACTIVE" - All requests against your custom domain's domain name are 295 // served by Hosting. If the custom domain's `OwnershipState` is also `ACTIVE`, 296 // Hosting serves your Hosting site's content on the domain name. 297 HostState string `json:"hostState,omitempty"` 298 // Issues: A list of issues that are currently preventing Hosting from 299 // completing the operation. These are generally DNS-related issues that 300 // Hosting encounters when querying a domain name's records or attempting to 301 // mint an SSL certificate. 302 Issues []*Status `json:"issues,omitempty"` 303 // LiveMigrationSteps: A set of DNS record updates and ACME challenges that 304 // allow you to transition domain names to Firebase Hosting with zero downtime. 305 // These updates allow Hosting to create an SSL certificate and establish 306 // ownership for your custom domain before Hosting begins serving traffic on 307 // it. If your domain name is already in active use with another provider, add 308 // one of the challenges and make the recommended DNS updates. After adding 309 // challenges and adjusting DNS records as necessary, wait for the 310 // `ownershipState` to be `OWNERSHIP_ACTIVE` and the `certState` to be 311 // `CERT_ACTIVE` before sending traffic to Hosting. 312 LiveMigrationSteps []*LiveMigrationStep `json:"liveMigrationSteps,omitempty"` 313 // OwnershipState: The `OwnershipState` of the domain name this `CustomDomain` 314 // refers to. 315 // 316 // Possible values: 317 // "OWNERSHIP_STATE_UNSPECIFIED" - Your custom domain's ownership state is 318 // unspecified. This should never happen. 319 // "OWNERSHIP_MISSING" - Your custom domain's domain name has no 320 // Hosting-related ownership records; no Firebase project has permission to act 321 // on the domain name's behalf. 322 // "OWNERSHIP_UNREACHABLE" - Your custom domain's domain name can't be 323 // reached. Hosting services' DNS queries to find your domain name's ownership 324 // records resulted in errors. See your `CustomDomain` object's `issues` field 325 // for more details. 326 // "OWNERSHIP_MISMATCH" - Your custom domain's domain name is owned by 327 // another Firebase project. Remove the conflicting `TXT` records and replace 328 // them with project-specific records for your current Firebase project. 329 // "OWNERSHIP_CONFLICT" - Your custom domain's domain name has conflicting 330 // `TXT` records that indicate ownership by both your current Firebase project 331 // and another project. Remove the other project's ownership records to grant 332 // the current project ownership. 333 // "OWNERSHIP_PENDING" - Your custom domain's DNS records are configured 334 // correctly. Hosting will transfer ownership of your domain to this 335 // `CustomDomain` within 24 hours. 336 // "OWNERSHIP_ACTIVE" - Your custom domain's domain name has `TXT` records 337 // that grant its project permission to act on its behalf. 338 OwnershipState string `json:"ownershipState,omitempty"` 339 // QuickSetupUpdates: A set of DNS record updates that allow Hosting to serve 340 // secure content on your domain name. The record type determines the update's 341 // purpose: - `A` and `AAAA`: Updates your domain name's IP addresses so that 342 // they direct traffic to Hosting servers. - `TXT`: Updates ownership 343 // permissions on your domain name, letting Hosting know that your custom 344 // domain's project has permission to perform actions for that domain name. - 345 // `CAA`: Updates your domain name's list of authorized Certificate Authorities 346 // (CAs). Only present if you have existing `CAA` records that prohibit 347 // Hosting's CA from minting certs for your domain name. These updates include 348 // all DNS changes you'll need to get started with Hosting, but, if made all at 349 // once, can result in a brief period of downtime for your domain name--while 350 // Hosting creates and uploads an SSL cert, for example. If you'd like to add 351 // your domain name to Hosting without downtime, complete the 352 // `liveMigrationSteps` first, before making the remaining updates in this 353 // field. 354 QuickSetupUpdates *DnsUpdates `json:"quickSetupUpdates,omitempty"` 355 // ForceSendFields is a list of field names (e.g. "CertState") to 356 // unconditionally include in API requests. By default, fields with empty or 357 // default values are omitted from API requests. See 358 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 359 // details. 360 ForceSendFields []string `json:"-"` 361 // NullFields is a list of field names (e.g. "CertState") to include in API 362 // requests with the JSON null value. By default, fields with empty values are 363 // omitted from API requests. See 364 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 365 NullFields []string `json:"-"` 366 } 367 368 func (s *CustomDomainMetadata) MarshalJSON() ([]byte, error) { 369 type NoMethod CustomDomainMetadata 370 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 371 } 372 373 // DnsRecord: DNS records are resource records that define how systems and 374 // services should behave when handling requests for a domain name. For 375 // example, when you add `A` records to your domain name's DNS records, you're 376 // informing other systems (such as your users' web browsers) to contact those 377 // IPv4 addresses to retrieve resources relevant to your domain name (such as 378 // your Hosting site files). 379 type DnsRecord struct { 380 // DomainName: Output only. The domain name the record pertains to, e.g. 381 // `foo.bar.com.`. 382 DomainName string `json:"domainName,omitempty"` 383 // Rdata: Output only. The data of the record. The meaning of the value depends 384 // on record type: - A and AAAA: IP addresses for the domain name. - CNAME: 385 // Another domain to check for records. - TXT: Arbitrary text strings 386 // associated with the domain name. Hosting uses TXT records to determine which 387 // Firebase projects have permission to act on the domain name's behalf. - CAA: 388 // The record's flags, tag, and value, e.g. `0 issue "pki.goog". 389 Rdata string `json:"rdata,omitempty"` 390 // RequiredAction: Output only. An enum that indicates the a required action 391 // for this record. 392 // 393 // Possible values: 394 // "NONE" - No action necessary. 395 // "ADD" - Add this record to your DNS records. 396 // "REMOVE" - Remove this record from your DNS records. 397 RequiredAction string `json:"requiredAction,omitempty"` 398 // Type: Output only. The record's type, which determines what data the record 399 // contains. 400 // 401 // Possible values: 402 // "TYPE_UNSPECIFIED" - The record's type is unspecified. The message is 403 // invalid if this is unspecified. 404 // "A" - An `A` record, as defined in [RFC 405 // 1035](https://tools.ietf.org/html/rfc1035). A records determine which IPv4 406 // addresses a domain name directs traffic towards. 407 // "CNAME" - A `CNAME` record, as defined in [RFC 408 // 1035](https://tools.ietf.org/html/rfc1035). `CNAME` or Canonical Name 409 // records map a domain name to a different, canonical domain name. If a 410 // `CNAME` record is present, it should be the only record on the domain name. 411 // "TXT" - A `TXT` record, as defined in [RFC 412 // 1035](https://tools.ietf.org/html/rfc1035). `TXT` records hold arbitrary 413 // text data on a domain name. Hosting uses `TXT` records to establish which 414 // Firebase Project has permission to act on a domain name. 415 // "AAAA" - An AAAA record, as defined in [RFC 416 // 3596](https://tools.ietf.org/html/rfc3596) AAAA records determine which IPv6 417 // addresses a domain name directs traffic towards. 418 // "CAA" - A CAA record, as defined in [RFC 419 // 6844](https://tools.ietf.org/html/rfc6844). CAA, or Certificate Authority 420 // Authorization, records determine which Certificate Authorities (SSL 421 // certificate minting organizations) are authorized to mint a certificate for 422 // the domain name. Firebase Hosting uses `pki.goog` as its primary CA. CAA 423 // records cascade. A CAA record on `foo.com` also applies to `bar.foo.com` 424 // unless `bar.foo.com` has its own set of CAA records. CAA records are 425 // optional. If a domain name and its parents have no CAA records, all CAs are 426 // authorized to mint certificates on its behalf. In general, Hosting only asks 427 // you to modify CAA records when doing so is required to unblock SSL cert 428 // creation. 429 Type string `json:"type,omitempty"` 430 // ForceSendFields is a list of field names (e.g. "DomainName") to 431 // unconditionally include in API requests. By default, fields with empty or 432 // default values are omitted from API requests. See 433 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 434 // details. 435 ForceSendFields []string `json:"-"` 436 // NullFields is a list of field names (e.g. "DomainName") to include in API 437 // requests with the JSON null value. By default, fields with empty values are 438 // omitted from API requests. See 439 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 440 NullFields []string `json:"-"` 441 } 442 443 func (s *DnsRecord) MarshalJSON() ([]byte, error) { 444 type NoMethod DnsRecord 445 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 446 } 447 448 // DnsRecordSet: A set of DNS records relevant to the setup and maintenance of 449 // a custom domain in Firebase Hosting. 450 type DnsRecordSet struct { 451 // CheckError: Output only. An error Hosting services encountered when querying 452 // your domain name's DNS records. Note: Hosting ignores `NXDOMAIN` errors, as 453 // those generally just mean that a domain name hasn't been set up yet. 454 CheckError *Status `json:"checkError,omitempty"` 455 // DomainName: Output only. The domain name the record set pertains to. 456 DomainName string `json:"domainName,omitempty"` 457 // Records: Output only. Records on the domain. 458 Records []*DnsRecord `json:"records,omitempty"` 459 // ForceSendFields is a list of field names (e.g. "CheckError") to 460 // unconditionally include in API requests. By default, fields with empty or 461 // default values are omitted from API requests. See 462 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 463 // details. 464 ForceSendFields []string `json:"-"` 465 // NullFields is a list of field names (e.g. "CheckError") to include in API 466 // requests with the JSON null value. By default, fields with empty values are 467 // omitted from API requests. See 468 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 469 NullFields []string `json:"-"` 470 } 471 472 func (s *DnsRecordSet) MarshalJSON() ([]byte, error) { 473 type NoMethod DnsRecordSet 474 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 475 } 476 477 // DnsUpdates: A set of DNS record updates that you should make to allow 478 // Hosting to serve secure content in response to requests against your domain 479 // name. These updates present the current state of your domain name's DNS 480 // records when Hosting last queried them, and the desired set of records that 481 // Hosting needs to see before your custom domain can be fully active. 482 type DnsUpdates struct { 483 // CheckTime: The last time Hosting checked your custom domain's DNS records. 484 CheckTime string `json:"checkTime,omitempty"` 485 // Desired: The set of DNS records Hosting needs to serve secure content on the 486 // domain. 487 Desired []*DnsRecordSet `json:"desired,omitempty"` 488 // Discovered: The set of DNS records Hosting discovered when inspecting a 489 // domain. 490 Discovered []*DnsRecordSet `json:"discovered,omitempty"` 491 // ForceSendFields is a list of field names (e.g. "CheckTime") to 492 // unconditionally include in API requests. By default, fields with empty or 493 // default values are omitted from API requests. See 494 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 495 // details. 496 ForceSendFields []string `json:"-"` 497 // NullFields is a list of field names (e.g. "CheckTime") to include in API 498 // requests with the JSON null value. By default, fields with empty values are 499 // omitted from API requests. See 500 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 501 NullFields []string `json:"-"` 502 } 503 504 func (s *DnsUpdates) MarshalJSON() ([]byte, error) { 505 type NoMethod DnsUpdates 506 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 507 } 508 509 // Empty: A generic empty message that you can re-use to avoid defining 510 // duplicated empty messages in your APIs. A typical example is to use it as 511 // the request or the response type of an API method. For instance: service Foo 512 // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } 513 type Empty struct { 514 // ServerResponse contains the HTTP response code and headers from the server. 515 googleapi.ServerResponse `json:"-"` 516 } 517 518 // HttpUpdate: A file you can add to your existing, non-Hosting hosting service 519 // that confirms your intent to allow Hosting's Certificate Authorities to 520 // create an SSL certificate for your domain. 521 type HttpUpdate struct { 522 // CheckError: Output only. An error encountered during the last contents 523 // check. If null, the check completed successfully. 524 CheckError *Status `json:"checkError,omitempty"` 525 // Desired: Output only. A text string to serve at the path. 526 Desired string `json:"desired,omitempty"` 527 // Discovered: Output only. Whether Hosting was able to find the required file 528 // contents on the specified path during its last check. 529 Discovered string `json:"discovered,omitempty"` 530 // LastCheckTime: Output only. The last time Hosting systems checked for the 531 // file contents. 532 LastCheckTime string `json:"lastCheckTime,omitempty"` 533 // Path: Output only. The path to the file. 534 Path string `json:"path,omitempty"` 535 // ForceSendFields is a list of field names (e.g. "CheckError") to 536 // unconditionally include in API requests. By default, fields with empty or 537 // default values are omitted from API requests. See 538 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 539 // details. 540 ForceSendFields []string `json:"-"` 541 // NullFields is a list of field names (e.g. "CheckError") to include in API 542 // requests with the JSON null value. By default, fields with empty values are 543 // omitted from API requests. See 544 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 545 NullFields []string `json:"-"` 546 } 547 548 func (s *HttpUpdate) MarshalJSON() ([]byte, error) { 549 type NoMethod HttpUpdate 550 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 551 } 552 553 // ListOperationsResponse: The response message for Operations.ListOperations. 554 type ListOperationsResponse struct { 555 // NextPageToken: The standard List next-page token. 556 NextPageToken string `json:"nextPageToken,omitempty"` 557 // Operations: A list of operations that matches the specified filter in the 558 // request. 559 Operations []*Operation `json:"operations,omitempty"` 560 561 // ServerResponse contains the HTTP response code and headers from the server. 562 googleapi.ServerResponse `json:"-"` 563 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 564 // unconditionally include in API requests. By default, fields with empty or 565 // default values are omitted from API requests. See 566 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 567 // details. 568 ForceSendFields []string `json:"-"` 569 // NullFields is a list of field names (e.g. "NextPageToken") to include in API 570 // requests with the JSON null value. By default, fields with empty values are 571 // omitted from API requests. See 572 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 573 NullFields []string `json:"-"` 574 } 575 576 func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) { 577 type NoMethod ListOperationsResponse 578 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 579 } 580 581 // LiveMigrationStep: A set of updates including ACME challenges and DNS 582 // records that allow Hosting to create an SSL certificate and establish 583 // project ownership for your domain name before you direct traffic to Hosting 584 // servers. Use these updates to facilitate zero downtime migrations to Hosting 585 // from other services. After you've made the recommended updates, check your 586 // custom domain's `ownershipState` and `certState`. To avoid downtime, they 587 // should be `OWNERSHIP_ACTIVE` and `CERT_ACTIVE`, respectively, before you 588 // update your `A` and `AAAA` records. 589 type LiveMigrationStep struct { 590 // CertVerification: Output only. A pair of ACME challenges that Hosting's 591 // Certificate Authority (CA) can use to create an SSL cert for your domain 592 // name. Use either the DNS or HTTP challenge; it's not necessary to provide 593 // both. 594 CertVerification *CertVerification `json:"certVerification,omitempty"` 595 // DnsUpdates: Output only. DNS updates to facilitate your domain's 596 // zero-downtime migration to Hosting. 597 DnsUpdates *DnsUpdates `json:"dnsUpdates,omitempty"` 598 // Issues: Output only. Issues that prevent the current step from completing. 599 Issues []*Status `json:"issues,omitempty"` 600 // State: Output only. The state of the live migration step, indicates whether 601 // you should work to complete the step now, in the future, or have already 602 // completed it. 603 // 604 // Possible values: 605 // "STATE_UNSPECIFIED" - The step's state is unspecified. The message is 606 // invalid if this is unspecified. 607 // "PREPARING" - Hosting doesn't have enough information to construct the 608 // step yet. Complete any prior steps and/or resolve this step's issue to 609 // proceed. 610 // "PENDING" - The step's state is pending. Complete prior steps before 611 // working on a `PENDING` step. 612 // "INCOMPLETE" - The step is incomplete. You should complete any 613 // `certVerification` or `dnsUpdates` changes to complete it. 614 // "PROCESSING" - You've done your part to update records and present 615 // challenges as necessary. Hosting is now completing background processes to 616 // complete the step, e.g. minting an SSL cert for your domain name. 617 // "COMPLETE" - The step is complete. You've already made the necessary 618 // changes to your domain and/or prior hosting service to advance to the next 619 // step. Once all steps are complete, Hosting is ready to serve secure content 620 // on your domain. 621 State string `json:"state,omitempty"` 622 // ForceSendFields is a list of field names (e.g. "CertVerification") to 623 // unconditionally include in API requests. By default, fields with empty or 624 // default values are omitted from API requests. See 625 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 626 // details. 627 ForceSendFields []string `json:"-"` 628 // NullFields is a list of field names (e.g. "CertVerification") to include in 629 // API requests with the JSON null value. By default, fields with empty values 630 // are omitted from API requests. See 631 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 632 NullFields []string `json:"-"` 633 } 634 635 func (s *LiveMigrationStep) MarshalJSON() ([]byte, error) { 636 type NoMethod LiveMigrationStep 637 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 638 } 639 640 // Operation: This resource represents a long-running operation that is the 641 // result of a network API call. 642 type Operation struct { 643 // Done: If the value is `false`, it means the operation is still in progress. 644 // If `true`, the operation is completed, and either `error` or `response` is 645 // available. 646 Done bool `json:"done,omitempty"` 647 // Error: The error result of the operation in case of failure or cancellation. 648 Error *Status `json:"error,omitempty"` 649 // Metadata: Service-specific metadata associated with the operation. It 650 // typically contains progress information and common metadata such as create 651 // time. Some services might not provide such metadata. Any method that returns 652 // a long-running operation should document the metadata type, if any. 653 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 654 // Name: The server-assigned name, which is only unique within the same service 655 // that originally returns it. If you use the default HTTP mapping, the `name` 656 // should be a resource name ending with `operations/{unique_id}`. 657 Name string `json:"name,omitempty"` 658 // Response: The normal, successful response of the operation. If the original 659 // method returns no data on success, such as `Delete`, the response is 660 // `google.protobuf.Empty`. If the original method is standard 661 // `Get`/`Create`/`Update`, the response should be the resource. For other 662 // methods, the response should have the type `XxxResponse`, where `Xxx` is the 663 // original method name. For example, if the original method name is 664 // `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. 665 Response googleapi.RawMessage `json:"response,omitempty"` 666 // ForceSendFields is a list of field names (e.g. "Done") to unconditionally 667 // include in API requests. By default, fields with empty or default values are 668 // omitted from API requests. See 669 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 670 // details. 671 ForceSendFields []string `json:"-"` 672 // NullFields is a list of field names (e.g. "Done") to include in API requests 673 // with the JSON null value. By default, fields with empty values are omitted 674 // from API requests. See 675 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 676 NullFields []string `json:"-"` 677 } 678 679 func (s *Operation) MarshalJSON() ([]byte, error) { 680 type NoMethod Operation 681 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 682 } 683 684 // Status: The `Status` type defines a logical error model that is suitable for 685 // different programming environments, including REST APIs and RPC APIs. It is 686 // used by gRPC (https://github.com/grpc). Each `Status` message contains three 687 // pieces of data: error code, error message, and error details. You can find 688 // out more about this error model and how to work with it in the API Design 689 // Guide (https://cloud.google.com/apis/design/errors). 690 type Status struct { 691 // Code: The status code, which should be an enum value of google.rpc.Code. 692 Code int64 `json:"code,omitempty"` 693 // Details: A list of messages that carry the error details. There is a common 694 // set of message types for APIs to use. 695 Details []googleapi.RawMessage `json:"details,omitempty"` 696 // Message: A developer-facing error message, which should be in English. Any 697 // user-facing error message should be localized and sent in the 698 // google.rpc.Status.details field, or localized by the client. 699 Message string `json:"message,omitempty"` 700 // ForceSendFields is a list of field names (e.g. "Code") to unconditionally 701 // include in API requests. By default, fields with empty or default values are 702 // omitted from API requests. See 703 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 704 // details. 705 ForceSendFields []string `json:"-"` 706 // NullFields is a list of field names (e.g. "Code") to include in API requests 707 // with the JSON null value. By default, fields with empty values are omitted 708 // from API requests. See 709 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 710 NullFields []string `json:"-"` 711 } 712 713 func (s *Status) MarshalJSON() ([]byte, error) { 714 type NoMethod Status 715 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 716 } 717 718 type OperationsCancelCall struct { 719 s *Service 720 name string 721 canceloperationrequest *CancelOperationRequest 722 urlParams_ gensupport.URLParams 723 ctx_ context.Context 724 header_ http.Header 725 } 726 727 // Cancel: Starts asynchronous cancellation on a long-running operation. The 728 // server makes a best effort to cancel the operation, but success is not 729 // guaranteed. If the server doesn't support this method, it returns 730 // `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or 731 // other methods to check whether the cancellation succeeded or whether the 732 // operation completed despite cancellation. On successful cancellation, the 733 // operation is not deleted; instead, it becomes an operation with an 734 // Operation.error value with a google.rpc.Status.code of 1, corresponding to 735 // `Code.CANCELLED`. 736 // 737 // - name: The name of the operation resource to be cancelled. 738 func (r *OperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *OperationsCancelCall { 739 c := &OperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} 740 c.name = name 741 c.canceloperationrequest = canceloperationrequest 742 return c 743 } 744 745 // Fields allows partial responses to be retrieved. See 746 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 747 // details. 748 func (c *OperationsCancelCall) Fields(s ...googleapi.Field) *OperationsCancelCall { 749 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 750 return c 751 } 752 753 // Context sets the context to be used in this call's Do method. 754 func (c *OperationsCancelCall) Context(ctx context.Context) *OperationsCancelCall { 755 c.ctx_ = ctx 756 return c 757 } 758 759 // Header returns a http.Header that can be modified by the caller to add 760 // headers to the request. 761 func (c *OperationsCancelCall) Header() http.Header { 762 if c.header_ == nil { 763 c.header_ = make(http.Header) 764 } 765 return c.header_ 766 } 767 768 func (c *OperationsCancelCall) doRequest(alt string) (*http.Response, error) { 769 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 770 var body io.Reader = nil 771 body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) 772 if err != nil { 773 return nil, err 774 } 775 c.urlParams_.Set("alt", alt) 776 c.urlParams_.Set("prettyPrint", "false") 777 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") 778 urls += "?" + c.urlParams_.Encode() 779 req, err := http.NewRequest("POST", urls, body) 780 if err != nil { 781 return nil, err 782 } 783 req.Header = reqHeaders 784 googleapi.Expand(req.URL, map[string]string{ 785 "name": c.name, 786 }) 787 return gensupport.SendRequest(c.ctx_, c.s.client, req) 788 } 789 790 // Do executes the "firebasehosting.operations.cancel" call. 791 // Any non-2xx status code is an error. Response headers are in either 792 // *Empty.ServerResponse.Header or (if a response was returned at all) in 793 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 794 // whether the returned error was because http.StatusNotModified was returned. 795 func (c *OperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 796 gensupport.SetOptions(c.urlParams_, opts...) 797 res, err := c.doRequest("json") 798 if res != nil && res.StatusCode == http.StatusNotModified { 799 if res.Body != nil { 800 res.Body.Close() 801 } 802 return nil, gensupport.WrapError(&googleapi.Error{ 803 Code: res.StatusCode, 804 Header: res.Header, 805 }) 806 } 807 if err != nil { 808 return nil, err 809 } 810 defer googleapi.CloseBody(res) 811 if err := googleapi.CheckResponse(res); err != nil { 812 return nil, gensupport.WrapError(err) 813 } 814 ret := &Empty{ 815 ServerResponse: googleapi.ServerResponse{ 816 Header: res.Header, 817 HTTPStatusCode: res.StatusCode, 818 }, 819 } 820 target := &ret 821 if err := gensupport.DecodeResponse(target, res); err != nil { 822 return nil, err 823 } 824 return ret, nil 825 } 826 827 type OperationsDeleteCall struct { 828 s *Service 829 name string 830 urlParams_ gensupport.URLParams 831 ctx_ context.Context 832 header_ http.Header 833 } 834 835 // Delete: Deletes a long-running operation. This method indicates that the 836 // client is no longer interested in the operation result. It does not cancel 837 // the operation. If the server doesn't support this method, it returns 838 // `google.rpc.Code.UNIMPLEMENTED`. 839 // 840 // - name: The name of the operation resource to be deleted. 841 func (r *OperationsService) Delete(name string) *OperationsDeleteCall { 842 c := &OperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 843 c.name = name 844 return c 845 } 846 847 // Fields allows partial responses to be retrieved. See 848 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 849 // details. 850 func (c *OperationsDeleteCall) Fields(s ...googleapi.Field) *OperationsDeleteCall { 851 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 852 return c 853 } 854 855 // Context sets the context to be used in this call's Do method. 856 func (c *OperationsDeleteCall) Context(ctx context.Context) *OperationsDeleteCall { 857 c.ctx_ = ctx 858 return c 859 } 860 861 // Header returns a http.Header that can be modified by the caller to add 862 // headers to the request. 863 func (c *OperationsDeleteCall) Header() http.Header { 864 if c.header_ == nil { 865 c.header_ = make(http.Header) 866 } 867 return c.header_ 868 } 869 870 func (c *OperationsDeleteCall) doRequest(alt string) (*http.Response, error) { 871 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 872 var body io.Reader = nil 873 c.urlParams_.Set("alt", alt) 874 c.urlParams_.Set("prettyPrint", "false") 875 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 876 urls += "?" + c.urlParams_.Encode() 877 req, err := http.NewRequest("DELETE", urls, body) 878 if err != nil { 879 return nil, err 880 } 881 req.Header = reqHeaders 882 googleapi.Expand(req.URL, map[string]string{ 883 "name": c.name, 884 }) 885 return gensupport.SendRequest(c.ctx_, c.s.client, req) 886 } 887 888 // Do executes the "firebasehosting.operations.delete" call. 889 // Any non-2xx status code is an error. Response headers are in either 890 // *Empty.ServerResponse.Header or (if a response was returned at all) in 891 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 892 // whether the returned error was because http.StatusNotModified was returned. 893 func (c *OperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 894 gensupport.SetOptions(c.urlParams_, opts...) 895 res, err := c.doRequest("json") 896 if res != nil && res.StatusCode == http.StatusNotModified { 897 if res.Body != nil { 898 res.Body.Close() 899 } 900 return nil, gensupport.WrapError(&googleapi.Error{ 901 Code: res.StatusCode, 902 Header: res.Header, 903 }) 904 } 905 if err != nil { 906 return nil, err 907 } 908 defer googleapi.CloseBody(res) 909 if err := googleapi.CheckResponse(res); err != nil { 910 return nil, gensupport.WrapError(err) 911 } 912 ret := &Empty{ 913 ServerResponse: googleapi.ServerResponse{ 914 Header: res.Header, 915 HTTPStatusCode: res.StatusCode, 916 }, 917 } 918 target := &ret 919 if err := gensupport.DecodeResponse(target, res); err != nil { 920 return nil, err 921 } 922 return ret, nil 923 } 924 925 type OperationsListCall struct { 926 s *Service 927 name string 928 urlParams_ gensupport.URLParams 929 ifNoneMatch_ string 930 ctx_ context.Context 931 header_ http.Header 932 } 933 934 // List: Lists operations that match the specified filter in the request. If 935 // the server doesn't support this method, it returns `UNIMPLEMENTED`. 936 // 937 // - name: The name of the operation's parent resource. 938 func (r *OperationsService) List(name string) *OperationsListCall { 939 c := &OperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 940 c.name = name 941 return c 942 } 943 944 // Filter sets the optional parameter "filter": The standard list filter. 945 func (c *OperationsListCall) Filter(filter string) *OperationsListCall { 946 c.urlParams_.Set("filter", filter) 947 return c 948 } 949 950 // PageSize sets the optional parameter "pageSize": The standard list page 951 // size. 952 func (c *OperationsListCall) PageSize(pageSize int64) *OperationsListCall { 953 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 954 return c 955 } 956 957 // PageToken sets the optional parameter "pageToken": The standard list page 958 // token. 959 func (c *OperationsListCall) PageToken(pageToken string) *OperationsListCall { 960 c.urlParams_.Set("pageToken", pageToken) 961 return c 962 } 963 964 // Fields allows partial responses to be retrieved. See 965 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 966 // details. 967 func (c *OperationsListCall) Fields(s ...googleapi.Field) *OperationsListCall { 968 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 969 return c 970 } 971 972 // IfNoneMatch sets an optional parameter which makes the operation fail if the 973 // object's ETag matches the given value. This is useful for getting updates 974 // only after the object has changed since the last request. 975 func (c *OperationsListCall) IfNoneMatch(entityTag string) *OperationsListCall { 976 c.ifNoneMatch_ = entityTag 977 return c 978 } 979 980 // Context sets the context to be used in this call's Do method. 981 func (c *OperationsListCall) Context(ctx context.Context) *OperationsListCall { 982 c.ctx_ = ctx 983 return c 984 } 985 986 // Header returns a http.Header that can be modified by the caller to add 987 // headers to the request. 988 func (c *OperationsListCall) Header() http.Header { 989 if c.header_ == nil { 990 c.header_ = make(http.Header) 991 } 992 return c.header_ 993 } 994 995 func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) { 996 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 997 if c.ifNoneMatch_ != "" { 998 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 999 } 1000 var body io.Reader = nil 1001 c.urlParams_.Set("alt", alt) 1002 c.urlParams_.Set("prettyPrint", "false") 1003 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 1004 urls += "?" + c.urlParams_.Encode() 1005 req, err := http.NewRequest("GET", urls, body) 1006 if err != nil { 1007 return nil, err 1008 } 1009 req.Header = reqHeaders 1010 googleapi.Expand(req.URL, map[string]string{ 1011 "name": c.name, 1012 }) 1013 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1014 } 1015 1016 // Do executes the "firebasehosting.operations.list" call. 1017 // Any non-2xx status code is an error. Response headers are in either 1018 // *ListOperationsResponse.ServerResponse.Header or (if a response was returned 1019 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 1020 // check whether the returned error was because http.StatusNotModified was 1021 // returned. 1022 func (c *OperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) { 1023 gensupport.SetOptions(c.urlParams_, opts...) 1024 res, err := c.doRequest("json") 1025 if res != nil && res.StatusCode == http.StatusNotModified { 1026 if res.Body != nil { 1027 res.Body.Close() 1028 } 1029 return nil, gensupport.WrapError(&googleapi.Error{ 1030 Code: res.StatusCode, 1031 Header: res.Header, 1032 }) 1033 } 1034 if err != nil { 1035 return nil, err 1036 } 1037 defer googleapi.CloseBody(res) 1038 if err := googleapi.CheckResponse(res); err != nil { 1039 return nil, gensupport.WrapError(err) 1040 } 1041 ret := &ListOperationsResponse{ 1042 ServerResponse: googleapi.ServerResponse{ 1043 Header: res.Header, 1044 HTTPStatusCode: res.StatusCode, 1045 }, 1046 } 1047 target := &ret 1048 if err := gensupport.DecodeResponse(target, res); err != nil { 1049 return nil, err 1050 } 1051 return ret, nil 1052 } 1053 1054 // Pages invokes f for each page of results. 1055 // A non-nil error returned from f will halt the iteration. 1056 // The provided context supersedes any context provided to the Context method. 1057 func (c *OperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error { 1058 c.ctx_ = ctx 1059 defer c.PageToken(c.urlParams_.Get("pageToken")) 1060 for { 1061 x, err := c.Do() 1062 if err != nil { 1063 return err 1064 } 1065 if err := f(x); err != nil { 1066 return err 1067 } 1068 if x.NextPageToken == "" { 1069 return nil 1070 } 1071 c.PageToken(x.NextPageToken) 1072 } 1073 } 1074 1075 type ProjectsSitesCustomDomainsOperationsCancelCall struct { 1076 s *Service 1077 name string 1078 canceloperationrequest *CancelOperationRequest 1079 urlParams_ gensupport.URLParams 1080 ctx_ context.Context 1081 header_ http.Header 1082 } 1083 1084 // Cancel: CancelOperation is a part of the google.longrunning.Operations 1085 // interface, but is not implemented for CustomDomain resources. 1086 // 1087 // - name: The name of the operation resource to be cancelled. 1088 func (r *ProjectsSitesCustomDomainsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *ProjectsSitesCustomDomainsOperationsCancelCall { 1089 c := &ProjectsSitesCustomDomainsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1090 c.name = name 1091 c.canceloperationrequest = canceloperationrequest 1092 return c 1093 } 1094 1095 // Fields allows partial responses to be retrieved. See 1096 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 1097 // details. 1098 func (c *ProjectsSitesCustomDomainsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsSitesCustomDomainsOperationsCancelCall { 1099 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1100 return c 1101 } 1102 1103 // Context sets the context to be used in this call's Do method. 1104 func (c *ProjectsSitesCustomDomainsOperationsCancelCall) Context(ctx context.Context) *ProjectsSitesCustomDomainsOperationsCancelCall { 1105 c.ctx_ = ctx 1106 return c 1107 } 1108 1109 // Header returns a http.Header that can be modified by the caller to add 1110 // headers to the request. 1111 func (c *ProjectsSitesCustomDomainsOperationsCancelCall) Header() http.Header { 1112 if c.header_ == nil { 1113 c.header_ = make(http.Header) 1114 } 1115 return c.header_ 1116 } 1117 1118 func (c *ProjectsSitesCustomDomainsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { 1119 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 1120 var body io.Reader = nil 1121 body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) 1122 if err != nil { 1123 return nil, err 1124 } 1125 c.urlParams_.Set("alt", alt) 1126 c.urlParams_.Set("prettyPrint", "false") 1127 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") 1128 urls += "?" + c.urlParams_.Encode() 1129 req, err := http.NewRequest("POST", urls, body) 1130 if err != nil { 1131 return nil, err 1132 } 1133 req.Header = reqHeaders 1134 googleapi.Expand(req.URL, map[string]string{ 1135 "name": c.name, 1136 }) 1137 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1138 } 1139 1140 // Do executes the "firebasehosting.projects.sites.customDomains.operations.cancel" call. 1141 // Any non-2xx status code is an error. Response headers are in either 1142 // *Empty.ServerResponse.Header or (if a response was returned at all) in 1143 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 1144 // whether the returned error was because http.StatusNotModified was returned. 1145 func (c *ProjectsSitesCustomDomainsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 1146 gensupport.SetOptions(c.urlParams_, opts...) 1147 res, err := c.doRequest("json") 1148 if res != nil && res.StatusCode == http.StatusNotModified { 1149 if res.Body != nil { 1150 res.Body.Close() 1151 } 1152 return nil, gensupport.WrapError(&googleapi.Error{ 1153 Code: res.StatusCode, 1154 Header: res.Header, 1155 }) 1156 } 1157 if err != nil { 1158 return nil, err 1159 } 1160 defer googleapi.CloseBody(res) 1161 if err := googleapi.CheckResponse(res); err != nil { 1162 return nil, gensupport.WrapError(err) 1163 } 1164 ret := &Empty{ 1165 ServerResponse: googleapi.ServerResponse{ 1166 Header: res.Header, 1167 HTTPStatusCode: res.StatusCode, 1168 }, 1169 } 1170 target := &ret 1171 if err := gensupport.DecodeResponse(target, res); err != nil { 1172 return nil, err 1173 } 1174 return ret, nil 1175 } 1176 1177 type ProjectsSitesCustomDomainsOperationsDeleteCall struct { 1178 s *Service 1179 name string 1180 urlParams_ gensupport.URLParams 1181 ctx_ context.Context 1182 header_ http.Header 1183 } 1184 1185 // Delete: DeleteOperation is a part of the google.longrunning.Operations 1186 // interface, but is not implemented for CustomDomain resources. 1187 // 1188 // - name: The name of the operation resource to be deleted. 1189 func (r *ProjectsSitesCustomDomainsOperationsService) Delete(name string) *ProjectsSitesCustomDomainsOperationsDeleteCall { 1190 c := &ProjectsSitesCustomDomainsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1191 c.name = name 1192 return c 1193 } 1194 1195 // Fields allows partial responses to be retrieved. See 1196 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 1197 // details. 1198 func (c *ProjectsSitesCustomDomainsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsSitesCustomDomainsOperationsDeleteCall { 1199 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1200 return c 1201 } 1202 1203 // Context sets the context to be used in this call's Do method. 1204 func (c *ProjectsSitesCustomDomainsOperationsDeleteCall) Context(ctx context.Context) *ProjectsSitesCustomDomainsOperationsDeleteCall { 1205 c.ctx_ = ctx 1206 return c 1207 } 1208 1209 // Header returns a http.Header that can be modified by the caller to add 1210 // headers to the request. 1211 func (c *ProjectsSitesCustomDomainsOperationsDeleteCall) Header() http.Header { 1212 if c.header_ == nil { 1213 c.header_ = make(http.Header) 1214 } 1215 return c.header_ 1216 } 1217 1218 func (c *ProjectsSitesCustomDomainsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { 1219 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 1220 var body io.Reader = nil 1221 c.urlParams_.Set("alt", alt) 1222 c.urlParams_.Set("prettyPrint", "false") 1223 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 1224 urls += "?" + c.urlParams_.Encode() 1225 req, err := http.NewRequest("DELETE", urls, body) 1226 if err != nil { 1227 return nil, err 1228 } 1229 req.Header = reqHeaders 1230 googleapi.Expand(req.URL, map[string]string{ 1231 "name": c.name, 1232 }) 1233 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1234 } 1235 1236 // Do executes the "firebasehosting.projects.sites.customDomains.operations.delete" call. 1237 // Any non-2xx status code is an error. Response headers are in either 1238 // *Empty.ServerResponse.Header or (if a response was returned at all) in 1239 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 1240 // whether the returned error was because http.StatusNotModified was returned. 1241 func (c *ProjectsSitesCustomDomainsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 1242 gensupport.SetOptions(c.urlParams_, opts...) 1243 res, err := c.doRequest("json") 1244 if res != nil && res.StatusCode == http.StatusNotModified { 1245 if res.Body != nil { 1246 res.Body.Close() 1247 } 1248 return nil, gensupport.WrapError(&googleapi.Error{ 1249 Code: res.StatusCode, 1250 Header: res.Header, 1251 }) 1252 } 1253 if err != nil { 1254 return nil, err 1255 } 1256 defer googleapi.CloseBody(res) 1257 if err := googleapi.CheckResponse(res); err != nil { 1258 return nil, gensupport.WrapError(err) 1259 } 1260 ret := &Empty{ 1261 ServerResponse: googleapi.ServerResponse{ 1262 Header: res.Header, 1263 HTTPStatusCode: res.StatusCode, 1264 }, 1265 } 1266 target := &ret 1267 if err := gensupport.DecodeResponse(target, res); err != nil { 1268 return nil, err 1269 } 1270 return ret, nil 1271 } 1272