You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

652 lines
24 KiB

  1. // Package firebaseremoteconfig provides access to the Firebase Remote Config API.
  2. //
  3. // See https://firebase.google.com/docs/remote-config/
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/firebaseremoteconfig/v1"
  8. // ...
  9. // firebaseremoteconfigService, err := firebaseremoteconfig.New(oauthHttpClient)
  10. package firebaseremoteconfig // import "google.golang.org/api/firebaseremoteconfig/v1"
  11. import (
  12. "bytes"
  13. "encoding/json"
  14. "errors"
  15. "fmt"
  16. context "golang.org/x/net/context"
  17. ctxhttp "golang.org/x/net/context/ctxhttp"
  18. gensupport "google.golang.org/api/gensupport"
  19. googleapi "google.golang.org/api/googleapi"
  20. "io"
  21. "net/http"
  22. "net/url"
  23. "strconv"
  24. "strings"
  25. )
  26. // Always reference these packages, just in case the auto-generated code
  27. // below doesn't.
  28. var _ = bytes.NewBuffer
  29. var _ = strconv.Itoa
  30. var _ = fmt.Sprintf
  31. var _ = json.NewDecoder
  32. var _ = io.Copy
  33. var _ = url.Parse
  34. var _ = gensupport.MarshalJSON
  35. var _ = googleapi.Version
  36. var _ = errors.New
  37. var _ = strings.Replace
  38. var _ = context.Canceled
  39. var _ = ctxhttp.Do
  40. const apiId = "firebaseremoteconfig:v1"
  41. const apiName = "firebaseremoteconfig"
  42. const apiVersion = "v1"
  43. const basePath = "https://firebaseremoteconfig.googleapis.com/"
  44. func New(client *http.Client) (*Service, error) {
  45. if client == nil {
  46. return nil, errors.New("client is nil")
  47. }
  48. s := &Service{client: client, BasePath: basePath}
  49. s.Projects = NewProjectsService(s)
  50. return s, nil
  51. }
  52. type Service struct {
  53. client *http.Client
  54. BasePath string // API endpoint base URL
  55. UserAgent string // optional additional User-Agent fragment
  56. Projects *ProjectsService
  57. }
  58. func (s *Service) userAgent() string {
  59. if s.UserAgent == "" {
  60. return googleapi.UserAgent
  61. }
  62. return googleapi.UserAgent + " " + s.UserAgent
  63. }
  64. func NewProjectsService(s *Service) *ProjectsService {
  65. rs := &ProjectsService{s: s}
  66. return rs
  67. }
  68. type ProjectsService struct {
  69. s *Service
  70. }
  71. // RemoteConfig: *
  72. // The RemoteConfig consists of a list of conditions (which can
  73. // be
  74. // thought of as named "if" statements) and a map of parameters
  75. // (parameter key
  76. // to a structure containing an optional default value, as well as a
  77. // optional
  78. // submap of (condition name to value when that condition is true).
  79. type RemoteConfig struct {
  80. // Conditions: The list of named conditions. The order *does* affect the
  81. // semantics.
  82. // The condition_name values of these entries must be unique.
  83. //
  84. // The resolved value of a config parameter P is determined as follow:
  85. // * Let Y be the set of values from the submap of P that refer to
  86. // conditions
  87. // that evaluate to <code>true</code>.
  88. // * If Y is non empty, the value is taken from the specific submap in Y
  89. // whose
  90. // condition_name is the earliest in this condition list.
  91. // * Else, if P has a default value option (condition_name is empty)
  92. // then
  93. // the value is taken from that option.
  94. // * Else, parameter P has no value and is omitted from the config
  95. // result.
  96. //
  97. // Example: parameter key "p1", default value "v1", submap specified
  98. // as
  99. // {"c1": v2, "c2": v3} where "c1" and "c2" are names of conditions in
  100. // the
  101. // condition list (where "c1" in this example appears before "c2").
  102. // The
  103. // value of p1 would be v2 as long as c1 is true. Otherwise, if c2 is
  104. // true,
  105. // p1 would evaluate to v3, and if c1 and c2 are both false, p1 would
  106. // evaluate
  107. // to v1. If no default value was specified, and c1 and c2 were both
  108. // false,
  109. // no value for p1 would be generated.
  110. Conditions []*RemoteConfigCondition `json:"conditions,omitempty"`
  111. // Parameters: Map of parameter keys to their optional default values
  112. // and optional submap
  113. // of (condition name : value). Order doesn't affect semantics, and so
  114. // is
  115. // sorted by the server. The 'key' values of the params must be unique.
  116. Parameters map[string]RemoteConfigParameter `json:"parameters,omitempty"`
  117. // ServerResponse contains the HTTP response code and headers from the
  118. // server.
  119. googleapi.ServerResponse `json:"-"`
  120. // ForceSendFields is a list of field names (e.g. "Conditions") to
  121. // unconditionally include in API requests. By default, fields with
  122. // empty values are omitted from API requests. However, any non-pointer,
  123. // non-interface field appearing in ForceSendFields will be sent to the
  124. // server regardless of whether the field is empty or not. This may be
  125. // used to include empty fields in Patch requests.
  126. ForceSendFields []string `json:"-"`
  127. // NullFields is a list of field names (e.g. "Conditions") to include in
  128. // API requests with the JSON null value. By default, fields with empty
  129. // values are omitted from API requests. However, any field with an
  130. // empty value appearing in NullFields will be sent to the server as
  131. // null. It is an error if a field in this list has a non-empty value.
  132. // This may be used to include null fields in Patch requests.
  133. NullFields []string `json:"-"`
  134. }
  135. func (s *RemoteConfig) MarshalJSON() ([]byte, error) {
  136. type NoMethod RemoteConfig
  137. raw := NoMethod(*s)
  138. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  139. }
  140. // RemoteConfigCondition: A single RemoteConfig Condition. A list of
  141. // these (because order matters) are
  142. // part of a single RemoteConfig template.
  143. type RemoteConfigCondition struct {
  144. // Description: DO NOT USE. Implementation removed and will not be added
  145. // unless requested.
  146. // A description for this Condition. Length must be less than or equal
  147. // to
  148. // 100 characters (or more precisely, unicode code points, which is
  149. // defined
  150. // in
  151. // java/com/google/wireless/android/config/ConstsExporter.java).
  152. // A description may contain any Unicode characters
  153. Description string `json:"description,omitempty"`
  154. // Expression: Required.
  155. Expression string `json:"expression,omitempty"`
  156. // Name: Required.
  157. // A non empty and unique name of this condition.
  158. Name string `json:"name,omitempty"`
  159. // TagColor: Optional.
  160. // The display (tag) color of this condition. This serves as part of a
  161. // tag
  162. // (in the future, we may add tag text as well as tag color, but that is
  163. // not
  164. // yet implemented in the UI).
  165. // This value has no affect on the semantics of the delivered config and
  166. // it
  167. // is ignored by the backend, except for passing it through
  168. // write/read
  169. // requests.
  170. // Not having this value or having the
  171. // "CONDITION_DISPLAY_COLOR_UNSPECIFIED"
  172. // value (0) have the same meaning: Let the UI choose any valid color
  173. // when
  174. // displaying the condition.
  175. //
  176. // Possible values:
  177. // "CONDITION_DISPLAY_COLOR_UNSPECIFIED"
  178. // "BLUE" - Blue
  179. // "BROWN" - Brown
  180. // "CYAN" - Cyan
  181. // "DEEP_ORANGE" - aka "Red Orange"
  182. // "GREEN" - Green
  183. // "INDIGO" - Indigo
  184. // *
  185. // "LIME" - Lime - Approved deviation from Material color palette
  186. // "ORANGE" - Orange
  187. // "PINK" - Pink
  188. // "PURPLE" - Purple
  189. // "TEAL" - Teal
  190. TagColor string `json:"tagColor,omitempty"`
  191. // ForceSendFields is a list of field names (e.g. "Description") to
  192. // unconditionally include in API requests. By default, fields with
  193. // empty values are omitted from API requests. However, any non-pointer,
  194. // non-interface field appearing in ForceSendFields will be sent to the
  195. // server regardless of whether the field is empty or not. This may be
  196. // used to include empty fields in Patch requests.
  197. ForceSendFields []string `json:"-"`
  198. // NullFields is a list of field names (e.g. "Description") to include
  199. // in API requests with the JSON null value. By default, fields with
  200. // empty values are omitted from API requests. However, any field with
  201. // an empty value appearing in NullFields will be sent to the server as
  202. // null. It is an error if a field in this list has a non-empty value.
  203. // This may be used to include null fields in Patch requests.
  204. NullFields []string `json:"-"`
  205. }
  206. func (s *RemoteConfigCondition) MarshalJSON() ([]byte, error) {
  207. type NoMethod RemoteConfigCondition
  208. raw := NoMethod(*s)
  209. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  210. }
  211. // RemoteConfigParameter: While default_value and conditional_values are
  212. // each optional, at least one of
  213. // the two is required - otherwise, the parameter is meaningless (and
  214. // an
  215. // exception will be thrown by the validation logic).
  216. type RemoteConfigParameter struct {
  217. // ConditionalValues: Optional - a map of (condition_name, value). The
  218. // condition_name of the
  219. // highest priority (the one listed first in the conditions array)
  220. // determines
  221. // the value of this parameter.
  222. ConditionalValues map[string]RemoteConfigParameterValue `json:"conditionalValues,omitempty"`
  223. // DefaultValue: Optional - value to set the parameter to, when none of
  224. // the named conditions
  225. // evaluate to <code>true</code>.
  226. DefaultValue *RemoteConfigParameterValue `json:"defaultValue,omitempty"`
  227. // Description: Optional.
  228. // A description for this Parameter. Length must be less than or equal
  229. // to
  230. // 100 characters (or more precisely, unicode code points, which is
  231. // defined
  232. // in
  233. // java/com/google/wireless/android/config/ConstsExporter.java).
  234. // A description may contain any Unicode characters
  235. Description string `json:"description,omitempty"`
  236. // ForceSendFields is a list of field names (e.g. "ConditionalValues")
  237. // to unconditionally include in API requests. By default, fields with
  238. // empty values are omitted from API requests. However, any non-pointer,
  239. // non-interface field appearing in ForceSendFields will be sent to the
  240. // server regardless of whether the field is empty or not. This may be
  241. // used to include empty fields in Patch requests.
  242. ForceSendFields []string `json:"-"`
  243. // NullFields is a list of field names (e.g. "ConditionalValues") to
  244. // include in API requests with the JSON null value. By default, fields
  245. // with empty values are omitted from API requests. However, any field
  246. // with an empty value appearing in NullFields will be sent to the
  247. // server as null. It is an error if a field in this list has a
  248. // non-empty value. This may be used to include null fields in Patch
  249. // requests.
  250. NullFields []string `json:"-"`
  251. }
  252. func (s *RemoteConfigParameter) MarshalJSON() ([]byte, error) {
  253. type NoMethod RemoteConfigParameter
  254. raw := NoMethod(*s)
  255. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  256. }
  257. // RemoteConfigParameterValue: A RemoteConfigParameter's "value" (either
  258. // the default value, or the value
  259. // associated with a condition name) is either a string, or
  260. // the
  261. // "use_in_app_default" indicator (which means to leave out the
  262. // parameter from
  263. // the returned <key, value> map that is the output of the parameter
  264. // fetch).
  265. // We represent the "use_in_app_default" as a bool, but (when using the
  266. // boolean
  267. // instead of the string) it should always be <code>true</code>.
  268. type RemoteConfigParameterValue struct {
  269. // UseInAppDefault: if true, omit the parameter from the map of fetched
  270. // parameter values
  271. UseInAppDefault bool `json:"useInAppDefault,omitempty"`
  272. // Value: the string to set the parameter to
  273. Value string `json:"value,omitempty"`
  274. // ForceSendFields is a list of field names (e.g. "UseInAppDefault") to
  275. // unconditionally include in API requests. By default, fields with
  276. // empty values are omitted from API requests. However, any non-pointer,
  277. // non-interface field appearing in ForceSendFields will be sent to the
  278. // server regardless of whether the field is empty or not. This may be
  279. // used to include empty fields in Patch requests.
  280. ForceSendFields []string `json:"-"`
  281. // NullFields is a list of field names (e.g. "UseInAppDefault") to
  282. // include in API requests with the JSON null value. By default, fields
  283. // with empty values are omitted from API requests. However, any field
  284. // with an empty value appearing in NullFields will be sent to the
  285. // server as null. It is an error if a field in this list has a
  286. // non-empty value. This may be used to include null fields in Patch
  287. // requests.
  288. NullFields []string `json:"-"`
  289. }
  290. func (s *RemoteConfigParameterValue) MarshalJSON() ([]byte, error) {
  291. type NoMethod RemoteConfigParameterValue
  292. raw := NoMethod(*s)
  293. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  294. }
  295. // method id "firebaseremoteconfig.projects.getRemoteConfig":
  296. type ProjectsGetRemoteConfigCall struct {
  297. s *Service
  298. projectid string
  299. urlParams_ gensupport.URLParams
  300. ifNoneMatch_ string
  301. ctx_ context.Context
  302. header_ http.Header
  303. }
  304. // GetRemoteConfig: Get the latest version Remote Configuration for a
  305. // project.
  306. // Returns the RemoteConfig as the payload, and also the eTag as
  307. // a
  308. // response header.
  309. func (r *ProjectsService) GetRemoteConfig(projectid string) *ProjectsGetRemoteConfigCall {
  310. c := &ProjectsGetRemoteConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  311. c.projectid = projectid
  312. return c
  313. }
  314. // Fields allows partial responses to be retrieved. See
  315. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  316. // for more information.
  317. func (c *ProjectsGetRemoteConfigCall) Fields(s ...googleapi.Field) *ProjectsGetRemoteConfigCall {
  318. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  319. return c
  320. }
  321. // IfNoneMatch sets the optional parameter which makes the operation
  322. // fail if the object's ETag matches the given value. This is useful for
  323. // getting updates only after the object has changed since the last
  324. // request. Use googleapi.IsNotModified to check whether the response
  325. // error from Do is the result of In-None-Match.
  326. func (c *ProjectsGetRemoteConfigCall) IfNoneMatch(entityTag string) *ProjectsGetRemoteConfigCall {
  327. c.ifNoneMatch_ = entityTag
  328. return c
  329. }
  330. // Context sets the context to be used in this call's Do method. Any
  331. // pending HTTP request will be aborted if the provided context is
  332. // canceled.
  333. func (c *ProjectsGetRemoteConfigCall) Context(ctx context.Context) *ProjectsGetRemoteConfigCall {
  334. c.ctx_ = ctx
  335. return c
  336. }
  337. // Header returns an http.Header that can be modified by the caller to
  338. // add HTTP headers to the request.
  339. func (c *ProjectsGetRemoteConfigCall) Header() http.Header {
  340. if c.header_ == nil {
  341. c.header_ = make(http.Header)
  342. }
  343. return c.header_
  344. }
  345. func (c *ProjectsGetRemoteConfigCall) doRequest(alt string) (*http.Response, error) {
  346. reqHeaders := make(http.Header)
  347. for k, v := range c.header_ {
  348. reqHeaders[k] = v
  349. }
  350. reqHeaders.Set("User-Agent", c.s.userAgent())
  351. if c.ifNoneMatch_ != "" {
  352. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  353. }
  354. var body io.Reader = nil
  355. c.urlParams_.Set("alt", alt)
  356. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+project}/remoteConfig")
  357. urls += "?" + c.urlParams_.Encode()
  358. req, _ := http.NewRequest("GET", urls, body)
  359. req.Header = reqHeaders
  360. googleapi.Expand(req.URL, map[string]string{
  361. "project": c.projectid,
  362. })
  363. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  364. }
  365. // Do executes the "firebaseremoteconfig.projects.getRemoteConfig" call.
  366. // Exactly one of *RemoteConfig or error will be non-nil. Any non-2xx
  367. // status code is an error. Response headers are in either
  368. // *RemoteConfig.ServerResponse.Header or (if a response was returned at
  369. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  370. // to check whether the returned error was because
  371. // http.StatusNotModified was returned.
  372. func (c *ProjectsGetRemoteConfigCall) Do(opts ...googleapi.CallOption) (*RemoteConfig, error) {
  373. gensupport.SetOptions(c.urlParams_, opts...)
  374. res, err := c.doRequest("json")
  375. if res != nil && res.StatusCode == http.StatusNotModified {
  376. if res.Body != nil {
  377. res.Body.Close()
  378. }
  379. return nil, &googleapi.Error{
  380. Code: res.StatusCode,
  381. Header: res.Header,
  382. }
  383. }
  384. if err != nil {
  385. return nil, err
  386. }
  387. defer googleapi.CloseBody(res)
  388. if err := googleapi.CheckResponse(res); err != nil {
  389. return nil, err
  390. }
  391. ret := &RemoteConfig{
  392. ServerResponse: googleapi.ServerResponse{
  393. Header: res.Header,
  394. HTTPStatusCode: res.StatusCode,
  395. },
  396. }
  397. target := &ret
  398. if err := gensupport.DecodeResponse(target, res); err != nil {
  399. return nil, err
  400. }
  401. return ret, nil
  402. // {
  403. // "description": "Get the latest version Remote Configuration for a project.\nReturns the RemoteConfig as the payload, and also the eTag as a\nresponse header.",
  404. // "flatPath": "v1/projects/{projectsId}/remoteConfig",
  405. // "httpMethod": "GET",
  406. // "id": "firebaseremoteconfig.projects.getRemoteConfig",
  407. // "parameterOrder": [
  408. // "project"
  409. // ],
  410. // "parameters": {
  411. // "project": {
  412. // "description": "The GMP project identifier. Required.\nSee note at the beginning of this file regarding project ids.",
  413. // "location": "path",
  414. // "pattern": "^projects/[^/]+$",
  415. // "required": true,
  416. // "type": "string"
  417. // }
  418. // },
  419. // "path": "v1/{+project}/remoteConfig",
  420. // "response": {
  421. // "$ref": "RemoteConfig"
  422. // }
  423. // }
  424. }
  425. // method id "firebaseremoteconfig.projects.updateRemoteConfig":
  426. type ProjectsUpdateRemoteConfigCall struct {
  427. s *Service
  428. projectid string
  429. remoteconfig *RemoteConfig
  430. urlParams_ gensupport.URLParams
  431. ctx_ context.Context
  432. header_ http.Header
  433. }
  434. // UpdateRemoteConfig: Update a RemoteConfig. We treat this as an
  435. // always-existing
  436. // resource (when it is not found in our data store, we treat it as
  437. // version
  438. // 0, a template with zero conditions and zero parameters). Hence there
  439. // are
  440. // no Create or Delete operations. Returns the updated template
  441. // when
  442. // successful (and the updated eTag as a response header), or an error
  443. // if
  444. // things go wrong.
  445. // Possible error messages:
  446. // * VALIDATION_ERROR (HTTP status 400) with additional details if
  447. // the
  448. // template being passed in can not be validated.
  449. // * AUTHENTICATION_ERROR (HTTP status 401) if the request can not
  450. // be
  451. // authenticate (e.g. no access token, or invalid access token).
  452. // * AUTHORIZATION_ERROR (HTTP status 403) if the request can not
  453. // be
  454. // authorized (e.g. the user has no access to the specified project
  455. // id).
  456. // * VERSION_MISMATCH (HTTP status 412) when trying to update when
  457. // the
  458. // expected eTag (passed in via the "If-match" header) is not specified,
  459. // or
  460. // is specified but does does not match the current eTag.
  461. // * Internal error (HTTP status 500) for Database problems or other
  462. // internal
  463. // errors.
  464. func (r *ProjectsService) UpdateRemoteConfig(projectid string, remoteconfig *RemoteConfig) *ProjectsUpdateRemoteConfigCall {
  465. c := &ProjectsUpdateRemoteConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  466. c.projectid = projectid
  467. c.remoteconfig = remoteconfig
  468. return c
  469. }
  470. // ValidateOnly sets the optional parameter "validateOnly": Defaults to
  471. // <code>false</code> (UpdateRemoteConfig call should
  472. // update the backend if there are no validation/interal errors). May be
  473. // set
  474. // to <code>true</code> to indicate that, should no validation errors
  475. // occur,
  476. // the call should return a "200 OK" instead of performing the update.
  477. // Note
  478. // that other error messages (500 Internal Error, 412 Version Mismatch,
  479. // etc)
  480. // may still result after flipping to <code>false</code>, even if
  481. // getting a
  482. // "200 OK" when calling with <code>true</code>.
  483. func (c *ProjectsUpdateRemoteConfigCall) ValidateOnly(validateOnly bool) *ProjectsUpdateRemoteConfigCall {
  484. c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
  485. return c
  486. }
  487. // Fields allows partial responses to be retrieved. See
  488. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  489. // for more information.
  490. func (c *ProjectsUpdateRemoteConfigCall) Fields(s ...googleapi.Field) *ProjectsUpdateRemoteConfigCall {
  491. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  492. return c
  493. }
  494. // Context sets the context to be used in this call's Do method. Any
  495. // pending HTTP request will be aborted if the provided context is
  496. // canceled.
  497. func (c *ProjectsUpdateRemoteConfigCall) Context(ctx context.Context) *ProjectsUpdateRemoteConfigCall {
  498. c.ctx_ = ctx
  499. return c
  500. }
  501. // Header returns an http.Header that can be modified by the caller to
  502. // add HTTP headers to the request.
  503. func (c *ProjectsUpdateRemoteConfigCall) Header() http.Header {
  504. if c.header_ == nil {
  505. c.header_ = make(http.Header)
  506. }
  507. return c.header_
  508. }
  509. func (c *ProjectsUpdateRemoteConfigCall) doRequest(alt string) (*http.Response, error) {
  510. reqHeaders := make(http.Header)
  511. for k, v := range c.header_ {
  512. reqHeaders[k] = v
  513. }
  514. reqHeaders.Set("User-Agent", c.s.userAgent())
  515. var body io.Reader = nil
  516. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remoteconfig)
  517. if err != nil {
  518. return nil, err
  519. }
  520. reqHeaders.Set("Content-Type", "application/json")
  521. c.urlParams_.Set("alt", alt)
  522. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+project}/remoteConfig")
  523. urls += "?" + c.urlParams_.Encode()
  524. req, _ := http.NewRequest("PUT", urls, body)
  525. req.Header = reqHeaders
  526. googleapi.Expand(req.URL, map[string]string{
  527. "project": c.projectid,
  528. })
  529. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  530. }
  531. // Do executes the "firebaseremoteconfig.projects.updateRemoteConfig" call.
  532. // Exactly one of *RemoteConfig or error will be non-nil. Any non-2xx
  533. // status code is an error. Response headers are in either
  534. // *RemoteConfig.ServerResponse.Header or (if a response was returned at
  535. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  536. // to check whether the returned error was because
  537. // http.StatusNotModified was returned.
  538. func (c *ProjectsUpdateRemoteConfigCall) Do(opts ...googleapi.CallOption) (*RemoteConfig, error) {
  539. gensupport.SetOptions(c.urlParams_, opts...)
  540. res, err := c.doRequest("json")
  541. if res != nil && res.StatusCode == http.StatusNotModified {
  542. if res.Body != nil {
  543. res.Body.Close()
  544. }
  545. return nil, &googleapi.Error{
  546. Code: res.StatusCode,
  547. Header: res.Header,
  548. }
  549. }
  550. if err != nil {
  551. return nil, err
  552. }
  553. defer googleapi.CloseBody(res)
  554. if err := googleapi.CheckResponse(res); err != nil {
  555. return nil, err
  556. }
  557. ret := &RemoteConfig{
  558. ServerResponse: googleapi.ServerResponse{
  559. Header: res.Header,
  560. HTTPStatusCode: res.StatusCode,
  561. },
  562. }
  563. target := &ret
  564. if err := gensupport.DecodeResponse(target, res); err != nil {
  565. return nil, err
  566. }
  567. return ret, nil
  568. // {
  569. // "description": "Update a RemoteConfig. We treat this as an always-existing\nresource (when it is not found in our data store, we treat it as version\n0, a template with zero conditions and zero parameters). Hence there are\nno Create or Delete operations. Returns the updated template when\nsuccessful (and the updated eTag as a response header), or an error if\nthings go wrong.\nPossible error messages:\n* VALIDATION_ERROR (HTTP status 400) with additional details if the\ntemplate being passed in can not be validated.\n* AUTHENTICATION_ERROR (HTTP status 401) if the request can not be\nauthenticate (e.g. no access token, or invalid access token).\n* AUTHORIZATION_ERROR (HTTP status 403) if the request can not be\nauthorized (e.g. the user has no access to the specified project id).\n* VERSION_MISMATCH (HTTP status 412) when trying to update when the\nexpected eTag (passed in via the \"If-match\" header) is not specified, or\nis specified but does does not match the current eTag.\n* Internal error (HTTP status 500) for Database problems or other internal\nerrors.",
  570. // "flatPath": "v1/projects/{projectsId}/remoteConfig",
  571. // "httpMethod": "PUT",
  572. // "id": "firebaseremoteconfig.projects.updateRemoteConfig",
  573. // "parameterOrder": [
  574. // "project"
  575. // ],
  576. // "parameters": {
  577. // "project": {
  578. // "description": "The GMP project identifier. Required.\nSee note at the beginning of this file regarding project ids.",
  579. // "location": "path",
  580. // "pattern": "^projects/[^/]+$",
  581. // "required": true,
  582. // "type": "string"
  583. // },
  584. // "validateOnly": {
  585. // "description": "Optional. Defaults to \u003ccode\u003efalse\u003c/code\u003e (UpdateRemoteConfig call should\nupdate the backend if there are no validation/interal errors). May be set\nto \u003ccode\u003etrue\u003c/code\u003e to indicate that, should no validation errors occur,\nthe call should return a \"200 OK\" instead of performing the update. Note\nthat other error messages (500 Internal Error, 412 Version Mismatch, etc)\nmay still result after flipping to \u003ccode\u003efalse\u003c/code\u003e, even if getting a\n\"200 OK\" when calling with \u003ccode\u003etrue\u003c/code\u003e.",
  586. // "location": "query",
  587. // "type": "boolean"
  588. // }
  589. // },
  590. // "path": "v1/{+project}/remoteConfig",
  591. // "request": {
  592. // "$ref": "RemoteConfig"
  593. // },
  594. // "response": {
  595. // "$ref": "RemoteConfig"
  596. // }
  597. // }
  598. }