Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 

3486 Zeilen
118 KiB

  1. // Copyright 2019 Google LLC.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Code generated file. DO NOT EDIT.
  5. // Package firebasehosting provides access to the Firebase Hosting API.
  6. //
  7. // For product documentation, see: https://firebase.google.com/docs/hosting/
  8. //
  9. // Creating a client
  10. //
  11. // Usage example:
  12. //
  13. // import "google.golang.org/api/firebasehosting/v1beta1"
  14. // ...
  15. // ctx := context.Background()
  16. // firebasehostingService, err := firebasehosting.NewService(ctx)
  17. //
  18. // In this example, Google Application Default Credentials are used for authentication.
  19. //
  20. // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
  21. //
  22. // Other authentication options
  23. //
  24. // By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
  25. //
  26. // firebasehostingService, err := firebasehosting.NewService(ctx, option.WithScopes(firebasehosting.FirebaseReadonlyScope))
  27. //
  28. // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
  29. //
  30. // firebasehostingService, err := firebasehosting.NewService(ctx, option.WithAPIKey("AIza..."))
  31. //
  32. // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
  33. //
  34. // config := &oauth2.Config{...}
  35. // // ...
  36. // token, err := config.Exchange(ctx, ...)
  37. // firebasehostingService, err := firebasehosting.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
  38. //
  39. // See https://godoc.org/google.golang.org/api/option/ for details on options.
  40. package firebasehosting // import "google.golang.org/api/firebasehosting/v1beta1"
  41. import (
  42. "bytes"
  43. "context"
  44. "encoding/json"
  45. "errors"
  46. "fmt"
  47. "io"
  48. "net/http"
  49. "net/url"
  50. "strconv"
  51. "strings"
  52. gensupport "google.golang.org/api/gensupport"
  53. googleapi "google.golang.org/api/googleapi"
  54. option "google.golang.org/api/option"
  55. htransport "google.golang.org/api/transport/http"
  56. )
  57. // Always reference these packages, just in case the auto-generated code
  58. // below doesn't.
  59. var _ = bytes.NewBuffer
  60. var _ = strconv.Itoa
  61. var _ = fmt.Sprintf
  62. var _ = json.NewDecoder
  63. var _ = io.Copy
  64. var _ = url.Parse
  65. var _ = gensupport.MarshalJSON
  66. var _ = googleapi.Version
  67. var _ = errors.New
  68. var _ = strings.Replace
  69. var _ = context.Canceled
  70. const apiId = "firebasehosting:v1beta1"
  71. const apiName = "firebasehosting"
  72. const apiVersion = "v1beta1"
  73. const basePath = "https://firebasehosting.googleapis.com/"
  74. // OAuth2 scopes used by this API.
  75. const (
  76. // View and manage your data across Google Cloud Platform services
  77. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  78. // View your data across Google Cloud Platform services
  79. CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only"
  80. // View and administer all your Firebase data and settings
  81. FirebaseScope = "https://www.googleapis.com/auth/firebase"
  82. // View all your Firebase data and settings
  83. FirebaseReadonlyScope = "https://www.googleapis.com/auth/firebase.readonly"
  84. )
  85. // NewService creates a new Service.
  86. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
  87. scopesOption := option.WithScopes(
  88. "https://www.googleapis.com/auth/cloud-platform",
  89. "https://www.googleapis.com/auth/cloud-platform.read-only",
  90. "https://www.googleapis.com/auth/firebase",
  91. "https://www.googleapis.com/auth/firebase.readonly",
  92. )
  93. // NOTE: prepend, so we don't override user-specified scopes.
  94. opts = append([]option.ClientOption{scopesOption}, opts...)
  95. client, endpoint, err := htransport.NewClient(ctx, opts...)
  96. if err != nil {
  97. return nil, err
  98. }
  99. s, err := New(client)
  100. if err != nil {
  101. return nil, err
  102. }
  103. if endpoint != "" {
  104. s.BasePath = endpoint
  105. }
  106. return s, nil
  107. }
  108. // New creates a new Service. It uses the provided http.Client for requests.
  109. //
  110. // Deprecated: please use NewService instead.
  111. // To provide a custom HTTP client, use option.WithHTTPClient.
  112. // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
  113. func New(client *http.Client) (*Service, error) {
  114. if client == nil {
  115. return nil, errors.New("client is nil")
  116. }
  117. s := &Service{client: client, BasePath: basePath}
  118. s.Sites = NewSitesService(s)
  119. return s, nil
  120. }
  121. type Service struct {
  122. client *http.Client
  123. BasePath string // API endpoint base URL
  124. UserAgent string // optional additional User-Agent fragment
  125. Sites *SitesService
  126. }
  127. func (s *Service) userAgent() string {
  128. if s.UserAgent == "" {
  129. return googleapi.UserAgent
  130. }
  131. return googleapi.UserAgent + " " + s.UserAgent
  132. }
  133. func NewSitesService(s *Service) *SitesService {
  134. rs := &SitesService{s: s}
  135. rs.Domains = NewSitesDomainsService(s)
  136. rs.Releases = NewSitesReleasesService(s)
  137. rs.Versions = NewSitesVersionsService(s)
  138. return rs
  139. }
  140. type SitesService struct {
  141. s *Service
  142. Domains *SitesDomainsService
  143. Releases *SitesReleasesService
  144. Versions *SitesVersionsService
  145. }
  146. func NewSitesDomainsService(s *Service) *SitesDomainsService {
  147. rs := &SitesDomainsService{s: s}
  148. return rs
  149. }
  150. type SitesDomainsService struct {
  151. s *Service
  152. }
  153. func NewSitesReleasesService(s *Service) *SitesReleasesService {
  154. rs := &SitesReleasesService{s: s}
  155. return rs
  156. }
  157. type SitesReleasesService struct {
  158. s *Service
  159. }
  160. func NewSitesVersionsService(s *Service) *SitesVersionsService {
  161. rs := &SitesVersionsService{s: s}
  162. rs.Files = NewSitesVersionsFilesService(s)
  163. return rs
  164. }
  165. type SitesVersionsService struct {
  166. s *Service
  167. Files *SitesVersionsFilesService
  168. }
  169. func NewSitesVersionsFilesService(s *Service) *SitesVersionsFilesService {
  170. rs := &SitesVersionsFilesService{s: s}
  171. return rs
  172. }
  173. type SitesVersionsFilesService struct {
  174. s *Service
  175. }
  176. // ActingUser: Contains metadata about the user who performed an action,
  177. // such as creating
  178. // a release or finalizing a version.
  179. type ActingUser struct {
  180. // Email: The email address of the user when the user performed the
  181. // action.
  182. Email string `json:"email,omitempty"`
  183. // ImageUrl: A profile image URL for the user. May not be present if the
  184. // user has
  185. // changed their email address or deleted their account.
  186. ImageUrl string `json:"imageUrl,omitempty"`
  187. // ForceSendFields is a list of field names (e.g. "Email") to
  188. // unconditionally include in API requests. By default, fields with
  189. // empty values are omitted from API requests. However, any non-pointer,
  190. // non-interface field appearing in ForceSendFields will be sent to the
  191. // server regardless of whether the field is empty or not. This may be
  192. // used to include empty fields in Patch requests.
  193. ForceSendFields []string `json:"-"`
  194. // NullFields is a list of field names (e.g. "Email") to include in API
  195. // requests with the JSON null value. By default, fields with empty
  196. // values are omitted from API requests. However, any field with an
  197. // empty value appearing in NullFields will be sent to the server as
  198. // null. It is an error if a field in this list has a non-empty value.
  199. // This may be used to include null fields in Patch requests.
  200. NullFields []string `json:"-"`
  201. }
  202. func (s *ActingUser) MarshalJSON() ([]byte, error) {
  203. type NoMethod ActingUser
  204. raw := NoMethod(*s)
  205. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  206. }
  207. // CertDnsChallenge: Represents a DNS certificate challenge.
  208. type CertDnsChallenge struct {
  209. // DomainName: The domain name upon which the DNS challenge must be
  210. // satisfied.
  211. DomainName string `json:"domainName,omitempty"`
  212. // Token: The value that must be present as a TXT record on the domain
  213. // name to
  214. // satisfy the challenge.
  215. Token string `json:"token,omitempty"`
  216. // ForceSendFields is a list of field names (e.g. "DomainName") to
  217. // unconditionally include in API requests. By default, fields with
  218. // empty values are omitted from API requests. However, any non-pointer,
  219. // non-interface field appearing in ForceSendFields will be sent to the
  220. // server regardless of whether the field is empty or not. This may be
  221. // used to include empty fields in Patch requests.
  222. ForceSendFields []string `json:"-"`
  223. // NullFields is a list of field names (e.g. "DomainName") to include in
  224. // API requests with the JSON null value. By default, fields with empty
  225. // values are omitted from API requests. However, any field with an
  226. // empty value appearing in NullFields will be sent to the server as
  227. // null. It is an error if a field in this list has a non-empty value.
  228. // This may be used to include null fields in Patch requests.
  229. NullFields []string `json:"-"`
  230. }
  231. func (s *CertDnsChallenge) MarshalJSON() ([]byte, error) {
  232. type NoMethod CertDnsChallenge
  233. raw := NoMethod(*s)
  234. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  235. }
  236. // CertHttpChallenge: Represents an HTTP certificate challenge.
  237. type CertHttpChallenge struct {
  238. // Path: The URL path on which to serve the specified token to satisfy
  239. // the
  240. // certificate challenge.
  241. Path string `json:"path,omitempty"`
  242. // Token: The token to serve at the specified URL path to satisfy the
  243. // certificate
  244. // challenge.
  245. Token string `json:"token,omitempty"`
  246. // ForceSendFields is a list of field names (e.g. "Path") to
  247. // unconditionally include in API requests. By default, fields with
  248. // empty values are omitted from API requests. However, any non-pointer,
  249. // non-interface field appearing in ForceSendFields will be sent to the
  250. // server regardless of whether the field is empty or not. This may be
  251. // used to include empty fields in Patch requests.
  252. ForceSendFields []string `json:"-"`
  253. // NullFields is a list of field names (e.g. "Path") to include in API
  254. // requests with the JSON null value. By default, fields with empty
  255. // values are omitted from API requests. However, any field with an
  256. // empty value appearing in NullFields will be sent to the server as
  257. // null. It is an error if a field in this list has a non-empty value.
  258. // This may be used to include null fields in Patch requests.
  259. NullFields []string `json:"-"`
  260. }
  261. func (s *CertHttpChallenge) MarshalJSON() ([]byte, error) {
  262. type NoMethod CertHttpChallenge
  263. raw := NoMethod(*s)
  264. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  265. }
  266. // CloudRunRewrite: A configured rewrite that will direct any requests
  267. // to a Cloud Run service. If
  268. // the Cloud Run service does not exist when setting or updating your
  269. // Firebase
  270. // Hosting configuration then the request will fail. Any errors from the
  271. // Cloud
  272. // Run service (including when the service has been deleted) will be
  273. // passed back
  274. // down to the end user.
  275. type CloudRunRewrite struct {
  276. // Region: Optional. The region where the Cloud Run service is hosted.
  277. // Defaults to
  278. // `us-central1` if not supplied.
  279. Region string `json:"region,omitempty"`
  280. // ServiceId: Required. User supplied ID of the Cloud Run service.
  281. ServiceId string `json:"serviceId,omitempty"`
  282. // ForceSendFields is a list of field names (e.g. "Region") to
  283. // unconditionally include in API requests. By default, fields with
  284. // empty values are omitted from API requests. However, any non-pointer,
  285. // non-interface field appearing in ForceSendFields will be sent to the
  286. // server regardless of whether the field is empty or not. This may be
  287. // used to include empty fields in Patch requests.
  288. ForceSendFields []string `json:"-"`
  289. // NullFields is a list of field names (e.g. "Region") to include in API
  290. // requests with the JSON null value. By default, fields with empty
  291. // values are omitted from API requests. However, any field with an
  292. // empty value appearing in NullFields will be sent to the server as
  293. // null. It is an error if a field in this list has a non-empty value.
  294. // This may be used to include null fields in Patch requests.
  295. NullFields []string `json:"-"`
  296. }
  297. func (s *CloudRunRewrite) MarshalJSON() ([]byte, error) {
  298. type NoMethod CloudRunRewrite
  299. raw := NoMethod(*s)
  300. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  301. }
  302. // Domain: The intended behavior and status information of a domain.
  303. type Domain struct {
  304. // DomainName: Required. The domain name of the association.
  305. DomainName string `json:"domainName,omitempty"`
  306. // DomainRedirect: If set, the domain should redirect with the provided
  307. // parameters.
  308. DomainRedirect *DomainRedirect `json:"domainRedirect,omitempty"`
  309. // Provisioning: Output only. Information about the provisioning of
  310. // certificates and the
  311. // health of the DNS resolution for the domain.
  312. Provisioning *DomainProvisioning `json:"provisioning,omitempty"`
  313. // Site: Required. The site name of the association.
  314. Site string `json:"site,omitempty"`
  315. // Status: Output only. Additional status of the domain association.
  316. //
  317. // Possible values:
  318. // "DOMAIN_STATUS_UNSPECIFIED" - Unspecified domain association
  319. // status.
  320. // "DOMAIN_CHANGE_PENDING" - An operation is in progress on the domain
  321. // association and no further
  322. // operations can be performed until it is complete.
  323. // "DOMAIN_ACTIVE" - The domain association is active and no
  324. // additional action is required.
  325. // "DOMAIN_VERIFICATION_REQUIRED" - The domain was previously verified
  326. // in the legacy system. User must
  327. // reverify the domain through the ownership service.
  328. // "DOMAIN_VERIFICATION_LOST" - The domain verification has been lost
  329. // and the domain is in the grace period
  330. // before being removed from the Firebase Hosting site.
  331. Status string `json:"status,omitempty"`
  332. // UpdateTime: Output only. The time at which the domain was last
  333. // updated.
  334. UpdateTime string `json:"updateTime,omitempty"`
  335. // ServerResponse contains the HTTP response code and headers from the
  336. // server.
  337. googleapi.ServerResponse `json:"-"`
  338. // ForceSendFields is a list of field names (e.g. "DomainName") to
  339. // unconditionally include in API requests. By default, fields with
  340. // empty values are omitted from API requests. However, any non-pointer,
  341. // non-interface field appearing in ForceSendFields will be sent to the
  342. // server regardless of whether the field is empty or not. This may be
  343. // used to include empty fields in Patch requests.
  344. ForceSendFields []string `json:"-"`
  345. // NullFields is a list of field names (e.g. "DomainName") to include in
  346. // API requests with the JSON null value. By default, fields with empty
  347. // values are omitted from API requests. However, any field with an
  348. // empty value appearing in NullFields will be sent to the server as
  349. // null. It is an error if a field in this list has a non-empty value.
  350. // This may be used to include null fields in Patch requests.
  351. NullFields []string `json:"-"`
  352. }
  353. func (s *Domain) MarshalJSON() ([]byte, error) {
  354. type NoMethod Domain
  355. raw := NoMethod(*s)
  356. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  357. }
  358. // DomainProvisioning: The current certificate provisioning status
  359. // information for a domain.
  360. type DomainProvisioning struct {
  361. // CertChallengeDiscoveredTxt: The TXT records (for the certificate
  362. // challenge) that were found at the last
  363. // DNS fetch.
  364. CertChallengeDiscoveredTxt []string `json:"certChallengeDiscoveredTxt,omitempty"`
  365. // CertChallengeDns: The DNS challenge for generating a certificate.
  366. CertChallengeDns *CertDnsChallenge `json:"certChallengeDns,omitempty"`
  367. // CertChallengeHttp: The HTTP challenge for generating a certificate.
  368. CertChallengeHttp *CertHttpChallenge `json:"certChallengeHttp,omitempty"`
  369. // CertStatus: The certificate provisioning status; updated when
  370. // Firebase Hosting
  371. // provisions an SSL certificate for the domain.
  372. //
  373. // Possible values:
  374. // "CERT_STATUS_UNSPECIFIED" - Unspecified certificate provisioning
  375. // status.
  376. // "CERT_PENDING" - Waiting for certificate challenge to be created.
  377. // "CERT_MISSING" - Waiting for certificate challenge to be met.
  378. // "CERT_PROCESSING" - Certificate challenge met; attempting to
  379. // acquire/propagate certificate.
  380. // "CERT_PROPAGATING" - Certificate obtained; propagating to the CDN.
  381. // "CERT_ACTIVE" - Certificate provisioned and deployed across the
  382. // CDN.
  383. // "CERT_ERROR" - Certificate provisioning failed in a non-recoverable
  384. // manner.
  385. CertStatus string `json:"certStatus,omitempty"`
  386. // DiscoveredIps: The IPs found at the last DNS fetch.
  387. DiscoveredIps []string `json:"discoveredIps,omitempty"`
  388. // DnsFetchTime: The time at which the last DNS fetch occurred.
  389. DnsFetchTime string `json:"dnsFetchTime,omitempty"`
  390. // DnsStatus: The DNS record match status as of the last DNS fetch.
  391. //
  392. // Possible values:
  393. // "DNS_STATUS_UNSPECIFIED" - Unspecified DNS status.
  394. // "DNS_PENDING" - No DNS records have been specified for this domain
  395. // yet.
  396. // "DNS_MISSING" - None of the required DNS records have been detected
  397. // on the domain.
  398. // "DNS_PARTIAL_MATCH" - Some of the required DNS records were
  399. // detected, but not all of them. No
  400. // extra (non-required) DNS records were detected.
  401. // "DNS_MATCH" - All required DNS records were detected. No extra
  402. // (non-required) DNS records
  403. // were detected.
  404. // "DNS_EXTRANEOUS_MATCH" - The domain has at least one of the
  405. // required DNS records, and it has at
  406. // least one extra (non-required) DNS record.
  407. DnsStatus string `json:"dnsStatus,omitempty"`
  408. // ExpectedIps: The list of IPs to which the domain is expected to
  409. // resolve.
  410. ExpectedIps []string `json:"expectedIps,omitempty"`
  411. // ForceSendFields is a list of field names (e.g.
  412. // "CertChallengeDiscoveredTxt") to unconditionally include in API
  413. // requests. By default, fields with empty values are omitted from API
  414. // requests. However, any non-pointer, non-interface field appearing in
  415. // ForceSendFields will be sent to the server regardless of whether the
  416. // field is empty or not. This may be used to include empty fields in
  417. // Patch requests.
  418. ForceSendFields []string `json:"-"`
  419. // NullFields is a list of field names (e.g.
  420. // "CertChallengeDiscoveredTxt") to include in API requests with the
  421. // JSON null value. By default, fields with empty values are omitted
  422. // from API requests. However, any field with an empty value appearing
  423. // in NullFields will be sent to the server as null. It is an error if a
  424. // field in this list has a non-empty value. This may be used to include
  425. // null fields in Patch requests.
  426. NullFields []string `json:"-"`
  427. }
  428. func (s *DomainProvisioning) MarshalJSON() ([]byte, error) {
  429. type NoMethod DomainProvisioning
  430. raw := NoMethod(*s)
  431. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  432. }
  433. // DomainRedirect: Defines the behavior of a domain-level redirect.
  434. // Domain redirects preserve
  435. // the path of the redirect but replace the requested domain with the
  436. // one
  437. // specified in the redirect configuration.
  438. type DomainRedirect struct {
  439. // DomainName: Required. The domain name to redirect to.
  440. DomainName string `json:"domainName,omitempty"`
  441. // Type: Required. The redirect status code.
  442. //
  443. // Possible values:
  444. // "REDIRECT_TYPE_UNSPECIFIED" - The default redirect type; should not
  445. // be intentionlly used.
  446. // "MOVED_PERMANENTLY" - The redirect will respond with an HTTP status
  447. // code of
  448. // `301 Moved Permanently`.
  449. Type string `json:"type,omitempty"`
  450. // ForceSendFields is a list of field names (e.g. "DomainName") to
  451. // unconditionally include in API requests. By default, fields with
  452. // empty values are omitted from API requests. However, any non-pointer,
  453. // non-interface field appearing in ForceSendFields will be sent to the
  454. // server regardless of whether the field is empty or not. This may be
  455. // used to include empty fields in Patch requests.
  456. ForceSendFields []string `json:"-"`
  457. // NullFields is a list of field names (e.g. "DomainName") to include in
  458. // API requests with the JSON null value. By default, fields with empty
  459. // values are omitted from API requests. However, any field with an
  460. // empty value appearing in NullFields will be sent to the server as
  461. // null. It is an error if a field in this list has a non-empty value.
  462. // This may be used to include null fields in Patch requests.
  463. NullFields []string `json:"-"`
  464. }
  465. func (s *DomainRedirect) MarshalJSON() ([]byte, error) {
  466. type NoMethod DomainRedirect
  467. raw := NoMethod(*s)
  468. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  469. }
  470. // Empty: A generic empty message that you can re-use to avoid defining
  471. // duplicated
  472. // empty messages in your APIs. A typical example is to use it as the
  473. // request
  474. // or the response type of an API method. For instance:
  475. //
  476. // service Foo {
  477. // rpc Bar(google.protobuf.Empty) returns
  478. // (google.protobuf.Empty);
  479. // }
  480. //
  481. // The JSON representation for `Empty` is empty JSON object `{}`.
  482. type Empty struct {
  483. // ServerResponse contains the HTTP response code and headers from the
  484. // server.
  485. googleapi.ServerResponse `json:"-"`
  486. }
  487. // Header: A [`header`](/docs/hosting/full-config#headers) defines
  488. // custom headers to
  489. // add to a response should the request URL path match the pattern.
  490. type Header struct {
  491. // Glob: Required. The user-supplied
  492. // [glob pattern](/docs/hosting/full-config#glob_pattern_matching) to
  493. // match
  494. // against the request URL path.
  495. Glob string `json:"glob,omitempty"`
  496. // Headers: Required. The additional headers to add to the response.
  497. Headers map[string]string `json:"headers,omitempty"`
  498. // ForceSendFields is a list of field names (e.g. "Glob") to
  499. // unconditionally include in API requests. By default, fields with
  500. // empty values are omitted from API requests. However, any non-pointer,
  501. // non-interface field appearing in ForceSendFields will be sent to the
  502. // server regardless of whether the field is empty or not. This may be
  503. // used to include empty fields in Patch requests.
  504. ForceSendFields []string `json:"-"`
  505. // NullFields is a list of field names (e.g. "Glob") to include in API
  506. // requests with the JSON null value. By default, fields with empty
  507. // values are omitted from API requests. However, any field with an
  508. // empty value appearing in NullFields will be sent to the server as
  509. // null. It is an error if a field in this list has a non-empty value.
  510. // This may be used to include null fields in Patch requests.
  511. NullFields []string `json:"-"`
  512. }
  513. func (s *Header) MarshalJSON() ([]byte, error) {
  514. type NoMethod Header
  515. raw := NoMethod(*s)
  516. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  517. }
  518. type ListDomainsResponse struct {
  519. // Domains: The list of domains, if any exist.
  520. Domains []*Domain `json:"domains,omitempty"`
  521. // NextPageToken: The pagination token, if more results exist.
  522. NextPageToken string `json:"nextPageToken,omitempty"`
  523. // ServerResponse contains the HTTP response code and headers from the
  524. // server.
  525. googleapi.ServerResponse `json:"-"`
  526. // ForceSendFields is a list of field names (e.g. "Domains") to
  527. // unconditionally include in API requests. By default, fields with
  528. // empty values are omitted from API requests. However, any non-pointer,
  529. // non-interface field appearing in ForceSendFields will be sent to the
  530. // server regardless of whether the field is empty or not. This may be
  531. // used to include empty fields in Patch requests.
  532. ForceSendFields []string `json:"-"`
  533. // NullFields is a list of field names (e.g. "Domains") to include in
  534. // API requests with the JSON null value. By default, fields with empty
  535. // values are omitted from API requests. However, any field with an
  536. // empty value appearing in NullFields will be sent to the server as
  537. // null. It is an error if a field in this list has a non-empty value.
  538. // This may be used to include null fields in Patch requests.
  539. NullFields []string `json:"-"`
  540. }
  541. func (s *ListDomainsResponse) MarshalJSON() ([]byte, error) {
  542. type NoMethod ListDomainsResponse
  543. raw := NoMethod(*s)
  544. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  545. }
  546. type ListReleasesResponse struct {
  547. // NextPageToken: If there are additional releases remaining beyond the
  548. // ones in this
  549. // response, then supply this token in the
  550. // next
  551. // [`list`](../sites.versions.files/list) call to continue with the next
  552. // set
  553. // of releases.
  554. NextPageToken string `json:"nextPageToken,omitempty"`
  555. // Releases: The list of hashes of files that still need to be uploaded,
  556. // if any exist.
  557. Releases []*Release `json:"releases,omitempty"`
  558. // ServerResponse contains the HTTP response code and headers from the
  559. // server.
  560. googleapi.ServerResponse `json:"-"`
  561. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  562. // unconditionally include in API requests. By default, fields with
  563. // empty values are omitted from API requests. However, any non-pointer,
  564. // non-interface field appearing in ForceSendFields will be sent to the
  565. // server regardless of whether the field is empty or not. This may be
  566. // used to include empty fields in Patch requests.
  567. ForceSendFields []string `json:"-"`
  568. // NullFields is a list of field names (e.g. "NextPageToken") to include
  569. // in API requests with the JSON null value. By default, fields with
  570. // empty values are omitted from API requests. However, any field with
  571. // an empty value appearing in NullFields will be sent to the server as
  572. // null. It is an error if a field in this list has a non-empty value.
  573. // This may be used to include null fields in Patch requests.
  574. NullFields []string `json:"-"`
  575. }
  576. func (s *ListReleasesResponse) MarshalJSON() ([]byte, error) {
  577. type NoMethod ListReleasesResponse
  578. raw := NoMethod(*s)
  579. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  580. }
  581. type ListVersionFilesResponse struct {
  582. // Files: The list path/hashes in the specified version.
  583. Files []*VersionFile `json:"files,omitempty"`
  584. // NextPageToken: The pagination token, if more results exist.
  585. NextPageToken string `json:"nextPageToken,omitempty"`
  586. // ServerResponse contains the HTTP response code and headers from the
  587. // server.
  588. googleapi.ServerResponse `json:"-"`
  589. // ForceSendFields is a list of field names (e.g. "Files") to
  590. // unconditionally include in API requests. By default, fields with
  591. // empty values are omitted from API requests. However, any non-pointer,
  592. // non-interface field appearing in ForceSendFields will be sent to the
  593. // server regardless of whether the field is empty or not. This may be
  594. // used to include empty fields in Patch requests.
  595. ForceSendFields []string `json:"-"`
  596. // NullFields is a list of field names (e.g. "Files") to include in API
  597. // requests with the JSON null value. By default, fields with empty
  598. // values are omitted from API requests. However, any field with an
  599. // empty value appearing in NullFields will be sent to the server as
  600. // null. It is an error if a field in this list has a non-empty value.
  601. // This may be used to include null fields in Patch requests.
  602. NullFields []string `json:"-"`
  603. }
  604. func (s *ListVersionFilesResponse) MarshalJSON() ([]byte, error) {
  605. type NoMethod ListVersionFilesResponse
  606. raw := NoMethod(*s)
  607. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  608. }
  609. type PopulateVersionFilesRequest struct {
  610. // Files: A set of file paths to the hashes corresponding to assets that
  611. // should be
  612. // added to the version. Note that a file path to an empty hash will
  613. // remove
  614. // the path from the version. Calculate a hash by Gzipping the file
  615. // then
  616. // taking the SHA256 hash of the newly compressed file.
  617. Files map[string]string `json:"files,omitempty"`
  618. // ForceSendFields is a list of field names (e.g. "Files") to
  619. // unconditionally include in API requests. By default, fields with
  620. // empty values are omitted from API requests. However, any non-pointer,
  621. // non-interface field appearing in ForceSendFields will be sent to the
  622. // server regardless of whether the field is empty or not. This may be
  623. // used to include empty fields in Patch requests.
  624. ForceSendFields []string `json:"-"`
  625. // NullFields is a list of field names (e.g. "Files") to include in API
  626. // requests with the JSON null value. By default, fields with empty
  627. // values are omitted from API requests. However, any field with an
  628. // empty value appearing in NullFields will be sent to the server as
  629. // null. It is an error if a field in this list has a non-empty value.
  630. // This may be used to include null fields in Patch requests.
  631. NullFields []string `json:"-"`
  632. }
  633. func (s *PopulateVersionFilesRequest) MarshalJSON() ([]byte, error) {
  634. type NoMethod PopulateVersionFilesRequest
  635. raw := NoMethod(*s)
  636. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  637. }
  638. type PopulateVersionFilesResponse struct {
  639. // UploadRequiredHashes: The content hashes of the specified files that
  640. // need to be uploaded to the
  641. // specified endpoint.
  642. UploadRequiredHashes []string `json:"uploadRequiredHashes,omitempty"`
  643. // UploadUrl: The URL to which the files should be uploaded, in the
  644. // format:
  645. // <br>"https://upload-firebasehosting.googleapis.com/upload/site
  646. // s/<var>site-name</var>/versions/<var>versionID</var>/files".
  647. // <br>Perfo
  648. // rm a multipart `POST` of the Gzipped file contents to the URL
  649. // using a forward slash and the hash of the file appended to the end.
  650. UploadUrl string `json:"uploadUrl,omitempty"`
  651. // ServerResponse contains the HTTP response code and headers from the
  652. // server.
  653. googleapi.ServerResponse `json:"-"`
  654. // ForceSendFields is a list of field names (e.g.
  655. // "UploadRequiredHashes") to unconditionally include in API requests.
  656. // By default, fields with empty values are omitted from API requests.
  657. // However, any non-pointer, non-interface field appearing in
  658. // ForceSendFields will be sent to the server regardless of whether the
  659. // field is empty or not. This may be used to include empty fields in
  660. // Patch requests.
  661. ForceSendFields []string `json:"-"`
  662. // NullFields is a list of field names (e.g. "UploadRequiredHashes") to
  663. // include in API requests with the JSON null value. By default, fields
  664. // with empty values are omitted from API requests. However, any field
  665. // with an empty value appearing in NullFields will be sent to the
  666. // server as null. It is an error if a field in this list has a
  667. // non-empty value. This may be used to include null fields in Patch
  668. // requests.
  669. NullFields []string `json:"-"`
  670. }
  671. func (s *PopulateVersionFilesResponse) MarshalJSON() ([]byte, error) {
  672. type NoMethod PopulateVersionFilesResponse
  673. raw := NoMethod(*s)
  674. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  675. }
  676. // Redirect: A [`redirect`](/docs/hosting/full-config#redirects)
  677. // represents the
  678. // configuration for returning an HTTP redirect response given a
  679. // matching
  680. // request URL path.
  681. type Redirect struct {
  682. // Glob: Required. The user-supplied
  683. // [glob pattern](/docs/hosting/full-config#glob_pattern_matching) to
  684. // match
  685. // against the request URL path.
  686. Glob string `json:"glob,omitempty"`
  687. // Location: Required. The value to put in the HTTP location header of
  688. // the response.
  689. // <br>The location can contain capture group values from the pattern
  690. // using
  691. // a `:` prefix to identify the segment and an optional `*` to capture
  692. // the
  693. // rest of the URL.
  694. // For example:
  695. // <code>"glob": "/:capture*",
  696. // <br>"statusCode": 301,
  697. // <br>"location": "https://example.com/foo/:capture"</code>
  698. Location string `json:"location,omitempty"`
  699. // StatusCode: Required. The status HTTP code to return in the response.
  700. // It must be a
  701. // valid 3xx status code.
  702. StatusCode int64 `json:"statusCode,omitempty"`
  703. // ForceSendFields is a list of field names (e.g. "Glob") to
  704. // unconditionally include in API requests. By default, fields with
  705. // empty values are omitted from API requests. However, any non-pointer,
  706. // non-interface field appearing in ForceSendFields will be sent to the
  707. // server regardless of whether the field is empty or not. This may be
  708. // used to include empty fields in Patch requests.
  709. ForceSendFields []string `json:"-"`
  710. // NullFields is a list of field names (e.g. "Glob") to include in API
  711. // requests with the JSON null value. By default, fields with empty
  712. // values are omitted from API requests. However, any field with an
  713. // empty value appearing in NullFields will be sent to the server as
  714. // null. It is an error if a field in this list has a non-empty value.
  715. // This may be used to include null fields in Patch requests.
  716. NullFields []string `json:"-"`
  717. }
  718. func (s *Redirect) MarshalJSON() ([]byte, error) {
  719. type NoMethod Redirect
  720. raw := NoMethod(*s)
  721. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  722. }
  723. // Release: A `Release` is a particular
  724. // [collection of configurations and files](sites.versions)
  725. // that is set to be public at a particular time.
  726. type Release struct {
  727. // Message: The deploy description when the release was created. The
  728. // value can be up to
  729. // 512&nbsp;characters.
  730. Message string `json:"message,omitempty"`
  731. // Name: Output only. The unique identifier for the release, in the
  732. // format:
  733. // <code>sites/<var>site-name</var>/releases/<var>releaseID</var>
  734. // </code>
  735. // This name is provided in the response body when you call
  736. // the
  737. // [`CreateRelease`](sites.releases/create) endpoint.
  738. Name string `json:"name,omitempty"`
  739. // ReleaseTime: Output only. The time at which the version is set to be
  740. // public.
  741. ReleaseTime string `json:"releaseTime,omitempty"`
  742. // ReleaseUser: Output only. Identifies the user who created the
  743. // release.
  744. ReleaseUser *ActingUser `json:"releaseUser,omitempty"`
  745. // Type: Explains the reason for the release.
  746. // <br>Specify a value for this field only when creating a
  747. // `SITE_DISABLE`
  748. // type release.
  749. //
  750. // Possible values:
  751. // "TYPE_UNSPECIFIED" - An unspecified type. Indicates that a version
  752. // was released.
  753. // <br>This is the default value when no other `type` is
  754. // explicitly
  755. // specified.
  756. // "DEPLOY" - A version was uploaded to Firebase Hosting and released.
  757. // "ROLLBACK" - The release points back to a previously deployed
  758. // version.
  759. // "SITE_DISABLE" - The release prevents the site from serving
  760. // content. Firebase Hosting acts
  761. // as if the site never existed.
  762. Type string `json:"type,omitempty"`
  763. // Version: Output only. The configuration and content that was
  764. // released.
  765. Version *Version `json:"version,omitempty"`
  766. // ServerResponse contains the HTTP response code and headers from the
  767. // server.
  768. googleapi.ServerResponse `json:"-"`
  769. // ForceSendFields is a list of field names (e.g. "Message") to
  770. // unconditionally include in API requests. By default, fields with
  771. // empty values are omitted from API requests. However, any non-pointer,
  772. // non-interface field appearing in ForceSendFields will be sent to the
  773. // server regardless of whether the field is empty or not. This may be
  774. // used to include empty fields in Patch requests.
  775. ForceSendFields []string `json:"-"`
  776. // NullFields is a list of field names (e.g. "Message") to include in
  777. // API requests with the JSON null value. By default, fields with empty
  778. // values are omitted from API requests. However, any field with an
  779. // empty value appearing in NullFields will be sent to the server as
  780. // null. It is an error if a field in this list has a non-empty value.
  781. // This may be used to include null fields in Patch requests.
  782. NullFields []string `json:"-"`
  783. }
  784. func (s *Release) MarshalJSON() ([]byte, error) {
  785. type NoMethod Release
  786. raw := NoMethod(*s)
  787. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  788. }
  789. // Rewrite: A [`rewrite`](/docs/hosting/full-config#rewrites) represents
  790. // an internal
  791. // content rewrite on the version. If the pattern matches, the request
  792. // will be
  793. // handled as if it were to the destination path specified in
  794. // the
  795. // configuration.
  796. type Rewrite struct {
  797. // DynamicLinks: The request will be forwarded to Firebase Dynamic
  798. // Links.
  799. DynamicLinks bool `json:"dynamicLinks,omitempty"`
  800. // Function: The function to proxy requests to. Must match the exported
  801. // function
  802. // name exactly.
  803. Function string `json:"function,omitempty"`
  804. // Glob: Required. The user-supplied
  805. // [glob pattern](/docs/hosting/full-config#glob_pattern_matching) to
  806. // match
  807. // against the request URL path.
  808. Glob string `json:"glob,omitempty"`
  809. // Path: The URL path to rewrite the request to.
  810. Path string `json:"path,omitempty"`
  811. // Run: The request will be forwarded to Cloud Run.
  812. Run *CloudRunRewrite `json:"run,omitempty"`
  813. // ForceSendFields is a list of field names (e.g. "DynamicLinks") to
  814. // unconditionally include in API requests. By default, fields with
  815. // empty values are omitted from API requests. However, any non-pointer,
  816. // non-interface field appearing in ForceSendFields will be sent to the
  817. // server regardless of whether the field is empty or not. This may be
  818. // used to include empty fields in Patch requests.
  819. ForceSendFields []string `json:"-"`
  820. // NullFields is a list of field names (e.g. "DynamicLinks") to include
  821. // in API requests with the JSON null value. By default, fields with
  822. // empty values are omitted from API requests. However, any field with
  823. // an empty value appearing in NullFields will be sent to the server as
  824. // null. It is an error if a field in this list has a non-empty value.
  825. // This may be used to include null fields in Patch requests.
  826. NullFields []string `json:"-"`
  827. }
  828. func (s *Rewrite) MarshalJSON() ([]byte, error) {
  829. type NoMethod Rewrite
  830. raw := NoMethod(*s)
  831. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  832. }
  833. // ServingConfig: The configuration for how incoming requests to a site
  834. // should be routed and
  835. // processed before serving content. The patterns are matched and
  836. // applied
  837. // according to a specific
  838. // [priority order](/docs/hosting/full-config#hosting_priority_order).
  839. type ServingConfig struct {
  840. // AppAssociation: How to handle well known App Association files.
  841. //
  842. // Possible values:
  843. // "AUTO" - The app association files will be automattically created
  844. // from the apps
  845. // that exist in the Firebase project.
  846. // "NONE" - No special handling of the app association files will
  847. // occur, these paths
  848. // will result in a 404 unless caught with a Rewrite.
  849. AppAssociation string `json:"appAssociation,omitempty"`
  850. // CleanUrls: Defines whether to drop the file extension from uploaded
  851. // files.
  852. CleanUrls bool `json:"cleanUrls,omitempty"`
  853. // Headers: A list of custom response headers that are added to the
  854. // content if the
  855. // request URL path matches the glob.
  856. Headers []*Header `json:"headers,omitempty"`
  857. // Redirects: A list of globs that will cause the response to redirect
  858. // to another
  859. // location.
  860. Redirects []*Redirect `json:"redirects,omitempty"`
  861. // Rewrites: A list of rewrites that will act as if the service were
  862. // given the
  863. // destination URL.
  864. Rewrites []*Rewrite `json:"rewrites,omitempty"`
  865. // TrailingSlashBehavior: Defines how to handle a trailing slash in the
  866. // URL path.
  867. //
  868. // Possible values:
  869. // "TRAILING_SLASH_BEHAVIOR_UNSPECIFIED" - No behavior is
  870. // specified.
  871. // <br>Files are served at their exact location only, and trailing
  872. // slashes
  873. // are only added to directory indexes.
  874. // "ADD" - Trailing slashes are _added_ to directory indexes as well
  875. // as to any URL
  876. // path not ending in a file extension.
  877. // "REMOVE" - Trailing slashes are _removed_ from directory indexes as
  878. // well as from any
  879. // URL path not ending in a file extension.
  880. TrailingSlashBehavior string `json:"trailingSlashBehavior,omitempty"`
  881. // ForceSendFields is a list of field names (e.g. "AppAssociation") to
  882. // unconditionally include in API requests. By default, fields with
  883. // empty values are omitted from API requests. However, any non-pointer,
  884. // non-interface field appearing in ForceSendFields will be sent to the
  885. // server regardless of whether the field is empty or not. This may be
  886. // used to include empty fields in Patch requests.
  887. ForceSendFields []string `json:"-"`
  888. // NullFields is a list of field names (e.g. "AppAssociation") to
  889. // include in API requests with the JSON null value. By default, fields
  890. // with empty values are omitted from API requests. However, any field
  891. // with an empty value appearing in NullFields will be sent to the
  892. // server as null. It is an error if a field in this list has a
  893. // non-empty value. This may be used to include null fields in Patch
  894. // requests.
  895. NullFields []string `json:"-"`
  896. }
  897. func (s *ServingConfig) MarshalJSON() ([]byte, error) {
  898. type NoMethod ServingConfig
  899. raw := NoMethod(*s)
  900. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  901. }
  902. // SiteConfig: A `SiteConfig` contains metadata associated with a
  903. // specific site that
  904. // controls Firebase Hosting serving behavior
  905. type SiteConfig struct {
  906. // MaxVersions: The number of FINALIZED versions that will be held for a
  907. // site before
  908. // automatic deletion. When a new version is deployed, content for
  909. // versions
  910. // in storage in excess of this number will be deleted, and will no
  911. // longer be
  912. // billed for storage usage. Oldest versions will be deleted first;
  913. // sites are
  914. // created with an unlimited number of max_versions by default.
  915. MaxVersions int64 `json:"maxVersions,omitempty,string"`
  916. // ServerResponse contains the HTTP response code and headers from the
  917. // server.
  918. googleapi.ServerResponse `json:"-"`
  919. // ForceSendFields is a list of field names (e.g. "MaxVersions") to
  920. // unconditionally include in API requests. By default, fields with
  921. // empty values are omitted from API requests. However, any non-pointer,
  922. // non-interface field appearing in ForceSendFields will be sent to the
  923. // server regardless of whether the field is empty or not. This may be
  924. // used to include empty fields in Patch requests.
  925. ForceSendFields []string `json:"-"`
  926. // NullFields is a list of field names (e.g. "MaxVersions") to include
  927. // in API requests with the JSON null value. By default, fields with
  928. // empty values are omitted from API requests. However, any field with
  929. // an empty value appearing in NullFields will be sent to the server as
  930. // null. It is an error if a field in this list has a non-empty value.
  931. // This may be used to include null fields in Patch requests.
  932. NullFields []string `json:"-"`
  933. }
  934. func (s *SiteConfig) MarshalJSON() ([]byte, error) {
  935. type NoMethod SiteConfig
  936. raw := NoMethod(*s)
  937. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  938. }
  939. // Version: A `Version` is the collection of configuration and
  940. // [static files](sites.versions.files) that determine how a site is
  941. // displayed.
  942. type Version struct {
  943. // Config: The configuration for the behavior of the site. This
  944. // configuration exists
  945. // in the [`firebase.json`](/docs/cli/#the_firebasejson_file) file.
  946. Config *ServingConfig `json:"config,omitempty"`
  947. // CreateTime: Output only. The time at which the version was created.
  948. CreateTime string `json:"createTime,omitempty"`
  949. // CreateUser: Output only. Identifies the user who created the version.
  950. CreateUser *ActingUser `json:"createUser,omitempty"`
  951. // DeleteTime: Output only. The time at which the version was `DELETED`.
  952. DeleteTime string `json:"deleteTime,omitempty"`
  953. // DeleteUser: Output only. Identifies the user who `DELETED` the
  954. // version.
  955. DeleteUser *ActingUser `json:"deleteUser,omitempty"`
  956. // FileCount: Output only. The total number of files associated with the
  957. // version.
  958. // <br>This value is calculated after a version is `FINALIZED`.
  959. FileCount int64 `json:"fileCount,omitempty,string"`
  960. // FinalizeTime: Output only. The time at which the version was
  961. // `FINALIZED`.
  962. FinalizeTime string `json:"finalizeTime,omitempty"`
  963. // FinalizeUser: Output only. Identifies the user who `FINALIZED` the
  964. // version.
  965. FinalizeUser *ActingUser `json:"finalizeUser,omitempty"`
  966. // Labels: The labels used for extra metadata and/or filtering.
  967. Labels map[string]string `json:"labels,omitempty"`
  968. // Name: The unique identifier for a version, in the
  969. // format:
  970. // <code>sites/<var>site-name</var>/versions/<var>versionID</var>
  971. // </code>
  972. // This name is provided in the response body when you call
  973. // the
  974. // [`CreateVersion`](../sites.versions/create) endpoint.
  975. Name string `json:"name,omitempty"`
  976. // Status: The deploy status of a version.
  977. // <br>
  978. // <br>For a successful deploy, call
  979. // the
  980. // [`CreateVersion`](sites.versions/create) endpoint to make a new
  981. // version
  982. // (`CREATED` status),
  983. // [upload all desired files](sites.versions/populateFiles) to the
  984. // version,
  985. // then [update](sites.versions/patch) the version to the `FINALIZED`
  986. // status.
  987. // <br>
  988. // <br>Note that if you leave the version in the `CREATED` state for
  989. // more
  990. // than 12&nbsp;hours, the system will automatically mark the version
  991. // as
  992. // `ABANDONED`.
  993. // <br>
  994. // <br>You can also change the status of a version to `DELETED` by
  995. // calling the
  996. // [`DeleteVersion`](sites.versions/delete) endpoint.
  997. //
  998. // Possible values:
  999. // "VERSION_STATUS_UNSPECIFIED" - The default status; should not be
  1000. // intentionally used.
  1001. // "CREATED" - The version has been created, and content is currently
  1002. // being added to the
  1003. // version.
  1004. // "FINALIZED" - All content has been added to the version, and the
  1005. // version can no longer be
  1006. // changed.
  1007. // "DELETED" - The version has been deleted.
  1008. // "ABANDONED" - The version was not updated to `FINALIZED` within
  1009. // 12&nbsp;hours and was
  1010. // automatically deleted.
  1011. // "EXPIRED" - The version is outside the site-configured limit for
  1012. // the number of
  1013. // retained versions, so the version's content is scheduled for
  1014. // deletion.
  1015. Status string `json:"status,omitempty"`
  1016. // VersionBytes: Output only. The total stored bytesize of the
  1017. // version.
  1018. // <br>This value is calculated after a version is `FINALIZED`.
  1019. VersionBytes int64 `json:"versionBytes,omitempty,string"`
  1020. // ServerResponse contains the HTTP response code and headers from the
  1021. // server.
  1022. googleapi.ServerResponse `json:"-"`
  1023. // ForceSendFields is a list of field names (e.g. "Config") to
  1024. // unconditionally include in API requests. By default, fields with
  1025. // empty values are omitted from API requests. However, any non-pointer,
  1026. // non-interface field appearing in ForceSendFields will be sent to the
  1027. // server regardless of whether the field is empty or not. This may be
  1028. // used to include empty fields in Patch requests.
  1029. ForceSendFields []string `json:"-"`
  1030. // NullFields is a list of field names (e.g. "Config") to include in API
  1031. // requests with the JSON null value. By default, fields with empty
  1032. // values are omitted from API requests. However, any field with an
  1033. // empty value appearing in NullFields will be sent to the server as
  1034. // null. It is an error if a field in this list has a non-empty value.
  1035. // This may be used to include null fields in Patch requests.
  1036. NullFields []string `json:"-"`
  1037. }
  1038. func (s *Version) MarshalJSON() ([]byte, error) {
  1039. type NoMethod Version
  1040. raw := NoMethod(*s)
  1041. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1042. }
  1043. // VersionFile: A static content file that is part of a version.
  1044. type VersionFile struct {
  1045. // Hash: The SHA256 content hash of the file.
  1046. Hash string `json:"hash,omitempty"`
  1047. // Path: The URI at which the file's content should display.
  1048. Path string `json:"path,omitempty"`
  1049. // Status: Output only. The current status of a particular file in the
  1050. // specified
  1051. // version.
  1052. // <br>The value will be either `pending upload` or `uploaded`.
  1053. //
  1054. // Possible values:
  1055. // "STATUS_UNSPECIFIED" - The default status; should not be
  1056. // intentionally used.
  1057. // "EXPECTED" - The file has been included in the version and is
  1058. // expected to be uploaded
  1059. // in the near future.
  1060. // "ACTIVE" - The file has already been uploaded to Firebase Hosting.
  1061. Status string `json:"status,omitempty"`
  1062. // ForceSendFields is a list of field names (e.g. "Hash") to
  1063. // unconditionally include in API requests. By default, fields with
  1064. // empty values are omitted from API requests. However, any non-pointer,
  1065. // non-interface field appearing in ForceSendFields will be sent to the
  1066. // server regardless of whether the field is empty or not. This may be
  1067. // used to include empty fields in Patch requests.
  1068. ForceSendFields []string `json:"-"`
  1069. // NullFields is a list of field names (e.g. "Hash") to include in API
  1070. // requests with the JSON null value. By default, fields with empty
  1071. // values are omitted from API requests. However, any field with an
  1072. // empty value appearing in NullFields will be sent to the server as
  1073. // null. It is an error if a field in this list has a non-empty value.
  1074. // This may be used to include null fields in Patch requests.
  1075. NullFields []string `json:"-"`
  1076. }
  1077. func (s *VersionFile) MarshalJSON() ([]byte, error) {
  1078. type NoMethod VersionFile
  1079. raw := NoMethod(*s)
  1080. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1081. }
  1082. // method id "firebasehosting.sites.getConfig":
  1083. type SitesGetConfigCall struct {
  1084. s *Service
  1085. name string
  1086. urlParams_ gensupport.URLParams
  1087. ifNoneMatch_ string
  1088. ctx_ context.Context
  1089. header_ http.Header
  1090. }
  1091. // GetConfig: Gets the Hosting metadata for a specific site.
  1092. func (r *SitesService) GetConfig(name string) *SitesGetConfigCall {
  1093. c := &SitesGetConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1094. c.name = name
  1095. return c
  1096. }
  1097. // Fields allows partial responses to be retrieved. See
  1098. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1099. // for more information.
  1100. func (c *SitesGetConfigCall) Fields(s ...googleapi.Field) *SitesGetConfigCall {
  1101. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1102. return c
  1103. }
  1104. // IfNoneMatch sets the optional parameter which makes the operation
  1105. // fail if the object's ETag matches the given value. This is useful for
  1106. // getting updates only after the object has changed since the last
  1107. // request. Use googleapi.IsNotModified to check whether the response
  1108. // error from Do is the result of In-None-Match.
  1109. func (c *SitesGetConfigCall) IfNoneMatch(entityTag string) *SitesGetConfigCall {
  1110. c.ifNoneMatch_ = entityTag
  1111. return c
  1112. }
  1113. // Context sets the context to be used in this call's Do method. Any
  1114. // pending HTTP request will be aborted if the provided context is
  1115. // canceled.
  1116. func (c *SitesGetConfigCall) Context(ctx context.Context) *SitesGetConfigCall {
  1117. c.ctx_ = ctx
  1118. return c
  1119. }
  1120. // Header returns an http.Header that can be modified by the caller to
  1121. // add HTTP headers to the request.
  1122. func (c *SitesGetConfigCall) Header() http.Header {
  1123. if c.header_ == nil {
  1124. c.header_ = make(http.Header)
  1125. }
  1126. return c.header_
  1127. }
  1128. func (c *SitesGetConfigCall) doRequest(alt string) (*http.Response, error) {
  1129. reqHeaders := make(http.Header)
  1130. for k, v := range c.header_ {
  1131. reqHeaders[k] = v
  1132. }
  1133. reqHeaders.Set("User-Agent", c.s.userAgent())
  1134. if c.ifNoneMatch_ != "" {
  1135. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1136. }
  1137. var body io.Reader = nil
  1138. c.urlParams_.Set("alt", alt)
  1139. c.urlParams_.Set("prettyPrint", "false")
  1140. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  1141. urls += "?" + c.urlParams_.Encode()
  1142. req, err := http.NewRequest("GET", urls, body)
  1143. if err != nil {
  1144. return nil, err
  1145. }
  1146. req.Header = reqHeaders
  1147. googleapi.Expand(req.URL, map[string]string{
  1148. "name": c.name,
  1149. })
  1150. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1151. }
  1152. // Do executes the "firebasehosting.sites.getConfig" call.
  1153. // Exactly one of *SiteConfig or error will be non-nil. Any non-2xx
  1154. // status code is an error. Response headers are in either
  1155. // *SiteConfig.ServerResponse.Header or (if a response was returned at
  1156. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1157. // to check whether the returned error was because
  1158. // http.StatusNotModified was returned.
  1159. func (c *SitesGetConfigCall) Do(opts ...googleapi.CallOption) (*SiteConfig, error) {
  1160. gensupport.SetOptions(c.urlParams_, opts...)
  1161. res, err := c.doRequest("json")
  1162. if res != nil && res.StatusCode == http.StatusNotModified {
  1163. if res.Body != nil {
  1164. res.Body.Close()
  1165. }
  1166. return nil, &googleapi.Error{
  1167. Code: res.StatusCode,
  1168. Header: res.Header,
  1169. }
  1170. }
  1171. if err != nil {
  1172. return nil, err
  1173. }
  1174. defer googleapi.CloseBody(res)
  1175. if err := googleapi.CheckResponse(res); err != nil {
  1176. return nil, err
  1177. }
  1178. ret := &SiteConfig{
  1179. ServerResponse: googleapi.ServerResponse{
  1180. Header: res.Header,
  1181. HTTPStatusCode: res.StatusCode,
  1182. },
  1183. }
  1184. target := &ret
  1185. if err := gensupport.DecodeResponse(target, res); err != nil {
  1186. return nil, err
  1187. }
  1188. return ret, nil
  1189. // {
  1190. // "description": "Gets the Hosting metadata for a specific site.",
  1191. // "flatPath": "v1beta1/sites/{sitesId}/config",
  1192. // "httpMethod": "GET",
  1193. // "id": "firebasehosting.sites.getConfig",
  1194. // "parameterOrder": [
  1195. // "name"
  1196. // ],
  1197. // "parameters": {
  1198. // "name": {
  1199. // "description": "Required. The site for which to get the SiteConfig, in the format:\n\u003ccode\u003esites/\u003cvar\u003esite-name\u003c/var\u003e/config\u003c/code\u003e",
  1200. // "location": "path",
  1201. // "pattern": "^sites/[^/]+/config$",
  1202. // "required": true,
  1203. // "type": "string"
  1204. // }
  1205. // },
  1206. // "path": "v1beta1/{+name}",
  1207. // "response": {
  1208. // "$ref": "SiteConfig"
  1209. // },
  1210. // "scopes": [
  1211. // "https://www.googleapis.com/auth/cloud-platform",
  1212. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  1213. // "https://www.googleapis.com/auth/firebase",
  1214. // "https://www.googleapis.com/auth/firebase.readonly"
  1215. // ]
  1216. // }
  1217. }
  1218. // method id "firebasehosting.sites.updateConfig":
  1219. type SitesUpdateConfigCall struct {
  1220. s *Service
  1221. name string
  1222. siteconfig *SiteConfig
  1223. urlParams_ gensupport.URLParams
  1224. ctx_ context.Context
  1225. header_ http.Header
  1226. }
  1227. // UpdateConfig: Sets the Hosting metadata for a specific site.
  1228. func (r *SitesService) UpdateConfig(name string, siteconfig *SiteConfig) *SitesUpdateConfigCall {
  1229. c := &SitesUpdateConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1230. c.name = name
  1231. c.siteconfig = siteconfig
  1232. return c
  1233. }
  1234. // UpdateMask sets the optional parameter "updateMask": A set of field
  1235. // names from your [site configuration](../sites.SiteConfig)
  1236. // that you want to update.
  1237. // <br>A field will be overwritten if, and only if, it's in the
  1238. // mask.
  1239. // <br>If a mask is not provided then a default mask of
  1240. // only
  1241. // [`max_versions`](../sites.SiteConfig.max_versions) will be used.
  1242. func (c *SitesUpdateConfigCall) UpdateMask(updateMask string) *SitesUpdateConfigCall {
  1243. c.urlParams_.Set("updateMask", updateMask)
  1244. return c
  1245. }
  1246. // Fields allows partial responses to be retrieved. See
  1247. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1248. // for more information.
  1249. func (c *SitesUpdateConfigCall) Fields(s ...googleapi.Field) *SitesUpdateConfigCall {
  1250. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1251. return c
  1252. }
  1253. // Context sets the context to be used in this call's Do method. Any
  1254. // pending HTTP request will be aborted if the provided context is
  1255. // canceled.
  1256. func (c *SitesUpdateConfigCall) Context(ctx context.Context) *SitesUpdateConfigCall {
  1257. c.ctx_ = ctx
  1258. return c
  1259. }
  1260. // Header returns an http.Header that can be modified by the caller to
  1261. // add HTTP headers to the request.
  1262. func (c *SitesUpdateConfigCall) Header() http.Header {
  1263. if c.header_ == nil {
  1264. c.header_ = make(http.Header)
  1265. }
  1266. return c.header_
  1267. }
  1268. func (c *SitesUpdateConfigCall) doRequest(alt string) (*http.Response, error) {
  1269. reqHeaders := make(http.Header)
  1270. for k, v := range c.header_ {
  1271. reqHeaders[k] = v
  1272. }
  1273. reqHeaders.Set("User-Agent", c.s.userAgent())
  1274. var body io.Reader = nil
  1275. body, err := googleapi.WithoutDataWrapper.JSONReader(c.siteconfig)
  1276. if err != nil {
  1277. return nil, err
  1278. }
  1279. reqHeaders.Set("Content-Type", "application/json")
  1280. c.urlParams_.Set("alt", alt)
  1281. c.urlParams_.Set("prettyPrint", "false")
  1282. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  1283. urls += "?" + c.urlParams_.Encode()
  1284. req, err := http.NewRequest("PATCH", urls, body)
  1285. if err != nil {
  1286. return nil, err
  1287. }
  1288. req.Header = reqHeaders
  1289. googleapi.Expand(req.URL, map[string]string{
  1290. "name": c.name,
  1291. })
  1292. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1293. }
  1294. // Do executes the "firebasehosting.sites.updateConfig" call.
  1295. // Exactly one of *SiteConfig or error will be non-nil. Any non-2xx
  1296. // status code is an error. Response headers are in either
  1297. // *SiteConfig.ServerResponse.Header or (if a response was returned at
  1298. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1299. // to check whether the returned error was because
  1300. // http.StatusNotModified was returned.
  1301. func (c *SitesUpdateConfigCall) Do(opts ...googleapi.CallOption) (*SiteConfig, error) {
  1302. gensupport.SetOptions(c.urlParams_, opts...)
  1303. res, err := c.doRequest("json")
  1304. if res != nil && res.StatusCode == http.StatusNotModified {
  1305. if res.Body != nil {
  1306. res.Body.Close()
  1307. }
  1308. return nil, &googleapi.Error{
  1309. Code: res.StatusCode,
  1310. Header: res.Header,
  1311. }
  1312. }
  1313. if err != nil {
  1314. return nil, err
  1315. }
  1316. defer googleapi.CloseBody(res)
  1317. if err := googleapi.CheckResponse(res); err != nil {
  1318. return nil, err
  1319. }
  1320. ret := &SiteConfig{
  1321. ServerResponse: googleapi.ServerResponse{
  1322. Header: res.Header,
  1323. HTTPStatusCode: res.StatusCode,
  1324. },
  1325. }
  1326. target := &ret
  1327. if err := gensupport.DecodeResponse(target, res); err != nil {
  1328. return nil, err
  1329. }
  1330. return ret, nil
  1331. // {
  1332. // "description": "Sets the Hosting metadata for a specific site.",
  1333. // "flatPath": "v1beta1/sites/{sitesId}/config",
  1334. // "httpMethod": "PATCH",
  1335. // "id": "firebasehosting.sites.updateConfig",
  1336. // "parameterOrder": [
  1337. // "name"
  1338. // ],
  1339. // "parameters": {
  1340. // "name": {
  1341. // "description": "Required. The site for which to update the SiteConfig, in the format:\n\u003ccode\u003esites/\u003cvar\u003esite-name\u003c/var\u003e/config\u003c/code\u003e",
  1342. // "location": "path",
  1343. // "pattern": "^sites/[^/]+/config$",
  1344. // "required": true,
  1345. // "type": "string"
  1346. // },
  1347. // "updateMask": {
  1348. // "description": "A set of field names from your [site configuration](../sites.SiteConfig)\nthat you want to update.\n\u003cbr\u003eA field will be overwritten if, and only if, it's in the mask.\n\u003cbr\u003eIf a mask is not provided then a default mask of only\n[`max_versions`](../sites.SiteConfig.max_versions) will be used.",
  1349. // "format": "google-fieldmask",
  1350. // "location": "query",
  1351. // "type": "string"
  1352. // }
  1353. // },
  1354. // "path": "v1beta1/{+name}",
  1355. // "request": {
  1356. // "$ref": "SiteConfig"
  1357. // },
  1358. // "response": {
  1359. // "$ref": "SiteConfig"
  1360. // },
  1361. // "scopes": [
  1362. // "https://www.googleapis.com/auth/cloud-platform",
  1363. // "https://www.googleapis.com/auth/firebase"
  1364. // ]
  1365. // }
  1366. }
  1367. // method id "firebasehosting.sites.domains.create":
  1368. type SitesDomainsCreateCall struct {
  1369. s *Service
  1370. parent string
  1371. domain *Domain
  1372. urlParams_ gensupport.URLParams
  1373. ctx_ context.Context
  1374. header_ http.Header
  1375. }
  1376. // Create: Creates a domain mapping on the specified site.
  1377. func (r *SitesDomainsService) Create(parent string, domain *Domain) *SitesDomainsCreateCall {
  1378. c := &SitesDomainsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1379. c.parent = parent
  1380. c.domain = domain
  1381. return c
  1382. }
  1383. // Fields allows partial responses to be retrieved. See
  1384. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1385. // for more information.
  1386. func (c *SitesDomainsCreateCall) Fields(s ...googleapi.Field) *SitesDomainsCreateCall {
  1387. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1388. return c
  1389. }
  1390. // Context sets the context to be used in this call's Do method. Any
  1391. // pending HTTP request will be aborted if the provided context is
  1392. // canceled.
  1393. func (c *SitesDomainsCreateCall) Context(ctx context.Context) *SitesDomainsCreateCall {
  1394. c.ctx_ = ctx
  1395. return c
  1396. }
  1397. // Header returns an http.Header that can be modified by the caller to
  1398. // add HTTP headers to the request.
  1399. func (c *SitesDomainsCreateCall) Header() http.Header {
  1400. if c.header_ == nil {
  1401. c.header_ = make(http.Header)
  1402. }
  1403. return c.header_
  1404. }
  1405. func (c *SitesDomainsCreateCall) doRequest(alt string) (*http.Response, error) {
  1406. reqHeaders := make(http.Header)
  1407. for k, v := range c.header_ {
  1408. reqHeaders[k] = v
  1409. }
  1410. reqHeaders.Set("User-Agent", c.s.userAgent())
  1411. var body io.Reader = nil
  1412. body, err := googleapi.WithoutDataWrapper.JSONReader(c.domain)
  1413. if err != nil {
  1414. return nil, err
  1415. }
  1416. reqHeaders.Set("Content-Type", "application/json")
  1417. c.urlParams_.Set("alt", alt)
  1418. c.urlParams_.Set("prettyPrint", "false")
  1419. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/domains")
  1420. urls += "?" + c.urlParams_.Encode()
  1421. req, err := http.NewRequest("POST", urls, body)
  1422. if err != nil {
  1423. return nil, err
  1424. }
  1425. req.Header = reqHeaders
  1426. googleapi.Expand(req.URL, map[string]string{
  1427. "parent": c.parent,
  1428. })
  1429. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1430. }
  1431. // Do executes the "firebasehosting.sites.domains.create" call.
  1432. // Exactly one of *Domain or error will be non-nil. Any non-2xx status
  1433. // code is an error. Response headers are in either
  1434. // *Domain.ServerResponse.Header or (if a response was returned at all)
  1435. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1436. // check whether the returned error was because http.StatusNotModified
  1437. // was returned.
  1438. func (c *SitesDomainsCreateCall) Do(opts ...googleapi.CallOption) (*Domain, error) {
  1439. gensupport.SetOptions(c.urlParams_, opts...)
  1440. res, err := c.doRequest("json")
  1441. if res != nil && res.StatusCode == http.StatusNotModified {
  1442. if res.Body != nil {
  1443. res.Body.Close()
  1444. }
  1445. return nil, &googleapi.Error{
  1446. Code: res.StatusCode,
  1447. Header: res.Header,
  1448. }
  1449. }
  1450. if err != nil {
  1451. return nil, err
  1452. }
  1453. defer googleapi.CloseBody(res)
  1454. if err := googleapi.CheckResponse(res); err != nil {
  1455. return nil, err
  1456. }
  1457. ret := &Domain{
  1458. ServerResponse: googleapi.ServerResponse{
  1459. Header: res.Header,
  1460. HTTPStatusCode: res.StatusCode,
  1461. },
  1462. }
  1463. target := &ret
  1464. if err := gensupport.DecodeResponse(target, res); err != nil {
  1465. return nil, err
  1466. }
  1467. return ret, nil
  1468. // {
  1469. // "description": "Creates a domain mapping on the specified site.",
  1470. // "flatPath": "v1beta1/sites/{sitesId}/domains",
  1471. // "httpMethod": "POST",
  1472. // "id": "firebasehosting.sites.domains.create",
  1473. // "parameterOrder": [
  1474. // "parent"
  1475. // ],
  1476. // "parameters": {
  1477. // "parent": {
  1478. // "description": "Required. The parent to create the domain association for, in the format:\n\u003ccode\u003esites/\u003cvar\u003esite-name\u003c/var\u003e\u003c/code\u003e",
  1479. // "location": "path",
  1480. // "pattern": "^sites/[^/]+$",
  1481. // "required": true,
  1482. // "type": "string"
  1483. // }
  1484. // },
  1485. // "path": "v1beta1/{+parent}/domains",
  1486. // "request": {
  1487. // "$ref": "Domain"
  1488. // },
  1489. // "response": {
  1490. // "$ref": "Domain"
  1491. // },
  1492. // "scopes": [
  1493. // "https://www.googleapis.com/auth/cloud-platform",
  1494. // "https://www.googleapis.com/auth/firebase"
  1495. // ]
  1496. // }
  1497. }
  1498. // method id "firebasehosting.sites.domains.delete":
  1499. type SitesDomainsDeleteCall struct {
  1500. s *Service
  1501. name string
  1502. urlParams_ gensupport.URLParams
  1503. ctx_ context.Context
  1504. header_ http.Header
  1505. }
  1506. // Delete: Deletes the existing domain mapping on the specified site.
  1507. func (r *SitesDomainsService) Delete(name string) *SitesDomainsDeleteCall {
  1508. c := &SitesDomainsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1509. c.name = name
  1510. return c
  1511. }
  1512. // Fields allows partial responses to be retrieved. See
  1513. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1514. // for more information.
  1515. func (c *SitesDomainsDeleteCall) Fields(s ...googleapi.Field) *SitesDomainsDeleteCall {
  1516. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1517. return c
  1518. }
  1519. // Context sets the context to be used in this call's Do method. Any
  1520. // pending HTTP request will be aborted if the provided context is
  1521. // canceled.
  1522. func (c *SitesDomainsDeleteCall) Context(ctx context.Context) *SitesDomainsDeleteCall {
  1523. c.ctx_ = ctx
  1524. return c
  1525. }
  1526. // Header returns an http.Header that can be modified by the caller to
  1527. // add HTTP headers to the request.
  1528. func (c *SitesDomainsDeleteCall) Header() http.Header {
  1529. if c.header_ == nil {
  1530. c.header_ = make(http.Header)
  1531. }
  1532. return c.header_
  1533. }
  1534. func (c *SitesDomainsDeleteCall) doRequest(alt string) (*http.Response, error) {
  1535. reqHeaders := make(http.Header)
  1536. for k, v := range c.header_ {
  1537. reqHeaders[k] = v
  1538. }
  1539. reqHeaders.Set("User-Agent", c.s.userAgent())
  1540. var body io.Reader = nil
  1541. c.urlParams_.Set("alt", alt)
  1542. c.urlParams_.Set("prettyPrint", "false")
  1543. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  1544. urls += "?" + c.urlParams_.Encode()
  1545. req, err := http.NewRequest("DELETE", urls, body)
  1546. if err != nil {
  1547. return nil, err
  1548. }
  1549. req.Header = reqHeaders
  1550. googleapi.Expand(req.URL, map[string]string{
  1551. "name": c.name,
  1552. })
  1553. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1554. }
  1555. // Do executes the "firebasehosting.sites.domains.delete" call.
  1556. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  1557. // code is an error. Response headers are in either
  1558. // *Empty.ServerResponse.Header or (if a response was returned at all)
  1559. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1560. // check whether the returned error was because http.StatusNotModified
  1561. // was returned.
  1562. func (c *SitesDomainsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  1563. gensupport.SetOptions(c.urlParams_, opts...)
  1564. res, err := c.doRequest("json")
  1565. if res != nil && res.StatusCode == http.StatusNotModified {
  1566. if res.Body != nil {
  1567. res.Body.Close()
  1568. }
  1569. return nil, &googleapi.Error{
  1570. Code: res.StatusCode,
  1571. Header: res.Header,
  1572. }
  1573. }
  1574. if err != nil {
  1575. return nil, err
  1576. }
  1577. defer googleapi.CloseBody(res)
  1578. if err := googleapi.CheckResponse(res); err != nil {
  1579. return nil, err
  1580. }
  1581. ret := &Empty{
  1582. ServerResponse: googleapi.ServerResponse{
  1583. Header: res.Header,
  1584. HTTPStatusCode: res.StatusCode,
  1585. },
  1586. }
  1587. target := &ret
  1588. if err := gensupport.DecodeResponse(target, res); err != nil {
  1589. return nil, err
  1590. }
  1591. return ret, nil
  1592. // {
  1593. // "description": "Deletes the existing domain mapping on the specified site.",
  1594. // "flatPath": "v1beta1/sites/{sitesId}/domains/{domainsId}",
  1595. // "httpMethod": "DELETE",
  1596. // "id": "firebasehosting.sites.domains.delete",
  1597. // "parameterOrder": [
  1598. // "name"
  1599. // ],
  1600. // "parameters": {
  1601. // "name": {
  1602. // "description": "Required. The name of the domain association to delete.",
  1603. // "location": "path",
  1604. // "pattern": "^sites/[^/]+/domains/[^/]+$",
  1605. // "required": true,
  1606. // "type": "string"
  1607. // }
  1608. // },
  1609. // "path": "v1beta1/{+name}",
  1610. // "response": {
  1611. // "$ref": "Empty"
  1612. // },
  1613. // "scopes": [
  1614. // "https://www.googleapis.com/auth/cloud-platform",
  1615. // "https://www.googleapis.com/auth/firebase"
  1616. // ]
  1617. // }
  1618. }
  1619. // method id "firebasehosting.sites.domains.get":
  1620. type SitesDomainsGetCall struct {
  1621. s *Service
  1622. name string
  1623. urlParams_ gensupport.URLParams
  1624. ifNoneMatch_ string
  1625. ctx_ context.Context
  1626. header_ http.Header
  1627. }
  1628. // Get: Gets a domain mapping on the specified site.
  1629. func (r *SitesDomainsService) Get(name string) *SitesDomainsGetCall {
  1630. c := &SitesDomainsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1631. c.name = name
  1632. return c
  1633. }
  1634. // Fields allows partial responses to be retrieved. See
  1635. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1636. // for more information.
  1637. func (c *SitesDomainsGetCall) Fields(s ...googleapi.Field) *SitesDomainsGetCall {
  1638. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1639. return c
  1640. }
  1641. // IfNoneMatch sets the optional parameter which makes the operation
  1642. // fail if the object's ETag matches the given value. This is useful for
  1643. // getting updates only after the object has changed since the last
  1644. // request. Use googleapi.IsNotModified to check whether the response
  1645. // error from Do is the result of In-None-Match.
  1646. func (c *SitesDomainsGetCall) IfNoneMatch(entityTag string) *SitesDomainsGetCall {
  1647. c.ifNoneMatch_ = entityTag
  1648. return c
  1649. }
  1650. // Context sets the context to be used in this call's Do method. Any
  1651. // pending HTTP request will be aborted if the provided context is
  1652. // canceled.
  1653. func (c *SitesDomainsGetCall) Context(ctx context.Context) *SitesDomainsGetCall {
  1654. c.ctx_ = ctx
  1655. return c
  1656. }
  1657. // Header returns an http.Header that can be modified by the caller to
  1658. // add HTTP headers to the request.
  1659. func (c *SitesDomainsGetCall) Header() http.Header {
  1660. if c.header_ == nil {
  1661. c.header_ = make(http.Header)
  1662. }
  1663. return c.header_
  1664. }
  1665. func (c *SitesDomainsGetCall) doRequest(alt string) (*http.Response, error) {
  1666. reqHeaders := make(http.Header)
  1667. for k, v := range c.header_ {
  1668. reqHeaders[k] = v
  1669. }
  1670. reqHeaders.Set("User-Agent", c.s.userAgent())
  1671. if c.ifNoneMatch_ != "" {
  1672. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1673. }
  1674. var body io.Reader = nil
  1675. c.urlParams_.Set("alt", alt)
  1676. c.urlParams_.Set("prettyPrint", "false")
  1677. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  1678. urls += "?" + c.urlParams_.Encode()
  1679. req, err := http.NewRequest("GET", urls, body)
  1680. if err != nil {
  1681. return nil, err
  1682. }
  1683. req.Header = reqHeaders
  1684. googleapi.Expand(req.URL, map[string]string{
  1685. "name": c.name,
  1686. })
  1687. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1688. }
  1689. // Do executes the "firebasehosting.sites.domains.get" call.
  1690. // Exactly one of *Domain or error will be non-nil. Any non-2xx status
  1691. // code is an error. Response headers are in either
  1692. // *Domain.ServerResponse.Header or (if a response was returned at all)
  1693. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1694. // check whether the returned error was because http.StatusNotModified
  1695. // was returned.
  1696. func (c *SitesDomainsGetCall) Do(opts ...googleapi.CallOption) (*Domain, error) {
  1697. gensupport.SetOptions(c.urlParams_, opts...)
  1698. res, err := c.doRequest("json")
  1699. if res != nil && res.StatusCode == http.StatusNotModified {
  1700. if res.Body != nil {
  1701. res.Body.Close()
  1702. }
  1703. return nil, &googleapi.Error{
  1704. Code: res.StatusCode,
  1705. Header: res.Header,
  1706. }
  1707. }
  1708. if err != nil {
  1709. return nil, err
  1710. }
  1711. defer googleapi.CloseBody(res)
  1712. if err := googleapi.CheckResponse(res); err != nil {
  1713. return nil, err
  1714. }
  1715. ret := &Domain{
  1716. ServerResponse: googleapi.ServerResponse{
  1717. Header: res.Header,
  1718. HTTPStatusCode: res.StatusCode,
  1719. },
  1720. }
  1721. target := &ret
  1722. if err := gensupport.DecodeResponse(target, res); err != nil {
  1723. return nil, err
  1724. }
  1725. return ret, nil
  1726. // {
  1727. // "description": "Gets a domain mapping on the specified site.",
  1728. // "flatPath": "v1beta1/sites/{sitesId}/domains/{domainsId}",
  1729. // "httpMethod": "GET",
  1730. // "id": "firebasehosting.sites.domains.get",
  1731. // "parameterOrder": [
  1732. // "name"
  1733. // ],
  1734. // "parameters": {
  1735. // "name": {
  1736. // "description": "Required. The name of the domain configuration to get.",
  1737. // "location": "path",
  1738. // "pattern": "^sites/[^/]+/domains/[^/]+$",
  1739. // "required": true,
  1740. // "type": "string"
  1741. // }
  1742. // },
  1743. // "path": "v1beta1/{+name}",
  1744. // "response": {
  1745. // "$ref": "Domain"
  1746. // },
  1747. // "scopes": [
  1748. // "https://www.googleapis.com/auth/cloud-platform",
  1749. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  1750. // "https://www.googleapis.com/auth/firebase",
  1751. // "https://www.googleapis.com/auth/firebase.readonly"
  1752. // ]
  1753. // }
  1754. }
  1755. // method id "firebasehosting.sites.domains.list":
  1756. type SitesDomainsListCall struct {
  1757. s *Service
  1758. parent string
  1759. urlParams_ gensupport.URLParams
  1760. ifNoneMatch_ string
  1761. ctx_ context.Context
  1762. header_ http.Header
  1763. }
  1764. // List: Lists the domains for the specified site.
  1765. func (r *SitesDomainsService) List(parent string) *SitesDomainsListCall {
  1766. c := &SitesDomainsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1767. c.parent = parent
  1768. return c
  1769. }
  1770. // PageSize sets the optional parameter "pageSize": The page size to
  1771. // return. Defaults to 50.
  1772. func (c *SitesDomainsListCall) PageSize(pageSize int64) *SitesDomainsListCall {
  1773. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1774. return c
  1775. }
  1776. // PageToken sets the optional parameter "pageToken": The
  1777. // next_page_token from a previous request, if provided.
  1778. func (c *SitesDomainsListCall) PageToken(pageToken string) *SitesDomainsListCall {
  1779. c.urlParams_.Set("pageToken", pageToken)
  1780. return c
  1781. }
  1782. // Fields allows partial responses to be retrieved. See
  1783. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1784. // for more information.
  1785. func (c *SitesDomainsListCall) Fields(s ...googleapi.Field) *SitesDomainsListCall {
  1786. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1787. return c
  1788. }
  1789. // IfNoneMatch sets the optional parameter which makes the operation
  1790. // fail if the object's ETag matches the given value. This is useful for
  1791. // getting updates only after the object has changed since the last
  1792. // request. Use googleapi.IsNotModified to check whether the response
  1793. // error from Do is the result of In-None-Match.
  1794. func (c *SitesDomainsListCall) IfNoneMatch(entityTag string) *SitesDomainsListCall {
  1795. c.ifNoneMatch_ = entityTag
  1796. return c
  1797. }
  1798. // Context sets the context to be used in this call's Do method. Any
  1799. // pending HTTP request will be aborted if the provided context is
  1800. // canceled.
  1801. func (c *SitesDomainsListCall) Context(ctx context.Context) *SitesDomainsListCall {
  1802. c.ctx_ = ctx
  1803. return c
  1804. }
  1805. // Header returns an http.Header that can be modified by the caller to
  1806. // add HTTP headers to the request.
  1807. func (c *SitesDomainsListCall) Header() http.Header {
  1808. if c.header_ == nil {
  1809. c.header_ = make(http.Header)
  1810. }
  1811. return c.header_
  1812. }
  1813. func (c *SitesDomainsListCall) doRequest(alt string) (*http.Response, error) {
  1814. reqHeaders := make(http.Header)
  1815. for k, v := range c.header_ {
  1816. reqHeaders[k] = v
  1817. }
  1818. reqHeaders.Set("User-Agent", c.s.userAgent())
  1819. if c.ifNoneMatch_ != "" {
  1820. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1821. }
  1822. var body io.Reader = nil
  1823. c.urlParams_.Set("alt", alt)
  1824. c.urlParams_.Set("prettyPrint", "false")
  1825. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/domains")
  1826. urls += "?" + c.urlParams_.Encode()
  1827. req, err := http.NewRequest("GET", urls, body)
  1828. if err != nil {
  1829. return nil, err
  1830. }
  1831. req.Header = reqHeaders
  1832. googleapi.Expand(req.URL, map[string]string{
  1833. "parent": c.parent,
  1834. })
  1835. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1836. }
  1837. // Do executes the "firebasehosting.sites.domains.list" call.
  1838. // Exactly one of *ListDomainsResponse or error will be non-nil. Any
  1839. // non-2xx status code is an error. Response headers are in either
  1840. // *ListDomainsResponse.ServerResponse.Header or (if a response was
  1841. // returned at all) in error.(*googleapi.Error).Header. Use
  1842. // googleapi.IsNotModified to check whether the returned error was
  1843. // because http.StatusNotModified was returned.
  1844. func (c *SitesDomainsListCall) Do(opts ...googleapi.CallOption) (*ListDomainsResponse, error) {
  1845. gensupport.SetOptions(c.urlParams_, opts...)
  1846. res, err := c.doRequest("json")
  1847. if res != nil && res.StatusCode == http.StatusNotModified {
  1848. if res.Body != nil {
  1849. res.Body.Close()
  1850. }
  1851. return nil, &googleapi.Error{
  1852. Code: res.StatusCode,
  1853. Header: res.Header,
  1854. }
  1855. }
  1856. if err != nil {
  1857. return nil, err
  1858. }
  1859. defer googleapi.CloseBody(res)
  1860. if err := googleapi.CheckResponse(res); err != nil {
  1861. return nil, err
  1862. }
  1863. ret := &ListDomainsResponse{
  1864. ServerResponse: googleapi.ServerResponse{
  1865. Header: res.Header,
  1866. HTTPStatusCode: res.StatusCode,
  1867. },
  1868. }
  1869. target := &ret
  1870. if err := gensupport.DecodeResponse(target, res); err != nil {
  1871. return nil, err
  1872. }
  1873. return ret, nil
  1874. // {
  1875. // "description": "Lists the domains for the specified site.",
  1876. // "flatPath": "v1beta1/sites/{sitesId}/domains",
  1877. // "httpMethod": "GET",
  1878. // "id": "firebasehosting.sites.domains.list",
  1879. // "parameterOrder": [
  1880. // "parent"
  1881. // ],
  1882. // "parameters": {
  1883. // "pageSize": {
  1884. // "description": "The page size to return. Defaults to 50.",
  1885. // "format": "int32",
  1886. // "location": "query",
  1887. // "type": "integer"
  1888. // },
  1889. // "pageToken": {
  1890. // "description": "The next_page_token from a previous request, if provided.",
  1891. // "location": "query",
  1892. // "type": "string"
  1893. // },
  1894. // "parent": {
  1895. // "description": "Required. The parent for which to list domains, in the format:\n\u003ccode\u003esites/\u003cvar\u003esite-name\u003c/var\u003e\u003c/code\u003e",
  1896. // "location": "path",
  1897. // "pattern": "^sites/[^/]+$",
  1898. // "required": true,
  1899. // "type": "string"
  1900. // }
  1901. // },
  1902. // "path": "v1beta1/{+parent}/domains",
  1903. // "response": {
  1904. // "$ref": "ListDomainsResponse"
  1905. // },
  1906. // "scopes": [
  1907. // "https://www.googleapis.com/auth/cloud-platform",
  1908. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  1909. // "https://www.googleapis.com/auth/firebase",
  1910. // "https://www.googleapis.com/auth/firebase.readonly"
  1911. // ]
  1912. // }
  1913. }
  1914. // Pages invokes f for each page of results.
  1915. // A non-nil error returned from f will halt the iteration.
  1916. // The provided context supersedes any context provided to the Context method.
  1917. func (c *SitesDomainsListCall) Pages(ctx context.Context, f func(*ListDomainsResponse) error) error {
  1918. c.ctx_ = ctx
  1919. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1920. for {
  1921. x, err := c.Do()
  1922. if err != nil {
  1923. return err
  1924. }
  1925. if err := f(x); err != nil {
  1926. return err
  1927. }
  1928. if x.NextPageToken == "" {
  1929. return nil
  1930. }
  1931. c.PageToken(x.NextPageToken)
  1932. }
  1933. }
  1934. // method id "firebasehosting.sites.domains.update":
  1935. type SitesDomainsUpdateCall struct {
  1936. s *Service
  1937. name string
  1938. domain *Domain
  1939. urlParams_ gensupport.URLParams
  1940. ctx_ context.Context
  1941. header_ http.Header
  1942. }
  1943. // Update: Updates the specified domain mapping, creating the mapping as
  1944. // if it does
  1945. // not exist.
  1946. func (r *SitesDomainsService) Update(name string, domain *Domain) *SitesDomainsUpdateCall {
  1947. c := &SitesDomainsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1948. c.name = name
  1949. c.domain = domain
  1950. return c
  1951. }
  1952. // Fields allows partial responses to be retrieved. See
  1953. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1954. // for more information.
  1955. func (c *SitesDomainsUpdateCall) Fields(s ...googleapi.Field) *SitesDomainsUpdateCall {
  1956. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1957. return c
  1958. }
  1959. // Context sets the context to be used in this call's Do method. Any
  1960. // pending HTTP request will be aborted if the provided context is
  1961. // canceled.
  1962. func (c *SitesDomainsUpdateCall) Context(ctx context.Context) *SitesDomainsUpdateCall {
  1963. c.ctx_ = ctx
  1964. return c
  1965. }
  1966. // Header returns an http.Header that can be modified by the caller to
  1967. // add HTTP headers to the request.
  1968. func (c *SitesDomainsUpdateCall) Header() http.Header {
  1969. if c.header_ == nil {
  1970. c.header_ = make(http.Header)
  1971. }
  1972. return c.header_
  1973. }
  1974. func (c *SitesDomainsUpdateCall) doRequest(alt string) (*http.Response, error) {
  1975. reqHeaders := make(http.Header)
  1976. for k, v := range c.header_ {
  1977. reqHeaders[k] = v
  1978. }
  1979. reqHeaders.Set("User-Agent", c.s.userAgent())
  1980. var body io.Reader = nil
  1981. body, err := googleapi.WithoutDataWrapper.JSONReader(c.domain)
  1982. if err != nil {
  1983. return nil, err
  1984. }
  1985. reqHeaders.Set("Content-Type", "application/json")
  1986. c.urlParams_.Set("alt", alt)
  1987. c.urlParams_.Set("prettyPrint", "false")
  1988. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  1989. urls += "?" + c.urlParams_.Encode()
  1990. req, err := http.NewRequest("PUT", urls, body)
  1991. if err != nil {
  1992. return nil, err
  1993. }
  1994. req.Header = reqHeaders
  1995. googleapi.Expand(req.URL, map[string]string{
  1996. "name": c.name,
  1997. })
  1998. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1999. }
  2000. // Do executes the "firebasehosting.sites.domains.update" call.
  2001. // Exactly one of *Domain or error will be non-nil. Any non-2xx status
  2002. // code is an error. Response headers are in either
  2003. // *Domain.ServerResponse.Header or (if a response was returned at all)
  2004. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2005. // check whether the returned error was because http.StatusNotModified
  2006. // was returned.
  2007. func (c *SitesDomainsUpdateCall) Do(opts ...googleapi.CallOption) (*Domain, error) {
  2008. gensupport.SetOptions(c.urlParams_, opts...)
  2009. res, err := c.doRequest("json")
  2010. if res != nil && res.StatusCode == http.StatusNotModified {
  2011. if res.Body != nil {
  2012. res.Body.Close()
  2013. }
  2014. return nil, &googleapi.Error{
  2015. Code: res.StatusCode,
  2016. Header: res.Header,
  2017. }
  2018. }
  2019. if err != nil {
  2020. return nil, err
  2021. }
  2022. defer googleapi.CloseBody(res)
  2023. if err := googleapi.CheckResponse(res); err != nil {
  2024. return nil, err
  2025. }
  2026. ret := &Domain{
  2027. ServerResponse: googleapi.ServerResponse{
  2028. Header: res.Header,
  2029. HTTPStatusCode: res.StatusCode,
  2030. },
  2031. }
  2032. target := &ret
  2033. if err := gensupport.DecodeResponse(target, res); err != nil {
  2034. return nil, err
  2035. }
  2036. return ret, nil
  2037. // {
  2038. // "description": "Updates the specified domain mapping, creating the mapping as if it does\nnot exist.",
  2039. // "flatPath": "v1beta1/sites/{sitesId}/domains/{domainsId}",
  2040. // "httpMethod": "PUT",
  2041. // "id": "firebasehosting.sites.domains.update",
  2042. // "parameterOrder": [
  2043. // "name"
  2044. // ],
  2045. // "parameters": {
  2046. // "name": {
  2047. // "description": "Required. The name of the domain association to update or create, if an\nassociation doesn't already exist.",
  2048. // "location": "path",
  2049. // "pattern": "^sites/[^/]+/domains/[^/]+$",
  2050. // "required": true,
  2051. // "type": "string"
  2052. // }
  2053. // },
  2054. // "path": "v1beta1/{+name}",
  2055. // "request": {
  2056. // "$ref": "Domain"
  2057. // },
  2058. // "response": {
  2059. // "$ref": "Domain"
  2060. // },
  2061. // "scopes": [
  2062. // "https://www.googleapis.com/auth/cloud-platform",
  2063. // "https://www.googleapis.com/auth/firebase"
  2064. // ]
  2065. // }
  2066. }
  2067. // method id "firebasehosting.sites.releases.create":
  2068. type SitesReleasesCreateCall struct {
  2069. s *Service
  2070. parent string
  2071. release *Release
  2072. urlParams_ gensupport.URLParams
  2073. ctx_ context.Context
  2074. header_ http.Header
  2075. }
  2076. // Create: Creates a new release which makes the content of the
  2077. // specified version
  2078. // actively display on the site.
  2079. func (r *SitesReleasesService) Create(parent string, release *Release) *SitesReleasesCreateCall {
  2080. c := &SitesReleasesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2081. c.parent = parent
  2082. c.release = release
  2083. return c
  2084. }
  2085. // VersionName sets the optional parameter "versionName": The unique
  2086. // identifier for a version, in the
  2087. // format:
  2088. // <code>/sites/<var>site-name</var>/versions/<var>versionID</var
  2089. // ></code>
  2090. // The <var>site-name</var> in this version identifier must match
  2091. // the
  2092. // <var>site-name</var> in the `parent` parameter.
  2093. // <br>
  2094. // <br>This query parameter must be empty if the `type` field in
  2095. // the
  2096. // request body is `SITE_DISABLE`.
  2097. func (c *SitesReleasesCreateCall) VersionName(versionName string) *SitesReleasesCreateCall {
  2098. c.urlParams_.Set("versionName", versionName)
  2099. return c
  2100. }
  2101. // Fields allows partial responses to be retrieved. See
  2102. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2103. // for more information.
  2104. func (c *SitesReleasesCreateCall) Fields(s ...googleapi.Field) *SitesReleasesCreateCall {
  2105. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2106. return c
  2107. }
  2108. // Context sets the context to be used in this call's Do method. Any
  2109. // pending HTTP request will be aborted if the provided context is
  2110. // canceled.
  2111. func (c *SitesReleasesCreateCall) Context(ctx context.Context) *SitesReleasesCreateCall {
  2112. c.ctx_ = ctx
  2113. return c
  2114. }
  2115. // Header returns an http.Header that can be modified by the caller to
  2116. // add HTTP headers to the request.
  2117. func (c *SitesReleasesCreateCall) Header() http.Header {
  2118. if c.header_ == nil {
  2119. c.header_ = make(http.Header)
  2120. }
  2121. return c.header_
  2122. }
  2123. func (c *SitesReleasesCreateCall) doRequest(alt string) (*http.Response, error) {
  2124. reqHeaders := make(http.Header)
  2125. for k, v := range c.header_ {
  2126. reqHeaders[k] = v
  2127. }
  2128. reqHeaders.Set("User-Agent", c.s.userAgent())
  2129. var body io.Reader = nil
  2130. body, err := googleapi.WithoutDataWrapper.JSONReader(c.release)
  2131. if err != nil {
  2132. return nil, err
  2133. }
  2134. reqHeaders.Set("Content-Type", "application/json")
  2135. c.urlParams_.Set("alt", alt)
  2136. c.urlParams_.Set("prettyPrint", "false")
  2137. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/releases")
  2138. urls += "?" + c.urlParams_.Encode()
  2139. req, err := http.NewRequest("POST", urls, body)
  2140. if err != nil {
  2141. return nil, err
  2142. }
  2143. req.Header = reqHeaders
  2144. googleapi.Expand(req.URL, map[string]string{
  2145. "parent": c.parent,
  2146. })
  2147. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2148. }
  2149. // Do executes the "firebasehosting.sites.releases.create" call.
  2150. // Exactly one of *Release or error will be non-nil. Any non-2xx status
  2151. // code is an error. Response headers are in either
  2152. // *Release.ServerResponse.Header or (if a response was returned at all)
  2153. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2154. // check whether the returned error was because http.StatusNotModified
  2155. // was returned.
  2156. func (c *SitesReleasesCreateCall) Do(opts ...googleapi.CallOption) (*Release, error) {
  2157. gensupport.SetOptions(c.urlParams_, opts...)
  2158. res, err := c.doRequest("json")
  2159. if res != nil && res.StatusCode == http.StatusNotModified {
  2160. if res.Body != nil {
  2161. res.Body.Close()
  2162. }
  2163. return nil, &googleapi.Error{
  2164. Code: res.StatusCode,
  2165. Header: res.Header,
  2166. }
  2167. }
  2168. if err != nil {
  2169. return nil, err
  2170. }
  2171. defer googleapi.CloseBody(res)
  2172. if err := googleapi.CheckResponse(res); err != nil {
  2173. return nil, err
  2174. }
  2175. ret := &Release{
  2176. ServerResponse: googleapi.ServerResponse{
  2177. Header: res.Header,
  2178. HTTPStatusCode: res.StatusCode,
  2179. },
  2180. }
  2181. target := &ret
  2182. if err := gensupport.DecodeResponse(target, res); err != nil {
  2183. return nil, err
  2184. }
  2185. return ret, nil
  2186. // {
  2187. // "description": "Creates a new release which makes the content of the specified version\nactively display on the site.",
  2188. // "flatPath": "v1beta1/sites/{sitesId}/releases",
  2189. // "httpMethod": "POST",
  2190. // "id": "firebasehosting.sites.releases.create",
  2191. // "parameterOrder": [
  2192. // "parent"
  2193. // ],
  2194. // "parameters": {
  2195. // "parent": {
  2196. // "description": "The site that the release belongs to, in the format:\n\u003ccode\u003esites/\u003cvar\u003esite-name\u003c/var\u003e\u003c/code\u003e",
  2197. // "location": "path",
  2198. // "pattern": "^sites/[^/]+$",
  2199. // "required": true,
  2200. // "type": "string"
  2201. // },
  2202. // "versionName": {
  2203. // "description": "The unique identifier for a version, in the format:\n\u003ccode\u003e/sites/\u003cvar\u003esite-name\u003c/var\u003e/versions/\u003cvar\u003eversionID\u003c/var\u003e\u003c/code\u003e\nThe \u003cvar\u003esite-name\u003c/var\u003e in this version identifier must match the\n\u003cvar\u003esite-name\u003c/var\u003e in the `parent` parameter.\n\u003cbr\u003e\n\u003cbr\u003eThis query parameter must be empty if the `type` field in the\nrequest body is `SITE_DISABLE`.",
  2204. // "location": "query",
  2205. // "type": "string"
  2206. // }
  2207. // },
  2208. // "path": "v1beta1/{+parent}/releases",
  2209. // "request": {
  2210. // "$ref": "Release"
  2211. // },
  2212. // "response": {
  2213. // "$ref": "Release"
  2214. // },
  2215. // "scopes": [
  2216. // "https://www.googleapis.com/auth/cloud-platform",
  2217. // "https://www.googleapis.com/auth/firebase"
  2218. // ]
  2219. // }
  2220. }
  2221. // method id "firebasehosting.sites.releases.list":
  2222. type SitesReleasesListCall struct {
  2223. s *Service
  2224. parent string
  2225. urlParams_ gensupport.URLParams
  2226. ifNoneMatch_ string
  2227. ctx_ context.Context
  2228. header_ http.Header
  2229. }
  2230. // List: Lists the releases that have been created on the specified
  2231. // site.
  2232. func (r *SitesReleasesService) List(parent string) *SitesReleasesListCall {
  2233. c := &SitesReleasesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2234. c.parent = parent
  2235. return c
  2236. }
  2237. // PageSize sets the optional parameter "pageSize": The page size to
  2238. // return. Defaults to 100.
  2239. func (c *SitesReleasesListCall) PageSize(pageSize int64) *SitesReleasesListCall {
  2240. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2241. return c
  2242. }
  2243. // PageToken sets the optional parameter "pageToken": The
  2244. // next_page_token from a previous request, if provided.
  2245. func (c *SitesReleasesListCall) PageToken(pageToken string) *SitesReleasesListCall {
  2246. c.urlParams_.Set("pageToken", pageToken)
  2247. return c
  2248. }
  2249. // Fields allows partial responses to be retrieved. See
  2250. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2251. // for more information.
  2252. func (c *SitesReleasesListCall) Fields(s ...googleapi.Field) *SitesReleasesListCall {
  2253. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2254. return c
  2255. }
  2256. // IfNoneMatch sets the optional parameter which makes the operation
  2257. // fail if the object's ETag matches the given value. This is useful for
  2258. // getting updates only after the object has changed since the last
  2259. // request. Use googleapi.IsNotModified to check whether the response
  2260. // error from Do is the result of In-None-Match.
  2261. func (c *SitesReleasesListCall) IfNoneMatch(entityTag string) *SitesReleasesListCall {
  2262. c.ifNoneMatch_ = entityTag
  2263. return c
  2264. }
  2265. // Context sets the context to be used in this call's Do method. Any
  2266. // pending HTTP request will be aborted if the provided context is
  2267. // canceled.
  2268. func (c *SitesReleasesListCall) Context(ctx context.Context) *SitesReleasesListCall {
  2269. c.ctx_ = ctx
  2270. return c
  2271. }
  2272. // Header returns an http.Header that can be modified by the caller to
  2273. // add HTTP headers to the request.
  2274. func (c *SitesReleasesListCall) Header() http.Header {
  2275. if c.header_ == nil {
  2276. c.header_ = make(http.Header)
  2277. }
  2278. return c.header_
  2279. }
  2280. func (c *SitesReleasesListCall) doRequest(alt string) (*http.Response, error) {
  2281. reqHeaders := make(http.Header)
  2282. for k, v := range c.header_ {
  2283. reqHeaders[k] = v
  2284. }
  2285. reqHeaders.Set("User-Agent", c.s.userAgent())
  2286. if c.ifNoneMatch_ != "" {
  2287. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2288. }
  2289. var body io.Reader = nil
  2290. c.urlParams_.Set("alt", alt)
  2291. c.urlParams_.Set("prettyPrint", "false")
  2292. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/releases")
  2293. urls += "?" + c.urlParams_.Encode()
  2294. req, err := http.NewRequest("GET", urls, body)
  2295. if err != nil {
  2296. return nil, err
  2297. }
  2298. req.Header = reqHeaders
  2299. googleapi.Expand(req.URL, map[string]string{
  2300. "parent": c.parent,
  2301. })
  2302. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2303. }
  2304. // Do executes the "firebasehosting.sites.releases.list" call.
  2305. // Exactly one of *ListReleasesResponse or error will be non-nil. Any
  2306. // non-2xx status code is an error. Response headers are in either
  2307. // *ListReleasesResponse.ServerResponse.Header or (if a response was
  2308. // returned at all) in error.(*googleapi.Error).Header. Use
  2309. // googleapi.IsNotModified to check whether the returned error was
  2310. // because http.StatusNotModified was returned.
  2311. func (c *SitesReleasesListCall) Do(opts ...googleapi.CallOption) (*ListReleasesResponse, error) {
  2312. gensupport.SetOptions(c.urlParams_, opts...)
  2313. res, err := c.doRequest("json")
  2314. if res != nil && res.StatusCode == http.StatusNotModified {
  2315. if res.Body != nil {
  2316. res.Body.Close()
  2317. }
  2318. return nil, &googleapi.Error{
  2319. Code: res.StatusCode,
  2320. Header: res.Header,
  2321. }
  2322. }
  2323. if err != nil {
  2324. return nil, err
  2325. }
  2326. defer googleapi.CloseBody(res)
  2327. if err := googleapi.CheckResponse(res); err != nil {
  2328. return nil, err
  2329. }
  2330. ret := &ListReleasesResponse{
  2331. ServerResponse: googleapi.ServerResponse{
  2332. Header: res.Header,
  2333. HTTPStatusCode: res.StatusCode,
  2334. },
  2335. }
  2336. target := &ret
  2337. if err := gensupport.DecodeResponse(target, res); err != nil {
  2338. return nil, err
  2339. }
  2340. return ret, nil
  2341. // {
  2342. // "description": "Lists the releases that have been created on the specified site.",
  2343. // "flatPath": "v1beta1/sites/{sitesId}/releases",
  2344. // "httpMethod": "GET",
  2345. // "id": "firebasehosting.sites.releases.list",
  2346. // "parameterOrder": [
  2347. // "parent"
  2348. // ],
  2349. // "parameters": {
  2350. // "pageSize": {
  2351. // "description": "The page size to return. Defaults to 100.",
  2352. // "format": "int32",
  2353. // "location": "query",
  2354. // "type": "integer"
  2355. // },
  2356. // "pageToken": {
  2357. // "description": "The next_page_token from a previous request, if provided.",
  2358. // "location": "query",
  2359. // "type": "string"
  2360. // },
  2361. // "parent": {
  2362. // "description": "Required. The parent for which to list files, in the format:\n\u003ccode\u003esites/\u003cvar\u003esite-name\u003c/var\u003e\u003c/code\u003e",
  2363. // "location": "path",
  2364. // "pattern": "^sites/[^/]+$",
  2365. // "required": true,
  2366. // "type": "string"
  2367. // }
  2368. // },
  2369. // "path": "v1beta1/{+parent}/releases",
  2370. // "response": {
  2371. // "$ref": "ListReleasesResponse"
  2372. // },
  2373. // "scopes": [
  2374. // "https://www.googleapis.com/auth/cloud-platform",
  2375. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  2376. // "https://www.googleapis.com/auth/firebase",
  2377. // "https://www.googleapis.com/auth/firebase.readonly"
  2378. // ]
  2379. // }
  2380. }
  2381. // Pages invokes f for each page of results.
  2382. // A non-nil error returned from f will halt the iteration.
  2383. // The provided context supersedes any context provided to the Context method.
  2384. func (c *SitesReleasesListCall) Pages(ctx context.Context, f func(*ListReleasesResponse) error) error {
  2385. c.ctx_ = ctx
  2386. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2387. for {
  2388. x, err := c.Do()
  2389. if err != nil {
  2390. return err
  2391. }
  2392. if err := f(x); err != nil {
  2393. return err
  2394. }
  2395. if x.NextPageToken == "" {
  2396. return nil
  2397. }
  2398. c.PageToken(x.NextPageToken)
  2399. }
  2400. }
  2401. // method id "firebasehosting.sites.versions.create":
  2402. type SitesVersionsCreateCall struct {
  2403. s *Service
  2404. parent string
  2405. version *Version
  2406. urlParams_ gensupport.URLParams
  2407. ctx_ context.Context
  2408. header_ http.Header
  2409. }
  2410. // Create: Creates a new version for a site.
  2411. func (r *SitesVersionsService) Create(parent string, version *Version) *SitesVersionsCreateCall {
  2412. c := &SitesVersionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2413. c.parent = parent
  2414. c.version = version
  2415. return c
  2416. }
  2417. // SizeBytes sets the optional parameter "sizeBytes": The self-reported
  2418. // size of the version. This value is used for a pre-emptive
  2419. // quota check for legacy version uploads.
  2420. func (c *SitesVersionsCreateCall) SizeBytes(sizeBytes int64) *SitesVersionsCreateCall {
  2421. c.urlParams_.Set("sizeBytes", fmt.Sprint(sizeBytes))
  2422. return c
  2423. }
  2424. // VersionId sets the optional parameter "versionId": A unique id for
  2425. // the new version. This is only specified for legacy version
  2426. // creations.
  2427. func (c *SitesVersionsCreateCall) VersionId(versionId string) *SitesVersionsCreateCall {
  2428. c.urlParams_.Set("versionId", versionId)
  2429. return c
  2430. }
  2431. // Fields allows partial responses to be retrieved. See
  2432. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2433. // for more information.
  2434. func (c *SitesVersionsCreateCall) Fields(s ...googleapi.Field) *SitesVersionsCreateCall {
  2435. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2436. return c
  2437. }
  2438. // Context sets the context to be used in this call's Do method. Any
  2439. // pending HTTP request will be aborted if the provided context is
  2440. // canceled.
  2441. func (c *SitesVersionsCreateCall) Context(ctx context.Context) *SitesVersionsCreateCall {
  2442. c.ctx_ = ctx
  2443. return c
  2444. }
  2445. // Header returns an http.Header that can be modified by the caller to
  2446. // add HTTP headers to the request.
  2447. func (c *SitesVersionsCreateCall) Header() http.Header {
  2448. if c.header_ == nil {
  2449. c.header_ = make(http.Header)
  2450. }
  2451. return c.header_
  2452. }
  2453. func (c *SitesVersionsCreateCall) doRequest(alt string) (*http.Response, error) {
  2454. reqHeaders := make(http.Header)
  2455. for k, v := range c.header_ {
  2456. reqHeaders[k] = v
  2457. }
  2458. reqHeaders.Set("User-Agent", c.s.userAgent())
  2459. var body io.Reader = nil
  2460. body, err := googleapi.WithoutDataWrapper.JSONReader(c.version)
  2461. if err != nil {
  2462. return nil, err
  2463. }
  2464. reqHeaders.Set("Content-Type", "application/json")
  2465. c.urlParams_.Set("alt", alt)
  2466. c.urlParams_.Set("prettyPrint", "false")
  2467. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/versions")
  2468. urls += "?" + c.urlParams_.Encode()
  2469. req, err := http.NewRequest("POST", urls, body)
  2470. if err != nil {
  2471. return nil, err
  2472. }
  2473. req.Header = reqHeaders
  2474. googleapi.Expand(req.URL, map[string]string{
  2475. "parent": c.parent,
  2476. })
  2477. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2478. }
  2479. // Do executes the "firebasehosting.sites.versions.create" call.
  2480. // Exactly one of *Version or error will be non-nil. Any non-2xx status
  2481. // code is an error. Response headers are in either
  2482. // *Version.ServerResponse.Header or (if a response was returned at all)
  2483. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2484. // check whether the returned error was because http.StatusNotModified
  2485. // was returned.
  2486. func (c *SitesVersionsCreateCall) Do(opts ...googleapi.CallOption) (*Version, error) {
  2487. gensupport.SetOptions(c.urlParams_, opts...)
  2488. res, err := c.doRequest("json")
  2489. if res != nil && res.StatusCode == http.StatusNotModified {
  2490. if res.Body != nil {
  2491. res.Body.Close()
  2492. }
  2493. return nil, &googleapi.Error{
  2494. Code: res.StatusCode,
  2495. Header: res.Header,
  2496. }
  2497. }
  2498. if err != nil {
  2499. return nil, err
  2500. }
  2501. defer googleapi.CloseBody(res)
  2502. if err := googleapi.CheckResponse(res); err != nil {
  2503. return nil, err
  2504. }
  2505. ret := &Version{
  2506. ServerResponse: googleapi.ServerResponse{
  2507. Header: res.Header,
  2508. HTTPStatusCode: res.StatusCode,
  2509. },
  2510. }
  2511. target := &ret
  2512. if err := gensupport.DecodeResponse(target, res); err != nil {
  2513. return nil, err
  2514. }
  2515. return ret, nil
  2516. // {
  2517. // "description": "Creates a new version for a site.",
  2518. // "flatPath": "v1beta1/sites/{sitesId}/versions",
  2519. // "httpMethod": "POST",
  2520. // "id": "firebasehosting.sites.versions.create",
  2521. // "parameterOrder": [
  2522. // "parent"
  2523. // ],
  2524. // "parameters": {
  2525. // "parent": {
  2526. // "description": "Required. The parent to create the version for, in the format:\n\u003ccode\u003esites/\u003cvar\u003esite-name\u003c/var\u003e\u003c/code\u003e",
  2527. // "location": "path",
  2528. // "pattern": "^sites/[^/]+$",
  2529. // "required": true,
  2530. // "type": "string"
  2531. // },
  2532. // "sizeBytes": {
  2533. // "description": "The self-reported size of the version. This value is used for a pre-emptive\nquota check for legacy version uploads.",
  2534. // "format": "int64",
  2535. // "location": "query",
  2536. // "type": "string"
  2537. // },
  2538. // "versionId": {
  2539. // "description": "A unique id for the new version. This is only specified for legacy version\ncreations.",
  2540. // "location": "query",
  2541. // "type": "string"
  2542. // }
  2543. // },
  2544. // "path": "v1beta1/{+parent}/versions",
  2545. // "request": {
  2546. // "$ref": "Version"
  2547. // },
  2548. // "response": {
  2549. // "$ref": "Version"
  2550. // },
  2551. // "scopes": [
  2552. // "https://www.googleapis.com/auth/cloud-platform",
  2553. // "https://www.googleapis.com/auth/firebase"
  2554. // ]
  2555. // }
  2556. }
  2557. // method id "firebasehosting.sites.versions.delete":
  2558. type SitesVersionsDeleteCall struct {
  2559. s *Service
  2560. name string
  2561. urlParams_ gensupport.URLParams
  2562. ctx_ context.Context
  2563. header_ http.Header
  2564. }
  2565. // Delete: Deletes the specified version.
  2566. func (r *SitesVersionsService) Delete(name string) *SitesVersionsDeleteCall {
  2567. c := &SitesVersionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2568. c.name = name
  2569. return c
  2570. }
  2571. // Fields allows partial responses to be retrieved. See
  2572. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2573. // for more information.
  2574. func (c *SitesVersionsDeleteCall) Fields(s ...googleapi.Field) *SitesVersionsDeleteCall {
  2575. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2576. return c
  2577. }
  2578. // Context sets the context to be used in this call's Do method. Any
  2579. // pending HTTP request will be aborted if the provided context is
  2580. // canceled.
  2581. func (c *SitesVersionsDeleteCall) Context(ctx context.Context) *SitesVersionsDeleteCall {
  2582. c.ctx_ = ctx
  2583. return c
  2584. }
  2585. // Header returns an http.Header that can be modified by the caller to
  2586. // add HTTP headers to the request.
  2587. func (c *SitesVersionsDeleteCall) Header() http.Header {
  2588. if c.header_ == nil {
  2589. c.header_ = make(http.Header)
  2590. }
  2591. return c.header_
  2592. }
  2593. func (c *SitesVersionsDeleteCall) doRequest(alt string) (*http.Response, error) {
  2594. reqHeaders := make(http.Header)
  2595. for k, v := range c.header_ {
  2596. reqHeaders[k] = v
  2597. }
  2598. reqHeaders.Set("User-Agent", c.s.userAgent())
  2599. var body io.Reader = nil
  2600. c.urlParams_.Set("alt", alt)
  2601. c.urlParams_.Set("prettyPrint", "false")
  2602. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  2603. urls += "?" + c.urlParams_.Encode()
  2604. req, err := http.NewRequest("DELETE", urls, body)
  2605. if err != nil {
  2606. return nil, err
  2607. }
  2608. req.Header = reqHeaders
  2609. googleapi.Expand(req.URL, map[string]string{
  2610. "name": c.name,
  2611. })
  2612. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2613. }
  2614. // Do executes the "firebasehosting.sites.versions.delete" call.
  2615. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  2616. // code is an error. Response headers are in either
  2617. // *Empty.ServerResponse.Header or (if a response was returned at all)
  2618. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2619. // check whether the returned error was because http.StatusNotModified
  2620. // was returned.
  2621. func (c *SitesVersionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  2622. gensupport.SetOptions(c.urlParams_, opts...)
  2623. res, err := c.doRequest("json")
  2624. if res != nil && res.StatusCode == http.StatusNotModified {
  2625. if res.Body != nil {
  2626. res.Body.Close()
  2627. }
  2628. return nil, &googleapi.Error{
  2629. Code: res.StatusCode,
  2630. Header: res.Header,
  2631. }
  2632. }
  2633. if err != nil {
  2634. return nil, err
  2635. }
  2636. defer googleapi.CloseBody(res)
  2637. if err := googleapi.CheckResponse(res); err != nil {
  2638. return nil, err
  2639. }
  2640. ret := &Empty{
  2641. ServerResponse: googleapi.ServerResponse{
  2642. Header: res.Header,
  2643. HTTPStatusCode: res.StatusCode,
  2644. },
  2645. }
  2646. target := &ret
  2647. if err := gensupport.DecodeResponse(target, res); err != nil {
  2648. return nil, err
  2649. }
  2650. return ret, nil
  2651. // {
  2652. // "description": "Deletes the specified version.",
  2653. // "flatPath": "v1beta1/sites/{sitesId}/versions/{versionsId}",
  2654. // "httpMethod": "DELETE",
  2655. // "id": "firebasehosting.sites.versions.delete",
  2656. // "parameterOrder": [
  2657. // "name"
  2658. // ],
  2659. // "parameters": {
  2660. // "name": {
  2661. // "description": "Required. The name of the version to be deleted, in the format:\n\u003ccode\u003esites/\u003cvar\u003esite-name\u003c/var\u003e/versions/\u003cvar\u003eversionID\u003c/var\u003e\u003c/code\u003e",
  2662. // "location": "path",
  2663. // "pattern": "^sites/[^/]+/versions/[^/]+$",
  2664. // "required": true,
  2665. // "type": "string"
  2666. // }
  2667. // },
  2668. // "path": "v1beta1/{+name}",
  2669. // "response": {
  2670. // "$ref": "Empty"
  2671. // },
  2672. // "scopes": [
  2673. // "https://www.googleapis.com/auth/cloud-platform",
  2674. // "https://www.googleapis.com/auth/firebase"
  2675. // ]
  2676. // }
  2677. }
  2678. // method id "firebasehosting.sites.versions.patch":
  2679. type SitesVersionsPatchCall struct {
  2680. s *Service
  2681. nameid string
  2682. version *Version
  2683. urlParams_ gensupport.URLParams
  2684. ctx_ context.Context
  2685. header_ http.Header
  2686. }
  2687. // Patch: Updates the specified metadata for a version. Note that this
  2688. // method will
  2689. // fail with `FAILED_PRECONDITION` in the event of an invalid
  2690. // state
  2691. // transition. The only valid transition for a version is currently from
  2692. // a
  2693. // `CREATED` status to a `FINALIZED` status.
  2694. // Use [`DeleteVersion`](../sites.versions/delete) to set the status of
  2695. // a
  2696. // version to `DELETED`.
  2697. func (r *SitesVersionsService) Patch(nameid string, version *Version) *SitesVersionsPatchCall {
  2698. c := &SitesVersionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2699. c.nameid = nameid
  2700. c.version = version
  2701. return c
  2702. }
  2703. // UpdateMask sets the optional parameter "updateMask": A set of field
  2704. // names from your [version](../sites.versions) that you want
  2705. // to update.
  2706. // <br>A field will be overwritten if, and only if, it's in the
  2707. // mask.
  2708. // <br>If a mask is not provided then a default mask of
  2709. // only
  2710. // [`status`](../sites.versions#Version.FIELDS.status) will be used.
  2711. func (c *SitesVersionsPatchCall) UpdateMask(updateMask string) *SitesVersionsPatchCall {
  2712. c.urlParams_.Set("updateMask", updateMask)
  2713. return c
  2714. }
  2715. // Fields allows partial responses to be retrieved. See
  2716. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2717. // for more information.
  2718. func (c *SitesVersionsPatchCall) Fields(s ...googleapi.Field) *SitesVersionsPatchCall {
  2719. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2720. return c
  2721. }
  2722. // Context sets the context to be used in this call's Do method. Any
  2723. // pending HTTP request will be aborted if the provided context is
  2724. // canceled.
  2725. func (c *SitesVersionsPatchCall) Context(ctx context.Context) *SitesVersionsPatchCall {
  2726. c.ctx_ = ctx
  2727. return c
  2728. }
  2729. // Header returns an http.Header that can be modified by the caller to
  2730. // add HTTP headers to the request.
  2731. func (c *SitesVersionsPatchCall) Header() http.Header {
  2732. if c.header_ == nil {
  2733. c.header_ = make(http.Header)
  2734. }
  2735. return c.header_
  2736. }
  2737. func (c *SitesVersionsPatchCall) doRequest(alt string) (*http.Response, error) {
  2738. reqHeaders := make(http.Header)
  2739. for k, v := range c.header_ {
  2740. reqHeaders[k] = v
  2741. }
  2742. reqHeaders.Set("User-Agent", c.s.userAgent())
  2743. var body io.Reader = nil
  2744. body, err := googleapi.WithoutDataWrapper.JSONReader(c.version)
  2745. if err != nil {
  2746. return nil, err
  2747. }
  2748. reqHeaders.Set("Content-Type", "application/json")
  2749. c.urlParams_.Set("alt", alt)
  2750. c.urlParams_.Set("prettyPrint", "false")
  2751. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  2752. urls += "?" + c.urlParams_.Encode()
  2753. req, err := http.NewRequest("PATCH", urls, body)
  2754. if err != nil {
  2755. return nil, err
  2756. }
  2757. req.Header = reqHeaders
  2758. googleapi.Expand(req.URL, map[string]string{
  2759. "name": c.nameid,
  2760. })
  2761. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2762. }
  2763. // Do executes the "firebasehosting.sites.versions.patch" call.
  2764. // Exactly one of *Version or error will be non-nil. Any non-2xx status
  2765. // code is an error. Response headers are in either
  2766. // *Version.ServerResponse.Header or (if a response was returned at all)
  2767. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2768. // check whether the returned error was because http.StatusNotModified
  2769. // was returned.
  2770. func (c *SitesVersionsPatchCall) Do(opts ...googleapi.CallOption) (*Version, error) {
  2771. gensupport.SetOptions(c.urlParams_, opts...)
  2772. res, err := c.doRequest("json")
  2773. if res != nil && res.StatusCode == http.StatusNotModified {
  2774. if res.Body != nil {
  2775. res.Body.Close()
  2776. }
  2777. return nil, &googleapi.Error{
  2778. Code: res.StatusCode,
  2779. Header: res.Header,
  2780. }
  2781. }
  2782. if err != nil {
  2783. return nil, err
  2784. }
  2785. defer googleapi.CloseBody(res)
  2786. if err := googleapi.CheckResponse(res); err != nil {
  2787. return nil, err
  2788. }
  2789. ret := &Version{
  2790. ServerResponse: googleapi.ServerResponse{
  2791. Header: res.Header,
  2792. HTTPStatusCode: res.StatusCode,
  2793. },
  2794. }
  2795. target := &ret
  2796. if err := gensupport.DecodeResponse(target, res); err != nil {
  2797. return nil, err
  2798. }
  2799. return ret, nil
  2800. // {
  2801. // "description": "Updates the specified metadata for a version. Note that this method will\nfail with `FAILED_PRECONDITION` in the event of an invalid state\ntransition. The only valid transition for a version is currently from a\n`CREATED` status to a `FINALIZED` status.\nUse [`DeleteVersion`](../sites.versions/delete) to set the status of a\nversion to `DELETED`.",
  2802. // "flatPath": "v1beta1/sites/{sitesId}/versions/{versionsId}",
  2803. // "httpMethod": "PATCH",
  2804. // "id": "firebasehosting.sites.versions.patch",
  2805. // "parameterOrder": [
  2806. // "name"
  2807. // ],
  2808. // "parameters": {
  2809. // "name": {
  2810. // "description": "The unique identifier for a version, in the format:\n\u003ccode\u003esites/\u003cvar\u003esite-name\u003c/var\u003e/versions/\u003cvar\u003eversionID\u003c/var\u003e\u003c/code\u003e\nThis name is provided in the response body when you call the\n[`CreateVersion`](../sites.versions/create) endpoint.",
  2811. // "location": "path",
  2812. // "pattern": "^sites/[^/]+/versions/[^/]+$",
  2813. // "required": true,
  2814. // "type": "string"
  2815. // },
  2816. // "updateMask": {
  2817. // "description": "A set of field names from your [version](../sites.versions) that you want\nto update.\n\u003cbr\u003eA field will be overwritten if, and only if, it's in the mask.\n\u003cbr\u003eIf a mask is not provided then a default mask of only\n[`status`](../sites.versions#Version.FIELDS.status) will be used.",
  2818. // "format": "google-fieldmask",
  2819. // "location": "query",
  2820. // "type": "string"
  2821. // }
  2822. // },
  2823. // "path": "v1beta1/{+name}",
  2824. // "request": {
  2825. // "$ref": "Version"
  2826. // },
  2827. // "response": {
  2828. // "$ref": "Version"
  2829. // },
  2830. // "scopes": [
  2831. // "https://www.googleapis.com/auth/cloud-platform",
  2832. // "https://www.googleapis.com/auth/firebase"
  2833. // ]
  2834. // }
  2835. }
  2836. // method id "firebasehosting.sites.versions.populateFiles":
  2837. type SitesVersionsPopulateFilesCall struct {
  2838. s *Service
  2839. parent string
  2840. populateversionfilesrequest *PopulateVersionFilesRequest
  2841. urlParams_ gensupport.URLParams
  2842. ctx_ context.Context
  2843. header_ http.Header
  2844. }
  2845. // PopulateFiles: Adds content files to a version.
  2846. func (r *SitesVersionsService) PopulateFiles(parent string, populateversionfilesrequest *PopulateVersionFilesRequest) *SitesVersionsPopulateFilesCall {
  2847. c := &SitesVersionsPopulateFilesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2848. c.parent = parent
  2849. c.populateversionfilesrequest = populateversionfilesrequest
  2850. return c
  2851. }
  2852. // Fields allows partial responses to be retrieved. See
  2853. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2854. // for more information.
  2855. func (c *SitesVersionsPopulateFilesCall) Fields(s ...googleapi.Field) *SitesVersionsPopulateFilesCall {
  2856. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2857. return c
  2858. }
  2859. // Context sets the context to be used in this call's Do method. Any
  2860. // pending HTTP request will be aborted if the provided context is
  2861. // canceled.
  2862. func (c *SitesVersionsPopulateFilesCall) Context(ctx context.Context) *SitesVersionsPopulateFilesCall {
  2863. c.ctx_ = ctx
  2864. return c
  2865. }
  2866. // Header returns an http.Header that can be modified by the caller to
  2867. // add HTTP headers to the request.
  2868. func (c *SitesVersionsPopulateFilesCall) Header() http.Header {
  2869. if c.header_ == nil {
  2870. c.header_ = make(http.Header)
  2871. }
  2872. return c.header_
  2873. }
  2874. func (c *SitesVersionsPopulateFilesCall) doRequest(alt string) (*http.Response, error) {
  2875. reqHeaders := make(http.Header)
  2876. for k, v := range c.header_ {
  2877. reqHeaders[k] = v
  2878. }
  2879. reqHeaders.Set("User-Agent", c.s.userAgent())
  2880. var body io.Reader = nil
  2881. body, err := googleapi.WithoutDataWrapper.JSONReader(c.populateversionfilesrequest)
  2882. if err != nil {
  2883. return nil, err
  2884. }
  2885. reqHeaders.Set("Content-Type", "application/json")
  2886. c.urlParams_.Set("alt", alt)
  2887. c.urlParams_.Set("prettyPrint", "false")
  2888. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}:populateFiles")
  2889. urls += "?" + c.urlParams_.Encode()
  2890. req, err := http.NewRequest("POST", urls, body)
  2891. if err != nil {
  2892. return nil, err
  2893. }
  2894. req.Header = reqHeaders
  2895. googleapi.Expand(req.URL, map[string]string{
  2896. "parent": c.parent,
  2897. })
  2898. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2899. }
  2900. // Do executes the "firebasehosting.sites.versions.populateFiles" call.
  2901. // Exactly one of *PopulateVersionFilesResponse or error will be
  2902. // non-nil. Any non-2xx status code is an error. Response headers are in
  2903. // either *PopulateVersionFilesResponse.ServerResponse.Header or (if a
  2904. // response was returned at all) in error.(*googleapi.Error).Header. Use
  2905. // googleapi.IsNotModified to check whether the returned error was
  2906. // because http.StatusNotModified was returned.
  2907. func (c *SitesVersionsPopulateFilesCall) Do(opts ...googleapi.CallOption) (*PopulateVersionFilesResponse, error) {
  2908. gensupport.SetOptions(c.urlParams_, opts...)
  2909. res, err := c.doRequest("json")
  2910. if res != nil && res.StatusCode == http.StatusNotModified {
  2911. if res.Body != nil {
  2912. res.Body.Close()
  2913. }
  2914. return nil, &googleapi.Error{
  2915. Code: res.StatusCode,
  2916. Header: res.Header,
  2917. }
  2918. }
  2919. if err != nil {
  2920. return nil, err
  2921. }
  2922. defer googleapi.CloseBody(res)
  2923. if err := googleapi.CheckResponse(res); err != nil {
  2924. return nil, err
  2925. }
  2926. ret := &PopulateVersionFilesResponse{
  2927. ServerResponse: googleapi.ServerResponse{
  2928. Header: res.Header,
  2929. HTTPStatusCode: res.StatusCode,
  2930. },
  2931. }
  2932. target := &ret
  2933. if err := gensupport.DecodeResponse(target, res); err != nil {
  2934. return nil, err
  2935. }
  2936. return ret, nil
  2937. // {
  2938. // "description": "Adds content files to a version.",
  2939. // "flatPath": "v1beta1/sites/{sitesId}/versions/{versionsId}:populateFiles",
  2940. // "httpMethod": "POST",
  2941. // "id": "firebasehosting.sites.versions.populateFiles",
  2942. // "parameterOrder": [
  2943. // "parent"
  2944. // ],
  2945. // "parameters": {
  2946. // "parent": {
  2947. // "description": "Required. The version to add files to, in the format:\n\u003ccode\u003esites/\u003cvar\u003esite-name\u003c/var\u003e/versions/\u003cvar\u003eversionID\u003c/var\u003e\u003c/code\u003e",
  2948. // "location": "path",
  2949. // "pattern": "^sites/[^/]+/versions/[^/]+$",
  2950. // "required": true,
  2951. // "type": "string"
  2952. // }
  2953. // },
  2954. // "path": "v1beta1/{+parent}:populateFiles",
  2955. // "request": {
  2956. // "$ref": "PopulateVersionFilesRequest"
  2957. // },
  2958. // "response": {
  2959. // "$ref": "PopulateVersionFilesResponse"
  2960. // },
  2961. // "scopes": [
  2962. // "https://www.googleapis.com/auth/cloud-platform",
  2963. // "https://www.googleapis.com/auth/firebase"
  2964. // ]
  2965. // }
  2966. }
  2967. // method id "firebasehosting.sites.versions.files.list":
  2968. type SitesVersionsFilesListCall struct {
  2969. s *Service
  2970. parent string
  2971. urlParams_ gensupport.URLParams
  2972. ifNoneMatch_ string
  2973. ctx_ context.Context
  2974. header_ http.Header
  2975. }
  2976. // List: Lists the remaining files to be uploaded for the specified
  2977. // version.
  2978. func (r *SitesVersionsFilesService) List(parent string) *SitesVersionsFilesListCall {
  2979. c := &SitesVersionsFilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2980. c.parent = parent
  2981. return c
  2982. }
  2983. // PageSize sets the optional parameter "pageSize": The page size to
  2984. // return. Defaults to 1000.
  2985. func (c *SitesVersionsFilesListCall) PageSize(pageSize int64) *SitesVersionsFilesListCall {
  2986. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2987. return c
  2988. }
  2989. // PageToken sets the optional parameter "pageToken": The
  2990. // next_page_token from a previous request, if provided. This will be
  2991. // the
  2992. // encoded version of a
  2993. // firebase.hosting.proto.metadata.ListFilesPageToken.
  2994. func (c *SitesVersionsFilesListCall) PageToken(pageToken string) *SitesVersionsFilesListCall {
  2995. c.urlParams_.Set("pageToken", pageToken)
  2996. return c
  2997. }
  2998. // Status sets the optional parameter "status": The type of files in the
  2999. // version that should be listed.
  3000. //
  3001. // Possible values:
  3002. // "STATUS_UNSPECIFIED"
  3003. // "EXPECTED"
  3004. // "ACTIVE"
  3005. func (c *SitesVersionsFilesListCall) Status(status string) *SitesVersionsFilesListCall {
  3006. c.urlParams_.Set("status", status)
  3007. return c
  3008. }
  3009. // Fields allows partial responses to be retrieved. See
  3010. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3011. // for more information.
  3012. func (c *SitesVersionsFilesListCall) Fields(s ...googleapi.Field) *SitesVersionsFilesListCall {
  3013. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3014. return c
  3015. }
  3016. // IfNoneMatch sets the optional parameter which makes the operation
  3017. // fail if the object's ETag matches the given value. This is useful for
  3018. // getting updates only after the object has changed since the last
  3019. // request. Use googleapi.IsNotModified to check whether the response
  3020. // error from Do is the result of In-None-Match.
  3021. func (c *SitesVersionsFilesListCall) IfNoneMatch(entityTag string) *SitesVersionsFilesListCall {
  3022. c.ifNoneMatch_ = entityTag
  3023. return c
  3024. }
  3025. // Context sets the context to be used in this call's Do method. Any
  3026. // pending HTTP request will be aborted if the provided context is
  3027. // canceled.
  3028. func (c *SitesVersionsFilesListCall) Context(ctx context.Context) *SitesVersionsFilesListCall {
  3029. c.ctx_ = ctx
  3030. return c
  3031. }
  3032. // Header returns an http.Header that can be modified by the caller to
  3033. // add HTTP headers to the request.
  3034. func (c *SitesVersionsFilesListCall) Header() http.Header {
  3035. if c.header_ == nil {
  3036. c.header_ = make(http.Header)
  3037. }
  3038. return c.header_
  3039. }
  3040. func (c *SitesVersionsFilesListCall) doRequest(alt string) (*http.Response, error) {
  3041. reqHeaders := make(http.Header)
  3042. for k, v := range c.header_ {
  3043. reqHeaders[k] = v
  3044. }
  3045. reqHeaders.Set("User-Agent", c.s.userAgent())
  3046. if c.ifNoneMatch_ != "" {
  3047. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3048. }
  3049. var body io.Reader = nil
  3050. c.urlParams_.Set("alt", alt)
  3051. c.urlParams_.Set("prettyPrint", "false")
  3052. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/files")
  3053. urls += "?" + c.urlParams_.Encode()
  3054. req, err := http.NewRequest("GET", urls, body)
  3055. if err != nil {
  3056. return nil, err
  3057. }
  3058. req.Header = reqHeaders
  3059. googleapi.Expand(req.URL, map[string]string{
  3060. "parent": c.parent,
  3061. })
  3062. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3063. }
  3064. // Do executes the "firebasehosting.sites.versions.files.list" call.
  3065. // Exactly one of *ListVersionFilesResponse or error will be non-nil.
  3066. // Any non-2xx status code is an error. Response headers are in either
  3067. // *ListVersionFilesResponse.ServerResponse.Header or (if a response was
  3068. // returned at all) in error.(*googleapi.Error).Header. Use
  3069. // googleapi.IsNotModified to check whether the returned error was
  3070. // because http.StatusNotModified was returned.
  3071. func (c *SitesVersionsFilesListCall) Do(opts ...googleapi.CallOption) (*ListVersionFilesResponse, error) {
  3072. gensupport.SetOptions(c.urlParams_, opts...)
  3073. res, err := c.doRequest("json")
  3074. if res != nil && res.StatusCode == http.StatusNotModified {
  3075. if res.Body != nil {
  3076. res.Body.Close()
  3077. }
  3078. return nil, &googleapi.Error{
  3079. Code: res.StatusCode,
  3080. Header: res.Header,
  3081. }
  3082. }
  3083. if err != nil {
  3084. return nil, err
  3085. }
  3086. defer googleapi.CloseBody(res)
  3087. if err := googleapi.CheckResponse(res); err != nil {
  3088. return nil, err
  3089. }
  3090. ret := &ListVersionFilesResponse{
  3091. ServerResponse: googleapi.ServerResponse{
  3092. Header: res.Header,
  3093. HTTPStatusCode: res.StatusCode,
  3094. },
  3095. }
  3096. target := &ret
  3097. if err := gensupport.DecodeResponse(target, res); err != nil {
  3098. return nil, err
  3099. }
  3100. return ret, nil
  3101. // {
  3102. // "description": "Lists the remaining files to be uploaded for the specified version.",
  3103. // "flatPath": "v1beta1/sites/{sitesId}/versions/{versionsId}/files",
  3104. // "httpMethod": "GET",
  3105. // "id": "firebasehosting.sites.versions.files.list",
  3106. // "parameterOrder": [
  3107. // "parent"
  3108. // ],
  3109. // "parameters": {
  3110. // "pageSize": {
  3111. // "description": "The page size to return. Defaults to 1000.",
  3112. // "format": "int32",
  3113. // "location": "query",
  3114. // "type": "integer"
  3115. // },
  3116. // "pageToken": {
  3117. // "description": "The next_page_token from a previous request, if provided. This will be the\nencoded version of a firebase.hosting.proto.metadata.ListFilesPageToken.",
  3118. // "location": "query",
  3119. // "type": "string"
  3120. // },
  3121. // "parent": {
  3122. // "description": "Required. The parent to list files for, in the format:\n\u003ccode\u003esites/\u003cvar\u003esite-name\u003c/var\u003e/versions/\u003cvar\u003eversionID\u003c/var\u003e\u003c/code\u003e",
  3123. // "location": "path",
  3124. // "pattern": "^sites/[^/]+/versions/[^/]+$",
  3125. // "required": true,
  3126. // "type": "string"
  3127. // },
  3128. // "status": {
  3129. // "description": "The type of files in the version that should be listed.",
  3130. // "enum": [
  3131. // "STATUS_UNSPECIFIED",
  3132. // "EXPECTED",
  3133. // "ACTIVE"
  3134. // ],
  3135. // "location": "query",
  3136. // "type": "string"
  3137. // }
  3138. // },
  3139. // "path": "v1beta1/{+parent}/files",
  3140. // "response": {
  3141. // "$ref": "ListVersionFilesResponse"
  3142. // },
  3143. // "scopes": [
  3144. // "https://www.googleapis.com/auth/cloud-platform",
  3145. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  3146. // "https://www.googleapis.com/auth/firebase",
  3147. // "https://www.googleapis.com/auth/firebase.readonly"
  3148. // ]
  3149. // }
  3150. }
  3151. // Pages invokes f for each page of results.
  3152. // A non-nil error returned from f will halt the iteration.
  3153. // The provided context supersedes any context provided to the Context method.
  3154. func (c *SitesVersionsFilesListCall) Pages(ctx context.Context, f func(*ListVersionFilesResponse) error) error {
  3155. c.ctx_ = ctx
  3156. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  3157. for {
  3158. x, err := c.Do()
  3159. if err != nil {
  3160. return err
  3161. }
  3162. if err := f(x); err != nil {
  3163. return err
  3164. }
  3165. if x.NextPageToken == "" {
  3166. return nil
  3167. }
  3168. c.PageToken(x.NextPageToken)
  3169. }
  3170. }