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

4722 lines
163 KiB

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