No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 

4507 líneas
156 KiB

  1. // Package runtimeconfig provides access to the Cloud Runtime Configuration API.
  2. //
  3. // See https://cloud.google.com/deployment-manager/runtime-configurator/
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/runtimeconfig/v1beta1"
  8. // ...
  9. // runtimeconfigService, err := runtimeconfig.New(oauthHttpClient)
  10. package runtimeconfig // import "google.golang.org/api/runtimeconfig/v1beta1"
  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 = "runtimeconfig:v1beta1"
  41. const apiName = "runtimeconfig"
  42. const apiVersion = "v1beta1"
  43. const basePath = "https://runtimeconfig.googleapis.com/"
  44. // OAuth2 scopes used by this API.
  45. const (
  46. // View and manage your data across Google Cloud Platform services
  47. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  48. // Manage your Google Cloud Platform services' runtime configuration
  49. CloudruntimeconfigScope = "https://www.googleapis.com/auth/cloudruntimeconfig"
  50. )
  51. func New(client *http.Client) (*Service, error) {
  52. if client == nil {
  53. return nil, errors.New("client is nil")
  54. }
  55. s := &Service{client: client, BasePath: basePath}
  56. s.Projects = NewProjectsService(s)
  57. return s, nil
  58. }
  59. type Service struct {
  60. client *http.Client
  61. BasePath string // API endpoint base URL
  62. UserAgent string // optional additional User-Agent fragment
  63. Projects *ProjectsService
  64. }
  65. func (s *Service) userAgent() string {
  66. if s.UserAgent == "" {
  67. return googleapi.UserAgent
  68. }
  69. return googleapi.UserAgent + " " + s.UserAgent
  70. }
  71. func NewProjectsService(s *Service) *ProjectsService {
  72. rs := &ProjectsService{s: s}
  73. rs.Configs = NewProjectsConfigsService(s)
  74. return rs
  75. }
  76. type ProjectsService struct {
  77. s *Service
  78. Configs *ProjectsConfigsService
  79. }
  80. func NewProjectsConfigsService(s *Service) *ProjectsConfigsService {
  81. rs := &ProjectsConfigsService{s: s}
  82. rs.Operations = NewProjectsConfigsOperationsService(s)
  83. rs.Variables = NewProjectsConfigsVariablesService(s)
  84. rs.Waiters = NewProjectsConfigsWaitersService(s)
  85. return rs
  86. }
  87. type ProjectsConfigsService struct {
  88. s *Service
  89. Operations *ProjectsConfigsOperationsService
  90. Variables *ProjectsConfigsVariablesService
  91. Waiters *ProjectsConfigsWaitersService
  92. }
  93. func NewProjectsConfigsOperationsService(s *Service) *ProjectsConfigsOperationsService {
  94. rs := &ProjectsConfigsOperationsService{s: s}
  95. return rs
  96. }
  97. type ProjectsConfigsOperationsService struct {
  98. s *Service
  99. }
  100. func NewProjectsConfigsVariablesService(s *Service) *ProjectsConfigsVariablesService {
  101. rs := &ProjectsConfigsVariablesService{s: s}
  102. return rs
  103. }
  104. type ProjectsConfigsVariablesService struct {
  105. s *Service
  106. }
  107. func NewProjectsConfigsWaitersService(s *Service) *ProjectsConfigsWaitersService {
  108. rs := &ProjectsConfigsWaitersService{s: s}
  109. return rs
  110. }
  111. type ProjectsConfigsWaitersService struct {
  112. s *Service
  113. }
  114. // Binding: Associates `members` with a `role`.
  115. type Binding struct {
  116. // Members: Specifies the identities requesting access for a Cloud
  117. // Platform resource.
  118. // `members` can have the following values:
  119. //
  120. // * `allUsers`: A special identifier that represents anyone who is
  121. // on the internet; with or without a Google account.
  122. //
  123. // * `allAuthenticatedUsers`: A special identifier that represents
  124. // anyone
  125. // who is authenticated with a Google account or a service
  126. // account.
  127. //
  128. // * `user:{emailid}`: An email address that represents a specific
  129. // Google
  130. // account. For example, `alice@gmail.com` .
  131. //
  132. //
  133. // * `serviceAccount:{emailid}`: An email address that represents a
  134. // service
  135. // account. For example,
  136. // `my-other-app@appspot.gserviceaccount.com`.
  137. //
  138. // * `group:{emailid}`: An email address that represents a Google
  139. // group.
  140. // For example, `admins@example.com`.
  141. //
  142. //
  143. // * `domain:{domain}`: A Google Apps domain name that represents all
  144. // the
  145. // users of that domain. For example, `google.com` or
  146. // `example.com`.
  147. //
  148. //
  149. Members []string `json:"members,omitempty"`
  150. // Role: Role that is assigned to `members`.
  151. // For example, `roles/viewer`, `roles/editor`, or
  152. // `roles/owner`.
  153. // Required
  154. Role string `json:"role,omitempty"`
  155. // ForceSendFields is a list of field names (e.g. "Members") to
  156. // unconditionally include in API requests. By default, fields with
  157. // empty values are omitted from API requests. However, any non-pointer,
  158. // non-interface field appearing in ForceSendFields will be sent to the
  159. // server regardless of whether the field is empty or not. This may be
  160. // used to include empty fields in Patch requests.
  161. ForceSendFields []string `json:"-"`
  162. // NullFields is a list of field names (e.g. "Members") to include in
  163. // API requests with the JSON null value. By default, fields with empty
  164. // values are omitted from API requests. However, any field with an
  165. // empty value appearing in NullFields will be sent to the server as
  166. // null. It is an error if a field in this list has a non-empty value.
  167. // This may be used to include null fields in Patch requests.
  168. NullFields []string `json:"-"`
  169. }
  170. func (s *Binding) MarshalJSON() ([]byte, error) {
  171. type NoMethod Binding
  172. raw := NoMethod(*s)
  173. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  174. }
  175. // Cardinality: A Cardinality condition for the Waiter resource. A
  176. // cardinality condition is
  177. // met when the number of variables under a specified path prefix
  178. // reaches a
  179. // predefined number. For example, if you set a Cardinality condition
  180. // where
  181. // the `path` is set to `/foo` and the number of paths is set to 2,
  182. // the
  183. // following variables would meet the condition in a RuntimeConfig
  184. // resource:
  185. //
  186. // + `/foo/variable1 = "value1"
  187. // + `/foo/variable2 = "value2"
  188. // + `/bar/variable3 = "value3"
  189. //
  190. // It would not would not satisify the same condition with the `number`
  191. // set to
  192. // 3, however, because there is only 2 paths that start with
  193. // `/foo`.
  194. // Cardinality conditions are recursive; all subtrees under the
  195. // specific
  196. // path prefix are counted.
  197. type Cardinality struct {
  198. // Number: The number variables under the `path` that must exist to meet
  199. // this
  200. // condition. Defaults to 1 if not specified.
  201. Number int64 `json:"number,omitempty"`
  202. // Path: The root of the variable subtree to monitor. For example,
  203. // `/foo`.
  204. Path string `json:"path,omitempty"`
  205. // ForceSendFields is a list of field names (e.g. "Number") to
  206. // unconditionally include in API requests. By default, fields with
  207. // empty values are omitted from API requests. However, any non-pointer,
  208. // non-interface field appearing in ForceSendFields will be sent to the
  209. // server regardless of whether the field is empty or not. This may be
  210. // used to include empty fields in Patch requests.
  211. ForceSendFields []string `json:"-"`
  212. // NullFields is a list of field names (e.g. "Number") to include in API
  213. // requests with the JSON null value. By default, fields with empty
  214. // values are omitted from API requests. However, any field with an
  215. // empty value appearing in NullFields will be sent to the server as
  216. // null. It is an error if a field in this list has a non-empty value.
  217. // This may be used to include null fields in Patch requests.
  218. NullFields []string `json:"-"`
  219. }
  220. func (s *Cardinality) MarshalJSON() ([]byte, error) {
  221. type NoMethod Cardinality
  222. raw := NoMethod(*s)
  223. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  224. }
  225. // Empty: A generic empty message that you can re-use to avoid defining
  226. // duplicated
  227. // empty messages in your APIs. A typical example is to use it as the
  228. // request
  229. // or the response type of an API method. For instance:
  230. //
  231. // service Foo {
  232. // rpc Bar(google.protobuf.Empty) returns
  233. // (google.protobuf.Empty);
  234. // }
  235. //
  236. // The JSON representation for `Empty` is empty JSON object `{}`.
  237. type Empty struct {
  238. // ServerResponse contains the HTTP response code and headers from the
  239. // server.
  240. googleapi.ServerResponse `json:"-"`
  241. }
  242. // EndCondition: The condition that a Waiter resource is waiting for.
  243. type EndCondition struct {
  244. // Cardinality: The cardinality of the `EndCondition`.
  245. Cardinality *Cardinality `json:"cardinality,omitempty"`
  246. // ForceSendFields is a list of field names (e.g. "Cardinality") 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. "Cardinality") to include
  254. // in API requests with the JSON null value. By default, fields with
  255. // empty values are omitted from API requests. However, any field with
  256. // an 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 *EndCondition) MarshalJSON() ([]byte, error) {
  262. type NoMethod EndCondition
  263. raw := NoMethod(*s)
  264. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  265. }
  266. // ListConfigsResponse: `ListConfigs()` returns the following response.
  267. // The order of returned
  268. // objects is arbitrary; that is, it is not ordered in any particular
  269. // way.
  270. type ListConfigsResponse struct {
  271. // Configs: A list of the configurations in the project. The order of
  272. // returned
  273. // objects is arbitrary; that is, it is not ordered in any particular
  274. // way.
  275. Configs []*RuntimeConfig `json:"configs,omitempty"`
  276. // NextPageToken: This token allows you to get the next page of results
  277. // for list requests.
  278. // If the number of results is larger than `pageSize`, use the
  279. // `nextPageToken`
  280. // as a value for the query parameter `pageToken` in the next list
  281. // request.
  282. // Subsequent list requests will have their own `nextPageToken` to
  283. // continue
  284. // paging through the results
  285. NextPageToken string `json:"nextPageToken,omitempty"`
  286. // ServerResponse contains the HTTP response code and headers from the
  287. // server.
  288. googleapi.ServerResponse `json:"-"`
  289. // ForceSendFields is a list of field names (e.g. "Configs") to
  290. // unconditionally include in API requests. By default, fields with
  291. // empty values are omitted from API requests. However, any non-pointer,
  292. // non-interface field appearing in ForceSendFields will be sent to the
  293. // server regardless of whether the field is empty or not. This may be
  294. // used to include empty fields in Patch requests.
  295. ForceSendFields []string `json:"-"`
  296. // NullFields is a list of field names (e.g. "Configs") to include in
  297. // API requests with the JSON null value. By default, fields with empty
  298. // values are omitted from API requests. However, any field with an
  299. // empty value appearing in NullFields will be sent to the server as
  300. // null. It is an error if a field in this list has a non-empty value.
  301. // This may be used to include null fields in Patch requests.
  302. NullFields []string `json:"-"`
  303. }
  304. func (s *ListConfigsResponse) MarshalJSON() ([]byte, error) {
  305. type NoMethod ListConfigsResponse
  306. raw := NoMethod(*s)
  307. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  308. }
  309. // ListVariablesResponse: Response for the `ListVariables()` method.
  310. type ListVariablesResponse struct {
  311. // NextPageToken: This token allows you to get the next page of results
  312. // for list requests.
  313. // If the number of results is larger than `pageSize`, use the
  314. // `nextPageToken`
  315. // as a value for the query parameter `pageToken` in the next list
  316. // request.
  317. // Subsequent list requests will have their own `nextPageToken` to
  318. // continue
  319. // paging through the results
  320. NextPageToken string `json:"nextPageToken,omitempty"`
  321. // Variables: A list of variables and their values. The order of
  322. // returned variable
  323. // objects is arbitrary.
  324. Variables []*Variable `json:"variables,omitempty"`
  325. // ServerResponse contains the HTTP response code and headers from the
  326. // server.
  327. googleapi.ServerResponse `json:"-"`
  328. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  329. // unconditionally include in API requests. By default, fields with
  330. // empty values are omitted from API requests. However, any non-pointer,
  331. // non-interface field appearing in ForceSendFields will be sent to the
  332. // server regardless of whether the field is empty or not. This may be
  333. // used to include empty fields in Patch requests.
  334. ForceSendFields []string `json:"-"`
  335. // NullFields is a list of field names (e.g. "NextPageToken") to include
  336. // in API requests with the JSON null value. By default, fields with
  337. // empty values are omitted from API requests. However, any field with
  338. // an empty value appearing in NullFields will be sent to the server as
  339. // null. It is an error if a field in this list has a non-empty value.
  340. // This may be used to include null fields in Patch requests.
  341. NullFields []string `json:"-"`
  342. }
  343. func (s *ListVariablesResponse) MarshalJSON() ([]byte, error) {
  344. type NoMethod ListVariablesResponse
  345. raw := NoMethod(*s)
  346. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  347. }
  348. // ListWaitersResponse: Response for the `ListWaiters()` method.
  349. // Order of returned waiter objects is arbitrary.
  350. type ListWaitersResponse struct {
  351. // NextPageToken: This token allows you to get the next page of results
  352. // for list requests.
  353. // If the number of results is larger than `pageSize`, use the
  354. // `nextPageToken`
  355. // as a value for the query parameter `pageToken` in the next list
  356. // request.
  357. // Subsequent list requests will have their own `nextPageToken` to
  358. // continue
  359. // paging through the results
  360. NextPageToken string `json:"nextPageToken,omitempty"`
  361. // Waiters: Found waiters in the project.
  362. Waiters []*Waiter `json:"waiters,omitempty"`
  363. // ServerResponse contains the HTTP response code and headers from the
  364. // server.
  365. googleapi.ServerResponse `json:"-"`
  366. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  367. // unconditionally include in API requests. By default, fields with
  368. // empty values are omitted from API requests. However, any non-pointer,
  369. // non-interface field appearing in ForceSendFields will be sent to the
  370. // server regardless of whether the field is empty or not. This may be
  371. // used to include empty fields in Patch requests.
  372. ForceSendFields []string `json:"-"`
  373. // NullFields is a list of field names (e.g. "NextPageToken") to include
  374. // in API requests with the JSON null value. By default, fields with
  375. // empty values are omitted from API requests. However, any field with
  376. // an empty value appearing in NullFields will be sent to the server as
  377. // null. It is an error if a field in this list has a non-empty value.
  378. // This may be used to include null fields in Patch requests.
  379. NullFields []string `json:"-"`
  380. }
  381. func (s *ListWaitersResponse) MarshalJSON() ([]byte, error) {
  382. type NoMethod ListWaitersResponse
  383. raw := NoMethod(*s)
  384. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  385. }
  386. // Operation: This resource represents a long-running operation that is
  387. // the result of a
  388. // network API call.
  389. type Operation struct {
  390. // Done: If the value is `false`, it means the operation is still in
  391. // progress.
  392. // If `true`, the operation is completed, and either `error` or
  393. // `response` is
  394. // available.
  395. Done bool `json:"done,omitempty"`
  396. // Error: The error result of the operation in case of failure or
  397. // cancellation.
  398. Error *Status `json:"error,omitempty"`
  399. // Metadata: Service-specific metadata associated with the operation.
  400. // It typically
  401. // contains progress information and common metadata such as create
  402. // time.
  403. // Some services might not provide such metadata. Any method that
  404. // returns a
  405. // long-running operation should document the metadata type, if any.
  406. Metadata googleapi.RawMessage `json:"metadata,omitempty"`
  407. // Name: The server-assigned name, which is only unique within the same
  408. // service that
  409. // originally returns it. If you use the default HTTP mapping,
  410. // the
  411. // `name` should have the format of `operations/some/unique/name`.
  412. Name string `json:"name,omitempty"`
  413. // Response: The normal response of the operation in case of success.
  414. // If the original
  415. // method returns no data on success, such as `Delete`, the response
  416. // is
  417. // `google.protobuf.Empty`. If the original method is
  418. // standard
  419. // `Get`/`Create`/`Update`, the response should be the resource. For
  420. // other
  421. // methods, the response should have the type `XxxResponse`, where
  422. // `Xxx`
  423. // is the original method name. For example, if the original method
  424. // name
  425. // is `TakeSnapshot()`, the inferred response type
  426. // is
  427. // `TakeSnapshotResponse`.
  428. Response googleapi.RawMessage `json:"response,omitempty"`
  429. // ServerResponse contains the HTTP response code and headers from the
  430. // server.
  431. googleapi.ServerResponse `json:"-"`
  432. // ForceSendFields is a list of field names (e.g. "Done") to
  433. // unconditionally include in API requests. By default, fields with
  434. // empty values are omitted from API requests. However, any non-pointer,
  435. // non-interface field appearing in ForceSendFields will be sent to the
  436. // server regardless of whether the field is empty or not. This may be
  437. // used to include empty fields in Patch requests.
  438. ForceSendFields []string `json:"-"`
  439. // NullFields is a list of field names (e.g. "Done") to include in API
  440. // requests with the JSON null value. By default, fields with empty
  441. // values are omitted from API requests. However, any field with an
  442. // empty value appearing in NullFields will be sent to the server as
  443. // null. It is an error if a field in this list has a non-empty value.
  444. // This may be used to include null fields in Patch requests.
  445. NullFields []string `json:"-"`
  446. }
  447. func (s *Operation) MarshalJSON() ([]byte, error) {
  448. type NoMethod Operation
  449. raw := NoMethod(*s)
  450. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  451. }
  452. // Policy: Defines an Identity and Access Management (IAM) policy. It is
  453. // used to
  454. // specify access control policies for Cloud Platform resources.
  455. //
  456. //
  457. // A `Policy` consists of a list of `bindings`. A `binding` binds a list
  458. // of
  459. // `members` to a `role`, where the members can be user accounts, Google
  460. // groups,
  461. // Google domains, and service accounts. A `role` is a named list of
  462. // permissions
  463. // defined by IAM.
  464. //
  465. // **JSON Example**
  466. //
  467. // {
  468. // "bindings": [
  469. // {
  470. // "role": "roles/owner",
  471. // "members": [
  472. // "user:mike@example.com",
  473. // "group:admins@example.com",
  474. // "domain:google.com",
  475. //
  476. // "serviceAccount:my-other-app@appspot.gserviceaccount.com"
  477. // ]
  478. // },
  479. // {
  480. // "role": "roles/viewer",
  481. // "members": ["user:sean@example.com"]
  482. // }
  483. // ]
  484. // }
  485. //
  486. // **YAML Example**
  487. //
  488. // bindings:
  489. // - members:
  490. // - user:mike@example.com
  491. // - group:admins@example.com
  492. // - domain:google.com
  493. // - serviceAccount:my-other-app@appspot.gserviceaccount.com
  494. // role: roles/owner
  495. // - members:
  496. // - user:sean@example.com
  497. // role: roles/viewer
  498. //
  499. //
  500. // For a description of IAM and its features, see the
  501. // [IAM developer's guide](https://cloud.google.com/iam/docs).
  502. type Policy struct {
  503. // Bindings: Associates a list of `members` to a `role`.
  504. // `bindings` with no members will result in an error.
  505. Bindings []*Binding `json:"bindings,omitempty"`
  506. // Etag: `etag` is used for optimistic concurrency control as a way to
  507. // help
  508. // prevent simultaneous updates of a policy from overwriting each
  509. // other.
  510. // It is strongly suggested that systems make use of the `etag` in
  511. // the
  512. // read-modify-write cycle to perform policy updates in order to avoid
  513. // race
  514. // conditions: An `etag` is returned in the response to `getIamPolicy`,
  515. // and
  516. // systems are expected to put that etag in the request to
  517. // `setIamPolicy` to
  518. // ensure that their change will be applied to the same version of the
  519. // policy.
  520. //
  521. // If no `etag` is provided in the call to `setIamPolicy`, then the
  522. // existing
  523. // policy is overwritten blindly.
  524. Etag string `json:"etag,omitempty"`
  525. // Version: Deprecated.
  526. Version int64 `json:"version,omitempty"`
  527. // ServerResponse contains the HTTP response code and headers from the
  528. // server.
  529. googleapi.ServerResponse `json:"-"`
  530. // ForceSendFields is a list of field names (e.g. "Bindings") to
  531. // unconditionally include in API requests. By default, fields with
  532. // empty values are omitted from API requests. However, any non-pointer,
  533. // non-interface field appearing in ForceSendFields will be sent to the
  534. // server regardless of whether the field is empty or not. This may be
  535. // used to include empty fields in Patch requests.
  536. ForceSendFields []string `json:"-"`
  537. // NullFields is a list of field names (e.g. "Bindings") to include in
  538. // API requests with the JSON null value. By default, fields with empty
  539. // values are omitted from API requests. However, any field with an
  540. // empty value appearing in NullFields will be sent to the server as
  541. // null. It is an error if a field in this list has a non-empty value.
  542. // This may be used to include null fields in Patch requests.
  543. NullFields []string `json:"-"`
  544. }
  545. func (s *Policy) MarshalJSON() ([]byte, error) {
  546. type NoMethod Policy
  547. raw := NoMethod(*s)
  548. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  549. }
  550. // RuntimeConfig: A RuntimeConfig resource is the primary resource in
  551. // the Cloud RuntimeConfig
  552. // service. A RuntimeConfig resource consists of metadata and a
  553. // hierarchy of
  554. // variables.
  555. type RuntimeConfig struct {
  556. // Description: An optional description of the RuntimeConfig object.
  557. Description string `json:"description,omitempty"`
  558. // Name: The resource name of a runtime config. The name must have the
  559. // format:
  560. //
  561. // projects/[PROJECT_ID]/configs/[CONFIG_NAME]
  562. //
  563. // The `[PROJECT_ID]` must be a valid project ID, and `[CONFIG_NAME]` is
  564. // an
  565. // arbitrary name that matches
  566. // the
  567. // `[0-9A-Za-z](?:[_.A-Za-z0-9-]{0,62}[_.A-Za-z0-9])?` regular
  568. // expression.
  569. // The length of `[CONFIG_NAME]` must be less than 64 characters.
  570. //
  571. // You pick the RuntimeConfig resource name, but the server will
  572. // validate that
  573. // the name adheres to this format. After you create the resource, you
  574. // cannot
  575. // change the resource's name.
  576. Name string `json:"name,omitempty"`
  577. // ServerResponse contains the HTTP response code and headers from the
  578. // server.
  579. googleapi.ServerResponse `json:"-"`
  580. // ForceSendFields is a list of field names (e.g. "Description") to
  581. // unconditionally include in API requests. By default, fields with
  582. // empty values are omitted from API requests. However, any non-pointer,
  583. // non-interface field appearing in ForceSendFields will be sent to the
  584. // server regardless of whether the field is empty or not. This may be
  585. // used to include empty fields in Patch requests.
  586. ForceSendFields []string `json:"-"`
  587. // NullFields is a list of field names (e.g. "Description") to include
  588. // in API requests with the JSON null value. By default, fields with
  589. // empty values are omitted from API requests. However, any field with
  590. // an empty value appearing in NullFields will be sent to the server as
  591. // null. It is an error if a field in this list has a non-empty value.
  592. // This may be used to include null fields in Patch requests.
  593. NullFields []string `json:"-"`
  594. }
  595. func (s *RuntimeConfig) MarshalJSON() ([]byte, error) {
  596. type NoMethod RuntimeConfig
  597. raw := NoMethod(*s)
  598. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  599. }
  600. // SetIamPolicyRequest: Request message for `SetIamPolicy` method.
  601. type SetIamPolicyRequest struct {
  602. // Policy: REQUIRED: The complete policy to be applied to the
  603. // `resource`. The size of
  604. // the policy is limited to a few 10s of KB. An empty policy is a
  605. // valid policy but certain Cloud Platform services (such as
  606. // Projects)
  607. // might reject them.
  608. Policy *Policy `json:"policy,omitempty"`
  609. // ForceSendFields is a list of field names (e.g. "Policy") to
  610. // unconditionally include in API requests. By default, fields with
  611. // empty values are omitted from API requests. However, any non-pointer,
  612. // non-interface field appearing in ForceSendFields will be sent to the
  613. // server regardless of whether the field is empty or not. This may be
  614. // used to include empty fields in Patch requests.
  615. ForceSendFields []string `json:"-"`
  616. // NullFields is a list of field names (e.g. "Policy") to include in API
  617. // requests with the JSON null value. By default, fields with empty
  618. // values are omitted from API requests. However, any field with an
  619. // empty value appearing in NullFields will be sent to the server as
  620. // null. It is an error if a field in this list has a non-empty value.
  621. // This may be used to include null fields in Patch requests.
  622. NullFields []string `json:"-"`
  623. }
  624. func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) {
  625. type NoMethod SetIamPolicyRequest
  626. raw := NoMethod(*s)
  627. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  628. }
  629. // Status: The `Status` type defines a logical error model that is
  630. // suitable for different
  631. // programming environments, including REST APIs and RPC APIs. It is
  632. // used by
  633. // [gRPC](https://github.com/grpc). The error model is designed to
  634. // be:
  635. //
  636. // - Simple to use and understand for most users
  637. // - Flexible enough to meet unexpected needs
  638. //
  639. // # Overview
  640. //
  641. // The `Status` message contains three pieces of data: error code, error
  642. // message,
  643. // and error details. The error code should be an enum value
  644. // of
  645. // google.rpc.Code, but it may accept additional error codes if needed.
  646. // The
  647. // error message should be a developer-facing English message that
  648. // helps
  649. // developers *understand* and *resolve* the error. If a localized
  650. // user-facing
  651. // error message is needed, put the localized message in the error
  652. // details or
  653. // localize it in the client. The optional error details may contain
  654. // arbitrary
  655. // information about the error. There is a predefined set of error
  656. // detail types
  657. // in the package `google.rpc` that can be used for common error
  658. // conditions.
  659. //
  660. // # Language mapping
  661. //
  662. // The `Status` message is the logical representation of the error
  663. // model, but it
  664. // is not necessarily the actual wire format. When the `Status` message
  665. // is
  666. // exposed in different client libraries and different wire protocols,
  667. // it can be
  668. // mapped differently. For example, it will likely be mapped to some
  669. // exceptions
  670. // in Java, but more likely mapped to some error codes in C.
  671. //
  672. // # Other uses
  673. //
  674. // The error model and the `Status` message can be used in a variety
  675. // of
  676. // environments, either with or without APIs, to provide a
  677. // consistent developer experience across different
  678. // environments.
  679. //
  680. // Example uses of this error model include:
  681. //
  682. // - Partial errors. If a service needs to return partial errors to the
  683. // client,
  684. // it may embed the `Status` in the normal response to indicate the
  685. // partial
  686. // errors.
  687. //
  688. // - Workflow errors. A typical workflow has multiple steps. Each step
  689. // may
  690. // have a `Status` message for error reporting.
  691. //
  692. // - Batch operations. If a client uses batch request and batch
  693. // response, the
  694. // `Status` message should be used directly inside batch response,
  695. // one for
  696. // each error sub-response.
  697. //
  698. // - Asynchronous operations. If an API call embeds asynchronous
  699. // operation
  700. // results in its response, the status of those operations should
  701. // be
  702. // represented directly using the `Status` message.
  703. //
  704. // - Logging. If some API errors are stored in logs, the message
  705. // `Status` could
  706. // be used directly after any stripping needed for security/privacy
  707. // reasons.
  708. type Status struct {
  709. // Code: The status code, which should be an enum value of
  710. // google.rpc.Code.
  711. Code int64 `json:"code,omitempty"`
  712. // Details: A list of messages that carry the error details. There is a
  713. // common set of
  714. // message types for APIs to use.
  715. Details []googleapi.RawMessage `json:"details,omitempty"`
  716. // Message: A developer-facing error message, which should be in
  717. // English. Any
  718. // user-facing error message should be localized and sent in
  719. // the
  720. // google.rpc.Status.details field, or localized by the client.
  721. Message string `json:"message,omitempty"`
  722. // ForceSendFields is a list of field names (e.g. "Code") to
  723. // unconditionally include in API requests. By default, fields with
  724. // empty values are omitted from API requests. However, any non-pointer,
  725. // non-interface field appearing in ForceSendFields will be sent to the
  726. // server regardless of whether the field is empty or not. This may be
  727. // used to include empty fields in Patch requests.
  728. ForceSendFields []string `json:"-"`
  729. // NullFields is a list of field names (e.g. "Code") to include in API
  730. // requests with the JSON null value. By default, fields with empty
  731. // values are omitted from API requests. However, any field with an
  732. // empty value appearing in NullFields will be sent to the server as
  733. // null. It is an error if a field in this list has a non-empty value.
  734. // This may be used to include null fields in Patch requests.
  735. NullFields []string `json:"-"`
  736. }
  737. func (s *Status) MarshalJSON() ([]byte, error) {
  738. type NoMethod Status
  739. raw := NoMethod(*s)
  740. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  741. }
  742. // TestIamPermissionsRequest: Request message for `TestIamPermissions`
  743. // method.
  744. type TestIamPermissionsRequest struct {
  745. // Permissions: The set of permissions to check for the `resource`.
  746. // Permissions with
  747. // wildcards (such as '*' or 'storage.*') are not allowed. For
  748. // more
  749. // information see
  750. // [IAM
  751. // Overview](https://cloud.google.com/iam/docs/overview#permissions).
  752. Permissions []string `json:"permissions,omitempty"`
  753. // ForceSendFields is a list of field names (e.g. "Permissions") to
  754. // unconditionally include in API requests. By default, fields with
  755. // empty values are omitted from API requests. However, any non-pointer,
  756. // non-interface field appearing in ForceSendFields will be sent to the
  757. // server regardless of whether the field is empty or not. This may be
  758. // used to include empty fields in Patch requests.
  759. ForceSendFields []string `json:"-"`
  760. // NullFields is a list of field names (e.g. "Permissions") to include
  761. // in API requests with the JSON null value. By default, fields with
  762. // empty values are omitted from API requests. However, any field with
  763. // an empty value appearing in NullFields will be sent to the server as
  764. // null. It is an error if a field in this list has a non-empty value.
  765. // This may be used to include null fields in Patch requests.
  766. NullFields []string `json:"-"`
  767. }
  768. func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) {
  769. type NoMethod TestIamPermissionsRequest
  770. raw := NoMethod(*s)
  771. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  772. }
  773. // TestIamPermissionsResponse: Response message for `TestIamPermissions`
  774. // method.
  775. type TestIamPermissionsResponse struct {
  776. // Permissions: A subset of `TestPermissionsRequest.permissions` that
  777. // the caller is
  778. // allowed.
  779. Permissions []string `json:"permissions,omitempty"`
  780. // ServerResponse contains the HTTP response code and headers from the
  781. // server.
  782. googleapi.ServerResponse `json:"-"`
  783. // ForceSendFields is a list of field names (e.g. "Permissions") to
  784. // unconditionally include in API requests. By default, fields with
  785. // empty values are omitted from API requests. However, any non-pointer,
  786. // non-interface field appearing in ForceSendFields will be sent to the
  787. // server regardless of whether the field is empty or not. This may be
  788. // used to include empty fields in Patch requests.
  789. ForceSendFields []string `json:"-"`
  790. // NullFields is a list of field names (e.g. "Permissions") to include
  791. // in API requests with the JSON null value. By default, fields with
  792. // empty values are omitted from API requests. However, any field with
  793. // an empty value appearing in NullFields will be sent to the server as
  794. // null. It is an error if a field in this list has a non-empty value.
  795. // This may be used to include null fields in Patch requests.
  796. NullFields []string `json:"-"`
  797. }
  798. func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
  799. type NoMethod TestIamPermissionsResponse
  800. raw := NoMethod(*s)
  801. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  802. }
  803. // Variable: Describes a single variable within a RuntimeConfig
  804. // resource.
  805. // The name denotes the hierarchical variable name. For
  806. // example,
  807. // `ports/serving_port` is a valid variable name. The variable value is
  808. // an
  809. // opaque string and only leaf variables can have values (that is,
  810. // variables
  811. // that do not have any child variables).
  812. type Variable struct {
  813. // Name: The name of the variable resource, in the format:
  814. //
  815. //
  816. // projects/[PROJECT_ID]/configs/[CONFIG_NAME]/variables/[VARIABLE_NAME]
  817. //
  818. //
  819. // The `[PROJECT_ID]` must be a valid project ID, `[CONFIG_NAME]` must
  820. // be a
  821. // valid RuntimeConfig reource and `[VARIABLE_NAME]` follows Unix file
  822. // system
  823. // file path naming.
  824. //
  825. // The `[VARIABLE_NAME]` can contain ASCII letters, numbers, slashes
  826. // and
  827. // dashes. Slashes are used as path element separators and are not part
  828. // of the
  829. // `[VARIABLE_NAME]` itself, so `[VARIABLE_NAME]` must contain at least
  830. // one
  831. // non-slash character. Multiple slashes are coalesced into single
  832. // slash
  833. // character. Each path segment should
  834. // match
  835. // [0-9A-Za-z](?:[_.A-Za-z0-9-]{0,62}[_.A-Za-z0-9])? regular
  836. // expression.
  837. // The length of a `[VARIABLE_NAME]` must be less than 256
  838. // characters.
  839. //
  840. // Once you create a variable, you cannot change the variable name.
  841. Name string `json:"name,omitempty"`
  842. // State: [Ouput only] The current state of the variable. The variable
  843. // state indicates
  844. // the outcome of the `variables().watch` call and is visible through
  845. // the
  846. // `get` and `list` calls.
  847. //
  848. // Possible values:
  849. // "VARIABLE_STATE_UNSPECIFIED" - Default variable state.
  850. // "UPDATED" - The variable was updated, while `variables().watch` was
  851. // executing.
  852. // "DELETED" - The variable was deleted, while `variables().watch` was
  853. // executing.
  854. State string `json:"state,omitempty"`
  855. // Text: The string value of the variable. The length of the value must
  856. // be less
  857. // than 4096 bytes. Empty values are also accepted. For example,
  858. // `text: "my text value". The string must be valid UTF-8.
  859. Text string `json:"text,omitempty"`
  860. // UpdateTime: Output only. The time of the last variable update.
  861. UpdateTime string `json:"updateTime,omitempty"`
  862. // Value: The binary value of the variable. The length of the value must
  863. // be less
  864. // than 4096 bytes. Empty values are also accepted. The value must
  865. // be
  866. // base64 encoded. Only one of `value` or `text` can be set.
  867. Value string `json:"value,omitempty"`
  868. // ServerResponse contains the HTTP response code and headers from the
  869. // server.
  870. googleapi.ServerResponse `json:"-"`
  871. // ForceSendFields is a list of field names (e.g. "Name") to
  872. // unconditionally include in API requests. By default, fields with
  873. // empty values are omitted from API requests. However, any non-pointer,
  874. // non-interface field appearing in ForceSendFields will be sent to the
  875. // server regardless of whether the field is empty or not. This may be
  876. // used to include empty fields in Patch requests.
  877. ForceSendFields []string `json:"-"`
  878. // NullFields is a list of field names (e.g. "Name") to include in API
  879. // requests with the JSON null value. By default, fields with empty
  880. // values are omitted from API requests. However, any field with an
  881. // empty value appearing in NullFields will be sent to the server as
  882. // null. It is an error if a field in this list has a non-empty value.
  883. // This may be used to include null fields in Patch requests.
  884. NullFields []string `json:"-"`
  885. }
  886. func (s *Variable) MarshalJSON() ([]byte, error) {
  887. type NoMethod Variable
  888. raw := NoMethod(*s)
  889. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  890. }
  891. // Waiter: A Waiter resource waits for some end condition within a
  892. // RuntimeConfig resource
  893. // to be met before it returns. For example, assume you have a
  894. // distributed
  895. // system where each node writes to a Variable resource indidicating the
  896. // node's
  897. // readiness as part of the startup process.
  898. //
  899. // You then configure a Waiter resource with the success condition set
  900. // to wait
  901. // until some number of nodes have checked in. Afterwards, your
  902. // application
  903. // runs some arbitrary code after the condition has been met and the
  904. // waiter
  905. // returns successfully.
  906. //
  907. // Once created, a Waiter resource is immutable.
  908. //
  909. // To learn more about using waiters, read the
  910. // [Creating a
  911. // Waiter](/deployment-manager/runtime-configurator/creating-a-waiter)
  912. // do
  913. // cumentation.
  914. type Waiter struct {
  915. // CreateTime: Output only. The instant at which this Waiter resource
  916. // was created. Adding
  917. // the value of `timeout` to this instant yields the timeout deadline
  918. // for the
  919. // waiter.
  920. CreateTime string `json:"createTime,omitempty"`
  921. // Done: Output only. If the value is `false`, it means the waiter is
  922. // still waiting
  923. // for one of its conditions to be met.
  924. //
  925. // If true, the waiter has finished. If the waiter finished due to a
  926. // timeout
  927. // or failure, `error` will be set.
  928. Done bool `json:"done,omitempty"`
  929. // Error: Output only. If the waiter ended due to a failure or timeout,
  930. // this value
  931. // will be set.
  932. Error *Status `json:"error,omitempty"`
  933. // Failure: [Optional] The failure condition of this waiter. If this
  934. // condition is met,
  935. // `done` will be set to `true` and the `error` code will be set to
  936. // `ABORTED`.
  937. // The failure condition takes precedence over the success condition. If
  938. // both
  939. // conditions are met, a failure will be indicated. This value is
  940. // optional; if
  941. // no failure condition is set, the only failure scenario will be a
  942. // timeout.
  943. Failure *EndCondition `json:"failure,omitempty"`
  944. // Name: The name of the Waiter resource, in the format:
  945. //
  946. //
  947. // projects/[PROJECT_ID]/configs/[CONFIG_NAME]/waiters/[WAITER_NAME]
  948. //
  949. // The
  950. // `[PROJECT_ID]` must be a valid Google Cloud project ID,
  951. // the `[CONFIG_NAME]` must be a valid RuntimeConfig resource,
  952. // the
  953. // `[WAITER_NAME]` must match RFC 1035 segment specification, and the
  954. // length
  955. // of `[WAITER_NAME]` must be less than 64 bytes.
  956. //
  957. // After you create a Waiter resource, you cannot change the resource
  958. // name.
  959. Name string `json:"name,omitempty"`
  960. // Success: [Required] The success condition. If this condition is met,
  961. // `done` will be
  962. // set to `true` and the `error` value will remain unset. The failure
  963. // condition
  964. // takes precedence over the success condition. If both conditions are
  965. // met, a
  966. // failure will be indicated.
  967. Success *EndCondition `json:"success,omitempty"`
  968. // Timeout: [Required] Specifies the timeout of the waiter in seconds,
  969. // beginning from
  970. // the instant that `waiters().create` method is called. If this time
  971. // elapses
  972. // before the success or failure conditions are met, the waiter fails
  973. // and sets
  974. // the `error` code to `DEADLINE_EXCEEDED`.
  975. Timeout string `json:"timeout,omitempty"`
  976. // ServerResponse contains the HTTP response code and headers from the
  977. // server.
  978. googleapi.ServerResponse `json:"-"`
  979. // ForceSendFields is a list of field names (e.g. "CreateTime") to
  980. // unconditionally include in API requests. By default, fields with
  981. // empty values are omitted from API requests. However, any non-pointer,
  982. // non-interface field appearing in ForceSendFields will be sent to the
  983. // server regardless of whether the field is empty or not. This may be
  984. // used to include empty fields in Patch requests.
  985. ForceSendFields []string `json:"-"`
  986. // NullFields is a list of field names (e.g. "CreateTime") to include in
  987. // API requests with the JSON null value. By default, fields with empty
  988. // values are omitted from API requests. However, any field with an
  989. // empty value appearing in NullFields will be sent to the server as
  990. // null. It is an error if a field in this list has a non-empty value.
  991. // This may be used to include null fields in Patch requests.
  992. NullFields []string `json:"-"`
  993. }
  994. func (s *Waiter) MarshalJSON() ([]byte, error) {
  995. type NoMethod Waiter
  996. raw := NoMethod(*s)
  997. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  998. }
  999. // WatchVariableRequest: Request for the `WatchVariable()` method.
  1000. type WatchVariableRequest struct {
  1001. // NewerThan: If specified, checks the current timestamp of the variable
  1002. // and if the
  1003. // current timestamp is newer than `newerThan` timestamp, the method
  1004. // returns
  1005. // immediately.
  1006. //
  1007. // If not specified or the variable has an older timestamp, the watcher
  1008. // waits
  1009. // for a the value to change before returning.
  1010. NewerThan string `json:"newerThan,omitempty"`
  1011. // ForceSendFields is a list of field names (e.g. "NewerThan") to
  1012. // unconditionally include in API requests. By default, fields with
  1013. // empty values are omitted from API requests. However, any non-pointer,
  1014. // non-interface field appearing in ForceSendFields will be sent to the
  1015. // server regardless of whether the field is empty or not. This may be
  1016. // used to include empty fields in Patch requests.
  1017. ForceSendFields []string `json:"-"`
  1018. // NullFields is a list of field names (e.g. "NewerThan") to include in
  1019. // API requests with the JSON null value. By default, fields with empty
  1020. // values are omitted from API requests. However, any field with an
  1021. // empty value appearing in NullFields will be sent to the server as
  1022. // null. It is an error if a field in this list has a non-empty value.
  1023. // This may be used to include null fields in Patch requests.
  1024. NullFields []string `json:"-"`
  1025. }
  1026. func (s *WatchVariableRequest) MarshalJSON() ([]byte, error) {
  1027. type NoMethod WatchVariableRequest
  1028. raw := NoMethod(*s)
  1029. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1030. }
  1031. // method id "runtimeconfig.projects.configs.create":
  1032. type ProjectsConfigsCreateCall struct {
  1033. s *Service
  1034. parent string
  1035. runtimeconfig *RuntimeConfig
  1036. urlParams_ gensupport.URLParams
  1037. ctx_ context.Context
  1038. header_ http.Header
  1039. }
  1040. // Create: Creates a new RuntimeConfig resource. The configuration name
  1041. // must be
  1042. // unique within project.
  1043. func (r *ProjectsConfigsService) Create(parent string, runtimeconfig *RuntimeConfig) *ProjectsConfigsCreateCall {
  1044. c := &ProjectsConfigsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1045. c.parent = parent
  1046. c.runtimeconfig = runtimeconfig
  1047. return c
  1048. }
  1049. // RequestId sets the optional parameter "requestId": An optional but
  1050. // recommended unique `request_id`. If the server
  1051. // receives two `create()` requests with the same
  1052. // `request_id`, then the second request will be ignored and the
  1053. // first resource created and stored in the backend is returned.
  1054. // Empty `request_id` fields are ignored.
  1055. //
  1056. // It is responsibility of the client to ensure uniqueness of
  1057. // the
  1058. // `request_id` strings.
  1059. //
  1060. // `request_id` strings are limited to 64 characters.
  1061. func (c *ProjectsConfigsCreateCall) RequestId(requestId string) *ProjectsConfigsCreateCall {
  1062. c.urlParams_.Set("requestId", requestId)
  1063. return c
  1064. }
  1065. // Fields allows partial responses to be retrieved. See
  1066. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1067. // for more information.
  1068. func (c *ProjectsConfigsCreateCall) Fields(s ...googleapi.Field) *ProjectsConfigsCreateCall {
  1069. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1070. return c
  1071. }
  1072. // Context sets the context to be used in this call's Do method. Any
  1073. // pending HTTP request will be aborted if the provided context is
  1074. // canceled.
  1075. func (c *ProjectsConfigsCreateCall) Context(ctx context.Context) *ProjectsConfigsCreateCall {
  1076. c.ctx_ = ctx
  1077. return c
  1078. }
  1079. // Header returns an http.Header that can be modified by the caller to
  1080. // add HTTP headers to the request.
  1081. func (c *ProjectsConfigsCreateCall) Header() http.Header {
  1082. if c.header_ == nil {
  1083. c.header_ = make(http.Header)
  1084. }
  1085. return c.header_
  1086. }
  1087. func (c *ProjectsConfigsCreateCall) doRequest(alt string) (*http.Response, error) {
  1088. reqHeaders := make(http.Header)
  1089. for k, v := range c.header_ {
  1090. reqHeaders[k] = v
  1091. }
  1092. reqHeaders.Set("User-Agent", c.s.userAgent())
  1093. var body io.Reader = nil
  1094. body, err := googleapi.WithoutDataWrapper.JSONReader(c.runtimeconfig)
  1095. if err != nil {
  1096. return nil, err
  1097. }
  1098. reqHeaders.Set("Content-Type", "application/json")
  1099. c.urlParams_.Set("alt", alt)
  1100. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/configs")
  1101. urls += "?" + c.urlParams_.Encode()
  1102. req, _ := http.NewRequest("POST", urls, body)
  1103. req.Header = reqHeaders
  1104. googleapi.Expand(req.URL, map[string]string{
  1105. "parent": c.parent,
  1106. })
  1107. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1108. }
  1109. // Do executes the "runtimeconfig.projects.configs.create" call.
  1110. // Exactly one of *RuntimeConfig or error will be non-nil. Any non-2xx
  1111. // status code is an error. Response headers are in either
  1112. // *RuntimeConfig.ServerResponse.Header or (if a response was returned
  1113. // at all) in error.(*googleapi.Error).Header. Use
  1114. // googleapi.IsNotModified to check whether the returned error was
  1115. // because http.StatusNotModified was returned.
  1116. func (c *ProjectsConfigsCreateCall) Do(opts ...googleapi.CallOption) (*RuntimeConfig, error) {
  1117. gensupport.SetOptions(c.urlParams_, opts...)
  1118. res, err := c.doRequest("json")
  1119. if res != nil && res.StatusCode == http.StatusNotModified {
  1120. if res.Body != nil {
  1121. res.Body.Close()
  1122. }
  1123. return nil, &googleapi.Error{
  1124. Code: res.StatusCode,
  1125. Header: res.Header,
  1126. }
  1127. }
  1128. if err != nil {
  1129. return nil, err
  1130. }
  1131. defer googleapi.CloseBody(res)
  1132. if err := googleapi.CheckResponse(res); err != nil {
  1133. return nil, err
  1134. }
  1135. ret := &RuntimeConfig{
  1136. ServerResponse: googleapi.ServerResponse{
  1137. Header: res.Header,
  1138. HTTPStatusCode: res.StatusCode,
  1139. },
  1140. }
  1141. target := &ret
  1142. if err := gensupport.DecodeResponse(target, res); err != nil {
  1143. return nil, err
  1144. }
  1145. return ret, nil
  1146. // {
  1147. // "description": "Creates a new RuntimeConfig resource. The configuration name must be\nunique within project.",
  1148. // "flatPath": "v1beta1/projects/{projectsId}/configs",
  1149. // "httpMethod": "POST",
  1150. // "id": "runtimeconfig.projects.configs.create",
  1151. // "parameterOrder": [
  1152. // "parent"
  1153. // ],
  1154. // "parameters": {
  1155. // "parent": {
  1156. // "description": "The [project\nID](https://support.google.com/cloud/answer/6158840?hl=en\u0026ref_topic=6158848)\nfor this request, in the format `projects/[PROJECT_ID]`.",
  1157. // "location": "path",
  1158. // "pattern": "^projects/[^/]+$",
  1159. // "required": true,
  1160. // "type": "string"
  1161. // },
  1162. // "requestId": {
  1163. // "description": "An optional but recommended unique `request_id`. If the server\nreceives two `create()` requests with the same\n`request_id`, then the second request will be ignored and the\nfirst resource created and stored in the backend is returned.\nEmpty `request_id` fields are ignored.\n\nIt is responsibility of the client to ensure uniqueness of the\n`request_id` strings.\n\n`request_id` strings are limited to 64 characters.",
  1164. // "location": "query",
  1165. // "type": "string"
  1166. // }
  1167. // },
  1168. // "path": "v1beta1/{+parent}/configs",
  1169. // "request": {
  1170. // "$ref": "RuntimeConfig"
  1171. // },
  1172. // "response": {
  1173. // "$ref": "RuntimeConfig"
  1174. // },
  1175. // "scopes": [
  1176. // "https://www.googleapis.com/auth/cloud-platform",
  1177. // "https://www.googleapis.com/auth/cloudruntimeconfig"
  1178. // ]
  1179. // }
  1180. }
  1181. // method id "runtimeconfig.projects.configs.delete":
  1182. type ProjectsConfigsDeleteCall struct {
  1183. s *Service
  1184. name string
  1185. urlParams_ gensupport.URLParams
  1186. ctx_ context.Context
  1187. header_ http.Header
  1188. }
  1189. // Delete: Deletes a RuntimeConfig resource.
  1190. func (r *ProjectsConfigsService) Delete(name string) *ProjectsConfigsDeleteCall {
  1191. c := &ProjectsConfigsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1192. c.name = name
  1193. return c
  1194. }
  1195. // Fields allows partial responses to be retrieved. See
  1196. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1197. // for more information.
  1198. func (c *ProjectsConfigsDeleteCall) Fields(s ...googleapi.Field) *ProjectsConfigsDeleteCall {
  1199. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1200. return c
  1201. }
  1202. // Context sets the context to be used in this call's Do method. Any
  1203. // pending HTTP request will be aborted if the provided context is
  1204. // canceled.
  1205. func (c *ProjectsConfigsDeleteCall) Context(ctx context.Context) *ProjectsConfigsDeleteCall {
  1206. c.ctx_ = ctx
  1207. return c
  1208. }
  1209. // Header returns an http.Header that can be modified by the caller to
  1210. // add HTTP headers to the request.
  1211. func (c *ProjectsConfigsDeleteCall) Header() http.Header {
  1212. if c.header_ == nil {
  1213. c.header_ = make(http.Header)
  1214. }
  1215. return c.header_
  1216. }
  1217. func (c *ProjectsConfigsDeleteCall) doRequest(alt string) (*http.Response, error) {
  1218. reqHeaders := make(http.Header)
  1219. for k, v := range c.header_ {
  1220. reqHeaders[k] = v
  1221. }
  1222. reqHeaders.Set("User-Agent", c.s.userAgent())
  1223. var body io.Reader = nil
  1224. c.urlParams_.Set("alt", alt)
  1225. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  1226. urls += "?" + c.urlParams_.Encode()
  1227. req, _ := http.NewRequest("DELETE", urls, body)
  1228. req.Header = reqHeaders
  1229. googleapi.Expand(req.URL, map[string]string{
  1230. "name": c.name,
  1231. })
  1232. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1233. }
  1234. // Do executes the "runtimeconfig.projects.configs.delete" call.
  1235. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  1236. // code is an error. Response headers are in either
  1237. // *Empty.ServerResponse.Header or (if a response was returned at all)
  1238. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1239. // check whether the returned error was because http.StatusNotModified
  1240. // was returned.
  1241. func (c *ProjectsConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  1242. gensupport.SetOptions(c.urlParams_, opts...)
  1243. res, err := c.doRequest("json")
  1244. if res != nil && res.StatusCode == http.StatusNotModified {
  1245. if res.Body != nil {
  1246. res.Body.Close()
  1247. }
  1248. return nil, &googleapi.Error{
  1249. Code: res.StatusCode,
  1250. Header: res.Header,
  1251. }
  1252. }
  1253. if err != nil {
  1254. return nil, err
  1255. }
  1256. defer googleapi.CloseBody(res)
  1257. if err := googleapi.CheckResponse(res); err != nil {
  1258. return nil, err
  1259. }
  1260. ret := &Empty{
  1261. ServerResponse: googleapi.ServerResponse{
  1262. Header: res.Header,
  1263. HTTPStatusCode: res.StatusCode,
  1264. },
  1265. }
  1266. target := &ret
  1267. if err := gensupport.DecodeResponse(target, res); err != nil {
  1268. return nil, err
  1269. }
  1270. return ret, nil
  1271. // {
  1272. // "description": "Deletes a RuntimeConfig resource.",
  1273. // "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}",
  1274. // "httpMethod": "DELETE",
  1275. // "id": "runtimeconfig.projects.configs.delete",
  1276. // "parameterOrder": [
  1277. // "name"
  1278. // ],
  1279. // "parameters": {
  1280. // "name": {
  1281. // "description": "The RuntimeConfig resource to delete, in the format:\n\n`projects/[PROJECT_ID]/configs/[CONFIG_NAME]`",
  1282. // "location": "path",
  1283. // "pattern": "^projects/[^/]+/configs/[^/]+$",
  1284. // "required": true,
  1285. // "type": "string"
  1286. // }
  1287. // },
  1288. // "path": "v1beta1/{+name}",
  1289. // "response": {
  1290. // "$ref": "Empty"
  1291. // },
  1292. // "scopes": [
  1293. // "https://www.googleapis.com/auth/cloud-platform",
  1294. // "https://www.googleapis.com/auth/cloudruntimeconfig"
  1295. // ]
  1296. // }
  1297. }
  1298. // method id "runtimeconfig.projects.configs.get":
  1299. type ProjectsConfigsGetCall struct {
  1300. s *Service
  1301. name string
  1302. urlParams_ gensupport.URLParams
  1303. ifNoneMatch_ string
  1304. ctx_ context.Context
  1305. header_ http.Header
  1306. }
  1307. // Get: Gets information about a RuntimeConfig resource.
  1308. func (r *ProjectsConfigsService) Get(name string) *ProjectsConfigsGetCall {
  1309. c := &ProjectsConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1310. c.name = name
  1311. return c
  1312. }
  1313. // Fields allows partial responses to be retrieved. See
  1314. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1315. // for more information.
  1316. func (c *ProjectsConfigsGetCall) Fields(s ...googleapi.Field) *ProjectsConfigsGetCall {
  1317. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1318. return c
  1319. }
  1320. // IfNoneMatch sets the optional parameter which makes the operation
  1321. // fail if the object's ETag matches the given value. This is useful for
  1322. // getting updates only after the object has changed since the last
  1323. // request. Use googleapi.IsNotModified to check whether the response
  1324. // error from Do is the result of In-None-Match.
  1325. func (c *ProjectsConfigsGetCall) IfNoneMatch(entityTag string) *ProjectsConfigsGetCall {
  1326. c.ifNoneMatch_ = entityTag
  1327. return c
  1328. }
  1329. // Context sets the context to be used in this call's Do method. Any
  1330. // pending HTTP request will be aborted if the provided context is
  1331. // canceled.
  1332. func (c *ProjectsConfigsGetCall) Context(ctx context.Context) *ProjectsConfigsGetCall {
  1333. c.ctx_ = ctx
  1334. return c
  1335. }
  1336. // Header returns an http.Header that can be modified by the caller to
  1337. // add HTTP headers to the request.
  1338. func (c *ProjectsConfigsGetCall) Header() http.Header {
  1339. if c.header_ == nil {
  1340. c.header_ = make(http.Header)
  1341. }
  1342. return c.header_
  1343. }
  1344. func (c *ProjectsConfigsGetCall) doRequest(alt string) (*http.Response, error) {
  1345. reqHeaders := make(http.Header)
  1346. for k, v := range c.header_ {
  1347. reqHeaders[k] = v
  1348. }
  1349. reqHeaders.Set("User-Agent", c.s.userAgent())
  1350. if c.ifNoneMatch_ != "" {
  1351. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1352. }
  1353. var body io.Reader = nil
  1354. c.urlParams_.Set("alt", alt)
  1355. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  1356. urls += "?" + c.urlParams_.Encode()
  1357. req, _ := http.NewRequest("GET", urls, body)
  1358. req.Header = reqHeaders
  1359. googleapi.Expand(req.URL, map[string]string{
  1360. "name": c.name,
  1361. })
  1362. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1363. }
  1364. // Do executes the "runtimeconfig.projects.configs.get" call.
  1365. // Exactly one of *RuntimeConfig or error will be non-nil. Any non-2xx
  1366. // status code is an error. Response headers are in either
  1367. // *RuntimeConfig.ServerResponse.Header or (if a response was returned
  1368. // at all) in error.(*googleapi.Error).Header. Use
  1369. // googleapi.IsNotModified to check whether the returned error was
  1370. // because http.StatusNotModified was returned.
  1371. func (c *ProjectsConfigsGetCall) Do(opts ...googleapi.CallOption) (*RuntimeConfig, error) {
  1372. gensupport.SetOptions(c.urlParams_, opts...)
  1373. res, err := c.doRequest("json")
  1374. if res != nil && res.StatusCode == http.StatusNotModified {
  1375. if res.Body != nil {
  1376. res.Body.Close()
  1377. }
  1378. return nil, &googleapi.Error{
  1379. Code: res.StatusCode,
  1380. Header: res.Header,
  1381. }
  1382. }
  1383. if err != nil {
  1384. return nil, err
  1385. }
  1386. defer googleapi.CloseBody(res)
  1387. if err := googleapi.CheckResponse(res); err != nil {
  1388. return nil, err
  1389. }
  1390. ret := &RuntimeConfig{
  1391. ServerResponse: googleapi.ServerResponse{
  1392. Header: res.Header,
  1393. HTTPStatusCode: res.StatusCode,
  1394. },
  1395. }
  1396. target := &ret
  1397. if err := gensupport.DecodeResponse(target, res); err != nil {
  1398. return nil, err
  1399. }
  1400. return ret, nil
  1401. // {
  1402. // "description": "Gets information about a RuntimeConfig resource.",
  1403. // "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}",
  1404. // "httpMethod": "GET",
  1405. // "id": "runtimeconfig.projects.configs.get",
  1406. // "parameterOrder": [
  1407. // "name"
  1408. // ],
  1409. // "parameters": {
  1410. // "name": {
  1411. // "description": "The name of the RuntimeConfig resource to retrieve, in the format:\n\n`projects/[PROJECT_ID]/configs/[CONFIG_NAME]`",
  1412. // "location": "path",
  1413. // "pattern": "^projects/[^/]+/configs/[^/]+$",
  1414. // "required": true,
  1415. // "type": "string"
  1416. // }
  1417. // },
  1418. // "path": "v1beta1/{+name}",
  1419. // "response": {
  1420. // "$ref": "RuntimeConfig"
  1421. // },
  1422. // "scopes": [
  1423. // "https://www.googleapis.com/auth/cloud-platform",
  1424. // "https://www.googleapis.com/auth/cloudruntimeconfig"
  1425. // ]
  1426. // }
  1427. }
  1428. // method id "runtimeconfig.projects.configs.getIamPolicy":
  1429. type ProjectsConfigsGetIamPolicyCall struct {
  1430. s *Service
  1431. resource string
  1432. urlParams_ gensupport.URLParams
  1433. ifNoneMatch_ string
  1434. ctx_ context.Context
  1435. header_ http.Header
  1436. }
  1437. // GetIamPolicy: Gets the access control policy for a resource.
  1438. // Returns an empty policy if the resource exists and does not have a
  1439. // policy
  1440. // set.
  1441. func (r *ProjectsConfigsService) GetIamPolicy(resource string) *ProjectsConfigsGetIamPolicyCall {
  1442. c := &ProjectsConfigsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1443. c.resource = resource
  1444. return c
  1445. }
  1446. // Fields allows partial responses to be retrieved. See
  1447. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1448. // for more information.
  1449. func (c *ProjectsConfigsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsConfigsGetIamPolicyCall {
  1450. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1451. return c
  1452. }
  1453. // IfNoneMatch sets the optional parameter which makes the operation
  1454. // fail if the object's ETag matches the given value. This is useful for
  1455. // getting updates only after the object has changed since the last
  1456. // request. Use googleapi.IsNotModified to check whether the response
  1457. // error from Do is the result of In-None-Match.
  1458. func (c *ProjectsConfigsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsConfigsGetIamPolicyCall {
  1459. c.ifNoneMatch_ = entityTag
  1460. return c
  1461. }
  1462. // Context sets the context to be used in this call's Do method. Any
  1463. // pending HTTP request will be aborted if the provided context is
  1464. // canceled.
  1465. func (c *ProjectsConfigsGetIamPolicyCall) Context(ctx context.Context) *ProjectsConfigsGetIamPolicyCall {
  1466. c.ctx_ = ctx
  1467. return c
  1468. }
  1469. // Header returns an http.Header that can be modified by the caller to
  1470. // add HTTP headers to the request.
  1471. func (c *ProjectsConfigsGetIamPolicyCall) Header() http.Header {
  1472. if c.header_ == nil {
  1473. c.header_ = make(http.Header)
  1474. }
  1475. return c.header_
  1476. }
  1477. func (c *ProjectsConfigsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  1478. reqHeaders := make(http.Header)
  1479. for k, v := range c.header_ {
  1480. reqHeaders[k] = v
  1481. }
  1482. reqHeaders.Set("User-Agent", c.s.userAgent())
  1483. if c.ifNoneMatch_ != "" {
  1484. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1485. }
  1486. var body io.Reader = nil
  1487. c.urlParams_.Set("alt", alt)
  1488. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy")
  1489. urls += "?" + c.urlParams_.Encode()
  1490. req, _ := http.NewRequest("GET", urls, body)
  1491. req.Header = reqHeaders
  1492. googleapi.Expand(req.URL, map[string]string{
  1493. "resource": c.resource,
  1494. })
  1495. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1496. }
  1497. // Do executes the "runtimeconfig.projects.configs.getIamPolicy" call.
  1498. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  1499. // code is an error. Response headers are in either
  1500. // *Policy.ServerResponse.Header or (if a response was returned at all)
  1501. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1502. // check whether the returned error was because http.StatusNotModified
  1503. // was returned.
  1504. func (c *ProjectsConfigsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  1505. gensupport.SetOptions(c.urlParams_, opts...)
  1506. res, err := c.doRequest("json")
  1507. if res != nil && res.StatusCode == http.StatusNotModified {
  1508. if res.Body != nil {
  1509. res.Body.Close()
  1510. }
  1511. return nil, &googleapi.Error{
  1512. Code: res.StatusCode,
  1513. Header: res.Header,
  1514. }
  1515. }
  1516. if err != nil {
  1517. return nil, err
  1518. }
  1519. defer googleapi.CloseBody(res)
  1520. if err := googleapi.CheckResponse(res); err != nil {
  1521. return nil, err
  1522. }
  1523. ret := &Policy{
  1524. ServerResponse: googleapi.ServerResponse{
  1525. Header: res.Header,
  1526. HTTPStatusCode: res.StatusCode,
  1527. },
  1528. }
  1529. target := &ret
  1530. if err := gensupport.DecodeResponse(target, res); err != nil {
  1531. return nil, err
  1532. }
  1533. return ret, nil
  1534. // {
  1535. // "description": "Gets the access control policy for a resource.\nReturns an empty policy if the resource exists and does not have a policy\nset.",
  1536. // "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}:getIamPolicy",
  1537. // "httpMethod": "GET",
  1538. // "id": "runtimeconfig.projects.configs.getIamPolicy",
  1539. // "parameterOrder": [
  1540. // "resource"
  1541. // ],
  1542. // "parameters": {
  1543. // "resource": {
  1544. // "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field.",
  1545. // "location": "path",
  1546. // "pattern": "^projects/[^/]+/configs/[^/]+$",
  1547. // "required": true,
  1548. // "type": "string"
  1549. // }
  1550. // },
  1551. // "path": "v1beta1/{+resource}:getIamPolicy",
  1552. // "response": {
  1553. // "$ref": "Policy"
  1554. // },
  1555. // "scopes": [
  1556. // "https://www.googleapis.com/auth/cloud-platform",
  1557. // "https://www.googleapis.com/auth/cloudruntimeconfig"
  1558. // ]
  1559. // }
  1560. }
  1561. // method id "runtimeconfig.projects.configs.list":
  1562. type ProjectsConfigsListCall struct {
  1563. s *Service
  1564. parent string
  1565. urlParams_ gensupport.URLParams
  1566. ifNoneMatch_ string
  1567. ctx_ context.Context
  1568. header_ http.Header
  1569. }
  1570. // List: Lists all the RuntimeConfig resources within project.
  1571. func (r *ProjectsConfigsService) List(parent string) *ProjectsConfigsListCall {
  1572. c := &ProjectsConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1573. c.parent = parent
  1574. return c
  1575. }
  1576. // PageSize sets the optional parameter "pageSize": Specifies the number
  1577. // of results to return per page. If there are fewer
  1578. // elements than the specified number, returns all elements.
  1579. func (c *ProjectsConfigsListCall) PageSize(pageSize int64) *ProjectsConfigsListCall {
  1580. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1581. return c
  1582. }
  1583. // PageToken sets the optional parameter "pageToken": Specifies a page
  1584. // token to use. Set `pageToken` to a `nextPageToken`
  1585. // returned by a previous list request to get the next page of results.
  1586. func (c *ProjectsConfigsListCall) PageToken(pageToken string) *ProjectsConfigsListCall {
  1587. c.urlParams_.Set("pageToken", pageToken)
  1588. return c
  1589. }
  1590. // Fields allows partial responses to be retrieved. See
  1591. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1592. // for more information.
  1593. func (c *ProjectsConfigsListCall) Fields(s ...googleapi.Field) *ProjectsConfigsListCall {
  1594. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1595. return c
  1596. }
  1597. // IfNoneMatch sets the optional parameter which makes the operation
  1598. // fail if the object's ETag matches the given value. This is useful for
  1599. // getting updates only after the object has changed since the last
  1600. // request. Use googleapi.IsNotModified to check whether the response
  1601. // error from Do is the result of In-None-Match.
  1602. func (c *ProjectsConfigsListCall) IfNoneMatch(entityTag string) *ProjectsConfigsListCall {
  1603. c.ifNoneMatch_ = entityTag
  1604. return c
  1605. }
  1606. // Context sets the context to be used in this call's Do method. Any
  1607. // pending HTTP request will be aborted if the provided context is
  1608. // canceled.
  1609. func (c *ProjectsConfigsListCall) Context(ctx context.Context) *ProjectsConfigsListCall {
  1610. c.ctx_ = ctx
  1611. return c
  1612. }
  1613. // Header returns an http.Header that can be modified by the caller to
  1614. // add HTTP headers to the request.
  1615. func (c *ProjectsConfigsListCall) Header() http.Header {
  1616. if c.header_ == nil {
  1617. c.header_ = make(http.Header)
  1618. }
  1619. return c.header_
  1620. }
  1621. func (c *ProjectsConfigsListCall) doRequest(alt string) (*http.Response, error) {
  1622. reqHeaders := make(http.Header)
  1623. for k, v := range c.header_ {
  1624. reqHeaders[k] = v
  1625. }
  1626. reqHeaders.Set("User-Agent", c.s.userAgent())
  1627. if c.ifNoneMatch_ != "" {
  1628. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1629. }
  1630. var body io.Reader = nil
  1631. c.urlParams_.Set("alt", alt)
  1632. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/configs")
  1633. urls += "?" + c.urlParams_.Encode()
  1634. req, _ := http.NewRequest("GET", urls, body)
  1635. req.Header = reqHeaders
  1636. googleapi.Expand(req.URL, map[string]string{
  1637. "parent": c.parent,
  1638. })
  1639. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1640. }
  1641. // Do executes the "runtimeconfig.projects.configs.list" call.
  1642. // Exactly one of *ListConfigsResponse or error will be non-nil. Any
  1643. // non-2xx status code is an error. Response headers are in either
  1644. // *ListConfigsResponse.ServerResponse.Header or (if a response was
  1645. // returned at all) in error.(*googleapi.Error).Header. Use
  1646. // googleapi.IsNotModified to check whether the returned error was
  1647. // because http.StatusNotModified was returned.
  1648. func (c *ProjectsConfigsListCall) Do(opts ...googleapi.CallOption) (*ListConfigsResponse, error) {
  1649. gensupport.SetOptions(c.urlParams_, opts...)
  1650. res, err := c.doRequest("json")
  1651. if res != nil && res.StatusCode == http.StatusNotModified {
  1652. if res.Body != nil {
  1653. res.Body.Close()
  1654. }
  1655. return nil, &googleapi.Error{
  1656. Code: res.StatusCode,
  1657. Header: res.Header,
  1658. }
  1659. }
  1660. if err != nil {
  1661. return nil, err
  1662. }
  1663. defer googleapi.CloseBody(res)
  1664. if err := googleapi.CheckResponse(res); err != nil {
  1665. return nil, err
  1666. }
  1667. ret := &ListConfigsResponse{
  1668. ServerResponse: googleapi.ServerResponse{
  1669. Header: res.Header,
  1670. HTTPStatusCode: res.StatusCode,
  1671. },
  1672. }
  1673. target := &ret
  1674. if err := gensupport.DecodeResponse(target, res); err != nil {
  1675. return nil, err
  1676. }
  1677. return ret, nil
  1678. // {
  1679. // "description": "Lists all the RuntimeConfig resources within project.",
  1680. // "flatPath": "v1beta1/projects/{projectsId}/configs",
  1681. // "httpMethod": "GET",
  1682. // "id": "runtimeconfig.projects.configs.list",
  1683. // "parameterOrder": [
  1684. // "parent"
  1685. // ],
  1686. // "parameters": {
  1687. // "pageSize": {
  1688. // "description": "Specifies the number of results to return per page. If there are fewer\nelements than the specified number, returns all elements.",
  1689. // "format": "int32",
  1690. // "location": "query",
  1691. // "type": "integer"
  1692. // },
  1693. // "pageToken": {
  1694. // "description": "Specifies a page token to use. Set `pageToken` to a `nextPageToken`\nreturned by a previous list request to get the next page of results.",
  1695. // "location": "query",
  1696. // "type": "string"
  1697. // },
  1698. // "parent": {
  1699. // "description": "The [project\nID](https://support.google.com/cloud/answer/6158840?hl=en\u0026ref_topic=6158848)\nfor this request, in the format `projects/[PROJECT_ID]`.",
  1700. // "location": "path",
  1701. // "pattern": "^projects/[^/]+$",
  1702. // "required": true,
  1703. // "type": "string"
  1704. // }
  1705. // },
  1706. // "path": "v1beta1/{+parent}/configs",
  1707. // "response": {
  1708. // "$ref": "ListConfigsResponse"
  1709. // },
  1710. // "scopes": [
  1711. // "https://www.googleapis.com/auth/cloud-platform",
  1712. // "https://www.googleapis.com/auth/cloudruntimeconfig"
  1713. // ]
  1714. // }
  1715. }
  1716. // Pages invokes f for each page of results.
  1717. // A non-nil error returned from f will halt the iteration.
  1718. // The provided context supersedes any context provided to the Context method.
  1719. func (c *ProjectsConfigsListCall) Pages(ctx context.Context, f func(*ListConfigsResponse) error) error {
  1720. c.ctx_ = ctx
  1721. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1722. for {
  1723. x, err := c.Do()
  1724. if err != nil {
  1725. return err
  1726. }
  1727. if err := f(x); err != nil {
  1728. return err
  1729. }
  1730. if x.NextPageToken == "" {
  1731. return nil
  1732. }
  1733. c.PageToken(x.NextPageToken)
  1734. }
  1735. }
  1736. // method id "runtimeconfig.projects.configs.setIamPolicy":
  1737. type ProjectsConfigsSetIamPolicyCall struct {
  1738. s *Service
  1739. resource string
  1740. setiampolicyrequest *SetIamPolicyRequest
  1741. urlParams_ gensupport.URLParams
  1742. ctx_ context.Context
  1743. header_ http.Header
  1744. }
  1745. // SetIamPolicy: Sets the access control policy on the specified
  1746. // resource. Replaces any
  1747. // existing policy.
  1748. func (r *ProjectsConfigsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsConfigsSetIamPolicyCall {
  1749. c := &ProjectsConfigsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1750. c.resource = resource
  1751. c.setiampolicyrequest = setiampolicyrequest
  1752. return c
  1753. }
  1754. // Fields allows partial responses to be retrieved. See
  1755. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1756. // for more information.
  1757. func (c *ProjectsConfigsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsConfigsSetIamPolicyCall {
  1758. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1759. return c
  1760. }
  1761. // Context sets the context to be used in this call's Do method. Any
  1762. // pending HTTP request will be aborted if the provided context is
  1763. // canceled.
  1764. func (c *ProjectsConfigsSetIamPolicyCall) Context(ctx context.Context) *ProjectsConfigsSetIamPolicyCall {
  1765. c.ctx_ = ctx
  1766. return c
  1767. }
  1768. // Header returns an http.Header that can be modified by the caller to
  1769. // add HTTP headers to the request.
  1770. func (c *ProjectsConfigsSetIamPolicyCall) Header() http.Header {
  1771. if c.header_ == nil {
  1772. c.header_ = make(http.Header)
  1773. }
  1774. return c.header_
  1775. }
  1776. func (c *ProjectsConfigsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  1777. reqHeaders := make(http.Header)
  1778. for k, v := range c.header_ {
  1779. reqHeaders[k] = v
  1780. }
  1781. reqHeaders.Set("User-Agent", c.s.userAgent())
  1782. var body io.Reader = nil
  1783. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
  1784. if err != nil {
  1785. return nil, err
  1786. }
  1787. reqHeaders.Set("Content-Type", "application/json")
  1788. c.urlParams_.Set("alt", alt)
  1789. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:setIamPolicy")
  1790. urls += "?" + c.urlParams_.Encode()
  1791. req, _ := http.NewRequest("POST", urls, body)
  1792. req.Header = reqHeaders
  1793. googleapi.Expand(req.URL, map[string]string{
  1794. "resource": c.resource,
  1795. })
  1796. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1797. }
  1798. // Do executes the "runtimeconfig.projects.configs.setIamPolicy" call.
  1799. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  1800. // code is an error. Response headers are in either
  1801. // *Policy.ServerResponse.Header or (if a response was returned at all)
  1802. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1803. // check whether the returned error was because http.StatusNotModified
  1804. // was returned.
  1805. func (c *ProjectsConfigsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  1806. gensupport.SetOptions(c.urlParams_, opts...)
  1807. res, err := c.doRequest("json")
  1808. if res != nil && res.StatusCode == http.StatusNotModified {
  1809. if res.Body != nil {
  1810. res.Body.Close()
  1811. }
  1812. return nil, &googleapi.Error{
  1813. Code: res.StatusCode,
  1814. Header: res.Header,
  1815. }
  1816. }
  1817. if err != nil {
  1818. return nil, err
  1819. }
  1820. defer googleapi.CloseBody(res)
  1821. if err := googleapi.CheckResponse(res); err != nil {
  1822. return nil, err
  1823. }
  1824. ret := &Policy{
  1825. ServerResponse: googleapi.ServerResponse{
  1826. Header: res.Header,
  1827. HTTPStatusCode: res.StatusCode,
  1828. },
  1829. }
  1830. target := &ret
  1831. if err := gensupport.DecodeResponse(target, res); err != nil {
  1832. return nil, err
  1833. }
  1834. return ret, nil
  1835. // {
  1836. // "description": "Sets the access control policy on the specified resource. Replaces any\nexisting policy.",
  1837. // "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}:setIamPolicy",
  1838. // "httpMethod": "POST",
  1839. // "id": "runtimeconfig.projects.configs.setIamPolicy",
  1840. // "parameterOrder": [
  1841. // "resource"
  1842. // ],
  1843. // "parameters": {
  1844. // "resource": {
  1845. // "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field.",
  1846. // "location": "path",
  1847. // "pattern": "^projects/[^/]+/configs/[^/]+$",
  1848. // "required": true,
  1849. // "type": "string"
  1850. // }
  1851. // },
  1852. // "path": "v1beta1/{+resource}:setIamPolicy",
  1853. // "request": {
  1854. // "$ref": "SetIamPolicyRequest"
  1855. // },
  1856. // "response": {
  1857. // "$ref": "Policy"
  1858. // },
  1859. // "scopes": [
  1860. // "https://www.googleapis.com/auth/cloud-platform",
  1861. // "https://www.googleapis.com/auth/cloudruntimeconfig"
  1862. // ]
  1863. // }
  1864. }
  1865. // method id "runtimeconfig.projects.configs.testIamPermissions":
  1866. type ProjectsConfigsTestIamPermissionsCall struct {
  1867. s *Service
  1868. resource string
  1869. testiampermissionsrequest *TestIamPermissionsRequest
  1870. urlParams_ gensupport.URLParams
  1871. ctx_ context.Context
  1872. header_ http.Header
  1873. }
  1874. // TestIamPermissions: Returns permissions that a caller has on the
  1875. // specified resource.
  1876. // If the resource does not exist, this will return an empty set
  1877. // of
  1878. // permissions, not a NOT_FOUND error.
  1879. //
  1880. // Note: This operation is designed to be used for building
  1881. // permission-aware
  1882. // UIs and command-line tools, not for authorization checking. This
  1883. // operation
  1884. // may "fail open" without warning.
  1885. func (r *ProjectsConfigsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsConfigsTestIamPermissionsCall {
  1886. c := &ProjectsConfigsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1887. c.resource = resource
  1888. c.testiampermissionsrequest = testiampermissionsrequest
  1889. return c
  1890. }
  1891. // Fields allows partial responses to be retrieved. See
  1892. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1893. // for more information.
  1894. func (c *ProjectsConfigsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsConfigsTestIamPermissionsCall {
  1895. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1896. return c
  1897. }
  1898. // Context sets the context to be used in this call's Do method. Any
  1899. // pending HTTP request will be aborted if the provided context is
  1900. // canceled.
  1901. func (c *ProjectsConfigsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsConfigsTestIamPermissionsCall {
  1902. c.ctx_ = ctx
  1903. return c
  1904. }
  1905. // Header returns an http.Header that can be modified by the caller to
  1906. // add HTTP headers to the request.
  1907. func (c *ProjectsConfigsTestIamPermissionsCall) Header() http.Header {
  1908. if c.header_ == nil {
  1909. c.header_ = make(http.Header)
  1910. }
  1911. return c.header_
  1912. }
  1913. func (c *ProjectsConfigsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  1914. reqHeaders := make(http.Header)
  1915. for k, v := range c.header_ {
  1916. reqHeaders[k] = v
  1917. }
  1918. reqHeaders.Set("User-Agent", c.s.userAgent())
  1919. var body io.Reader = nil
  1920. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  1921. if err != nil {
  1922. return nil, err
  1923. }
  1924. reqHeaders.Set("Content-Type", "application/json")
  1925. c.urlParams_.Set("alt", alt)
  1926. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:testIamPermissions")
  1927. urls += "?" + c.urlParams_.Encode()
  1928. req, _ := http.NewRequest("POST", urls, body)
  1929. req.Header = reqHeaders
  1930. googleapi.Expand(req.URL, map[string]string{
  1931. "resource": c.resource,
  1932. })
  1933. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1934. }
  1935. // Do executes the "runtimeconfig.projects.configs.testIamPermissions" call.
  1936. // Exactly one of *TestIamPermissionsResponse or error will be non-nil.
  1937. // Any non-2xx status code is an error. Response headers are in either
  1938. // *TestIamPermissionsResponse.ServerResponse.Header or (if a response
  1939. // was returned at all) in error.(*googleapi.Error).Header. Use
  1940. // googleapi.IsNotModified to check whether the returned error was
  1941. // because http.StatusNotModified was returned.
  1942. func (c *ProjectsConfigsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  1943. gensupport.SetOptions(c.urlParams_, opts...)
  1944. res, err := c.doRequest("json")
  1945. if res != nil && res.StatusCode == http.StatusNotModified {
  1946. if res.Body != nil {
  1947. res.Body.Close()
  1948. }
  1949. return nil, &googleapi.Error{
  1950. Code: res.StatusCode,
  1951. Header: res.Header,
  1952. }
  1953. }
  1954. if err != nil {
  1955. return nil, err
  1956. }
  1957. defer googleapi.CloseBody(res)
  1958. if err := googleapi.CheckResponse(res); err != nil {
  1959. return nil, err
  1960. }
  1961. ret := &TestIamPermissionsResponse{
  1962. ServerResponse: googleapi.ServerResponse{
  1963. Header: res.Header,
  1964. HTTPStatusCode: res.StatusCode,
  1965. },
  1966. }
  1967. target := &ret
  1968. if err := gensupport.DecodeResponse(target, res); err != nil {
  1969. return nil, err
  1970. }
  1971. return ret, nil
  1972. // {
  1973. // "description": "Returns permissions that a caller has on the specified resource.\nIf the resource does not exist, this will return an empty set of\npermissions, not a NOT_FOUND error.\n\nNote: This operation is designed to be used for building permission-aware\nUIs and command-line tools, not for authorization checking. This operation\nmay \"fail open\" without warning.",
  1974. // "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}:testIamPermissions",
  1975. // "httpMethod": "POST",
  1976. // "id": "runtimeconfig.projects.configs.testIamPermissions",
  1977. // "parameterOrder": [
  1978. // "resource"
  1979. // ],
  1980. // "parameters": {
  1981. // "resource": {
  1982. // "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.",
  1983. // "location": "path",
  1984. // "pattern": "^projects/[^/]+/configs/[^/]+$",
  1985. // "required": true,
  1986. // "type": "string"
  1987. // }
  1988. // },
  1989. // "path": "v1beta1/{+resource}:testIamPermissions",
  1990. // "request": {
  1991. // "$ref": "TestIamPermissionsRequest"
  1992. // },
  1993. // "response": {
  1994. // "$ref": "TestIamPermissionsResponse"
  1995. // },
  1996. // "scopes": [
  1997. // "https://www.googleapis.com/auth/cloud-platform",
  1998. // "https://www.googleapis.com/auth/cloudruntimeconfig"
  1999. // ]
  2000. // }
  2001. }
  2002. // method id "runtimeconfig.projects.configs.update":
  2003. type ProjectsConfigsUpdateCall struct {
  2004. s *Service
  2005. name string
  2006. runtimeconfig *RuntimeConfig
  2007. urlParams_ gensupport.URLParams
  2008. ctx_ context.Context
  2009. header_ http.Header
  2010. }
  2011. // Update: Updates a RuntimeConfig resource. The configuration must
  2012. // exist beforehand.
  2013. func (r *ProjectsConfigsService) Update(name string, runtimeconfig *RuntimeConfig) *ProjectsConfigsUpdateCall {
  2014. c := &ProjectsConfigsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2015. c.name = name
  2016. c.runtimeconfig = runtimeconfig
  2017. return c
  2018. }
  2019. // Fields allows partial responses to be retrieved. See
  2020. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2021. // for more information.
  2022. func (c *ProjectsConfigsUpdateCall) Fields(s ...googleapi.Field) *ProjectsConfigsUpdateCall {
  2023. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2024. return c
  2025. }
  2026. // Context sets the context to be used in this call's Do method. Any
  2027. // pending HTTP request will be aborted if the provided context is
  2028. // canceled.
  2029. func (c *ProjectsConfigsUpdateCall) Context(ctx context.Context) *ProjectsConfigsUpdateCall {
  2030. c.ctx_ = ctx
  2031. return c
  2032. }
  2033. // Header returns an http.Header that can be modified by the caller to
  2034. // add HTTP headers to the request.
  2035. func (c *ProjectsConfigsUpdateCall) Header() http.Header {
  2036. if c.header_ == nil {
  2037. c.header_ = make(http.Header)
  2038. }
  2039. return c.header_
  2040. }
  2041. func (c *ProjectsConfigsUpdateCall) doRequest(alt string) (*http.Response, error) {
  2042. reqHeaders := make(http.Header)
  2043. for k, v := range c.header_ {
  2044. reqHeaders[k] = v
  2045. }
  2046. reqHeaders.Set("User-Agent", c.s.userAgent())
  2047. var body io.Reader = nil
  2048. body, err := googleapi.WithoutDataWrapper.JSONReader(c.runtimeconfig)
  2049. if err != nil {
  2050. return nil, err
  2051. }
  2052. reqHeaders.Set("Content-Type", "application/json")
  2053. c.urlParams_.Set("alt", alt)
  2054. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  2055. urls += "?" + c.urlParams_.Encode()
  2056. req, _ := http.NewRequest("PUT", urls, body)
  2057. req.Header = reqHeaders
  2058. googleapi.Expand(req.URL, map[string]string{
  2059. "name": c.name,
  2060. })
  2061. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2062. }
  2063. // Do executes the "runtimeconfig.projects.configs.update" call.
  2064. // Exactly one of *RuntimeConfig or error will be non-nil. Any non-2xx
  2065. // status code is an error. Response headers are in either
  2066. // *RuntimeConfig.ServerResponse.Header or (if a response was returned
  2067. // at all) in error.(*googleapi.Error).Header. Use
  2068. // googleapi.IsNotModified to check whether the returned error was
  2069. // because http.StatusNotModified was returned.
  2070. func (c *ProjectsConfigsUpdateCall) Do(opts ...googleapi.CallOption) (*RuntimeConfig, error) {
  2071. gensupport.SetOptions(c.urlParams_, opts...)
  2072. res, err := c.doRequest("json")
  2073. if res != nil && res.StatusCode == http.StatusNotModified {
  2074. if res.Body != nil {
  2075. res.Body.Close()
  2076. }
  2077. return nil, &googleapi.Error{
  2078. Code: res.StatusCode,
  2079. Header: res.Header,
  2080. }
  2081. }
  2082. if err != nil {
  2083. return nil, err
  2084. }
  2085. defer googleapi.CloseBody(res)
  2086. if err := googleapi.CheckResponse(res); err != nil {
  2087. return nil, err
  2088. }
  2089. ret := &RuntimeConfig{
  2090. ServerResponse: googleapi.ServerResponse{
  2091. Header: res.Header,
  2092. HTTPStatusCode: res.StatusCode,
  2093. },
  2094. }
  2095. target := &ret
  2096. if err := gensupport.DecodeResponse(target, res); err != nil {
  2097. return nil, err
  2098. }
  2099. return ret, nil
  2100. // {
  2101. // "description": "Updates a RuntimeConfig resource. The configuration must exist beforehand.",
  2102. // "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}",
  2103. // "httpMethod": "PUT",
  2104. // "id": "runtimeconfig.projects.configs.update",
  2105. // "parameterOrder": [
  2106. // "name"
  2107. // ],
  2108. // "parameters": {
  2109. // "name": {
  2110. // "description": "The name of the RuntimeConfig resource to update, in the format:\n\n`projects/[PROJECT_ID]/configs/[CONFIG_NAME]`",
  2111. // "location": "path",
  2112. // "pattern": "^projects/[^/]+/configs/[^/]+$",
  2113. // "required": true,
  2114. // "type": "string"
  2115. // }
  2116. // },
  2117. // "path": "v1beta1/{+name}",
  2118. // "request": {
  2119. // "$ref": "RuntimeConfig"
  2120. // },
  2121. // "response": {
  2122. // "$ref": "RuntimeConfig"
  2123. // },
  2124. // "scopes": [
  2125. // "https://www.googleapis.com/auth/cloud-platform",
  2126. // "https://www.googleapis.com/auth/cloudruntimeconfig"
  2127. // ]
  2128. // }
  2129. }
  2130. // method id "runtimeconfig.projects.configs.operations.get":
  2131. type ProjectsConfigsOperationsGetCall struct {
  2132. s *Service
  2133. name string
  2134. urlParams_ gensupport.URLParams
  2135. ifNoneMatch_ string
  2136. ctx_ context.Context
  2137. header_ http.Header
  2138. }
  2139. // Get: Gets the latest state of a long-running operation. Clients can
  2140. // use this
  2141. // method to poll the operation result at intervals as recommended by
  2142. // the API
  2143. // service.
  2144. func (r *ProjectsConfigsOperationsService) Get(name string) *ProjectsConfigsOperationsGetCall {
  2145. c := &ProjectsConfigsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2146. c.name = name
  2147. return c
  2148. }
  2149. // Fields allows partial responses to be retrieved. See
  2150. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2151. // for more information.
  2152. func (c *ProjectsConfigsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsConfigsOperationsGetCall {
  2153. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2154. return c
  2155. }
  2156. // IfNoneMatch sets the optional parameter which makes the operation
  2157. // fail if the object's ETag matches the given value. This is useful for
  2158. // getting updates only after the object has changed since the last
  2159. // request. Use googleapi.IsNotModified to check whether the response
  2160. // error from Do is the result of In-None-Match.
  2161. func (c *ProjectsConfigsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsConfigsOperationsGetCall {
  2162. c.ifNoneMatch_ = entityTag
  2163. return c
  2164. }
  2165. // Context sets the context to be used in this call's Do method. Any
  2166. // pending HTTP request will be aborted if the provided context is
  2167. // canceled.
  2168. func (c *ProjectsConfigsOperationsGetCall) Context(ctx context.Context) *ProjectsConfigsOperationsGetCall {
  2169. c.ctx_ = ctx
  2170. return c
  2171. }
  2172. // Header returns an http.Header that can be modified by the caller to
  2173. // add HTTP headers to the request.
  2174. func (c *ProjectsConfigsOperationsGetCall) Header() http.Header {
  2175. if c.header_ == nil {
  2176. c.header_ = make(http.Header)
  2177. }
  2178. return c.header_
  2179. }
  2180. func (c *ProjectsConfigsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  2181. reqHeaders := make(http.Header)
  2182. for k, v := range c.header_ {
  2183. reqHeaders[k] = v
  2184. }
  2185. reqHeaders.Set("User-Agent", c.s.userAgent())
  2186. if c.ifNoneMatch_ != "" {
  2187. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2188. }
  2189. var body io.Reader = nil
  2190. c.urlParams_.Set("alt", alt)
  2191. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  2192. urls += "?" + c.urlParams_.Encode()
  2193. req, _ := http.NewRequest("GET", urls, body)
  2194. req.Header = reqHeaders
  2195. googleapi.Expand(req.URL, map[string]string{
  2196. "name": c.name,
  2197. })
  2198. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2199. }
  2200. // Do executes the "runtimeconfig.projects.configs.operations.get" call.
  2201. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  2202. // status code is an error. Response headers are in either
  2203. // *Operation.ServerResponse.Header or (if a response was returned at
  2204. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2205. // to check whether the returned error was because
  2206. // http.StatusNotModified was returned.
  2207. func (c *ProjectsConfigsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  2208. gensupport.SetOptions(c.urlParams_, opts...)
  2209. res, err := c.doRequest("json")
  2210. if res != nil && res.StatusCode == http.StatusNotModified {
  2211. if res.Body != nil {
  2212. res.Body.Close()
  2213. }
  2214. return nil, &googleapi.Error{
  2215. Code: res.StatusCode,
  2216. Header: res.Header,
  2217. }
  2218. }
  2219. if err != nil {
  2220. return nil, err
  2221. }
  2222. defer googleapi.CloseBody(res)
  2223. if err := googleapi.CheckResponse(res); err != nil {
  2224. return nil, err
  2225. }
  2226. ret := &Operation{
  2227. ServerResponse: googleapi.ServerResponse{
  2228. Header: res.Header,
  2229. HTTPStatusCode: res.StatusCode,
  2230. },
  2231. }
  2232. target := &ret
  2233. if err := gensupport.DecodeResponse(target, res); err != nil {
  2234. return nil, err
  2235. }
  2236. return ret, nil
  2237. // {
  2238. // "description": "Gets the latest state of a long-running operation. Clients can use this\nmethod to poll the operation result at intervals as recommended by the API\nservice.",
  2239. // "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/operations/{operationsId}",
  2240. // "httpMethod": "GET",
  2241. // "id": "runtimeconfig.projects.configs.operations.get",
  2242. // "parameterOrder": [
  2243. // "name"
  2244. // ],
  2245. // "parameters": {
  2246. // "name": {
  2247. // "description": "The name of the operation resource.",
  2248. // "location": "path",
  2249. // "pattern": "^projects/[^/]+/configs/[^/]+/operations/.+$",
  2250. // "required": true,
  2251. // "type": "string"
  2252. // }
  2253. // },
  2254. // "path": "v1beta1/{+name}",
  2255. // "response": {
  2256. // "$ref": "Operation"
  2257. // },
  2258. // "scopes": [
  2259. // "https://www.googleapis.com/auth/cloud-platform",
  2260. // "https://www.googleapis.com/auth/cloudruntimeconfig"
  2261. // ]
  2262. // }
  2263. }
  2264. // method id "runtimeconfig.projects.configs.operations.testIamPermissions":
  2265. type ProjectsConfigsOperationsTestIamPermissionsCall struct {
  2266. s *Service
  2267. resource string
  2268. testiampermissionsrequest *TestIamPermissionsRequest
  2269. urlParams_ gensupport.URLParams
  2270. ctx_ context.Context
  2271. header_ http.Header
  2272. }
  2273. // TestIamPermissions: Returns permissions that a caller has on the
  2274. // specified resource.
  2275. // If the resource does not exist, this will return an empty set
  2276. // of
  2277. // permissions, not a NOT_FOUND error.
  2278. //
  2279. // Note: This operation is designed to be used for building
  2280. // permission-aware
  2281. // UIs and command-line tools, not for authorization checking. This
  2282. // operation
  2283. // may "fail open" without warning.
  2284. func (r *ProjectsConfigsOperationsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsConfigsOperationsTestIamPermissionsCall {
  2285. c := &ProjectsConfigsOperationsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2286. c.resource = resource
  2287. c.testiampermissionsrequest = testiampermissionsrequest
  2288. return c
  2289. }
  2290. // Fields allows partial responses to be retrieved. See
  2291. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2292. // for more information.
  2293. func (c *ProjectsConfigsOperationsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsConfigsOperationsTestIamPermissionsCall {
  2294. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2295. return c
  2296. }
  2297. // Context sets the context to be used in this call's Do method. Any
  2298. // pending HTTP request will be aborted if the provided context is
  2299. // canceled.
  2300. func (c *ProjectsConfigsOperationsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsConfigsOperationsTestIamPermissionsCall {
  2301. c.ctx_ = ctx
  2302. return c
  2303. }
  2304. // Header returns an http.Header that can be modified by the caller to
  2305. // add HTTP headers to the request.
  2306. func (c *ProjectsConfigsOperationsTestIamPermissionsCall) Header() http.Header {
  2307. if c.header_ == nil {
  2308. c.header_ = make(http.Header)
  2309. }
  2310. return c.header_
  2311. }
  2312. func (c *ProjectsConfigsOperationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  2313. reqHeaders := make(http.Header)
  2314. for k, v := range c.header_ {
  2315. reqHeaders[k] = v
  2316. }
  2317. reqHeaders.Set("User-Agent", c.s.userAgent())
  2318. var body io.Reader = nil
  2319. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  2320. if err != nil {
  2321. return nil, err
  2322. }
  2323. reqHeaders.Set("Content-Type", "application/json")
  2324. c.urlParams_.Set("alt", alt)
  2325. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:testIamPermissions")
  2326. urls += "?" + c.urlParams_.Encode()
  2327. req, _ := http.NewRequest("POST", urls, body)
  2328. req.Header = reqHeaders
  2329. googleapi.Expand(req.URL, map[string]string{
  2330. "resource": c.resource,
  2331. })
  2332. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2333. }
  2334. // Do executes the "runtimeconfig.projects.configs.operations.testIamPermissions" call.
  2335. // Exactly one of *TestIamPermissionsResponse or error will be non-nil.
  2336. // Any non-2xx status code is an error. Response headers are in either
  2337. // *TestIamPermissionsResponse.ServerResponse.Header or (if a response
  2338. // was returned at all) in error.(*googleapi.Error).Header. Use
  2339. // googleapi.IsNotModified to check whether the returned error was
  2340. // because http.StatusNotModified was returned.
  2341. func (c *ProjectsConfigsOperationsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  2342. gensupport.SetOptions(c.urlParams_, opts...)
  2343. res, err := c.doRequest("json")
  2344. if res != nil && res.StatusCode == http.StatusNotModified {
  2345. if res.Body != nil {
  2346. res.Body.Close()
  2347. }
  2348. return nil, &googleapi.Error{
  2349. Code: res.StatusCode,
  2350. Header: res.Header,
  2351. }
  2352. }
  2353. if err != nil {
  2354. return nil, err
  2355. }
  2356. defer googleapi.CloseBody(res)
  2357. if err := googleapi.CheckResponse(res); err != nil {
  2358. return nil, err
  2359. }
  2360. ret := &TestIamPermissionsResponse{
  2361. ServerResponse: googleapi.ServerResponse{
  2362. Header: res.Header,
  2363. HTTPStatusCode: res.StatusCode,
  2364. },
  2365. }
  2366. target := &ret
  2367. if err := gensupport.DecodeResponse(target, res); err != nil {
  2368. return nil, err
  2369. }
  2370. return ret, nil
  2371. // {
  2372. // "description": "Returns permissions that a caller has on the specified resource.\nIf the resource does not exist, this will return an empty set of\npermissions, not a NOT_FOUND error.\n\nNote: This operation is designed to be used for building permission-aware\nUIs and command-line tools, not for authorization checking. This operation\nmay \"fail open\" without warning.",
  2373. // "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/operations/{operationsId}:testIamPermissions",
  2374. // "httpMethod": "POST",
  2375. // "id": "runtimeconfig.projects.configs.operations.testIamPermissions",
  2376. // "parameterOrder": [
  2377. // "resource"
  2378. // ],
  2379. // "parameters": {
  2380. // "resource": {
  2381. // "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.",
  2382. // "location": "path",
  2383. // "pattern": "^projects/[^/]+/configs/[^/]+/operations/.+$",
  2384. // "required": true,
  2385. // "type": "string"
  2386. // }
  2387. // },
  2388. // "path": "v1beta1/{+resource}:testIamPermissions",
  2389. // "request": {
  2390. // "$ref": "TestIamPermissionsRequest"
  2391. // },
  2392. // "response": {
  2393. // "$ref": "TestIamPermissionsResponse"
  2394. // },
  2395. // "scopes": [
  2396. // "https://www.googleapis.com/auth/cloud-platform",
  2397. // "https://www.googleapis.com/auth/cloudruntimeconfig"
  2398. // ]
  2399. // }
  2400. }
  2401. // method id "runtimeconfig.projects.configs.variables.create":
  2402. type ProjectsConfigsVariablesCreateCall struct {
  2403. s *Service
  2404. parent string
  2405. variable *Variable
  2406. urlParams_ gensupport.URLParams
  2407. ctx_ context.Context
  2408. header_ http.Header
  2409. }
  2410. // Create: Creates a variable within the given configuration. You cannot
  2411. // create
  2412. // a variable with a name that is a prefix of an existing variable name,
  2413. // or a
  2414. // name that has an existing variable name as a prefix.
  2415. //
  2416. // To learn more about creating a variable, read the
  2417. // [Setting and
  2418. // Getting
  2419. // Data](/deployment-manager/runtime-configurator/set-and-get-var
  2420. // iables)
  2421. // documentation.
  2422. func (r *ProjectsConfigsVariablesService) Create(parent string, variable *Variable) *ProjectsConfigsVariablesCreateCall {
  2423. c := &ProjectsConfigsVariablesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2424. c.parent = parent
  2425. c.variable = variable
  2426. return c
  2427. }
  2428. // RequestId sets the optional parameter "requestId": An optional but
  2429. // recommended unique `request_id`. If the server
  2430. // receives two `create()` requests with the same
  2431. // `request_id`, then the second request will be ignored and the
  2432. // first resource created and stored in the backend is returned.
  2433. // Empty `request_id` fields are ignored.
  2434. //
  2435. // It is responsibility of the client to ensure uniqueness of
  2436. // the
  2437. // `request_id` strings.
  2438. //
  2439. // `request_id` strings are limited to 64 characters.
  2440. func (c *ProjectsConfigsVariablesCreateCall) RequestId(requestId string) *ProjectsConfigsVariablesCreateCall {
  2441. c.urlParams_.Set("requestId", requestId)
  2442. return c
  2443. }
  2444. // Fields allows partial responses to be retrieved. See
  2445. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2446. // for more information.
  2447. func (c *ProjectsConfigsVariablesCreateCall) Fields(s ...googleapi.Field) *ProjectsConfigsVariablesCreateCall {
  2448. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2449. return c
  2450. }
  2451. // Context sets the context to be used in this call's Do method. Any
  2452. // pending HTTP request will be aborted if the provided context is
  2453. // canceled.
  2454. func (c *ProjectsConfigsVariablesCreateCall) Context(ctx context.Context) *ProjectsConfigsVariablesCreateCall {
  2455. c.ctx_ = ctx
  2456. return c
  2457. }
  2458. // Header returns an http.Header that can be modified by the caller to
  2459. // add HTTP headers to the request.
  2460. func (c *ProjectsConfigsVariablesCreateCall) Header() http.Header {
  2461. if c.header_ == nil {
  2462. c.header_ = make(http.Header)
  2463. }
  2464. return c.header_
  2465. }
  2466. func (c *ProjectsConfigsVariablesCreateCall) doRequest(alt string) (*http.Response, error) {
  2467. reqHeaders := make(http.Header)
  2468. for k, v := range c.header_ {
  2469. reqHeaders[k] = v
  2470. }
  2471. reqHeaders.Set("User-Agent", c.s.userAgent())
  2472. var body io.Reader = nil
  2473. body, err := googleapi.WithoutDataWrapper.JSONReader(c.variable)
  2474. if err != nil {
  2475. return nil, err
  2476. }
  2477. reqHeaders.Set("Content-Type", "application/json")
  2478. c.urlParams_.Set("alt", alt)
  2479. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/variables")
  2480. urls += "?" + c.urlParams_.Encode()
  2481. req, _ := http.NewRequest("POST", urls, body)
  2482. req.Header = reqHeaders
  2483. googleapi.Expand(req.URL, map[string]string{
  2484. "parent": c.parent,
  2485. })
  2486. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2487. }
  2488. // Do executes the "runtimeconfig.projects.configs.variables.create" call.
  2489. // Exactly one of *Variable or error will be non-nil. Any non-2xx status
  2490. // code is an error. Response headers are in either
  2491. // *Variable.ServerResponse.Header or (if a response was returned at
  2492. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2493. // to check whether the returned error was because
  2494. // http.StatusNotModified was returned.
  2495. func (c *ProjectsConfigsVariablesCreateCall) Do(opts ...googleapi.CallOption) (*Variable, error) {
  2496. gensupport.SetOptions(c.urlParams_, opts...)
  2497. res, err := c.doRequest("json")
  2498. if res != nil && res.StatusCode == http.StatusNotModified {
  2499. if res.Body != nil {
  2500. res.Body.Close()
  2501. }
  2502. return nil, &googleapi.Error{
  2503. Code: res.StatusCode,
  2504. Header: res.Header,
  2505. }
  2506. }
  2507. if err != nil {
  2508. return nil, err
  2509. }
  2510. defer googleapi.CloseBody(res)
  2511. if err := googleapi.CheckResponse(res); err != nil {
  2512. return nil, err
  2513. }
  2514. ret := &Variable{
  2515. ServerResponse: googleapi.ServerResponse{
  2516. Header: res.Header,
  2517. HTTPStatusCode: res.StatusCode,
  2518. },
  2519. }
  2520. target := &ret
  2521. if err := gensupport.DecodeResponse(target, res); err != nil {
  2522. return nil, err
  2523. }
  2524. return ret, nil
  2525. // {
  2526. // "description": "Creates a variable within the given configuration. You cannot create\na variable with a name that is a prefix of an existing variable name, or a\nname that has an existing variable name as a prefix.\n\nTo learn more about creating a variable, read the\n[Setting and Getting\nData](/deployment-manager/runtime-configurator/set-and-get-variables)\ndocumentation.",
  2527. // "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/variables",
  2528. // "httpMethod": "POST",
  2529. // "id": "runtimeconfig.projects.configs.variables.create",
  2530. // "parameterOrder": [
  2531. // "parent"
  2532. // ],
  2533. // "parameters": {
  2534. // "parent": {
  2535. // "description": "The path to the RutimeConfig resource that this variable should belong to.\nThe configuration must exist beforehand; the path must be in the format:\n\n`projects/[PROJECT_ID]/configs/[CONFIG_NAME]`",
  2536. // "location": "path",
  2537. // "pattern": "^projects/[^/]+/configs/[^/]+$",
  2538. // "required": true,
  2539. // "type": "string"
  2540. // },
  2541. // "requestId": {
  2542. // "description": "An optional but recommended unique `request_id`. If the server\nreceives two `create()` requests with the same\n`request_id`, then the second request will be ignored and the\nfirst resource created and stored in the backend is returned.\nEmpty `request_id` fields are ignored.\n\nIt is responsibility of the client to ensure uniqueness of the\n`request_id` strings.\n\n`request_id` strings are limited to 64 characters.",
  2543. // "location": "query",
  2544. // "type": "string"
  2545. // }
  2546. // },
  2547. // "path": "v1beta1/{+parent}/variables",
  2548. // "request": {
  2549. // "$ref": "Variable"
  2550. // },
  2551. // "response": {
  2552. // "$ref": "Variable"
  2553. // },
  2554. // "scopes": [
  2555. // "https://www.googleapis.com/auth/cloud-platform",
  2556. // "https://www.googleapis.com/auth/cloudruntimeconfig"
  2557. // ]
  2558. // }
  2559. }
  2560. // method id "runtimeconfig.projects.configs.variables.delete":
  2561. type ProjectsConfigsVariablesDeleteCall struct {
  2562. s *Service
  2563. name string
  2564. urlParams_ gensupport.URLParams
  2565. ctx_ context.Context
  2566. header_ http.Header
  2567. }
  2568. // Delete: Deletes a variable or multiple variables.
  2569. //
  2570. // If you specify a variable name, then that variable is deleted. If
  2571. // you
  2572. // specify a prefix and `recursive` is true, then all variables with
  2573. // that
  2574. // prefix are deleted. You must set a `recursive` to true if you
  2575. // delete
  2576. // variables by prefix.
  2577. func (r *ProjectsConfigsVariablesService) Delete(name string) *ProjectsConfigsVariablesDeleteCall {
  2578. c := &ProjectsConfigsVariablesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2579. c.name = name
  2580. return c
  2581. }
  2582. // Recursive sets the optional parameter "recursive": Set to `true` to
  2583. // recursively delete multiple variables with the same
  2584. // prefix.
  2585. func (c *ProjectsConfigsVariablesDeleteCall) Recursive(recursive bool) *ProjectsConfigsVariablesDeleteCall {
  2586. c.urlParams_.Set("recursive", fmt.Sprint(recursive))
  2587. return c
  2588. }
  2589. // Fields allows partial responses to be retrieved. See
  2590. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2591. // for more information.
  2592. func (c *ProjectsConfigsVariablesDeleteCall) Fields(s ...googleapi.Field) *ProjectsConfigsVariablesDeleteCall {
  2593. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2594. return c
  2595. }
  2596. // Context sets the context to be used in this call's Do method. Any
  2597. // pending HTTP request will be aborted if the provided context is
  2598. // canceled.
  2599. func (c *ProjectsConfigsVariablesDeleteCall) Context(ctx context.Context) *ProjectsConfigsVariablesDeleteCall {
  2600. c.ctx_ = ctx
  2601. return c
  2602. }
  2603. // Header returns an http.Header that can be modified by the caller to
  2604. // add HTTP headers to the request.
  2605. func (c *ProjectsConfigsVariablesDeleteCall) Header() http.Header {
  2606. if c.header_ == nil {
  2607. c.header_ = make(http.Header)
  2608. }
  2609. return c.header_
  2610. }
  2611. func (c *ProjectsConfigsVariablesDeleteCall) doRequest(alt string) (*http.Response, error) {
  2612. reqHeaders := make(http.Header)
  2613. for k, v := range c.header_ {
  2614. reqHeaders[k] = v
  2615. }
  2616. reqHeaders.Set("User-Agent", c.s.userAgent())
  2617. var body io.Reader = nil
  2618. c.urlParams_.Set("alt", alt)
  2619. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  2620. urls += "?" + c.urlParams_.Encode()
  2621. req, _ := http.NewRequest("DELETE", urls, body)
  2622. req.Header = reqHeaders
  2623. googleapi.Expand(req.URL, map[string]string{
  2624. "name": c.name,
  2625. })
  2626. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2627. }
  2628. // Do executes the "runtimeconfig.projects.configs.variables.delete" call.
  2629. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  2630. // code is an error. Response headers are in either
  2631. // *Empty.ServerResponse.Header or (if a response was returned at all)
  2632. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2633. // check whether the returned error was because http.StatusNotModified
  2634. // was returned.
  2635. func (c *ProjectsConfigsVariablesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  2636. gensupport.SetOptions(c.urlParams_, opts...)
  2637. res, err := c.doRequest("json")
  2638. if res != nil && res.StatusCode == http.StatusNotModified {
  2639. if res.Body != nil {
  2640. res.Body.Close()
  2641. }
  2642. return nil, &googleapi.Error{
  2643. Code: res.StatusCode,
  2644. Header: res.Header,
  2645. }
  2646. }
  2647. if err != nil {
  2648. return nil, err
  2649. }
  2650. defer googleapi.CloseBody(res)
  2651. if err := googleapi.CheckResponse(res); err != nil {
  2652. return nil, err
  2653. }
  2654. ret := &Empty{
  2655. ServerResponse: googleapi.ServerResponse{
  2656. Header: res.Header,
  2657. HTTPStatusCode: res.StatusCode,
  2658. },
  2659. }
  2660. target := &ret
  2661. if err := gensupport.DecodeResponse(target, res); err != nil {
  2662. return nil, err
  2663. }
  2664. return ret, nil
  2665. // {
  2666. // "description": "Deletes a variable or multiple variables.\n\nIf you specify a variable name, then that variable is deleted. If you\nspecify a prefix and `recursive` is true, then all variables with that\nprefix are deleted. You must set a `recursive` to true if you delete\nvariables by prefix.",
  2667. // "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/variables/{variablesId}",
  2668. // "httpMethod": "DELETE",
  2669. // "id": "runtimeconfig.projects.configs.variables.delete",
  2670. // "parameterOrder": [
  2671. // "name"
  2672. // ],
  2673. // "parameters": {
  2674. // "name": {
  2675. // "description": "The name of the variable to delete, in the format:\n\n`projects/[PROJECT_ID]/configs/[CONFIG_NAME]/variables/[VARIABLE_NAME]`",
  2676. // "location": "path",
  2677. // "pattern": "^projects/[^/]+/configs/[^/]+/variables/.+$",
  2678. // "required": true,
  2679. // "type": "string"
  2680. // },
  2681. // "recursive": {
  2682. // "description": "Set to `true` to recursively delete multiple variables with the same\nprefix.",
  2683. // "location": "query",
  2684. // "type": "boolean"
  2685. // }
  2686. // },
  2687. // "path": "v1beta1/{+name}",
  2688. // "response": {
  2689. // "$ref": "Empty"
  2690. // },
  2691. // "scopes": [
  2692. // "https://www.googleapis.com/auth/cloud-platform",
  2693. // "https://www.googleapis.com/auth/cloudruntimeconfig"
  2694. // ]
  2695. // }
  2696. }
  2697. // method id "runtimeconfig.projects.configs.variables.get":
  2698. type ProjectsConfigsVariablesGetCall struct {
  2699. s *Service
  2700. name string
  2701. urlParams_ gensupport.URLParams
  2702. ifNoneMatch_ string
  2703. ctx_ context.Context
  2704. header_ http.Header
  2705. }
  2706. // Get: Gets information about a single variable.
  2707. func (r *ProjectsConfigsVariablesService) Get(name string) *ProjectsConfigsVariablesGetCall {
  2708. c := &ProjectsConfigsVariablesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2709. c.name = name
  2710. return c
  2711. }
  2712. // Fields allows partial responses to be retrieved. See
  2713. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2714. // for more information.
  2715. func (c *ProjectsConfigsVariablesGetCall) Fields(s ...googleapi.Field) *ProjectsConfigsVariablesGetCall {
  2716. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2717. return c
  2718. }
  2719. // IfNoneMatch sets the optional parameter which makes the operation
  2720. // fail if the object's ETag matches the given value. This is useful for
  2721. // getting updates only after the object has changed since the last
  2722. // request. Use googleapi.IsNotModified to check whether the response
  2723. // error from Do is the result of In-None-Match.
  2724. func (c *ProjectsConfigsVariablesGetCall) IfNoneMatch(entityTag string) *ProjectsConfigsVariablesGetCall {
  2725. c.ifNoneMatch_ = entityTag
  2726. return c
  2727. }
  2728. // Context sets the context to be used in this call's Do method. Any
  2729. // pending HTTP request will be aborted if the provided context is
  2730. // canceled.
  2731. func (c *ProjectsConfigsVariablesGetCall) Context(ctx context.Context) *ProjectsConfigsVariablesGetCall {
  2732. c.ctx_ = ctx
  2733. return c
  2734. }
  2735. // Header returns an http.Header that can be modified by the caller to
  2736. // add HTTP headers to the request.
  2737. func (c *ProjectsConfigsVariablesGetCall) Header() http.Header {
  2738. if c.header_ == nil {
  2739. c.header_ = make(http.Header)
  2740. }
  2741. return c.header_
  2742. }
  2743. func (c *ProjectsConfigsVariablesGetCall) doRequest(alt string) (*http.Response, error) {
  2744. reqHeaders := make(http.Header)
  2745. for k, v := range c.header_ {
  2746. reqHeaders[k] = v
  2747. }
  2748. reqHeaders.Set("User-Agent", c.s.userAgent())
  2749. if c.ifNoneMatch_ != "" {
  2750. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2751. }
  2752. var body io.Reader = nil
  2753. c.urlParams_.Set("alt", alt)
  2754. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  2755. urls += "?" + c.urlParams_.Encode()
  2756. req, _ := http.NewRequest("GET", urls, body)
  2757. req.Header = reqHeaders
  2758. googleapi.Expand(req.URL, map[string]string{
  2759. "name": c.name,
  2760. })
  2761. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2762. }
  2763. // Do executes the "runtimeconfig.projects.configs.variables.get" call.
  2764. // Exactly one of *Variable or error will be non-nil. Any non-2xx status
  2765. // code is an error. Response headers are in either
  2766. // *Variable.ServerResponse.Header or (if a response was returned at
  2767. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2768. // to check whether the returned error was because
  2769. // http.StatusNotModified was returned.
  2770. func (c *ProjectsConfigsVariablesGetCall) Do(opts ...googleapi.CallOption) (*Variable, 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 := &Variable{
  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": "Gets information about a single variable.",
  2802. // "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/variables/{variablesId}",
  2803. // "httpMethod": "GET",
  2804. // "id": "runtimeconfig.projects.configs.variables.get",
  2805. // "parameterOrder": [
  2806. // "name"
  2807. // ],
  2808. // "parameters": {
  2809. // "name": {
  2810. // "description": "The name of the variable to return, in the format:\n\n`projects/[PROJECT_ID]/configs/[CONFIG_NAME]/variables/[VARIBLE_NAME]`",
  2811. // "location": "path",
  2812. // "pattern": "^projects/[^/]+/configs/[^/]+/variables/.+$",
  2813. // "required": true,
  2814. // "type": "string"
  2815. // }
  2816. // },
  2817. // "path": "v1beta1/{+name}",
  2818. // "response": {
  2819. // "$ref": "Variable"
  2820. // },
  2821. // "scopes": [
  2822. // "https://www.googleapis.com/auth/cloud-platform",
  2823. // "https://www.googleapis.com/auth/cloudruntimeconfig"
  2824. // ]
  2825. // }
  2826. }
  2827. // method id "runtimeconfig.projects.configs.variables.list":
  2828. type ProjectsConfigsVariablesListCall struct {
  2829. s *Service
  2830. parent string
  2831. urlParams_ gensupport.URLParams
  2832. ifNoneMatch_ string
  2833. ctx_ context.Context
  2834. header_ http.Header
  2835. }
  2836. // List: Lists variables within given a configuration, matching any
  2837. // provided
  2838. // filters. This only lists variable names, not the values,
  2839. // unless
  2840. // `return_values` is true, in which case only variables that user has
  2841. // IAM
  2842. // permission to GetVariable will be returned.
  2843. func (r *ProjectsConfigsVariablesService) List(parent string) *ProjectsConfigsVariablesListCall {
  2844. c := &ProjectsConfigsVariablesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2845. c.parent = parent
  2846. return c
  2847. }
  2848. // Filter sets the optional parameter "filter": Filters variables by
  2849. // matching the specified filter. For
  2850. // example:
  2851. //
  2852. // `projects/example-project/config/[CONFIG_NAME]/variables/exa
  2853. // mple-variable`.
  2854. func (c *ProjectsConfigsVariablesListCall) Filter(filter string) *ProjectsConfigsVariablesListCall {
  2855. c.urlParams_.Set("filter", filter)
  2856. return c
  2857. }
  2858. // PageSize sets the optional parameter "pageSize": Specifies the number
  2859. // of results to return per page. If there are fewer
  2860. // elements than the specified number, returns all elements.
  2861. func (c *ProjectsConfigsVariablesListCall) PageSize(pageSize int64) *ProjectsConfigsVariablesListCall {
  2862. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2863. return c
  2864. }
  2865. // PageToken sets the optional parameter "pageToken": Specifies a page
  2866. // token to use. Set `pageToken` to a `nextPageToken`
  2867. // returned by a previous list request to get the next page of results.
  2868. func (c *ProjectsConfigsVariablesListCall) PageToken(pageToken string) *ProjectsConfigsVariablesListCall {
  2869. c.urlParams_.Set("pageToken", pageToken)
  2870. return c
  2871. }
  2872. // ReturnValues sets the optional parameter "returnValues": The flag
  2873. // indicates whether the user wants to return values of variables.
  2874. // If true, then only those variables that user has IAM GetVariable
  2875. // permission
  2876. // will be returned along with their values.
  2877. func (c *ProjectsConfigsVariablesListCall) ReturnValues(returnValues bool) *ProjectsConfigsVariablesListCall {
  2878. c.urlParams_.Set("returnValues", fmt.Sprint(returnValues))
  2879. return c
  2880. }
  2881. // Fields allows partial responses to be retrieved. See
  2882. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2883. // for more information.
  2884. func (c *ProjectsConfigsVariablesListCall) Fields(s ...googleapi.Field) *ProjectsConfigsVariablesListCall {
  2885. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2886. return c
  2887. }
  2888. // IfNoneMatch sets the optional parameter which makes the operation
  2889. // fail if the object's ETag matches the given value. This is useful for
  2890. // getting updates only after the object has changed since the last
  2891. // request. Use googleapi.IsNotModified to check whether the response
  2892. // error from Do is the result of In-None-Match.
  2893. func (c *ProjectsConfigsVariablesListCall) IfNoneMatch(entityTag string) *ProjectsConfigsVariablesListCall {
  2894. c.ifNoneMatch_ = entityTag
  2895. return c
  2896. }
  2897. // Context sets the context to be used in this call's Do method. Any
  2898. // pending HTTP request will be aborted if the provided context is
  2899. // canceled.
  2900. func (c *ProjectsConfigsVariablesListCall) Context(ctx context.Context) *ProjectsConfigsVariablesListCall {
  2901. c.ctx_ = ctx
  2902. return c
  2903. }
  2904. // Header returns an http.Header that can be modified by the caller to
  2905. // add HTTP headers to the request.
  2906. func (c *ProjectsConfigsVariablesListCall) Header() http.Header {
  2907. if c.header_ == nil {
  2908. c.header_ = make(http.Header)
  2909. }
  2910. return c.header_
  2911. }
  2912. func (c *ProjectsConfigsVariablesListCall) doRequest(alt string) (*http.Response, error) {
  2913. reqHeaders := make(http.Header)
  2914. for k, v := range c.header_ {
  2915. reqHeaders[k] = v
  2916. }
  2917. reqHeaders.Set("User-Agent", c.s.userAgent())
  2918. if c.ifNoneMatch_ != "" {
  2919. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2920. }
  2921. var body io.Reader = nil
  2922. c.urlParams_.Set("alt", alt)
  2923. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/variables")
  2924. urls += "?" + c.urlParams_.Encode()
  2925. req, _ := http.NewRequest("GET", urls, body)
  2926. req.Header = reqHeaders
  2927. googleapi.Expand(req.URL, map[string]string{
  2928. "parent": c.parent,
  2929. })
  2930. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2931. }
  2932. // Do executes the "runtimeconfig.projects.configs.variables.list" call.
  2933. // Exactly one of *ListVariablesResponse or error will be non-nil. Any
  2934. // non-2xx status code is an error. Response headers are in either
  2935. // *ListVariablesResponse.ServerResponse.Header or (if a response was
  2936. // returned at all) in error.(*googleapi.Error).Header. Use
  2937. // googleapi.IsNotModified to check whether the returned error was
  2938. // because http.StatusNotModified was returned.
  2939. func (c *ProjectsConfigsVariablesListCall) Do(opts ...googleapi.CallOption) (*ListVariablesResponse, error) {
  2940. gensupport.SetOptions(c.urlParams_, opts...)
  2941. res, err := c.doRequest("json")
  2942. if res != nil && res.StatusCode == http.StatusNotModified {
  2943. if res.Body != nil {
  2944. res.Body.Close()
  2945. }
  2946. return nil, &googleapi.Error{
  2947. Code: res.StatusCode,
  2948. Header: res.Header,
  2949. }
  2950. }
  2951. if err != nil {
  2952. return nil, err
  2953. }
  2954. defer googleapi.CloseBody(res)
  2955. if err := googleapi.CheckResponse(res); err != nil {
  2956. return nil, err
  2957. }
  2958. ret := &ListVariablesResponse{
  2959. ServerResponse: googleapi.ServerResponse{
  2960. Header: res.Header,
  2961. HTTPStatusCode: res.StatusCode,
  2962. },
  2963. }
  2964. target := &ret
  2965. if err := gensupport.DecodeResponse(target, res); err != nil {
  2966. return nil, err
  2967. }
  2968. return ret, nil
  2969. // {
  2970. // "description": "Lists variables within given a configuration, matching any provided\nfilters. This only lists variable names, not the values, unless\n`return_values` is true, in which case only variables that user has IAM\npermission to GetVariable will be returned.",
  2971. // "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/variables",
  2972. // "httpMethod": "GET",
  2973. // "id": "runtimeconfig.projects.configs.variables.list",
  2974. // "parameterOrder": [
  2975. // "parent"
  2976. // ],
  2977. // "parameters": {
  2978. // "filter": {
  2979. // "description": "Filters variables by matching the specified filter. For example:\n\n`projects/example-project/config/[CONFIG_NAME]/variables/example-variable`.",
  2980. // "location": "query",
  2981. // "type": "string"
  2982. // },
  2983. // "pageSize": {
  2984. // "description": "Specifies the number of results to return per page. If there are fewer\nelements than the specified number, returns all elements.",
  2985. // "format": "int32",
  2986. // "location": "query",
  2987. // "type": "integer"
  2988. // },
  2989. // "pageToken": {
  2990. // "description": "Specifies a page token to use. Set `pageToken` to a `nextPageToken`\nreturned by a previous list request to get the next page of results.",
  2991. // "location": "query",
  2992. // "type": "string"
  2993. // },
  2994. // "parent": {
  2995. // "description": "The path to the RuntimeConfig resource for which you want to list\nvariables. The configuration must exist beforehand; the path must be in the\nformat:\n\n`projects/[PROJECT_ID]/configs/[CONFIG_NAME]`",
  2996. // "location": "path",
  2997. // "pattern": "^projects/[^/]+/configs/[^/]+$",
  2998. // "required": true,
  2999. // "type": "string"
  3000. // },
  3001. // "returnValues": {
  3002. // "description": "The flag indicates whether the user wants to return values of variables.\nIf true, then only those variables that user has IAM GetVariable permission\nwill be returned along with their values.",
  3003. // "location": "query",
  3004. // "type": "boolean"
  3005. // }
  3006. // },
  3007. // "path": "v1beta1/{+parent}/variables",
  3008. // "response": {
  3009. // "$ref": "ListVariablesResponse"
  3010. // },
  3011. // "scopes": [
  3012. // "https://www.googleapis.com/auth/cloud-platform",
  3013. // "https://www.googleapis.com/auth/cloudruntimeconfig"
  3014. // ]
  3015. // }
  3016. }
  3017. // Pages invokes f for each page of results.
  3018. // A non-nil error returned from f will halt the iteration.
  3019. // The provided context supersedes any context provided to the Context method.
  3020. func (c *ProjectsConfigsVariablesListCall) Pages(ctx context.Context, f func(*ListVariablesResponse) error) error {
  3021. c.ctx_ = ctx
  3022. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  3023. for {
  3024. x, err := c.Do()
  3025. if err != nil {
  3026. return err
  3027. }
  3028. if err := f(x); err != nil {
  3029. return err
  3030. }
  3031. if x.NextPageToken == "" {
  3032. return nil
  3033. }
  3034. c.PageToken(x.NextPageToken)
  3035. }
  3036. }
  3037. // method id "runtimeconfig.projects.configs.variables.testIamPermissions":
  3038. type ProjectsConfigsVariablesTestIamPermissionsCall struct {
  3039. s *Service
  3040. resource string
  3041. testiampermissionsrequest *TestIamPermissionsRequest
  3042. urlParams_ gensupport.URLParams
  3043. ctx_ context.Context
  3044. header_ http.Header
  3045. }
  3046. // TestIamPermissions: Returns permissions that a caller has on the
  3047. // specified resource.
  3048. // If the resource does not exist, this will return an empty set
  3049. // of
  3050. // permissions, not a NOT_FOUND error.
  3051. //
  3052. // Note: This operation is designed to be used for building
  3053. // permission-aware
  3054. // UIs and command-line tools, not for authorization checking. This
  3055. // operation
  3056. // may "fail open" without warning.
  3057. func (r *ProjectsConfigsVariablesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsConfigsVariablesTestIamPermissionsCall {
  3058. c := &ProjectsConfigsVariablesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3059. c.resource = resource
  3060. c.testiampermissionsrequest = testiampermissionsrequest
  3061. return c
  3062. }
  3063. // Fields allows partial responses to be retrieved. See
  3064. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3065. // for more information.
  3066. func (c *ProjectsConfigsVariablesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsConfigsVariablesTestIamPermissionsCall {
  3067. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3068. return c
  3069. }
  3070. // Context sets the context to be used in this call's Do method. Any
  3071. // pending HTTP request will be aborted if the provided context is
  3072. // canceled.
  3073. func (c *ProjectsConfigsVariablesTestIamPermissionsCall) Context(ctx context.Context) *ProjectsConfigsVariablesTestIamPermissionsCall {
  3074. c.ctx_ = ctx
  3075. return c
  3076. }
  3077. // Header returns an http.Header that can be modified by the caller to
  3078. // add HTTP headers to the request.
  3079. func (c *ProjectsConfigsVariablesTestIamPermissionsCall) Header() http.Header {
  3080. if c.header_ == nil {
  3081. c.header_ = make(http.Header)
  3082. }
  3083. return c.header_
  3084. }
  3085. func (c *ProjectsConfigsVariablesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  3086. reqHeaders := make(http.Header)
  3087. for k, v := range c.header_ {
  3088. reqHeaders[k] = v
  3089. }
  3090. reqHeaders.Set("User-Agent", c.s.userAgent())
  3091. var body io.Reader = nil
  3092. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  3093. if err != nil {
  3094. return nil, err
  3095. }
  3096. reqHeaders.Set("Content-Type", "application/json")
  3097. c.urlParams_.Set("alt", alt)
  3098. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:testIamPermissions")
  3099. urls += "?" + c.urlParams_.Encode()
  3100. req, _ := http.NewRequest("POST", urls, body)
  3101. req.Header = reqHeaders
  3102. googleapi.Expand(req.URL, map[string]string{
  3103. "resource": c.resource,
  3104. })
  3105. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3106. }
  3107. // Do executes the "runtimeconfig.projects.configs.variables.testIamPermissions" call.
  3108. // Exactly one of *TestIamPermissionsResponse or error will be non-nil.
  3109. // Any non-2xx status code is an error. Response headers are in either
  3110. // *TestIamPermissionsResponse.ServerResponse.Header or (if a response
  3111. // was returned at all) in error.(*googleapi.Error).Header. Use
  3112. // googleapi.IsNotModified to check whether the returned error was
  3113. // because http.StatusNotModified was returned.
  3114. func (c *ProjectsConfigsVariablesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  3115. gensupport.SetOptions(c.urlParams_, opts...)
  3116. res, err := c.doRequest("json")
  3117. if res != nil && res.StatusCode == http.StatusNotModified {
  3118. if res.Body != nil {
  3119. res.Body.Close()
  3120. }
  3121. return nil, &googleapi.Error{
  3122. Code: res.StatusCode,
  3123. Header: res.Header,
  3124. }
  3125. }
  3126. if err != nil {
  3127. return nil, err
  3128. }
  3129. defer googleapi.CloseBody(res)
  3130. if err := googleapi.CheckResponse(res); err != nil {
  3131. return nil, err
  3132. }
  3133. ret := &TestIamPermissionsResponse{
  3134. ServerResponse: googleapi.ServerResponse{
  3135. Header: res.Header,
  3136. HTTPStatusCode: res.StatusCode,
  3137. },
  3138. }
  3139. target := &ret
  3140. if err := gensupport.DecodeResponse(target, res); err != nil {
  3141. return nil, err
  3142. }
  3143. return ret, nil
  3144. // {
  3145. // "description": "Returns permissions that a caller has on the specified resource.\nIf the resource does not exist, this will return an empty set of\npermissions, not a NOT_FOUND error.\n\nNote: This operation is designed to be used for building permission-aware\nUIs and command-line tools, not for authorization checking. This operation\nmay \"fail open\" without warning.",
  3146. // "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/variables/{variablesId}:testIamPermissions",
  3147. // "httpMethod": "POST",
  3148. // "id": "runtimeconfig.projects.configs.variables.testIamPermissions",
  3149. // "parameterOrder": [
  3150. // "resource"
  3151. // ],
  3152. // "parameters": {
  3153. // "resource": {
  3154. // "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.",
  3155. // "location": "path",
  3156. // "pattern": "^projects/[^/]+/configs/[^/]+/variables/.+$",
  3157. // "required": true,
  3158. // "type": "string"
  3159. // }
  3160. // },
  3161. // "path": "v1beta1/{+resource}:testIamPermissions",
  3162. // "request": {
  3163. // "$ref": "TestIamPermissionsRequest"
  3164. // },
  3165. // "response": {
  3166. // "$ref": "TestIamPermissionsResponse"
  3167. // },
  3168. // "scopes": [
  3169. // "https://www.googleapis.com/auth/cloud-platform",
  3170. // "https://www.googleapis.com/auth/cloudruntimeconfig"
  3171. // ]
  3172. // }
  3173. }
  3174. // method id "runtimeconfig.projects.configs.variables.update":
  3175. type ProjectsConfigsVariablesUpdateCall struct {
  3176. s *Service
  3177. name string
  3178. variable *Variable
  3179. urlParams_ gensupport.URLParams
  3180. ctx_ context.Context
  3181. header_ http.Header
  3182. }
  3183. // Update: Updates an existing variable with a new value.
  3184. func (r *ProjectsConfigsVariablesService) Update(name string, variable *Variable) *ProjectsConfigsVariablesUpdateCall {
  3185. c := &ProjectsConfigsVariablesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3186. c.name = name
  3187. c.variable = variable
  3188. return c
  3189. }
  3190. // Fields allows partial responses to be retrieved. See
  3191. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3192. // for more information.
  3193. func (c *ProjectsConfigsVariablesUpdateCall) Fields(s ...googleapi.Field) *ProjectsConfigsVariablesUpdateCall {
  3194. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3195. return c
  3196. }
  3197. // Context sets the context to be used in this call's Do method. Any
  3198. // pending HTTP request will be aborted if the provided context is
  3199. // canceled.
  3200. func (c *ProjectsConfigsVariablesUpdateCall) Context(ctx context.Context) *ProjectsConfigsVariablesUpdateCall {
  3201. c.ctx_ = ctx
  3202. return c
  3203. }
  3204. // Header returns an http.Header that can be modified by the caller to
  3205. // add HTTP headers to the request.
  3206. func (c *ProjectsConfigsVariablesUpdateCall) Header() http.Header {
  3207. if c.header_ == nil {
  3208. c.header_ = make(http.Header)
  3209. }
  3210. return c.header_
  3211. }
  3212. func (c *ProjectsConfigsVariablesUpdateCall) doRequest(alt string) (*http.Response, error) {
  3213. reqHeaders := make(http.Header)
  3214. for k, v := range c.header_ {
  3215. reqHeaders[k] = v
  3216. }
  3217. reqHeaders.Set("User-Agent", c.s.userAgent())
  3218. var body io.Reader = nil
  3219. body, err := googleapi.WithoutDataWrapper.JSONReader(c.variable)
  3220. if err != nil {
  3221. return nil, err
  3222. }
  3223. reqHeaders.Set("Content-Type", "application/json")
  3224. c.urlParams_.Set("alt", alt)
  3225. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  3226. urls += "?" + c.urlParams_.Encode()
  3227. req, _ := http.NewRequest("PUT", urls, body)
  3228. req.Header = reqHeaders
  3229. googleapi.Expand(req.URL, map[string]string{
  3230. "name": c.name,
  3231. })
  3232. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3233. }
  3234. // Do executes the "runtimeconfig.projects.configs.variables.update" call.
  3235. // Exactly one of *Variable or error will be non-nil. Any non-2xx status
  3236. // code is an error. Response headers are in either
  3237. // *Variable.ServerResponse.Header or (if a response was returned at
  3238. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3239. // to check whether the returned error was because
  3240. // http.StatusNotModified was returned.
  3241. func (c *ProjectsConfigsVariablesUpdateCall) Do(opts ...googleapi.CallOption) (*Variable, error) {
  3242. gensupport.SetOptions(c.urlParams_, opts...)
  3243. res, err := c.doRequest("json")
  3244. if res != nil && res.StatusCode == http.StatusNotModified {
  3245. if res.Body != nil {
  3246. res.Body.Close()
  3247. }
  3248. return nil, &googleapi.Error{
  3249. Code: res.StatusCode,
  3250. Header: res.Header,
  3251. }
  3252. }
  3253. if err != nil {
  3254. return nil, err
  3255. }
  3256. defer googleapi.CloseBody(res)
  3257. if err := googleapi.CheckResponse(res); err != nil {
  3258. return nil, err
  3259. }
  3260. ret := &Variable{
  3261. ServerResponse: googleapi.ServerResponse{
  3262. Header: res.Header,
  3263. HTTPStatusCode: res.StatusCode,
  3264. },
  3265. }
  3266. target := &ret
  3267. if err := gensupport.DecodeResponse(target, res); err != nil {
  3268. return nil, err
  3269. }
  3270. return ret, nil
  3271. // {
  3272. // "description": "Updates an existing variable with a new value.",
  3273. // "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/variables/{variablesId}",
  3274. // "httpMethod": "PUT",
  3275. // "id": "runtimeconfig.projects.configs.variables.update",
  3276. // "parameterOrder": [
  3277. // "name"
  3278. // ],
  3279. // "parameters": {
  3280. // "name": {
  3281. // "description": "The name of the variable to update, in the format:\n\n`projects/[PROJECT_ID]/configs/[CONFIG_NAME]/variables/[VARIABLE_NAME]`",
  3282. // "location": "path",
  3283. // "pattern": "^projects/[^/]+/configs/[^/]+/variables/.+$",
  3284. // "required": true,
  3285. // "type": "string"
  3286. // }
  3287. // },
  3288. // "path": "v1beta1/{+name}",
  3289. // "request": {
  3290. // "$ref": "Variable"
  3291. // },
  3292. // "response": {
  3293. // "$ref": "Variable"
  3294. // },
  3295. // "scopes": [
  3296. // "https://www.googleapis.com/auth/cloud-platform",
  3297. // "https://www.googleapis.com/auth/cloudruntimeconfig"
  3298. // ]
  3299. // }
  3300. }
  3301. // method id "runtimeconfig.projects.configs.variables.watch":
  3302. type ProjectsConfigsVariablesWatchCall struct {
  3303. s *Service
  3304. name string
  3305. watchvariablerequest *WatchVariableRequest
  3306. urlParams_ gensupport.URLParams
  3307. ctx_ context.Context
  3308. header_ http.Header
  3309. }
  3310. // Watch: Watches a specific variable and waits for a change in the
  3311. // variable's value.
  3312. // When there is a change, this method returns the new value or times
  3313. // out.
  3314. //
  3315. // If a variable is deleted while being watched, the `variableState`
  3316. // state is
  3317. // set to `DELETED` and the method returns the last known variable
  3318. // `value`.
  3319. //
  3320. // If you set the deadline for watching to a larger value than
  3321. // internal
  3322. // timeout (60 seconds), the current variable value is returned and
  3323. // the
  3324. // `variableState` will be `VARIABLE_STATE_UNSPECIFIED`.
  3325. //
  3326. // To learn more about creating a watcher, read the
  3327. // [Watching a Variable
  3328. // for
  3329. // Changes](/deployment-manager/runtime-configurator/watching-a-varia
  3330. // ble)
  3331. // documentation.
  3332. func (r *ProjectsConfigsVariablesService) Watch(name string, watchvariablerequest *WatchVariableRequest) *ProjectsConfigsVariablesWatchCall {
  3333. c := &ProjectsConfigsVariablesWatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3334. c.name = name
  3335. c.watchvariablerequest = watchvariablerequest
  3336. return c
  3337. }
  3338. // Fields allows partial responses to be retrieved. See
  3339. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3340. // for more information.
  3341. func (c *ProjectsConfigsVariablesWatchCall) Fields(s ...googleapi.Field) *ProjectsConfigsVariablesWatchCall {
  3342. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3343. return c
  3344. }
  3345. // Context sets the context to be used in this call's Do method. Any
  3346. // pending HTTP request will be aborted if the provided context is
  3347. // canceled.
  3348. func (c *ProjectsConfigsVariablesWatchCall) Context(ctx context.Context) *ProjectsConfigsVariablesWatchCall {
  3349. c.ctx_ = ctx
  3350. return c
  3351. }
  3352. // Header returns an http.Header that can be modified by the caller to
  3353. // add HTTP headers to the request.
  3354. func (c *ProjectsConfigsVariablesWatchCall) Header() http.Header {
  3355. if c.header_ == nil {
  3356. c.header_ = make(http.Header)
  3357. }
  3358. return c.header_
  3359. }
  3360. func (c *ProjectsConfigsVariablesWatchCall) doRequest(alt string) (*http.Response, error) {
  3361. reqHeaders := make(http.Header)
  3362. for k, v := range c.header_ {
  3363. reqHeaders[k] = v
  3364. }
  3365. reqHeaders.Set("User-Agent", c.s.userAgent())
  3366. var body io.Reader = nil
  3367. body, err := googleapi.WithoutDataWrapper.JSONReader(c.watchvariablerequest)
  3368. if err != nil {
  3369. return nil, err
  3370. }
  3371. reqHeaders.Set("Content-Type", "application/json")
  3372. c.urlParams_.Set("alt", alt)
  3373. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:watch")
  3374. urls += "?" + c.urlParams_.Encode()
  3375. req, _ := http.NewRequest("POST", urls, body)
  3376. req.Header = reqHeaders
  3377. googleapi.Expand(req.URL, map[string]string{
  3378. "name": c.name,
  3379. })
  3380. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3381. }
  3382. // Do executes the "runtimeconfig.projects.configs.variables.watch" call.
  3383. // Exactly one of *Variable or error will be non-nil. Any non-2xx status
  3384. // code is an error. Response headers are in either
  3385. // *Variable.ServerResponse.Header or (if a response was returned at
  3386. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3387. // to check whether the returned error was because
  3388. // http.StatusNotModified was returned.
  3389. func (c *ProjectsConfigsVariablesWatchCall) Do(opts ...googleapi.CallOption) (*Variable, error) {
  3390. gensupport.SetOptions(c.urlParams_, opts...)
  3391. res, err := c.doRequest("json")
  3392. if res != nil && res.StatusCode == http.StatusNotModified {
  3393. if res.Body != nil {
  3394. res.Body.Close()
  3395. }
  3396. return nil, &googleapi.Error{
  3397. Code: res.StatusCode,
  3398. Header: res.Header,
  3399. }
  3400. }
  3401. if err != nil {
  3402. return nil, err
  3403. }
  3404. defer googleapi.CloseBody(res)
  3405. if err := googleapi.CheckResponse(res); err != nil {
  3406. return nil, err
  3407. }
  3408. ret := &Variable{
  3409. ServerResponse: googleapi.ServerResponse{
  3410. Header: res.Header,
  3411. HTTPStatusCode: res.StatusCode,
  3412. },
  3413. }
  3414. target := &ret
  3415. if err := gensupport.DecodeResponse(target, res); err != nil {
  3416. return nil, err
  3417. }
  3418. return ret, nil
  3419. // {
  3420. // "description": "Watches a specific variable and waits for a change in the variable's value.\nWhen there is a change, this method returns the new value or times out.\n\nIf a variable is deleted while being watched, the `variableState` state is\nset to `DELETED` and the method returns the last known variable `value`.\n\nIf you set the deadline for watching to a larger value than internal\ntimeout (60 seconds), the current variable value is returned and the\n`variableState` will be `VARIABLE_STATE_UNSPECIFIED`.\n\nTo learn more about creating a watcher, read the\n[Watching a Variable for\nChanges](/deployment-manager/runtime-configurator/watching-a-variable)\ndocumentation.",
  3421. // "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/variables/{variablesId}:watch",
  3422. // "httpMethod": "POST",
  3423. // "id": "runtimeconfig.projects.configs.variables.watch",
  3424. // "parameterOrder": [
  3425. // "name"
  3426. // ],
  3427. // "parameters": {
  3428. // "name": {
  3429. // "description": "The name of the variable to watch, in the format:\n\n`projects/[PROJECT_ID]/configs/[CONFIG_NAME]`",
  3430. // "location": "path",
  3431. // "pattern": "^projects/[^/]+/configs/[^/]+/variables/.+$",
  3432. // "required": true,
  3433. // "type": "string"
  3434. // }
  3435. // },
  3436. // "path": "v1beta1/{+name}:watch",
  3437. // "request": {
  3438. // "$ref": "WatchVariableRequest"
  3439. // },
  3440. // "response": {
  3441. // "$ref": "Variable"
  3442. // },
  3443. // "scopes": [
  3444. // "https://www.googleapis.com/auth/cloud-platform",
  3445. // "https://www.googleapis.com/auth/cloudruntimeconfig"
  3446. // ]
  3447. // }
  3448. }
  3449. // method id "runtimeconfig.projects.configs.waiters.create":
  3450. type ProjectsConfigsWaitersCreateCall struct {
  3451. s *Service
  3452. parent string
  3453. waiter *Waiter
  3454. urlParams_ gensupport.URLParams
  3455. ctx_ context.Context
  3456. header_ http.Header
  3457. }
  3458. // Create: Creates a Waiter resource. This operation returns a
  3459. // long-running Operation
  3460. // resource which can be polled for completion. However, a waiter with
  3461. // the
  3462. // given name will exist (and can be retrieved) prior to the
  3463. // operation
  3464. // completing. If the operation fails, the failed Waiter resource
  3465. // will
  3466. // still exist and must be deleted prior to subsequent creation
  3467. // attempts.
  3468. func (r *ProjectsConfigsWaitersService) Create(parent string, waiter *Waiter) *ProjectsConfigsWaitersCreateCall {
  3469. c := &ProjectsConfigsWaitersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3470. c.parent = parent
  3471. c.waiter = waiter
  3472. return c
  3473. }
  3474. // RequestId sets the optional parameter "requestId": An optional but
  3475. // recommended unique `request_id`. If the server
  3476. // receives two `create()` requests with the same
  3477. // `request_id`, then the second request will be ignored and the
  3478. // first resource created and stored in the backend is returned.
  3479. // Empty `request_id` fields are ignored.
  3480. //
  3481. // It is responsibility of the client to ensure uniqueness of
  3482. // the
  3483. // `request_id` strings.
  3484. //
  3485. // `request_id` strings are limited to 64 characters.
  3486. func (c *ProjectsConfigsWaitersCreateCall) RequestId(requestId string) *ProjectsConfigsWaitersCreateCall {
  3487. c.urlParams_.Set("requestId", requestId)
  3488. return c
  3489. }
  3490. // Fields allows partial responses to be retrieved. See
  3491. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3492. // for more information.
  3493. func (c *ProjectsConfigsWaitersCreateCall) Fields(s ...googleapi.Field) *ProjectsConfigsWaitersCreateCall {
  3494. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3495. return c
  3496. }
  3497. // Context sets the context to be used in this call's Do method. Any
  3498. // pending HTTP request will be aborted if the provided context is
  3499. // canceled.
  3500. func (c *ProjectsConfigsWaitersCreateCall) Context(ctx context.Context) *ProjectsConfigsWaitersCreateCall {
  3501. c.ctx_ = ctx
  3502. return c
  3503. }
  3504. // Header returns an http.Header that can be modified by the caller to
  3505. // add HTTP headers to the request.
  3506. func (c *ProjectsConfigsWaitersCreateCall) Header() http.Header {
  3507. if c.header_ == nil {
  3508. c.header_ = make(http.Header)
  3509. }
  3510. return c.header_
  3511. }
  3512. func (c *ProjectsConfigsWaitersCreateCall) doRequest(alt string) (*http.Response, error) {
  3513. reqHeaders := make(http.Header)
  3514. for k, v := range c.header_ {
  3515. reqHeaders[k] = v
  3516. }
  3517. reqHeaders.Set("User-Agent", c.s.userAgent())
  3518. var body io.Reader = nil
  3519. body, err := googleapi.WithoutDataWrapper.JSONReader(c.waiter)
  3520. if err != nil {
  3521. return nil, err
  3522. }
  3523. reqHeaders.Set("Content-Type", "application/json")
  3524. c.urlParams_.Set("alt", alt)
  3525. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/waiters")
  3526. urls += "?" + c.urlParams_.Encode()
  3527. req, _ := http.NewRequest("POST", urls, body)
  3528. req.Header = reqHeaders
  3529. googleapi.Expand(req.URL, map[string]string{
  3530. "parent": c.parent,
  3531. })
  3532. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3533. }
  3534. // Do executes the "runtimeconfig.projects.configs.waiters.create" call.
  3535. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  3536. // status code is an error. Response headers are in either
  3537. // *Operation.ServerResponse.Header or (if a response was returned at
  3538. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3539. // to check whether the returned error was because
  3540. // http.StatusNotModified was returned.
  3541. func (c *ProjectsConfigsWaitersCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3542. gensupport.SetOptions(c.urlParams_, opts...)
  3543. res, err := c.doRequest("json")
  3544. if res != nil && res.StatusCode == http.StatusNotModified {
  3545. if res.Body != nil {
  3546. res.Body.Close()
  3547. }
  3548. return nil, &googleapi.Error{
  3549. Code: res.StatusCode,
  3550. Header: res.Header,
  3551. }
  3552. }
  3553. if err != nil {
  3554. return nil, err
  3555. }
  3556. defer googleapi.CloseBody(res)
  3557. if err := googleapi.CheckResponse(res); err != nil {
  3558. return nil, err
  3559. }
  3560. ret := &Operation{
  3561. ServerResponse: googleapi.ServerResponse{
  3562. Header: res.Header,
  3563. HTTPStatusCode: res.StatusCode,
  3564. },
  3565. }
  3566. target := &ret
  3567. if err := gensupport.DecodeResponse(target, res); err != nil {
  3568. return nil, err
  3569. }
  3570. return ret, nil
  3571. // {
  3572. // "description": "Creates a Waiter resource. This operation returns a long-running Operation\nresource which can be polled for completion. However, a waiter with the\ngiven name will exist (and can be retrieved) prior to the operation\ncompleting. If the operation fails, the failed Waiter resource will\nstill exist and must be deleted prior to subsequent creation attempts.",
  3573. // "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/waiters",
  3574. // "httpMethod": "POST",
  3575. // "id": "runtimeconfig.projects.configs.waiters.create",
  3576. // "parameterOrder": [
  3577. // "parent"
  3578. // ],
  3579. // "parameters": {
  3580. // "parent": {
  3581. // "description": "The path to the configuration that will own the waiter.\nThe configuration must exist beforehand; the path must be in the format:\n\n`projects/[PROJECT_ID]/configs/[CONFIG_NAME]`.",
  3582. // "location": "path",
  3583. // "pattern": "^projects/[^/]+/configs/[^/]+$",
  3584. // "required": true,
  3585. // "type": "string"
  3586. // },
  3587. // "requestId": {
  3588. // "description": "An optional but recommended unique `request_id`. If the server\nreceives two `create()` requests with the same\n`request_id`, then the second request will be ignored and the\nfirst resource created and stored in the backend is returned.\nEmpty `request_id` fields are ignored.\n\nIt is responsibility of the client to ensure uniqueness of the\n`request_id` strings.\n\n`request_id` strings are limited to 64 characters.",
  3589. // "location": "query",
  3590. // "type": "string"
  3591. // }
  3592. // },
  3593. // "path": "v1beta1/{+parent}/waiters",
  3594. // "request": {
  3595. // "$ref": "Waiter"
  3596. // },
  3597. // "response": {
  3598. // "$ref": "Operation"
  3599. // },
  3600. // "scopes": [
  3601. // "https://www.googleapis.com/auth/cloud-platform",
  3602. // "https://www.googleapis.com/auth/cloudruntimeconfig"
  3603. // ]
  3604. // }
  3605. }
  3606. // method id "runtimeconfig.projects.configs.waiters.delete":
  3607. type ProjectsConfigsWaitersDeleteCall struct {
  3608. s *Service
  3609. name string
  3610. urlParams_ gensupport.URLParams
  3611. ctx_ context.Context
  3612. header_ http.Header
  3613. }
  3614. // Delete: Deletes the waiter with the specified name.
  3615. func (r *ProjectsConfigsWaitersService) Delete(name string) *ProjectsConfigsWaitersDeleteCall {
  3616. c := &ProjectsConfigsWaitersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3617. c.name = name
  3618. return c
  3619. }
  3620. // Fields allows partial responses to be retrieved. See
  3621. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3622. // for more information.
  3623. func (c *ProjectsConfigsWaitersDeleteCall) Fields(s ...googleapi.Field) *ProjectsConfigsWaitersDeleteCall {
  3624. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3625. return c
  3626. }
  3627. // Context sets the context to be used in this call's Do method. Any
  3628. // pending HTTP request will be aborted if the provided context is
  3629. // canceled.
  3630. func (c *ProjectsConfigsWaitersDeleteCall) Context(ctx context.Context) *ProjectsConfigsWaitersDeleteCall {
  3631. c.ctx_ = ctx
  3632. return c
  3633. }
  3634. // Header returns an http.Header that can be modified by the caller to
  3635. // add HTTP headers to the request.
  3636. func (c *ProjectsConfigsWaitersDeleteCall) Header() http.Header {
  3637. if c.header_ == nil {
  3638. c.header_ = make(http.Header)
  3639. }
  3640. return c.header_
  3641. }
  3642. func (c *ProjectsConfigsWaitersDeleteCall) doRequest(alt string) (*http.Response, error) {
  3643. reqHeaders := make(http.Header)
  3644. for k, v := range c.header_ {
  3645. reqHeaders[k] = v
  3646. }
  3647. reqHeaders.Set("User-Agent", c.s.userAgent())
  3648. var body io.Reader = nil
  3649. c.urlParams_.Set("alt", alt)
  3650. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  3651. urls += "?" + c.urlParams_.Encode()
  3652. req, _ := http.NewRequest("DELETE", urls, body)
  3653. req.Header = reqHeaders
  3654. googleapi.Expand(req.URL, map[string]string{
  3655. "name": c.name,
  3656. })
  3657. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3658. }
  3659. // Do executes the "runtimeconfig.projects.configs.waiters.delete" call.
  3660. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  3661. // code is an error. Response headers are in either
  3662. // *Empty.ServerResponse.Header or (if a response was returned at all)
  3663. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3664. // check whether the returned error was because http.StatusNotModified
  3665. // was returned.
  3666. func (c *ProjectsConfigsWaitersDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  3667. gensupport.SetOptions(c.urlParams_, opts...)
  3668. res, err := c.doRequest("json")
  3669. if res != nil && res.StatusCode == http.StatusNotModified {
  3670. if res.Body != nil {
  3671. res.Body.Close()
  3672. }
  3673. return nil, &googleapi.Error{
  3674. Code: res.StatusCode,
  3675. Header: res.Header,
  3676. }
  3677. }
  3678. if err != nil {
  3679. return nil, err
  3680. }
  3681. defer googleapi.CloseBody(res)
  3682. if err := googleapi.CheckResponse(res); err != nil {
  3683. return nil, err
  3684. }
  3685. ret := &Empty{
  3686. ServerResponse: googleapi.ServerResponse{
  3687. Header: res.Header,
  3688. HTTPStatusCode: res.StatusCode,
  3689. },
  3690. }
  3691. target := &ret
  3692. if err := gensupport.DecodeResponse(target, res); err != nil {
  3693. return nil, err
  3694. }
  3695. return ret, nil
  3696. // {
  3697. // "description": "Deletes the waiter with the specified name.",
  3698. // "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/waiters/{waitersId}",
  3699. // "httpMethod": "DELETE",
  3700. // "id": "runtimeconfig.projects.configs.waiters.delete",
  3701. // "parameterOrder": [
  3702. // "name"
  3703. // ],
  3704. // "parameters": {
  3705. // "name": {
  3706. // "description": "The Waiter resource to delete, in the format:\n\n `projects/[PROJECT_ID]/configs/[CONFIG_NAME]/waiters/[WAITER_NAME]`",
  3707. // "location": "path",
  3708. // "pattern": "^projects/[^/]+/configs/[^/]+/waiters/[^/]+$",
  3709. // "required": true,
  3710. // "type": "string"
  3711. // }
  3712. // },
  3713. // "path": "v1beta1/{+name}",
  3714. // "response": {
  3715. // "$ref": "Empty"
  3716. // },
  3717. // "scopes": [
  3718. // "https://www.googleapis.com/auth/cloud-platform",
  3719. // "https://www.googleapis.com/auth/cloudruntimeconfig"
  3720. // ]
  3721. // }
  3722. }
  3723. // method id "runtimeconfig.projects.configs.waiters.get":
  3724. type ProjectsConfigsWaitersGetCall struct {
  3725. s *Service
  3726. name string
  3727. urlParams_ gensupport.URLParams
  3728. ifNoneMatch_ string
  3729. ctx_ context.Context
  3730. header_ http.Header
  3731. }
  3732. // Get: Gets information about a single waiter.
  3733. func (r *ProjectsConfigsWaitersService) Get(name string) *ProjectsConfigsWaitersGetCall {
  3734. c := &ProjectsConfigsWaitersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3735. c.name = name
  3736. return c
  3737. }
  3738. // Fields allows partial responses to be retrieved. See
  3739. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3740. // for more information.
  3741. func (c *ProjectsConfigsWaitersGetCall) Fields(s ...googleapi.Field) *ProjectsConfigsWaitersGetCall {
  3742. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3743. return c
  3744. }
  3745. // IfNoneMatch sets the optional parameter which makes the operation
  3746. // fail if the object's ETag matches the given value. This is useful for
  3747. // getting updates only after the object has changed since the last
  3748. // request. Use googleapi.IsNotModified to check whether the response
  3749. // error from Do is the result of In-None-Match.
  3750. func (c *ProjectsConfigsWaitersGetCall) IfNoneMatch(entityTag string) *ProjectsConfigsWaitersGetCall {
  3751. c.ifNoneMatch_ = entityTag
  3752. return c
  3753. }
  3754. // Context sets the context to be used in this call's Do method. Any
  3755. // pending HTTP request will be aborted if the provided context is
  3756. // canceled.
  3757. func (c *ProjectsConfigsWaitersGetCall) Context(ctx context.Context) *ProjectsConfigsWaitersGetCall {
  3758. c.ctx_ = ctx
  3759. return c
  3760. }
  3761. // Header returns an http.Header that can be modified by the caller to
  3762. // add HTTP headers to the request.
  3763. func (c *ProjectsConfigsWaitersGetCall) Header() http.Header {
  3764. if c.header_ == nil {
  3765. c.header_ = make(http.Header)
  3766. }
  3767. return c.header_
  3768. }
  3769. func (c *ProjectsConfigsWaitersGetCall) doRequest(alt string) (*http.Response, error) {
  3770. reqHeaders := make(http.Header)
  3771. for k, v := range c.header_ {
  3772. reqHeaders[k] = v
  3773. }
  3774. reqHeaders.Set("User-Agent", c.s.userAgent())
  3775. if c.ifNoneMatch_ != "" {
  3776. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3777. }
  3778. var body io.Reader = nil
  3779. c.urlParams_.Set("alt", alt)
  3780. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  3781. urls += "?" + c.urlParams_.Encode()
  3782. req, _ := http.NewRequest("GET", urls, body)
  3783. req.Header = reqHeaders
  3784. googleapi.Expand(req.URL, map[string]string{
  3785. "name": c.name,
  3786. })
  3787. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3788. }
  3789. // Do executes the "runtimeconfig.projects.configs.waiters.get" call.
  3790. // Exactly one of *Waiter or error will be non-nil. Any non-2xx status
  3791. // code is an error. Response headers are in either
  3792. // *Waiter.ServerResponse.Header or (if a response was returned at all)
  3793. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3794. // check whether the returned error was because http.StatusNotModified
  3795. // was returned.
  3796. func (c *ProjectsConfigsWaitersGetCall) Do(opts ...googleapi.CallOption) (*Waiter, error) {
  3797. gensupport.SetOptions(c.urlParams_, opts...)
  3798. res, err := c.doRequest("json")
  3799. if res != nil && res.StatusCode == http.StatusNotModified {
  3800. if res.Body != nil {
  3801. res.Body.Close()
  3802. }
  3803. return nil, &googleapi.Error{
  3804. Code: res.StatusCode,
  3805. Header: res.Header,
  3806. }
  3807. }
  3808. if err != nil {
  3809. return nil, err
  3810. }
  3811. defer googleapi.CloseBody(res)
  3812. if err := googleapi.CheckResponse(res); err != nil {
  3813. return nil, err
  3814. }
  3815. ret := &Waiter{
  3816. ServerResponse: googleapi.ServerResponse{
  3817. Header: res.Header,
  3818. HTTPStatusCode: res.StatusCode,
  3819. },
  3820. }
  3821. target := &ret
  3822. if err := gensupport.DecodeResponse(target, res); err != nil {
  3823. return nil, err
  3824. }
  3825. return ret, nil
  3826. // {
  3827. // "description": "Gets information about a single waiter.",
  3828. // "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/waiters/{waitersId}",
  3829. // "httpMethod": "GET",
  3830. // "id": "runtimeconfig.projects.configs.waiters.get",
  3831. // "parameterOrder": [
  3832. // "name"
  3833. // ],
  3834. // "parameters": {
  3835. // "name": {
  3836. // "description": "The fully-qualified name of the Waiter resource object to retrieve, in the\nformat:\n\n`projects/[PROJECT_ID]/configs/[CONFIG_NAME]/waiters/[WAITER_NAME]`",
  3837. // "location": "path",
  3838. // "pattern": "^projects/[^/]+/configs/[^/]+/waiters/[^/]+$",
  3839. // "required": true,
  3840. // "type": "string"
  3841. // }
  3842. // },
  3843. // "path": "v1beta1/{+name}",
  3844. // "response": {
  3845. // "$ref": "Waiter"
  3846. // },
  3847. // "scopes": [
  3848. // "https://www.googleapis.com/auth/cloud-platform",
  3849. // "https://www.googleapis.com/auth/cloudruntimeconfig"
  3850. // ]
  3851. // }
  3852. }
  3853. // method id "runtimeconfig.projects.configs.waiters.list":
  3854. type ProjectsConfigsWaitersListCall struct {
  3855. s *Service
  3856. parent string
  3857. urlParams_ gensupport.URLParams
  3858. ifNoneMatch_ string
  3859. ctx_ context.Context
  3860. header_ http.Header
  3861. }
  3862. // List: List waiters within the given configuration.
  3863. func (r *ProjectsConfigsWaitersService) List(parent string) *ProjectsConfigsWaitersListCall {
  3864. c := &ProjectsConfigsWaitersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3865. c.parent = parent
  3866. return c
  3867. }
  3868. // PageSize sets the optional parameter "pageSize": Specifies the number
  3869. // of results to return per page. If there are fewer
  3870. // elements than the specified number, returns all elements.
  3871. func (c *ProjectsConfigsWaitersListCall) PageSize(pageSize int64) *ProjectsConfigsWaitersListCall {
  3872. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  3873. return c
  3874. }
  3875. // PageToken sets the optional parameter "pageToken": Specifies a page
  3876. // token to use. Set `pageToken` to a `nextPageToken`
  3877. // returned by a previous list request to get the next page of results.
  3878. func (c *ProjectsConfigsWaitersListCall) PageToken(pageToken string) *ProjectsConfigsWaitersListCall {
  3879. c.urlParams_.Set("pageToken", pageToken)
  3880. return c
  3881. }
  3882. // Fields allows partial responses to be retrieved. See
  3883. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3884. // for more information.
  3885. func (c *ProjectsConfigsWaitersListCall) Fields(s ...googleapi.Field) *ProjectsConfigsWaitersListCall {
  3886. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3887. return c
  3888. }
  3889. // IfNoneMatch sets the optional parameter which makes the operation
  3890. // fail if the object's ETag matches the given value. This is useful for
  3891. // getting updates only after the object has changed since the last
  3892. // request. Use googleapi.IsNotModified to check whether the response
  3893. // error from Do is the result of In-None-Match.
  3894. func (c *ProjectsConfigsWaitersListCall) IfNoneMatch(entityTag string) *ProjectsConfigsWaitersListCall {
  3895. c.ifNoneMatch_ = entityTag
  3896. return c
  3897. }
  3898. // Context sets the context to be used in this call's Do method. Any
  3899. // pending HTTP request will be aborted if the provided context is
  3900. // canceled.
  3901. func (c *ProjectsConfigsWaitersListCall) Context(ctx context.Context) *ProjectsConfigsWaitersListCall {
  3902. c.ctx_ = ctx
  3903. return c
  3904. }
  3905. // Header returns an http.Header that can be modified by the caller to
  3906. // add HTTP headers to the request.
  3907. func (c *ProjectsConfigsWaitersListCall) Header() http.Header {
  3908. if c.header_ == nil {
  3909. c.header_ = make(http.Header)
  3910. }
  3911. return c.header_
  3912. }
  3913. func (c *ProjectsConfigsWaitersListCall) doRequest(alt string) (*http.Response, error) {
  3914. reqHeaders := make(http.Header)
  3915. for k, v := range c.header_ {
  3916. reqHeaders[k] = v
  3917. }
  3918. reqHeaders.Set("User-Agent", c.s.userAgent())
  3919. if c.ifNoneMatch_ != "" {
  3920. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3921. }
  3922. var body io.Reader = nil
  3923. c.urlParams_.Set("alt", alt)
  3924. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/waiters")
  3925. urls += "?" + c.urlParams_.Encode()
  3926. req, _ := http.NewRequest("GET", urls, body)
  3927. req.Header = reqHeaders
  3928. googleapi.Expand(req.URL, map[string]string{
  3929. "parent": c.parent,
  3930. })
  3931. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3932. }
  3933. // Do executes the "runtimeconfig.projects.configs.waiters.list" call.
  3934. // Exactly one of *ListWaitersResponse or error will be non-nil. Any
  3935. // non-2xx status code is an error. Response headers are in either
  3936. // *ListWaitersResponse.ServerResponse.Header or (if a response was
  3937. // returned at all) in error.(*googleapi.Error).Header. Use
  3938. // googleapi.IsNotModified to check whether the returned error was
  3939. // because http.StatusNotModified was returned.
  3940. func (c *ProjectsConfigsWaitersListCall) Do(opts ...googleapi.CallOption) (*ListWaitersResponse, error) {
  3941. gensupport.SetOptions(c.urlParams_, opts...)
  3942. res, err := c.doRequest("json")
  3943. if res != nil && res.StatusCode == http.StatusNotModified {
  3944. if res.Body != nil {
  3945. res.Body.Close()
  3946. }
  3947. return nil, &googleapi.Error{
  3948. Code: res.StatusCode,
  3949. Header: res.Header,
  3950. }
  3951. }
  3952. if err != nil {
  3953. return nil, err
  3954. }
  3955. defer googleapi.CloseBody(res)
  3956. if err := googleapi.CheckResponse(res); err != nil {
  3957. return nil, err
  3958. }
  3959. ret := &ListWaitersResponse{
  3960. ServerResponse: googleapi.ServerResponse{
  3961. Header: res.Header,
  3962. HTTPStatusCode: res.StatusCode,
  3963. },
  3964. }
  3965. target := &ret
  3966. if err := gensupport.DecodeResponse(target, res); err != nil {
  3967. return nil, err
  3968. }
  3969. return ret, nil
  3970. // {
  3971. // "description": "List waiters within the given configuration.",
  3972. // "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/waiters",
  3973. // "httpMethod": "GET",
  3974. // "id": "runtimeconfig.projects.configs.waiters.list",
  3975. // "parameterOrder": [
  3976. // "parent"
  3977. // ],
  3978. // "parameters": {
  3979. // "pageSize": {
  3980. // "description": "Specifies the number of results to return per page. If there are fewer\nelements than the specified number, returns all elements.",
  3981. // "format": "int32",
  3982. // "location": "query",
  3983. // "type": "integer"
  3984. // },
  3985. // "pageToken": {
  3986. // "description": "Specifies a page token to use. Set `pageToken` to a `nextPageToken`\nreturned by a previous list request to get the next page of results.",
  3987. // "location": "query",
  3988. // "type": "string"
  3989. // },
  3990. // "parent": {
  3991. // "description": "The path to the configuration for which you want to get a list of waiters.\nThe configuration must exist beforehand; the path must be in the format:\n\n`projects/[PROJECT_ID]/configs/[CONFIG_NAME]`",
  3992. // "location": "path",
  3993. // "pattern": "^projects/[^/]+/configs/[^/]+$",
  3994. // "required": true,
  3995. // "type": "string"
  3996. // }
  3997. // },
  3998. // "path": "v1beta1/{+parent}/waiters",
  3999. // "response": {
  4000. // "$ref": "ListWaitersResponse"
  4001. // },
  4002. // "scopes": [
  4003. // "https://www.googleapis.com/auth/cloud-platform",
  4004. // "https://www.googleapis.com/auth/cloudruntimeconfig"
  4005. // ]
  4006. // }
  4007. }
  4008. // Pages invokes f for each page of results.
  4009. // A non-nil error returned from f will halt the iteration.
  4010. // The provided context supersedes any context provided to the Context method.
  4011. func (c *ProjectsConfigsWaitersListCall) Pages(ctx context.Context, f func(*ListWaitersResponse) error) error {
  4012. c.ctx_ = ctx
  4013. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4014. for {
  4015. x, err := c.Do()
  4016. if err != nil {
  4017. return err
  4018. }
  4019. if err := f(x); err != nil {
  4020. return err
  4021. }
  4022. if x.NextPageToken == "" {
  4023. return nil
  4024. }
  4025. c.PageToken(x.NextPageToken)
  4026. }
  4027. }
  4028. // method id "runtimeconfig.projects.configs.waiters.testIamPermissions":
  4029. type ProjectsConfigsWaitersTestIamPermissionsCall struct {
  4030. s *Service
  4031. resource string
  4032. testiampermissionsrequest *TestIamPermissionsRequest
  4033. urlParams_ gensupport.URLParams
  4034. ctx_ context.Context
  4035. header_ http.Header
  4036. }
  4037. // TestIamPermissions: Returns permissions that a caller has on the
  4038. // specified resource.
  4039. // If the resource does not exist, this will return an empty set
  4040. // of
  4041. // permissions, not a NOT_FOUND error.
  4042. //
  4043. // Note: This operation is designed to be used for building
  4044. // permission-aware
  4045. // UIs and command-line tools, not for authorization checking. This
  4046. // operation
  4047. // may "fail open" without warning.
  4048. func (r *ProjectsConfigsWaitersService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsConfigsWaitersTestIamPermissionsCall {
  4049. c := &ProjectsConfigsWaitersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4050. c.resource = resource
  4051. c.testiampermissionsrequest = testiampermissionsrequest
  4052. return c
  4053. }
  4054. // Fields allows partial responses to be retrieved. See
  4055. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4056. // for more information.
  4057. func (c *ProjectsConfigsWaitersTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsConfigsWaitersTestIamPermissionsCall {
  4058. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4059. return c
  4060. }
  4061. // Context sets the context to be used in this call's Do method. Any
  4062. // pending HTTP request will be aborted if the provided context is
  4063. // canceled.
  4064. func (c *ProjectsConfigsWaitersTestIamPermissionsCall) Context(ctx context.Context) *ProjectsConfigsWaitersTestIamPermissionsCall {
  4065. c.ctx_ = ctx
  4066. return c
  4067. }
  4068. // Header returns an http.Header that can be modified by the caller to
  4069. // add HTTP headers to the request.
  4070. func (c *ProjectsConfigsWaitersTestIamPermissionsCall) Header() http.Header {
  4071. if c.header_ == nil {
  4072. c.header_ = make(http.Header)
  4073. }
  4074. return c.header_
  4075. }
  4076. func (c *ProjectsConfigsWaitersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  4077. reqHeaders := make(http.Header)
  4078. for k, v := range c.header_ {
  4079. reqHeaders[k] = v
  4080. }
  4081. reqHeaders.Set("User-Agent", c.s.userAgent())
  4082. var body io.Reader = nil
  4083. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  4084. if err != nil {
  4085. return nil, err
  4086. }
  4087. reqHeaders.Set("Content-Type", "application/json")
  4088. c.urlParams_.Set("alt", alt)
  4089. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:testIamPermissions")
  4090. urls += "?" + c.urlParams_.Encode()
  4091. req, _ := http.NewRequest("POST", urls, body)
  4092. req.Header = reqHeaders
  4093. googleapi.Expand(req.URL, map[string]string{
  4094. "resource": c.resource,
  4095. })
  4096. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4097. }
  4098. // Do executes the "runtimeconfig.projects.configs.waiters.testIamPermissions" call.
  4099. // Exactly one of *TestIamPermissionsResponse or error will be non-nil.
  4100. // Any non-2xx status code is an error. Response headers are in either
  4101. // *TestIamPermissionsResponse.ServerResponse.Header or (if a response
  4102. // was returned at all) in error.(*googleapi.Error).Header. Use
  4103. // googleapi.IsNotModified to check whether the returned error was
  4104. // because http.StatusNotModified was returned.
  4105. func (c *ProjectsConfigsWaitersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  4106. gensupport.SetOptions(c.urlParams_, opts...)
  4107. res, err := c.doRequest("json")
  4108. if res != nil && res.StatusCode == http.StatusNotModified {
  4109. if res.Body != nil {
  4110. res.Body.Close()
  4111. }
  4112. return nil, &googleapi.Error{
  4113. Code: res.StatusCode,
  4114. Header: res.Header,
  4115. }
  4116. }
  4117. if err != nil {
  4118. return nil, err
  4119. }
  4120. defer googleapi.CloseBody(res)
  4121. if err := googleapi.CheckResponse(res); err != nil {
  4122. return nil, err
  4123. }
  4124. ret := &TestIamPermissionsResponse{
  4125. ServerResponse: googleapi.ServerResponse{
  4126. Header: res.Header,
  4127. HTTPStatusCode: res.StatusCode,
  4128. },
  4129. }
  4130. target := &ret
  4131. if err := gensupport.DecodeResponse(target, res); err != nil {
  4132. return nil, err
  4133. }
  4134. return ret, nil
  4135. // {
  4136. // "description": "Returns permissions that a caller has on the specified resource.\nIf the resource does not exist, this will return an empty set of\npermissions, not a NOT_FOUND error.\n\nNote: This operation is designed to be used for building permission-aware\nUIs and command-line tools, not for authorization checking. This operation\nmay \"fail open\" without warning.",
  4137. // "flatPath": "v1beta1/projects/{projectsId}/configs/{configsId}/waiters/{waitersId}:testIamPermissions",
  4138. // "httpMethod": "POST",
  4139. // "id": "runtimeconfig.projects.configs.waiters.testIamPermissions",
  4140. // "parameterOrder": [
  4141. // "resource"
  4142. // ],
  4143. // "parameters": {
  4144. // "resource": {
  4145. // "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.",
  4146. // "location": "path",
  4147. // "pattern": "^projects/[^/]+/configs/[^/]+/waiters/[^/]+$",
  4148. // "required": true,
  4149. // "type": "string"
  4150. // }
  4151. // },
  4152. // "path": "v1beta1/{+resource}:testIamPermissions",
  4153. // "request": {
  4154. // "$ref": "TestIamPermissionsRequest"
  4155. // },
  4156. // "response": {
  4157. // "$ref": "TestIamPermissionsResponse"
  4158. // },
  4159. // "scopes": [
  4160. // "https://www.googleapis.com/auth/cloud-platform",
  4161. // "https://www.googleapis.com/auth/cloudruntimeconfig"
  4162. // ]
  4163. // }
  4164. }