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.
 
 
 

4208 lines
156 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 servicebroker provides access to the Service Broker API.
  6. //
  7. // For product documentation, see: https://cloud.google.com/kubernetes-engine/docs/concepts/add-on/service-broker
  8. //
  9. // Creating a client
  10. //
  11. // Usage example:
  12. //
  13. // import "google.golang.org/api/servicebroker/v1alpha1"
  14. // ...
  15. // ctx := context.Background()
  16. // servicebrokerService, err := servicebroker.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. // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
  25. //
  26. // servicebrokerService, err := servicebroker.NewService(ctx, option.WithAPIKey("AIza..."))
  27. //
  28. // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
  29. //
  30. // config := &oauth2.Config{...}
  31. // // ...
  32. // token, err := config.Exchange(ctx, ...)
  33. // servicebrokerService, err := servicebroker.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
  34. //
  35. // See https://godoc.org/google.golang.org/api/option/ for details on options.
  36. package servicebroker // import "google.golang.org/api/servicebroker/v1alpha1"
  37. import (
  38. "bytes"
  39. "context"
  40. "encoding/json"
  41. "errors"
  42. "fmt"
  43. "io"
  44. "net/http"
  45. "net/url"
  46. "strconv"
  47. "strings"
  48. gensupport "google.golang.org/api/gensupport"
  49. googleapi "google.golang.org/api/googleapi"
  50. option "google.golang.org/api/option"
  51. htransport "google.golang.org/api/transport/http"
  52. )
  53. // Always reference these packages, just in case the auto-generated code
  54. // below doesn't.
  55. var _ = bytes.NewBuffer
  56. var _ = strconv.Itoa
  57. var _ = fmt.Sprintf
  58. var _ = json.NewDecoder
  59. var _ = io.Copy
  60. var _ = url.Parse
  61. var _ = gensupport.MarshalJSON
  62. var _ = googleapi.Version
  63. var _ = errors.New
  64. var _ = strings.Replace
  65. var _ = context.Canceled
  66. const apiId = "servicebroker:v1alpha1"
  67. const apiName = "servicebroker"
  68. const apiVersion = "v1alpha1"
  69. const basePath = "https://servicebroker.googleapis.com/"
  70. // OAuth2 scopes used by this API.
  71. const (
  72. // View and manage your data across Google Cloud Platform services
  73. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  74. )
  75. // NewService creates a new Service.
  76. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
  77. scopesOption := option.WithScopes(
  78. "https://www.googleapis.com/auth/cloud-platform",
  79. )
  80. // NOTE: prepend, so we don't override user-specified scopes.
  81. opts = append([]option.ClientOption{scopesOption}, opts...)
  82. client, endpoint, err := htransport.NewClient(ctx, opts...)
  83. if err != nil {
  84. return nil, err
  85. }
  86. s, err := New(client)
  87. if err != nil {
  88. return nil, err
  89. }
  90. if endpoint != "" {
  91. s.BasePath = endpoint
  92. }
  93. return s, nil
  94. }
  95. // New creates a new Service. It uses the provided http.Client for requests.
  96. //
  97. // Deprecated: please use NewService instead.
  98. // To provide a custom HTTP client, use option.WithHTTPClient.
  99. // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
  100. func New(client *http.Client) (*Service, error) {
  101. if client == nil {
  102. return nil, errors.New("client is nil")
  103. }
  104. s := &Service{client: client, BasePath: basePath}
  105. s.Projects = NewProjectsService(s)
  106. s.V1alpha1 = NewV1alpha1Service(s)
  107. return s, nil
  108. }
  109. type Service struct {
  110. client *http.Client
  111. BasePath string // API endpoint base URL
  112. UserAgent string // optional additional User-Agent fragment
  113. Projects *ProjectsService
  114. V1alpha1 *V1alpha1Service
  115. }
  116. func (s *Service) userAgent() string {
  117. if s.UserAgent == "" {
  118. return googleapi.UserAgent
  119. }
  120. return googleapi.UserAgent + " " + s.UserAgent
  121. }
  122. func NewProjectsService(s *Service) *ProjectsService {
  123. rs := &ProjectsService{s: s}
  124. rs.Brokers = NewProjectsBrokersService(s)
  125. return rs
  126. }
  127. type ProjectsService struct {
  128. s *Service
  129. Brokers *ProjectsBrokersService
  130. }
  131. func NewProjectsBrokersService(s *Service) *ProjectsBrokersService {
  132. rs := &ProjectsBrokersService{s: s}
  133. rs.Instances = NewProjectsBrokersInstancesService(s)
  134. rs.ServiceInstances = NewProjectsBrokersServiceInstancesService(s)
  135. rs.V2 = NewProjectsBrokersV2Service(s)
  136. return rs
  137. }
  138. type ProjectsBrokersService struct {
  139. s *Service
  140. Instances *ProjectsBrokersInstancesService
  141. ServiceInstances *ProjectsBrokersServiceInstancesService
  142. V2 *ProjectsBrokersV2Service
  143. }
  144. func NewProjectsBrokersInstancesService(s *Service) *ProjectsBrokersInstancesService {
  145. rs := &ProjectsBrokersInstancesService{s: s}
  146. rs.ServiceBindings = NewProjectsBrokersInstancesServiceBindingsService(s)
  147. return rs
  148. }
  149. type ProjectsBrokersInstancesService struct {
  150. s *Service
  151. ServiceBindings *ProjectsBrokersInstancesServiceBindingsService
  152. }
  153. func NewProjectsBrokersInstancesServiceBindingsService(s *Service) *ProjectsBrokersInstancesServiceBindingsService {
  154. rs := &ProjectsBrokersInstancesServiceBindingsService{s: s}
  155. return rs
  156. }
  157. type ProjectsBrokersInstancesServiceBindingsService struct {
  158. s *Service
  159. }
  160. func NewProjectsBrokersServiceInstancesService(s *Service) *ProjectsBrokersServiceInstancesService {
  161. rs := &ProjectsBrokersServiceInstancesService{s: s}
  162. return rs
  163. }
  164. type ProjectsBrokersServiceInstancesService struct {
  165. s *Service
  166. }
  167. func NewProjectsBrokersV2Service(s *Service) *ProjectsBrokersV2Service {
  168. rs := &ProjectsBrokersV2Service{s: s}
  169. rs.Catalog = NewProjectsBrokersV2CatalogService(s)
  170. rs.ServiceInstances = NewProjectsBrokersV2ServiceInstancesService(s)
  171. return rs
  172. }
  173. type ProjectsBrokersV2Service struct {
  174. s *Service
  175. Catalog *ProjectsBrokersV2CatalogService
  176. ServiceInstances *ProjectsBrokersV2ServiceInstancesService
  177. }
  178. func NewProjectsBrokersV2CatalogService(s *Service) *ProjectsBrokersV2CatalogService {
  179. rs := &ProjectsBrokersV2CatalogService{s: s}
  180. return rs
  181. }
  182. type ProjectsBrokersV2CatalogService struct {
  183. s *Service
  184. }
  185. func NewProjectsBrokersV2ServiceInstancesService(s *Service) *ProjectsBrokersV2ServiceInstancesService {
  186. rs := &ProjectsBrokersV2ServiceInstancesService{s: s}
  187. rs.ServiceBindings = NewProjectsBrokersV2ServiceInstancesServiceBindingsService(s)
  188. return rs
  189. }
  190. type ProjectsBrokersV2ServiceInstancesService struct {
  191. s *Service
  192. ServiceBindings *ProjectsBrokersV2ServiceInstancesServiceBindingsService
  193. }
  194. func NewProjectsBrokersV2ServiceInstancesServiceBindingsService(s *Service) *ProjectsBrokersV2ServiceInstancesServiceBindingsService {
  195. rs := &ProjectsBrokersV2ServiceInstancesServiceBindingsService{s: s}
  196. return rs
  197. }
  198. type ProjectsBrokersV2ServiceInstancesServiceBindingsService struct {
  199. s *Service
  200. }
  201. func NewV1alpha1Service(s *Service) *V1alpha1Service {
  202. rs := &V1alpha1Service{s: s}
  203. return rs
  204. }
  205. type V1alpha1Service struct {
  206. s *Service
  207. }
  208. // GoogleCloudServicebrokerV1alpha1__Binding: Describes the binding.
  209. type GoogleCloudServicebrokerV1alpha1__Binding struct {
  210. // BindResource: A JSON object that contains data for platform resources
  211. // associated with
  212. // the binding to be created.
  213. BindResource googleapi.RawMessage `json:"bind_resource,omitempty"`
  214. // BindingId: The id of the binding. Must be unique within GCP
  215. // project.
  216. // Maximum length is 64, GUID recommended.
  217. // Required.
  218. BindingId string `json:"binding_id,omitempty"`
  219. // CreateTime: Output only.
  220. // Timestamp for when the binding was created.
  221. CreateTime string `json:"createTime,omitempty"`
  222. // Parameters: Configuration options for the service binding.
  223. Parameters googleapi.RawMessage `json:"parameters,omitempty"`
  224. // PlanId: The ID of the plan. See `Service` and `Plan` resources for
  225. // details.
  226. // Maximum length is 64, GUID recommended.
  227. // Required.
  228. PlanId string `json:"plan_id,omitempty"`
  229. // ServiceId: The id of the service. Must be a valid identifier of a
  230. // service
  231. // contained in the list from a `ListServices()` call.
  232. // Maximum length is 64, GUID recommended.
  233. // Required.
  234. ServiceId string `json:"service_id,omitempty"`
  235. // ForceSendFields is a list of field names (e.g. "BindResource") to
  236. // unconditionally include in API requests. By default, fields with
  237. // empty values are omitted from API requests. However, any non-pointer,
  238. // non-interface field appearing in ForceSendFields will be sent to the
  239. // server regardless of whether the field is empty or not. This may be
  240. // used to include empty fields in Patch requests.
  241. ForceSendFields []string `json:"-"`
  242. // NullFields is a list of field names (e.g. "BindResource") to include
  243. // in API requests with the JSON null value. By default, fields with
  244. // empty values are omitted from API requests. However, any field with
  245. // an empty value appearing in NullFields will be sent to the server as
  246. // null. It is an error if a field in this list has a non-empty value.
  247. // This may be used to include null fields in Patch requests.
  248. NullFields []string `json:"-"`
  249. }
  250. func (s *GoogleCloudServicebrokerV1alpha1__Binding) MarshalJSON() ([]byte, error) {
  251. type NoMethod GoogleCloudServicebrokerV1alpha1__Binding
  252. raw := NoMethod(*s)
  253. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  254. }
  255. // GoogleCloudServicebrokerV1alpha1__CreateBindingResponse: Response for
  256. // the `CreateBinding()` method.
  257. type GoogleCloudServicebrokerV1alpha1__CreateBindingResponse struct {
  258. // Credentials: Credentials to use the binding.
  259. Credentials googleapi.RawMessage `json:"credentials,omitempty"`
  260. // Description: Used to communicate description of the response. Usually
  261. // for non-standard
  262. // error
  263. // codes.
  264. // https://github.com/openservicebrokerapi/servicebroker/blob/mast
  265. // er/spec.md#service-broker-errors
  266. Description string `json:"description,omitempty"`
  267. // Operation: If broker executes operation asynchronously, this is the
  268. // operation ID that
  269. // can be polled to check the completion status of said operation.
  270. // This broker always executes all create/delete operations
  271. // asynchronously.
  272. Operation string `json:"operation,omitempty"`
  273. // RouteServiceUrl: A URL to which the platform may proxy requests for
  274. // the address sent with
  275. // bind_resource.route
  276. RouteServiceUrl string `json:"route_service_url,omitempty"`
  277. // SyslogDrainUrl: From where to read system logs.
  278. SyslogDrainUrl string `json:"syslog_drain_url,omitempty"`
  279. // VolumeMounts: An array of configuration for mounting volumes.
  280. VolumeMounts []googleapi.RawMessage `json:"volume_mounts,omitempty"`
  281. // ServerResponse contains the HTTP response code and headers from the
  282. // server.
  283. googleapi.ServerResponse `json:"-"`
  284. // ForceSendFields is a list of field names (e.g. "Credentials") to
  285. // unconditionally include in API requests. By default, fields with
  286. // empty values are omitted from API requests. However, any non-pointer,
  287. // non-interface field appearing in ForceSendFields will be sent to the
  288. // server regardless of whether the field is empty or not. This may be
  289. // used to include empty fields in Patch requests.
  290. ForceSendFields []string `json:"-"`
  291. // NullFields is a list of field names (e.g. "Credentials") to include
  292. // in API requests with the JSON null value. By default, fields with
  293. // empty values are omitted from API requests. However, any field with
  294. // an empty value appearing in NullFields will be sent to the server as
  295. // null. It is an error if a field in this list has a non-empty value.
  296. // This may be used to include null fields in Patch requests.
  297. NullFields []string `json:"-"`
  298. }
  299. func (s *GoogleCloudServicebrokerV1alpha1__CreateBindingResponse) MarshalJSON() ([]byte, error) {
  300. type NoMethod GoogleCloudServicebrokerV1alpha1__CreateBindingResponse
  301. raw := NoMethod(*s)
  302. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  303. }
  304. // GoogleCloudServicebrokerV1alpha1__CreateServiceInstanceResponse:
  305. // Response for the `CreateServiceInstance()` method.
  306. type GoogleCloudServicebrokerV1alpha1__CreateServiceInstanceResponse struct {
  307. // Description: Used to communicate description of the response. Usually
  308. // for non-standard
  309. // error
  310. // codes.
  311. // https://github.com/openservicebrokerapi/servicebroker/blob/mast
  312. // er/spec.md#service-broker-errors
  313. Description string `json:"description,omitempty"`
  314. // Operation: If broker executes operation asynchronously, this is the
  315. // operation ID that
  316. // can be polled to check the completion status of said operation.
  317. // This broker always will return a non-empty operation on success.
  318. Operation string `json:"operation,omitempty"`
  319. // ServerResponse contains the HTTP response code and headers from the
  320. // server.
  321. googleapi.ServerResponse `json:"-"`
  322. // ForceSendFields is a list of field names (e.g. "Description") to
  323. // unconditionally include in API requests. By default, fields with
  324. // empty values are omitted from API requests. However, any non-pointer,
  325. // non-interface field appearing in ForceSendFields will be sent to the
  326. // server regardless of whether the field is empty or not. This may be
  327. // used to include empty fields in Patch requests.
  328. ForceSendFields []string `json:"-"`
  329. // NullFields is a list of field names (e.g. "Description") to include
  330. // in API requests with the JSON null value. By default, fields with
  331. // empty values are omitted from API requests. However, any field with
  332. // an empty value appearing in NullFields will be sent to the server as
  333. // null. It is an error if a field in this list has a non-empty value.
  334. // This may be used to include null fields in Patch requests.
  335. NullFields []string `json:"-"`
  336. }
  337. func (s *GoogleCloudServicebrokerV1alpha1__CreateServiceInstanceResponse) MarshalJSON() ([]byte, error) {
  338. type NoMethod GoogleCloudServicebrokerV1alpha1__CreateServiceInstanceResponse
  339. raw := NoMethod(*s)
  340. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  341. }
  342. // GoogleCloudServicebrokerV1alpha1__DashboardClient: Message containing
  343. // information required to activate Dashboard SSO feature.
  344. type GoogleCloudServicebrokerV1alpha1__DashboardClient struct {
  345. // Id: The id of the Oauth client that the dashboard will use.
  346. Id string `json:"id,omitempty"`
  347. // RedirectUri: A URI for the service dashboard.
  348. // Validated by the OAuth token server when the dashboard requests a
  349. // token.
  350. RedirectUri string `json:"redirect_uri,omitempty"`
  351. // Secret: A secret for the dashboard client.
  352. Secret string `json:"secret,omitempty"`
  353. // ForceSendFields is a list of field names (e.g. "Id") to
  354. // unconditionally include in API requests. By default, fields with
  355. // empty values are omitted from API requests. However, any non-pointer,
  356. // non-interface field appearing in ForceSendFields will be sent to the
  357. // server regardless of whether the field is empty or not. This may be
  358. // used to include empty fields in Patch requests.
  359. ForceSendFields []string `json:"-"`
  360. // NullFields is a list of field names (e.g. "Id") to include in API
  361. // requests with the JSON null value. By default, fields with empty
  362. // values are omitted from API requests. However, any field with an
  363. // empty value appearing in NullFields will be sent to the server as
  364. // null. It is an error if a field in this list has a non-empty value.
  365. // This may be used to include null fields in Patch requests.
  366. NullFields []string `json:"-"`
  367. }
  368. func (s *GoogleCloudServicebrokerV1alpha1__DashboardClient) MarshalJSON() ([]byte, error) {
  369. type NoMethod GoogleCloudServicebrokerV1alpha1__DashboardClient
  370. raw := NoMethod(*s)
  371. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  372. }
  373. // GoogleCloudServicebrokerV1alpha1__DeleteBindingResponse: Response for
  374. // the `DeleteBinding()` method.
  375. type GoogleCloudServicebrokerV1alpha1__DeleteBindingResponse struct {
  376. // Description: Used to communicate description of the response. Usually
  377. // for non-standard
  378. // error
  379. // codes.
  380. // https://github.com/openservicebrokerapi/servicebroker/blob/mast
  381. // er/spec.md#service-broker-errors
  382. Description string `json:"description,omitempty"`
  383. // Operation: If broker executes operation asynchronously, this is the
  384. // operation ID that
  385. // can be polled to check the completion status of said operation.
  386. Operation string `json:"operation,omitempty"`
  387. // ServerResponse contains the HTTP response code and headers from the
  388. // server.
  389. googleapi.ServerResponse `json:"-"`
  390. // ForceSendFields is a list of field names (e.g. "Description") to
  391. // unconditionally include in API requests. By default, fields with
  392. // empty values are omitted from API requests. However, any non-pointer,
  393. // non-interface field appearing in ForceSendFields will be sent to the
  394. // server regardless of whether the field is empty or not. This may be
  395. // used to include empty fields in Patch requests.
  396. ForceSendFields []string `json:"-"`
  397. // NullFields is a list of field names (e.g. "Description") to include
  398. // in API requests with the JSON null value. By default, fields with
  399. // empty values are omitted from API requests. However, any field with
  400. // an empty value appearing in NullFields will be sent to the server as
  401. // null. It is an error if a field in this list has a non-empty value.
  402. // This may be used to include null fields in Patch requests.
  403. NullFields []string `json:"-"`
  404. }
  405. func (s *GoogleCloudServicebrokerV1alpha1__DeleteBindingResponse) MarshalJSON() ([]byte, error) {
  406. type NoMethod GoogleCloudServicebrokerV1alpha1__DeleteBindingResponse
  407. raw := NoMethod(*s)
  408. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  409. }
  410. // GoogleCloudServicebrokerV1alpha1__DeleteServiceInstanceResponse:
  411. // Response for the `DeleteServiceInstance()` method.
  412. type GoogleCloudServicebrokerV1alpha1__DeleteServiceInstanceResponse struct {
  413. // Description: Used to communicate description of the response. Usually
  414. // for non-standard
  415. // error
  416. // codes.
  417. // https://github.com/openservicebrokerapi/servicebroker/blob/mast
  418. // er/spec.md#service-broker-errors
  419. Description string `json:"description,omitempty"`
  420. // Operation: If broker executes operation asynchronously, this is the
  421. // operation ID that
  422. // can be polled to check the completion status of said operation.
  423. Operation string `json:"operation,omitempty"`
  424. // ServerResponse contains the HTTP response code and headers from the
  425. // server.
  426. googleapi.ServerResponse `json:"-"`
  427. // ForceSendFields is a list of field names (e.g. "Description") to
  428. // unconditionally include in API requests. By default, fields with
  429. // empty values are omitted from API requests. However, any non-pointer,
  430. // non-interface field appearing in ForceSendFields will be sent to the
  431. // server regardless of whether the field is empty or not. This may be
  432. // used to include empty fields in Patch requests.
  433. ForceSendFields []string `json:"-"`
  434. // NullFields is a list of field names (e.g. "Description") to include
  435. // in API requests with the JSON null value. By default, fields with
  436. // empty values are omitted from API requests. However, any field with
  437. // an empty value appearing in NullFields will be sent to the server as
  438. // null. It is an error if a field in this list has a non-empty value.
  439. // This may be used to include null fields in Patch requests.
  440. NullFields []string `json:"-"`
  441. }
  442. func (s *GoogleCloudServicebrokerV1alpha1__DeleteServiceInstanceResponse) MarshalJSON() ([]byte, error) {
  443. type NoMethod GoogleCloudServicebrokerV1alpha1__DeleteServiceInstanceResponse
  444. raw := NoMethod(*s)
  445. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  446. }
  447. // GoogleCloudServicebrokerV1alpha1__GetBindingResponse: Response for
  448. // the `GetBinding()` method.
  449. type GoogleCloudServicebrokerV1alpha1__GetBindingResponse struct {
  450. // Credentials: Credentials to use the binding.
  451. Credentials googleapi.RawMessage `json:"credentials,omitempty"`
  452. // Description: Used to communicate description of the response. Usually
  453. // for non-standard
  454. // error
  455. // codes.
  456. // https://github.com/openservicebrokerapi/servicebroker/blob/mast
  457. // er/spec.md#service-broker-errors
  458. Description string `json:"description,omitempty"`
  459. // RouteServiceUrl: A URL to which the platform may proxy requests for
  460. // the address sent with
  461. // bind_resource.route
  462. RouteServiceUrl string `json:"route_service_url,omitempty"`
  463. // SyslogDrainUrl: From where to read system logs.
  464. SyslogDrainUrl string `json:"syslog_drain_url,omitempty"`
  465. // VolumeMounts: An array of configuration for mounting volumes.
  466. VolumeMounts []googleapi.RawMessage `json:"volume_mounts,omitempty"`
  467. // ServerResponse contains the HTTP response code and headers from the
  468. // server.
  469. googleapi.ServerResponse `json:"-"`
  470. // ForceSendFields is a list of field names (e.g. "Credentials") to
  471. // unconditionally include in API requests. By default, fields with
  472. // empty values are omitted from API requests. However, any non-pointer,
  473. // non-interface field appearing in ForceSendFields will be sent to the
  474. // server regardless of whether the field is empty or not. This may be
  475. // used to include empty fields in Patch requests.
  476. ForceSendFields []string `json:"-"`
  477. // NullFields is a list of field names (e.g. "Credentials") to include
  478. // in API requests with the JSON null value. By default, fields with
  479. // empty values are omitted from API requests. However, any field with
  480. // an empty value appearing in NullFields will be sent to the server as
  481. // null. It is an error if a field in this list has a non-empty value.
  482. // This may be used to include null fields in Patch requests.
  483. NullFields []string `json:"-"`
  484. }
  485. func (s *GoogleCloudServicebrokerV1alpha1__GetBindingResponse) MarshalJSON() ([]byte, error) {
  486. type NoMethod GoogleCloudServicebrokerV1alpha1__GetBindingResponse
  487. raw := NoMethod(*s)
  488. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  489. }
  490. // GoogleCloudServicebrokerV1alpha1__ListBindingsResponse: The response
  491. // for the `ListBindings()` method.
  492. type GoogleCloudServicebrokerV1alpha1__ListBindingsResponse struct {
  493. // Bindings: The list of the bindings in the instance.
  494. Bindings []*GoogleCloudServicebrokerV1alpha1__Binding `json:"bindings,omitempty"`
  495. // Description: Used to communicate description of the response. Usually
  496. // for non-standard
  497. // error
  498. // codes.
  499. // https://github.com/openservicebrokerapi/servicebroker/blob/mast
  500. // er/spec.md#service-broker-errors
  501. Description string `json:"description,omitempty"`
  502. // NextPageToken: This token allows you to get the next page of results
  503. // for list requests.
  504. // If the number of results is larger than `pageSize`, use the
  505. // `nextPageToken`
  506. // as a value for the query parameter `pageToken` in the next list
  507. // request.
  508. // Subsequent list requests will have their own `nextPageToken` to
  509. // continue
  510. // paging through the results
  511. NextPageToken string `json:"nextPageToken,omitempty"`
  512. // ServerResponse contains the HTTP response code and headers from the
  513. // server.
  514. googleapi.ServerResponse `json:"-"`
  515. // ForceSendFields is a list of field names (e.g. "Bindings") to
  516. // unconditionally include in API requests. By default, fields with
  517. // empty values are omitted from API requests. However, any non-pointer,
  518. // non-interface field appearing in ForceSendFields will be sent to the
  519. // server regardless of whether the field is empty or not. This may be
  520. // used to include empty fields in Patch requests.
  521. ForceSendFields []string `json:"-"`
  522. // NullFields is a list of field names (e.g. "Bindings") to include in
  523. // API requests with the JSON null value. By default, fields with empty
  524. // values are omitted from API requests. However, any field with an
  525. // empty value appearing in NullFields will be sent to the server as
  526. // null. It is an error if a field in this list has a non-empty value.
  527. // This may be used to include null fields in Patch requests.
  528. NullFields []string `json:"-"`
  529. }
  530. func (s *GoogleCloudServicebrokerV1alpha1__ListBindingsResponse) MarshalJSON() ([]byte, error) {
  531. type NoMethod GoogleCloudServicebrokerV1alpha1__ListBindingsResponse
  532. raw := NoMethod(*s)
  533. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  534. }
  535. // GoogleCloudServicebrokerV1alpha1__ListCatalogResponse: Response
  536. // message for the `ListCatalog()` method.
  537. type GoogleCloudServicebrokerV1alpha1__ListCatalogResponse struct {
  538. // Description: Used to communicate description of the response. Usually
  539. // for non-standard
  540. // error
  541. // codes.
  542. // https://github.com/openservicebrokerapi/servicebroker/blob/mast
  543. // er/spec.md#service-broker-errors
  544. Description string `json:"description,omitempty"`
  545. // NextPageToken: This token allows you to get the next page of results
  546. // for list requests.
  547. // If the number of results is larger than `pageSize`, use the
  548. // `nextPageToken`
  549. // as a value for the query parameter `pageToken` in the next list
  550. // request.
  551. // Subsequent list requests will have their own `nextPageToken` to
  552. // continue
  553. // paging through the results
  554. NextPageToken string `json:"nextPageToken,omitempty"`
  555. // Services: The services available for the requested GCP project.
  556. Services []*GoogleCloudServicebrokerV1alpha1__Service `json:"services,omitempty"`
  557. // ServerResponse contains the HTTP response code and headers from the
  558. // server.
  559. googleapi.ServerResponse `json:"-"`
  560. // ForceSendFields is a list of field names (e.g. "Description") to
  561. // unconditionally include in API requests. By default, fields with
  562. // empty values are omitted from API requests. However, any non-pointer,
  563. // non-interface field appearing in ForceSendFields will be sent to the
  564. // server regardless of whether the field is empty or not. This may be
  565. // used to include empty fields in Patch requests.
  566. ForceSendFields []string `json:"-"`
  567. // NullFields is a list of field names (e.g. "Description") to include
  568. // in API requests with the JSON null value. By default, fields with
  569. // empty values are omitted from API requests. However, any field with
  570. // an empty value appearing in NullFields will be sent to the server as
  571. // null. It is an error if a field in this list has a non-empty value.
  572. // This may be used to include null fields in Patch requests.
  573. NullFields []string `json:"-"`
  574. }
  575. func (s *GoogleCloudServicebrokerV1alpha1__ListCatalogResponse) MarshalJSON() ([]byte, error) {
  576. type NoMethod GoogleCloudServicebrokerV1alpha1__ListCatalogResponse
  577. raw := NoMethod(*s)
  578. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  579. }
  580. // GoogleCloudServicebrokerV1alpha1__ListServiceInstancesResponse: The
  581. // response for the `ListServiceInstances()` method.
  582. type GoogleCloudServicebrokerV1alpha1__ListServiceInstancesResponse struct {
  583. // Description: Used to communicate description of the response. Usually
  584. // for non-standard
  585. // error
  586. // codes.
  587. // https://github.com/openservicebrokerapi/servicebroker/blob/mast
  588. // er/spec.md#service-broker-errors
  589. Description string `json:"description,omitempty"`
  590. // Instances: The list of the instances in the broker.
  591. Instances []*GoogleCloudServicebrokerV1alpha1__ServiceInstance `json:"instances,omitempty"`
  592. // NextPageToken: This token allows you to get the next page of results
  593. // for list requests.
  594. // If the number of results is larger than `pageSize`, use the
  595. // `nextPageToken`
  596. // as a value for the query parameter `pageToken` in the next list
  597. // request.
  598. // Subsequent list requests will have their own `nextPageToken` to
  599. // continue
  600. // paging through the results
  601. NextPageToken string `json:"nextPageToken,omitempty"`
  602. // ServerResponse contains the HTTP response code and headers from the
  603. // server.
  604. googleapi.ServerResponse `json:"-"`
  605. // ForceSendFields is a list of field names (e.g. "Description") to
  606. // unconditionally include in API requests. By default, fields with
  607. // empty values are omitted from API requests. However, any non-pointer,
  608. // non-interface field appearing in ForceSendFields will be sent to the
  609. // server regardless of whether the field is empty or not. This may be
  610. // used to include empty fields in Patch requests.
  611. ForceSendFields []string `json:"-"`
  612. // NullFields is a list of field names (e.g. "Description") to include
  613. // in API requests with the JSON null value. By default, fields with
  614. // empty values are omitted from API requests. However, any field with
  615. // an empty value appearing in NullFields will be sent to the server as
  616. // null. It is an error if a field in this list has a non-empty value.
  617. // This may be used to include null fields in Patch requests.
  618. NullFields []string `json:"-"`
  619. }
  620. func (s *GoogleCloudServicebrokerV1alpha1__ListServiceInstancesResponse) MarshalJSON() ([]byte, error) {
  621. type NoMethod GoogleCloudServicebrokerV1alpha1__ListServiceInstancesResponse
  622. raw := NoMethod(*s)
  623. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  624. }
  625. // GoogleCloudServicebrokerV1alpha1__Operation: Describes a long running
  626. // operation, which conforms to OpenService API.
  627. type GoogleCloudServicebrokerV1alpha1__Operation struct {
  628. // Description: Optional description of the Operation state.
  629. Description string `json:"description,omitempty"`
  630. // State: The state of the operation.
  631. // Valid values are: "in progress", "succeeded", and "failed".
  632. State string `json:"state,omitempty"`
  633. // ServerResponse contains the HTTP response code and headers from the
  634. // server.
  635. googleapi.ServerResponse `json:"-"`
  636. // ForceSendFields is a list of field names (e.g. "Description") to
  637. // unconditionally include in API requests. By default, fields with
  638. // empty values are omitted from API requests. However, any non-pointer,
  639. // non-interface field appearing in ForceSendFields will be sent to the
  640. // server regardless of whether the field is empty or not. This may be
  641. // used to include empty fields in Patch requests.
  642. ForceSendFields []string `json:"-"`
  643. // NullFields is a list of field names (e.g. "Description") to include
  644. // in API requests with the JSON null value. By default, fields with
  645. // empty values are omitted from API requests. However, any field with
  646. // an empty value appearing in NullFields will be sent to the server as
  647. // null. It is an error if a field in this list has a non-empty value.
  648. // This may be used to include null fields in Patch requests.
  649. NullFields []string `json:"-"`
  650. }
  651. func (s *GoogleCloudServicebrokerV1alpha1__Operation) MarshalJSON() ([]byte, error) {
  652. type NoMethod GoogleCloudServicebrokerV1alpha1__Operation
  653. raw := NoMethod(*s)
  654. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  655. }
  656. // GoogleCloudServicebrokerV1alpha1__Plan: Plan message describes a
  657. // Service Plan.
  658. type GoogleCloudServicebrokerV1alpha1__Plan struct {
  659. // Bindable: Specifies whether instances of the service can be bound to
  660. // applications.
  661. // If not specified, `Service.bindable` will be presumed.
  662. Bindable bool `json:"bindable,omitempty"`
  663. // Description: Textual description of the plan. Optional.
  664. Description string `json:"description,omitempty"`
  665. // Free: Whether the service is free.
  666. Free bool `json:"free,omitempty"`
  667. // Id: ID is a globally unique identifier used to uniquely identify the
  668. // plan.
  669. // User must make no presumption about the format of this field.
  670. Id string `json:"id,omitempty"`
  671. // Metadata: A list of metadata for a service offering.
  672. // Metadata is an arbitrary JSON object.
  673. Metadata googleapi.RawMessage `json:"metadata,omitempty"`
  674. // Name: User friendly name of the plan.
  675. // The name must be globally unique within GCP project.
  676. // Note, which is different from ("This must be globally unique within
  677. // a
  678. // platform marketplace").
  679. Name string `json:"name,omitempty"`
  680. // Schemas: Schema definitions for service instances and bindings for
  681. // the plan.
  682. Schemas googleapi.RawMessage `json:"schemas,omitempty"`
  683. // ForceSendFields is a list of field names (e.g. "Bindable") to
  684. // unconditionally include in API requests. By default, fields with
  685. // empty values are omitted from API requests. However, any non-pointer,
  686. // non-interface field appearing in ForceSendFields will be sent to the
  687. // server regardless of whether the field is empty or not. This may be
  688. // used to include empty fields in Patch requests.
  689. ForceSendFields []string `json:"-"`
  690. // NullFields is a list of field names (e.g. "Bindable") to include in
  691. // API requests with the JSON null value. By default, fields with empty
  692. // values are omitted from API requests. However, any field with an
  693. // empty value appearing in NullFields will be sent to the server as
  694. // null. It is an error if a field in this list has a non-empty value.
  695. // This may be used to include null fields in Patch requests.
  696. NullFields []string `json:"-"`
  697. }
  698. func (s *GoogleCloudServicebrokerV1alpha1__Plan) MarshalJSON() ([]byte, error) {
  699. type NoMethod GoogleCloudServicebrokerV1alpha1__Plan
  700. raw := NoMethod(*s)
  701. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  702. }
  703. // GoogleCloudServicebrokerV1alpha1__Service: The resource model mostly
  704. // follows the Open Service Broker API, as
  705. // described
  706. // here:
  707. // https://github.com/openservicebrokerapi/servicebroker/blob/maste
  708. // r/_spec.md
  709. // Though due to Google Specifics it has additional optional fields.
  710. type GoogleCloudServicebrokerV1alpha1__Service struct {
  711. // Bindable: Specifies whether instances of the service can be bound to
  712. // applications.
  713. // Required.
  714. Bindable bool `json:"bindable,omitempty"`
  715. // BindingRetrievable: Whether the service provides an endpoint to get
  716. // service bindings.
  717. BindingRetrievable bool `json:"binding_retrievable,omitempty"`
  718. // DashboardClient: Information to activate Dashboard SSO feature.
  719. DashboardClient *GoogleCloudServicebrokerV1alpha1__DashboardClient `json:"dashboard_client,omitempty"`
  720. // Description: Textual description of the service. Required.
  721. Description string `json:"description,omitempty"`
  722. // Id: ID is a globally unique identifier used to uniquely identify the
  723. // service.
  724. // ID is an opaque string.
  725. Id string `json:"id,omitempty"`
  726. // InstanceRetrievable: Whether the service provides an endpoint to get
  727. // service instances.
  728. InstanceRetrievable bool `json:"instance_retrievable,omitempty"`
  729. // Metadata: A list of metadata for a service offering.
  730. // Metadata is an arbitrary JSON object.
  731. Metadata googleapi.RawMessage `json:"metadata,omitempty"`
  732. // Name: User friendly service name.
  733. // Name must match [a-z0-9]+ regexp.
  734. // The name must be globally unique within GCP project.
  735. // Note, which is different from ("This must be globally unique within
  736. // a
  737. // platform marketplace").
  738. // Required.
  739. Name string `json:"name,omitempty"`
  740. // PlanUpdateable: Whether the service supports upgrade/downgrade for
  741. // some plans.
  742. PlanUpdateable bool `json:"plan_updateable,omitempty"`
  743. // Plans: A list of plans for this service.
  744. // At least one plan is required.
  745. Plans []*GoogleCloudServicebrokerV1alpha1__Plan `json:"plans,omitempty"`
  746. // Tags: Tags provide a flexible mechanism to expose a classification,
  747. // attribute, or
  748. // base technology of a service.
  749. Tags []string `json:"tags,omitempty"`
  750. // ForceSendFields is a list of field names (e.g. "Bindable") to
  751. // unconditionally include in API requests. By default, fields with
  752. // empty values are omitted from API requests. However, any non-pointer,
  753. // non-interface field appearing in ForceSendFields will be sent to the
  754. // server regardless of whether the field is empty or not. This may be
  755. // used to include empty fields in Patch requests.
  756. ForceSendFields []string `json:"-"`
  757. // NullFields is a list of field names (e.g. "Bindable") to include in
  758. // API requests with the JSON null value. By default, fields with empty
  759. // values are omitted from API requests. However, any field with an
  760. // empty value appearing in NullFields will be sent to the server as
  761. // null. It is an error if a field in this list has a non-empty value.
  762. // This may be used to include null fields in Patch requests.
  763. NullFields []string `json:"-"`
  764. }
  765. func (s *GoogleCloudServicebrokerV1alpha1__Service) MarshalJSON() ([]byte, error) {
  766. type NoMethod GoogleCloudServicebrokerV1alpha1__Service
  767. raw := NoMethod(*s)
  768. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  769. }
  770. // GoogleCloudServicebrokerV1alpha1__ServiceInstance: Message describing
  771. // inputs to Provision and Update Service instance requests.
  772. type GoogleCloudServicebrokerV1alpha1__ServiceInstance struct {
  773. // Context: Platform specific contextual information under which the
  774. // service instance
  775. // is to be provisioned. This replaces organization_guid and
  776. // space_guid.
  777. // But can also contain anything.
  778. // Currently only used for logging context information.
  779. Context googleapi.RawMessage `json:"context,omitempty"`
  780. // CreateTime: Output only.
  781. // Timestamp for when the instance was created.
  782. CreateTime string `json:"createTime,omitempty"`
  783. // DeploymentName: Output only.
  784. // Name of the Deployment Manager deployment used for provisioning of
  785. // this
  786. // service instance.
  787. DeploymentName string `json:"deploymentName,omitempty"`
  788. // InstanceId: The id of the service instance. Must be unique within GCP
  789. // project.
  790. // Maximum length is 64, GUID recommended.
  791. // Required.
  792. InstanceId string `json:"instance_id,omitempty"`
  793. // OrganizationGuid: The platform GUID for the organization under which
  794. // the service is to be
  795. // provisioned.
  796. // Required.
  797. OrganizationGuid string `json:"organization_guid,omitempty"`
  798. // Parameters: Configuration options for the service
  799. // instance.
  800. // Parameters is JSON object serialized to string.
  801. Parameters googleapi.RawMessage `json:"parameters,omitempty"`
  802. // PlanId: The ID of the plan. See `Service` and `Plan` resources for
  803. // details.
  804. // Maximum length is 64, GUID recommended.
  805. // Required.
  806. PlanId string `json:"plan_id,omitempty"`
  807. // PreviousValues: Used only in UpdateServiceInstance request to
  808. // optionally specify previous
  809. // fields.
  810. PreviousValues googleapi.RawMessage `json:"previous_values,omitempty"`
  811. // ResourceName: Output only.
  812. // The resource name of the instance,
  813. // e.g.
  814. // projects/project_id/brokers/broker_id/service_instances/instance_
  815. // id
  816. ResourceName string `json:"resourceName,omitempty"`
  817. // ServiceId: The id of the service. Must be a valid identifier of a
  818. // service
  819. // contained in the list from a `ListServices()` call.
  820. // Maximum length is 64, GUID recommended.
  821. // Required.
  822. ServiceId string `json:"service_id,omitempty"`
  823. // SpaceGuid: The identifier for the project space within the platform
  824. // organization.
  825. // Required.
  826. SpaceGuid string `json:"space_guid,omitempty"`
  827. // ServerResponse contains the HTTP response code and headers from the
  828. // server.
  829. googleapi.ServerResponse `json:"-"`
  830. // ForceSendFields is a list of field names (e.g. "Context") 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. "Context") to include in
  838. // API 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 *GoogleCloudServicebrokerV1alpha1__ServiceInstance) MarshalJSON() ([]byte, error) {
  846. type NoMethod GoogleCloudServicebrokerV1alpha1__ServiceInstance
  847. raw := NoMethod(*s)
  848. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  849. }
  850. // GoogleCloudServicebrokerV1alpha1__UpdateServiceInstanceResponse:
  851. // Response for the `UpdateServiceInstance()` method.
  852. type GoogleCloudServicebrokerV1alpha1__UpdateServiceInstanceResponse struct {
  853. // Description: Used to communicate description of the response. Usually
  854. // for non-standard
  855. // error
  856. // codes.
  857. // https://github.com/openservicebrokerapi/servicebroker/blob/mast
  858. // er/spec.md#service-broker-errors
  859. Description string `json:"description,omitempty"`
  860. // Operation: If broker executes operation asynchronously, this is the
  861. // operation ID that
  862. // can be polled to check the completion status of said operation.
  863. Operation string `json:"operation,omitempty"`
  864. // ServerResponse contains the HTTP response code and headers from the
  865. // server.
  866. googleapi.ServerResponse `json:"-"`
  867. // ForceSendFields is a list of field names (e.g. "Description") to
  868. // unconditionally include in API requests. By default, fields with
  869. // empty values are omitted from API requests. However, any non-pointer,
  870. // non-interface field appearing in ForceSendFields will be sent to the
  871. // server regardless of whether the field is empty or not. This may be
  872. // used to include empty fields in Patch requests.
  873. ForceSendFields []string `json:"-"`
  874. // NullFields is a list of field names (e.g. "Description") to include
  875. // in API requests with the JSON null value. By default, fields with
  876. // empty values are omitted from API requests. However, any field with
  877. // an empty value appearing in NullFields will be sent to the server as
  878. // null. It is an error if a field in this list has a non-empty value.
  879. // This may be used to include null fields in Patch requests.
  880. NullFields []string `json:"-"`
  881. }
  882. func (s *GoogleCloudServicebrokerV1alpha1__UpdateServiceInstanceResponse) MarshalJSON() ([]byte, error) {
  883. type NoMethod GoogleCloudServicebrokerV1alpha1__UpdateServiceInstanceResponse
  884. raw := NoMethod(*s)
  885. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  886. }
  887. // GoogleIamV1__Binding: Associates `members` with a `role`.
  888. type GoogleIamV1__Binding struct {
  889. // Condition: Unimplemented. The condition that is associated with this
  890. // binding.
  891. // NOTE: an unsatisfied condition will not allow user access via
  892. // current
  893. // binding. Different bindings, including their conditions, are
  894. // examined
  895. // independently.
  896. Condition *GoogleType__Expr `json:"condition,omitempty"`
  897. // Members: Specifies the identities requesting access for a Cloud
  898. // Platform resource.
  899. // `members` can have the following values:
  900. //
  901. // * `allUsers`: A special identifier that represents anyone who is
  902. // on the internet; with or without a Google account.
  903. //
  904. // * `allAuthenticatedUsers`: A special identifier that represents
  905. // anyone
  906. // who is authenticated with a Google account or a service
  907. // account.
  908. //
  909. // * `user:{emailid}`: An email address that represents a specific
  910. // Google
  911. // account. For example, `alice@gmail.com` .
  912. //
  913. //
  914. // * `serviceAccount:{emailid}`: An email address that represents a
  915. // service
  916. // account. For example,
  917. // `my-other-app@appspot.gserviceaccount.com`.
  918. //
  919. // * `group:{emailid}`: An email address that represents a Google
  920. // group.
  921. // For example, `admins@example.com`.
  922. //
  923. //
  924. // * `domain:{domain}`: A Google Apps domain name that represents all
  925. // the
  926. // users of that domain. For example, `google.com` or
  927. // `example.com`.
  928. //
  929. //
  930. Members []string `json:"members,omitempty"`
  931. // Role: Role that is assigned to `members`.
  932. // For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
  933. Role string `json:"role,omitempty"`
  934. // ForceSendFields is a list of field names (e.g. "Condition") to
  935. // unconditionally include in API requests. By default, fields with
  936. // empty values are omitted from API requests. However, any non-pointer,
  937. // non-interface field appearing in ForceSendFields will be sent to the
  938. // server regardless of whether the field is empty or not. This may be
  939. // used to include empty fields in Patch requests.
  940. ForceSendFields []string `json:"-"`
  941. // NullFields is a list of field names (e.g. "Condition") to include in
  942. // API requests with the JSON null value. By default, fields with empty
  943. // values are omitted from API requests. However, any field with an
  944. // empty value appearing in NullFields will be sent to the server as
  945. // null. It is an error if a field in this list has a non-empty value.
  946. // This may be used to include null fields in Patch requests.
  947. NullFields []string `json:"-"`
  948. }
  949. func (s *GoogleIamV1__Binding) MarshalJSON() ([]byte, error) {
  950. type NoMethod GoogleIamV1__Binding
  951. raw := NoMethod(*s)
  952. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  953. }
  954. // GoogleIamV1__Policy: Defines an Identity and Access Management (IAM)
  955. // policy. It is used to
  956. // specify access control policies for Cloud Platform resources.
  957. //
  958. //
  959. // A `Policy` consists of a list of `bindings`. A `binding` binds a list
  960. // of
  961. // `members` to a `role`, where the members can be user accounts, Google
  962. // groups,
  963. // Google domains, and service accounts. A `role` is a named list of
  964. // permissions
  965. // defined by IAM.
  966. //
  967. // **JSON Example**
  968. //
  969. // {
  970. // "bindings": [
  971. // {
  972. // "role": "roles/owner",
  973. // "members": [
  974. // "user:mike@example.com",
  975. // "group:admins@example.com",
  976. // "domain:google.com",
  977. //
  978. // "serviceAccount:my-other-app@appspot.gserviceaccount.com"
  979. // ]
  980. // },
  981. // {
  982. // "role": "roles/viewer",
  983. // "members": ["user:sean@example.com"]
  984. // }
  985. // ]
  986. // }
  987. //
  988. // **YAML Example**
  989. //
  990. // bindings:
  991. // - members:
  992. // - user:mike@example.com
  993. // - group:admins@example.com
  994. // - domain:google.com
  995. // - serviceAccount:my-other-app@appspot.gserviceaccount.com
  996. // role: roles/owner
  997. // - members:
  998. // - user:sean@example.com
  999. // role: roles/viewer
  1000. //
  1001. //
  1002. // For a description of IAM and its features, see the
  1003. // [IAM developer's guide](https://cloud.google.com/iam/docs).
  1004. type GoogleIamV1__Policy struct {
  1005. // Bindings: Associates a list of `members` to a `role`.
  1006. // `bindings` with no members will result in an error.
  1007. Bindings []*GoogleIamV1__Binding `json:"bindings,omitempty"`
  1008. // Etag: `etag` is used for optimistic concurrency control as a way to
  1009. // help
  1010. // prevent simultaneous updates of a policy from overwriting each
  1011. // other.
  1012. // It is strongly suggested that systems make use of the `etag` in
  1013. // the
  1014. // read-modify-write cycle to perform policy updates in order to avoid
  1015. // race
  1016. // conditions: An `etag` is returned in the response to `getIamPolicy`,
  1017. // and
  1018. // systems are expected to put that etag in the request to
  1019. // `setIamPolicy` to
  1020. // ensure that their change will be applied to the same version of the
  1021. // policy.
  1022. //
  1023. // If no `etag` is provided in the call to `setIamPolicy`, then the
  1024. // existing
  1025. // policy is overwritten blindly.
  1026. Etag string `json:"etag,omitempty"`
  1027. // Version: Deprecated.
  1028. Version int64 `json:"version,omitempty"`
  1029. // ServerResponse contains the HTTP response code and headers from the
  1030. // server.
  1031. googleapi.ServerResponse `json:"-"`
  1032. // ForceSendFields is a list of field names (e.g. "Bindings") to
  1033. // unconditionally include in API requests. By default, fields with
  1034. // empty values are omitted from API requests. However, any non-pointer,
  1035. // non-interface field appearing in ForceSendFields will be sent to the
  1036. // server regardless of whether the field is empty or not. This may be
  1037. // used to include empty fields in Patch requests.
  1038. ForceSendFields []string `json:"-"`
  1039. // NullFields is a list of field names (e.g. "Bindings") to include in
  1040. // API requests with the JSON null value. By default, fields with empty
  1041. // values are omitted from API requests. However, any field with an
  1042. // empty value appearing in NullFields will be sent to the server as
  1043. // null. It is an error if a field in this list has a non-empty value.
  1044. // This may be used to include null fields in Patch requests.
  1045. NullFields []string `json:"-"`
  1046. }
  1047. func (s *GoogleIamV1__Policy) MarshalJSON() ([]byte, error) {
  1048. type NoMethod GoogleIamV1__Policy
  1049. raw := NoMethod(*s)
  1050. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1051. }
  1052. // GoogleIamV1__SetIamPolicyRequest: Request message for `SetIamPolicy`
  1053. // method.
  1054. type GoogleIamV1__SetIamPolicyRequest struct {
  1055. // Policy: REQUIRED: The complete policy to be applied to the
  1056. // `resource`. The size of
  1057. // the policy is limited to a few 10s of KB. An empty policy is a
  1058. // valid policy but certain Cloud Platform services (such as
  1059. // Projects)
  1060. // might reject them.
  1061. Policy *GoogleIamV1__Policy `json:"policy,omitempty"`
  1062. // ForceSendFields is a list of field names (e.g. "Policy") to
  1063. // unconditionally include in API requests. By default, fields with
  1064. // empty values are omitted from API requests. However, any non-pointer,
  1065. // non-interface field appearing in ForceSendFields will be sent to the
  1066. // server regardless of whether the field is empty or not. This may be
  1067. // used to include empty fields in Patch requests.
  1068. ForceSendFields []string `json:"-"`
  1069. // NullFields is a list of field names (e.g. "Policy") to include in API
  1070. // requests with the JSON null value. By default, fields with empty
  1071. // values are omitted from API requests. However, any field with an
  1072. // empty value appearing in NullFields will be sent to the server as
  1073. // null. It is an error if a field in this list has a non-empty value.
  1074. // This may be used to include null fields in Patch requests.
  1075. NullFields []string `json:"-"`
  1076. }
  1077. func (s *GoogleIamV1__SetIamPolicyRequest) MarshalJSON() ([]byte, error) {
  1078. type NoMethod GoogleIamV1__SetIamPolicyRequest
  1079. raw := NoMethod(*s)
  1080. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1081. }
  1082. // GoogleIamV1__TestIamPermissionsRequest: Request message for
  1083. // `TestIamPermissions` method.
  1084. type GoogleIamV1__TestIamPermissionsRequest struct {
  1085. // Permissions: The set of permissions to check for the `resource`.
  1086. // Permissions with
  1087. // wildcards (such as '*' or 'storage.*') are not allowed. For
  1088. // more
  1089. // information see
  1090. // [IAM
  1091. // Overview](https://cloud.google.com/iam/docs/overview#permissions).
  1092. Permissions []string `json:"permissions,omitempty"`
  1093. // ForceSendFields is a list of field names (e.g. "Permissions") to
  1094. // unconditionally include in API requests. By default, fields with
  1095. // empty values are omitted from API requests. However, any non-pointer,
  1096. // non-interface field appearing in ForceSendFields will be sent to the
  1097. // server regardless of whether the field is empty or not. This may be
  1098. // used to include empty fields in Patch requests.
  1099. ForceSendFields []string `json:"-"`
  1100. // NullFields is a list of field names (e.g. "Permissions") to include
  1101. // in API requests with the JSON null value. By default, fields with
  1102. // empty values are omitted from API requests. However, any field with
  1103. // an empty value appearing in NullFields will be sent to the server as
  1104. // null. It is an error if a field in this list has a non-empty value.
  1105. // This may be used to include null fields in Patch requests.
  1106. NullFields []string `json:"-"`
  1107. }
  1108. func (s *GoogleIamV1__TestIamPermissionsRequest) MarshalJSON() ([]byte, error) {
  1109. type NoMethod GoogleIamV1__TestIamPermissionsRequest
  1110. raw := NoMethod(*s)
  1111. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1112. }
  1113. // GoogleIamV1__TestIamPermissionsResponse: Response message for
  1114. // `TestIamPermissions` method.
  1115. type GoogleIamV1__TestIamPermissionsResponse struct {
  1116. // Permissions: A subset of `TestPermissionsRequest.permissions` that
  1117. // the caller is
  1118. // allowed.
  1119. Permissions []string `json:"permissions,omitempty"`
  1120. // ServerResponse contains the HTTP response code and headers from the
  1121. // server.
  1122. googleapi.ServerResponse `json:"-"`
  1123. // ForceSendFields is a list of field names (e.g. "Permissions") to
  1124. // unconditionally include in API requests. By default, fields with
  1125. // empty values are omitted from API requests. However, any non-pointer,
  1126. // non-interface field appearing in ForceSendFields will be sent to the
  1127. // server regardless of whether the field is empty or not. This may be
  1128. // used to include empty fields in Patch requests.
  1129. ForceSendFields []string `json:"-"`
  1130. // NullFields is a list of field names (e.g. "Permissions") to include
  1131. // in API requests with the JSON null value. By default, fields with
  1132. // empty values are omitted from API requests. However, any field with
  1133. // an empty value appearing in NullFields will be sent to the server as
  1134. // null. It is an error if a field in this list has a non-empty value.
  1135. // This may be used to include null fields in Patch requests.
  1136. NullFields []string `json:"-"`
  1137. }
  1138. func (s *GoogleIamV1__TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
  1139. type NoMethod GoogleIamV1__TestIamPermissionsResponse
  1140. raw := NoMethod(*s)
  1141. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1142. }
  1143. // GoogleType__Expr: Represents an expression text. Example:
  1144. //
  1145. // title: "User account presence"
  1146. // description: "Determines whether the request has a user account"
  1147. // expression: "size(request.user) > 0"
  1148. type GoogleType__Expr struct {
  1149. // Description: An optional description of the expression. This is a
  1150. // longer text which
  1151. // describes the expression, e.g. when hovered over it in a UI.
  1152. Description string `json:"description,omitempty"`
  1153. // Expression: Textual representation of an expression in
  1154. // Common Expression Language syntax.
  1155. //
  1156. // The application context of the containing message determines
  1157. // which
  1158. // well-known feature set of CEL is supported.
  1159. Expression string `json:"expression,omitempty"`
  1160. // Location: An optional string indicating the location of the
  1161. // expression for error
  1162. // reporting, e.g. a file name and a position in the file.
  1163. Location string `json:"location,omitempty"`
  1164. // Title: An optional title for the expression, i.e. a short string
  1165. // describing
  1166. // its purpose. This can be used e.g. in UIs which allow to enter
  1167. // the
  1168. // expression.
  1169. Title string `json:"title,omitempty"`
  1170. // ForceSendFields is a list of field names (e.g. "Description") to
  1171. // unconditionally include in API requests. By default, fields with
  1172. // empty values are omitted from API requests. However, any non-pointer,
  1173. // non-interface field appearing in ForceSendFields will be sent to the
  1174. // server regardless of whether the field is empty or not. This may be
  1175. // used to include empty fields in Patch requests.
  1176. ForceSendFields []string `json:"-"`
  1177. // NullFields is a list of field names (e.g. "Description") to include
  1178. // in API requests with the JSON null value. By default, fields with
  1179. // empty values are omitted from API requests. However, any field with
  1180. // an empty value appearing in NullFields will be sent to the server as
  1181. // null. It is an error if a field in this list has a non-empty value.
  1182. // This may be used to include null fields in Patch requests.
  1183. NullFields []string `json:"-"`
  1184. }
  1185. func (s *GoogleType__Expr) MarshalJSON() ([]byte, error) {
  1186. type NoMethod GoogleType__Expr
  1187. raw := NoMethod(*s)
  1188. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1189. }
  1190. // method id "servicebroker.projects.brokers.instances.get":
  1191. type ProjectsBrokersInstancesGetCall struct {
  1192. s *Service
  1193. name string
  1194. urlParams_ gensupport.URLParams
  1195. ifNoneMatch_ string
  1196. ctx_ context.Context
  1197. header_ http.Header
  1198. }
  1199. // Get: Gets the given service instance from the system.
  1200. // This API is an extension and not part of the OSB spec.
  1201. // Hence the path is a standard Google API URL.
  1202. func (r *ProjectsBrokersInstancesService) Get(name string) *ProjectsBrokersInstancesGetCall {
  1203. c := &ProjectsBrokersInstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1204. c.name = name
  1205. return c
  1206. }
  1207. // Fields allows partial responses to be retrieved. See
  1208. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1209. // for more information.
  1210. func (c *ProjectsBrokersInstancesGetCall) Fields(s ...googleapi.Field) *ProjectsBrokersInstancesGetCall {
  1211. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1212. return c
  1213. }
  1214. // IfNoneMatch sets the optional parameter which makes the operation
  1215. // fail if the object's ETag matches the given value. This is useful for
  1216. // getting updates only after the object has changed since the last
  1217. // request. Use googleapi.IsNotModified to check whether the response
  1218. // error from Do is the result of In-None-Match.
  1219. func (c *ProjectsBrokersInstancesGetCall) IfNoneMatch(entityTag string) *ProjectsBrokersInstancesGetCall {
  1220. c.ifNoneMatch_ = entityTag
  1221. return c
  1222. }
  1223. // Context sets the context to be used in this call's Do method. Any
  1224. // pending HTTP request will be aborted if the provided context is
  1225. // canceled.
  1226. func (c *ProjectsBrokersInstancesGetCall) Context(ctx context.Context) *ProjectsBrokersInstancesGetCall {
  1227. c.ctx_ = ctx
  1228. return c
  1229. }
  1230. // Header returns an http.Header that can be modified by the caller to
  1231. // add HTTP headers to the request.
  1232. func (c *ProjectsBrokersInstancesGetCall) Header() http.Header {
  1233. if c.header_ == nil {
  1234. c.header_ = make(http.Header)
  1235. }
  1236. return c.header_
  1237. }
  1238. func (c *ProjectsBrokersInstancesGetCall) doRequest(alt string) (*http.Response, error) {
  1239. reqHeaders := make(http.Header)
  1240. for k, v := range c.header_ {
  1241. reqHeaders[k] = v
  1242. }
  1243. reqHeaders.Set("User-Agent", c.s.userAgent())
  1244. if c.ifNoneMatch_ != "" {
  1245. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1246. }
  1247. var body io.Reader = nil
  1248. c.urlParams_.Set("alt", alt)
  1249. c.urlParams_.Set("prettyPrint", "false")
  1250. urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
  1251. urls += "?" + c.urlParams_.Encode()
  1252. req, err := http.NewRequest("GET", urls, body)
  1253. if err != nil {
  1254. return nil, err
  1255. }
  1256. req.Header = reqHeaders
  1257. googleapi.Expand(req.URL, map[string]string{
  1258. "name": c.name,
  1259. })
  1260. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1261. }
  1262. // Do executes the "servicebroker.projects.brokers.instances.get" call.
  1263. // Exactly one of *GoogleCloudServicebrokerV1alpha1__ServiceInstance or
  1264. // error will be non-nil. Any non-2xx status code is an error. Response
  1265. // headers are in either
  1266. // *GoogleCloudServicebrokerV1alpha1__ServiceInstance.ServerResponse.Head
  1267. // er or (if a response was returned at all) in
  1268. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1269. // whether the returned error was because http.StatusNotModified was
  1270. // returned.
  1271. func (c *ProjectsBrokersInstancesGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudServicebrokerV1alpha1__ServiceInstance, error) {
  1272. gensupport.SetOptions(c.urlParams_, opts...)
  1273. res, err := c.doRequest("json")
  1274. if res != nil && res.StatusCode == http.StatusNotModified {
  1275. if res.Body != nil {
  1276. res.Body.Close()
  1277. }
  1278. return nil, &googleapi.Error{
  1279. Code: res.StatusCode,
  1280. Header: res.Header,
  1281. }
  1282. }
  1283. if err != nil {
  1284. return nil, err
  1285. }
  1286. defer googleapi.CloseBody(res)
  1287. if err := googleapi.CheckResponse(res); err != nil {
  1288. return nil, err
  1289. }
  1290. ret := &GoogleCloudServicebrokerV1alpha1__ServiceInstance{
  1291. ServerResponse: googleapi.ServerResponse{
  1292. Header: res.Header,
  1293. HTTPStatusCode: res.StatusCode,
  1294. },
  1295. }
  1296. target := &ret
  1297. if err := gensupport.DecodeResponse(target, res); err != nil {
  1298. return nil, err
  1299. }
  1300. return ret, nil
  1301. // {
  1302. // "description": "Gets the given service instance from the system.\nThis API is an extension and not part of the OSB spec.\nHence the path is a standard Google API URL.",
  1303. // "flatPath": "v1alpha1/projects/{projectsId}/brokers/{brokersId}/instances/{instancesId}",
  1304. // "httpMethod": "GET",
  1305. // "id": "servicebroker.projects.brokers.instances.get",
  1306. // "parameterOrder": [
  1307. // "name"
  1308. // ],
  1309. // "parameters": {
  1310. // "name": {
  1311. // "description": "The resource name of the instance to return.",
  1312. // "location": "path",
  1313. // "pattern": "^projects/[^/]+/brokers/[^/]+/instances/[^/]+$",
  1314. // "required": true,
  1315. // "type": "string"
  1316. // }
  1317. // },
  1318. // "path": "v1alpha1/{+name}",
  1319. // "response": {
  1320. // "$ref": "GoogleCloudServicebrokerV1alpha1__ServiceInstance"
  1321. // },
  1322. // "scopes": [
  1323. // "https://www.googleapis.com/auth/cloud-platform"
  1324. // ]
  1325. // }
  1326. }
  1327. // method id "servicebroker.projects.brokers.instances.service_bindings.list":
  1328. type ProjectsBrokersInstancesServiceBindingsListCall struct {
  1329. s *Service
  1330. parent string
  1331. urlParams_ gensupport.URLParams
  1332. ifNoneMatch_ string
  1333. ctx_ context.Context
  1334. header_ http.Header
  1335. }
  1336. // List: Lists all the bindings in the instance
  1337. func (r *ProjectsBrokersInstancesServiceBindingsService) List(parent string) *ProjectsBrokersInstancesServiceBindingsListCall {
  1338. c := &ProjectsBrokersInstancesServiceBindingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1339. c.parent = parent
  1340. return c
  1341. }
  1342. // PageSize sets the optional parameter "pageSize": Specifies the number
  1343. // of results to return per page. If there are fewer
  1344. // elements than the specified number, returns all elements.
  1345. // If unset or 0, all the results will be returned.
  1346. func (c *ProjectsBrokersInstancesServiceBindingsListCall) PageSize(pageSize int64) *ProjectsBrokersInstancesServiceBindingsListCall {
  1347. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1348. return c
  1349. }
  1350. // PageToken sets the optional parameter "pageToken": Specifies a page
  1351. // token to use. Set `pageToken` to a `nextPageToken`
  1352. // returned by a previous list request to get the next page of results.
  1353. func (c *ProjectsBrokersInstancesServiceBindingsListCall) PageToken(pageToken string) *ProjectsBrokersInstancesServiceBindingsListCall {
  1354. c.urlParams_.Set("pageToken", pageToken)
  1355. return c
  1356. }
  1357. // Fields allows partial responses to be retrieved. See
  1358. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1359. // for more information.
  1360. func (c *ProjectsBrokersInstancesServiceBindingsListCall) Fields(s ...googleapi.Field) *ProjectsBrokersInstancesServiceBindingsListCall {
  1361. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1362. return c
  1363. }
  1364. // IfNoneMatch sets the optional parameter which makes the operation
  1365. // fail if the object's ETag matches the given value. This is useful for
  1366. // getting updates only after the object has changed since the last
  1367. // request. Use googleapi.IsNotModified to check whether the response
  1368. // error from Do is the result of In-None-Match.
  1369. func (c *ProjectsBrokersInstancesServiceBindingsListCall) IfNoneMatch(entityTag string) *ProjectsBrokersInstancesServiceBindingsListCall {
  1370. c.ifNoneMatch_ = entityTag
  1371. return c
  1372. }
  1373. // Context sets the context to be used in this call's Do method. Any
  1374. // pending HTTP request will be aborted if the provided context is
  1375. // canceled.
  1376. func (c *ProjectsBrokersInstancesServiceBindingsListCall) Context(ctx context.Context) *ProjectsBrokersInstancesServiceBindingsListCall {
  1377. c.ctx_ = ctx
  1378. return c
  1379. }
  1380. // Header returns an http.Header that can be modified by the caller to
  1381. // add HTTP headers to the request.
  1382. func (c *ProjectsBrokersInstancesServiceBindingsListCall) Header() http.Header {
  1383. if c.header_ == nil {
  1384. c.header_ = make(http.Header)
  1385. }
  1386. return c.header_
  1387. }
  1388. func (c *ProjectsBrokersInstancesServiceBindingsListCall) doRequest(alt string) (*http.Response, error) {
  1389. reqHeaders := make(http.Header)
  1390. for k, v := range c.header_ {
  1391. reqHeaders[k] = v
  1392. }
  1393. reqHeaders.Set("User-Agent", c.s.userAgent())
  1394. if c.ifNoneMatch_ != "" {
  1395. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1396. }
  1397. var body io.Reader = nil
  1398. c.urlParams_.Set("alt", alt)
  1399. c.urlParams_.Set("prettyPrint", "false")
  1400. urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/service_bindings")
  1401. urls += "?" + c.urlParams_.Encode()
  1402. req, err := http.NewRequest("GET", urls, body)
  1403. if err != nil {
  1404. return nil, err
  1405. }
  1406. req.Header = reqHeaders
  1407. googleapi.Expand(req.URL, map[string]string{
  1408. "parent": c.parent,
  1409. })
  1410. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1411. }
  1412. // Do executes the "servicebroker.projects.brokers.instances.service_bindings.list" call.
  1413. // Exactly one of
  1414. // *GoogleCloudServicebrokerV1alpha1__ListBindingsResponse or error will
  1415. // be non-nil. Any non-2xx status code is an error. Response headers are
  1416. // in either
  1417. // *GoogleCloudServicebrokerV1alpha1__ListBindingsResponse.ServerResponse
  1418. // .Header or (if a response was returned at all) in
  1419. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1420. // whether the returned error was because http.StatusNotModified was
  1421. // returned.
  1422. func (c *ProjectsBrokersInstancesServiceBindingsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudServicebrokerV1alpha1__ListBindingsResponse, error) {
  1423. gensupport.SetOptions(c.urlParams_, opts...)
  1424. res, err := c.doRequest("json")
  1425. if res != nil && res.StatusCode == http.StatusNotModified {
  1426. if res.Body != nil {
  1427. res.Body.Close()
  1428. }
  1429. return nil, &googleapi.Error{
  1430. Code: res.StatusCode,
  1431. Header: res.Header,
  1432. }
  1433. }
  1434. if err != nil {
  1435. return nil, err
  1436. }
  1437. defer googleapi.CloseBody(res)
  1438. if err := googleapi.CheckResponse(res); err != nil {
  1439. return nil, err
  1440. }
  1441. ret := &GoogleCloudServicebrokerV1alpha1__ListBindingsResponse{
  1442. ServerResponse: googleapi.ServerResponse{
  1443. Header: res.Header,
  1444. HTTPStatusCode: res.StatusCode,
  1445. },
  1446. }
  1447. target := &ret
  1448. if err := gensupport.DecodeResponse(target, res); err != nil {
  1449. return nil, err
  1450. }
  1451. return ret, nil
  1452. // {
  1453. // "description": "Lists all the bindings in the instance",
  1454. // "flatPath": "v1alpha1/projects/{projectsId}/brokers/{brokersId}/instances/{instancesId}/service_bindings",
  1455. // "httpMethod": "GET",
  1456. // "id": "servicebroker.projects.brokers.instances.service_bindings.list",
  1457. // "parameterOrder": [
  1458. // "parent"
  1459. // ],
  1460. // "parameters": {
  1461. // "pageSize": {
  1462. // "description": "Specifies the number of results to return per page. If there are fewer\nelements than the specified number, returns all elements.\nOptional. If unset or 0, all the results will be returned.",
  1463. // "format": "int32",
  1464. // "location": "query",
  1465. // "type": "integer"
  1466. // },
  1467. // "pageToken": {
  1468. // "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.",
  1469. // "location": "query",
  1470. // "type": "string"
  1471. // },
  1472. // "parent": {
  1473. // "description": "Parent must match\n`projects/[PROJECT_ID]/brokers/[BROKER_ID]/instances/[INSTANCE_ID]`.",
  1474. // "location": "path",
  1475. // "pattern": "^projects/[^/]+/brokers/[^/]+/instances/[^/]+$",
  1476. // "required": true,
  1477. // "type": "string"
  1478. // }
  1479. // },
  1480. // "path": "v1alpha1/{+parent}/service_bindings",
  1481. // "response": {
  1482. // "$ref": "GoogleCloudServicebrokerV1alpha1__ListBindingsResponse"
  1483. // },
  1484. // "scopes": [
  1485. // "https://www.googleapis.com/auth/cloud-platform"
  1486. // ]
  1487. // }
  1488. }
  1489. // Pages invokes f for each page of results.
  1490. // A non-nil error returned from f will halt the iteration.
  1491. // The provided context supersedes any context provided to the Context method.
  1492. func (c *ProjectsBrokersInstancesServiceBindingsListCall) Pages(ctx context.Context, f func(*GoogleCloudServicebrokerV1alpha1__ListBindingsResponse) error) error {
  1493. c.ctx_ = ctx
  1494. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1495. for {
  1496. x, err := c.Do()
  1497. if err != nil {
  1498. return err
  1499. }
  1500. if err := f(x); err != nil {
  1501. return err
  1502. }
  1503. if x.NextPageToken == "" {
  1504. return nil
  1505. }
  1506. c.PageToken(x.NextPageToken)
  1507. }
  1508. }
  1509. // method id "servicebroker.projects.brokers.service_instances.list":
  1510. type ProjectsBrokersServiceInstancesListCall struct {
  1511. s *Service
  1512. parent string
  1513. urlParams_ gensupport.URLParams
  1514. ifNoneMatch_ string
  1515. ctx_ context.Context
  1516. header_ http.Header
  1517. }
  1518. // List: Lists all the instances in the brokers
  1519. // This API is an extension and not part of the OSB spec.
  1520. // Hence the path is a standard Google API URL.
  1521. func (r *ProjectsBrokersServiceInstancesService) List(parent string) *ProjectsBrokersServiceInstancesListCall {
  1522. c := &ProjectsBrokersServiceInstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1523. c.parent = parent
  1524. return c
  1525. }
  1526. // PageSize sets the optional parameter "pageSize": Specifies the number
  1527. // of results to return per page. If there are fewer
  1528. // elements than the specified number, returns all elements.
  1529. // If unset or 0, all the results will be returned.
  1530. func (c *ProjectsBrokersServiceInstancesListCall) PageSize(pageSize int64) *ProjectsBrokersServiceInstancesListCall {
  1531. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1532. return c
  1533. }
  1534. // PageToken sets the optional parameter "pageToken": Specifies a page
  1535. // token to use. Set `pageToken` to a `nextPageToken`
  1536. // returned by a previous list request to get the next page of results.
  1537. func (c *ProjectsBrokersServiceInstancesListCall) PageToken(pageToken string) *ProjectsBrokersServiceInstancesListCall {
  1538. c.urlParams_.Set("pageToken", pageToken)
  1539. return c
  1540. }
  1541. // Fields allows partial responses to be retrieved. See
  1542. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1543. // for more information.
  1544. func (c *ProjectsBrokersServiceInstancesListCall) Fields(s ...googleapi.Field) *ProjectsBrokersServiceInstancesListCall {
  1545. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1546. return c
  1547. }
  1548. // IfNoneMatch sets the optional parameter which makes the operation
  1549. // fail if the object's ETag matches the given value. This is useful for
  1550. // getting updates only after the object has changed since the last
  1551. // request. Use googleapi.IsNotModified to check whether the response
  1552. // error from Do is the result of In-None-Match.
  1553. func (c *ProjectsBrokersServiceInstancesListCall) IfNoneMatch(entityTag string) *ProjectsBrokersServiceInstancesListCall {
  1554. c.ifNoneMatch_ = entityTag
  1555. return c
  1556. }
  1557. // Context sets the context to be used in this call's Do method. Any
  1558. // pending HTTP request will be aborted if the provided context is
  1559. // canceled.
  1560. func (c *ProjectsBrokersServiceInstancesListCall) Context(ctx context.Context) *ProjectsBrokersServiceInstancesListCall {
  1561. c.ctx_ = ctx
  1562. return c
  1563. }
  1564. // Header returns an http.Header that can be modified by the caller to
  1565. // add HTTP headers to the request.
  1566. func (c *ProjectsBrokersServiceInstancesListCall) Header() http.Header {
  1567. if c.header_ == nil {
  1568. c.header_ = make(http.Header)
  1569. }
  1570. return c.header_
  1571. }
  1572. func (c *ProjectsBrokersServiceInstancesListCall) doRequest(alt string) (*http.Response, error) {
  1573. reqHeaders := make(http.Header)
  1574. for k, v := range c.header_ {
  1575. reqHeaders[k] = v
  1576. }
  1577. reqHeaders.Set("User-Agent", c.s.userAgent())
  1578. if c.ifNoneMatch_ != "" {
  1579. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1580. }
  1581. var body io.Reader = nil
  1582. c.urlParams_.Set("alt", alt)
  1583. c.urlParams_.Set("prettyPrint", "false")
  1584. urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/service_instances")
  1585. urls += "?" + c.urlParams_.Encode()
  1586. req, err := http.NewRequest("GET", urls, body)
  1587. if err != nil {
  1588. return nil, err
  1589. }
  1590. req.Header = reqHeaders
  1591. googleapi.Expand(req.URL, map[string]string{
  1592. "parent": c.parent,
  1593. })
  1594. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1595. }
  1596. // Do executes the "servicebroker.projects.brokers.service_instances.list" call.
  1597. // Exactly one of
  1598. // *GoogleCloudServicebrokerV1alpha1__ListServiceInstancesResponse or
  1599. // error will be non-nil. Any non-2xx status code is an error. Response
  1600. // headers are in either
  1601. // *GoogleCloudServicebrokerV1alpha1__ListServiceInstancesResponse.Server
  1602. // Response.Header or (if a response was returned at all) in
  1603. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1604. // whether the returned error was because http.StatusNotModified was
  1605. // returned.
  1606. func (c *ProjectsBrokersServiceInstancesListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudServicebrokerV1alpha1__ListServiceInstancesResponse, error) {
  1607. gensupport.SetOptions(c.urlParams_, opts...)
  1608. res, err := c.doRequest("json")
  1609. if res != nil && res.StatusCode == http.StatusNotModified {
  1610. if res.Body != nil {
  1611. res.Body.Close()
  1612. }
  1613. return nil, &googleapi.Error{
  1614. Code: res.StatusCode,
  1615. Header: res.Header,
  1616. }
  1617. }
  1618. if err != nil {
  1619. return nil, err
  1620. }
  1621. defer googleapi.CloseBody(res)
  1622. if err := googleapi.CheckResponse(res); err != nil {
  1623. return nil, err
  1624. }
  1625. ret := &GoogleCloudServicebrokerV1alpha1__ListServiceInstancesResponse{
  1626. ServerResponse: googleapi.ServerResponse{
  1627. Header: res.Header,
  1628. HTTPStatusCode: res.StatusCode,
  1629. },
  1630. }
  1631. target := &ret
  1632. if err := gensupport.DecodeResponse(target, res); err != nil {
  1633. return nil, err
  1634. }
  1635. return ret, nil
  1636. // {
  1637. // "description": "Lists all the instances in the brokers\nThis API is an extension and not part of the OSB spec.\nHence the path is a standard Google API URL.",
  1638. // "flatPath": "v1alpha1/projects/{projectsId}/brokers/{brokersId}/service_instances",
  1639. // "httpMethod": "GET",
  1640. // "id": "servicebroker.projects.brokers.service_instances.list",
  1641. // "parameterOrder": [
  1642. // "parent"
  1643. // ],
  1644. // "parameters": {
  1645. // "pageSize": {
  1646. // "description": "Specifies the number of results to return per page. If there are fewer\nelements than the specified number, returns all elements.\nOptional. If unset or 0, all the results will be returned.",
  1647. // "format": "int32",
  1648. // "location": "query",
  1649. // "type": "integer"
  1650. // },
  1651. // "pageToken": {
  1652. // "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.",
  1653. // "location": "query",
  1654. // "type": "string"
  1655. // },
  1656. // "parent": {
  1657. // "description": "Parent must match `projects/[PROJECT_ID]/brokers/[BROKER_ID]`.",
  1658. // "location": "path",
  1659. // "pattern": "^projects/[^/]+/brokers/[^/]+$",
  1660. // "required": true,
  1661. // "type": "string"
  1662. // }
  1663. // },
  1664. // "path": "v1alpha1/{+parent}/service_instances",
  1665. // "response": {
  1666. // "$ref": "GoogleCloudServicebrokerV1alpha1__ListServiceInstancesResponse"
  1667. // },
  1668. // "scopes": [
  1669. // "https://www.googleapis.com/auth/cloud-platform"
  1670. // ]
  1671. // }
  1672. }
  1673. // Pages invokes f for each page of results.
  1674. // A non-nil error returned from f will halt the iteration.
  1675. // The provided context supersedes any context provided to the Context method.
  1676. func (c *ProjectsBrokersServiceInstancesListCall) Pages(ctx context.Context, f func(*GoogleCloudServicebrokerV1alpha1__ListServiceInstancesResponse) error) error {
  1677. c.ctx_ = ctx
  1678. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1679. for {
  1680. x, err := c.Do()
  1681. if err != nil {
  1682. return err
  1683. }
  1684. if err := f(x); err != nil {
  1685. return err
  1686. }
  1687. if x.NextPageToken == "" {
  1688. return nil
  1689. }
  1690. c.PageToken(x.NextPageToken)
  1691. }
  1692. }
  1693. // method id "servicebroker.projects.brokers.v2.catalog.list":
  1694. type ProjectsBrokersV2CatalogListCall struct {
  1695. s *Service
  1696. parent string
  1697. urlParams_ gensupport.URLParams
  1698. ifNoneMatch_ string
  1699. ctx_ context.Context
  1700. header_ http.Header
  1701. }
  1702. // List: Lists all the Services registered with this broker for
  1703. // consumption for
  1704. // given service registry broker, which contains an set of
  1705. // services.
  1706. // Note, that Service producer API is separate from Broker API.
  1707. func (r *ProjectsBrokersV2CatalogService) List(parent string) *ProjectsBrokersV2CatalogListCall {
  1708. c := &ProjectsBrokersV2CatalogListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1709. c.parent = parent
  1710. return c
  1711. }
  1712. // PageSize sets the optional parameter "pageSize": Specifies the number
  1713. // of results to return per page. If there are fewer
  1714. // elements than the specified number, returns all elements.
  1715. // If unset or 0, all the results will be returned.
  1716. func (c *ProjectsBrokersV2CatalogListCall) PageSize(pageSize int64) *ProjectsBrokersV2CatalogListCall {
  1717. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1718. return c
  1719. }
  1720. // PageToken sets the optional parameter "pageToken": Specifies a page
  1721. // token to use. Set `pageToken` to a `nextPageToken`
  1722. // returned by a previous list request to get the next page of results.
  1723. func (c *ProjectsBrokersV2CatalogListCall) PageToken(pageToken string) *ProjectsBrokersV2CatalogListCall {
  1724. c.urlParams_.Set("pageToken", pageToken)
  1725. return c
  1726. }
  1727. // Fields allows partial responses to be retrieved. See
  1728. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1729. // for more information.
  1730. func (c *ProjectsBrokersV2CatalogListCall) Fields(s ...googleapi.Field) *ProjectsBrokersV2CatalogListCall {
  1731. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1732. return c
  1733. }
  1734. // IfNoneMatch sets the optional parameter which makes the operation
  1735. // fail if the object's ETag matches the given value. This is useful for
  1736. // getting updates only after the object has changed since the last
  1737. // request. Use googleapi.IsNotModified to check whether the response
  1738. // error from Do is the result of In-None-Match.
  1739. func (c *ProjectsBrokersV2CatalogListCall) IfNoneMatch(entityTag string) *ProjectsBrokersV2CatalogListCall {
  1740. c.ifNoneMatch_ = entityTag
  1741. return c
  1742. }
  1743. // Context sets the context to be used in this call's Do method. Any
  1744. // pending HTTP request will be aborted if the provided context is
  1745. // canceled.
  1746. func (c *ProjectsBrokersV2CatalogListCall) Context(ctx context.Context) *ProjectsBrokersV2CatalogListCall {
  1747. c.ctx_ = ctx
  1748. return c
  1749. }
  1750. // Header returns an http.Header that can be modified by the caller to
  1751. // add HTTP headers to the request.
  1752. func (c *ProjectsBrokersV2CatalogListCall) Header() http.Header {
  1753. if c.header_ == nil {
  1754. c.header_ = make(http.Header)
  1755. }
  1756. return c.header_
  1757. }
  1758. func (c *ProjectsBrokersV2CatalogListCall) doRequest(alt string) (*http.Response, error) {
  1759. reqHeaders := make(http.Header)
  1760. for k, v := range c.header_ {
  1761. reqHeaders[k] = v
  1762. }
  1763. reqHeaders.Set("User-Agent", c.s.userAgent())
  1764. if c.ifNoneMatch_ != "" {
  1765. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1766. }
  1767. var body io.Reader = nil
  1768. c.urlParams_.Set("alt", alt)
  1769. c.urlParams_.Set("prettyPrint", "false")
  1770. urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/v2/catalog")
  1771. urls += "?" + c.urlParams_.Encode()
  1772. req, err := http.NewRequest("GET", urls, body)
  1773. if err != nil {
  1774. return nil, err
  1775. }
  1776. req.Header = reqHeaders
  1777. googleapi.Expand(req.URL, map[string]string{
  1778. "parent": c.parent,
  1779. })
  1780. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1781. }
  1782. // Do executes the "servicebroker.projects.brokers.v2.catalog.list" call.
  1783. // Exactly one of *GoogleCloudServicebrokerV1alpha1__ListCatalogResponse
  1784. // or error will be non-nil. Any non-2xx status code is an error.
  1785. // Response headers are in either
  1786. // *GoogleCloudServicebrokerV1alpha1__ListCatalogResponse.ServerResponse.
  1787. // Header or (if a response was returned at all) in
  1788. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1789. // whether the returned error was because http.StatusNotModified was
  1790. // returned.
  1791. func (c *ProjectsBrokersV2CatalogListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudServicebrokerV1alpha1__ListCatalogResponse, error) {
  1792. gensupport.SetOptions(c.urlParams_, opts...)
  1793. res, err := c.doRequest("json")
  1794. if res != nil && res.StatusCode == http.StatusNotModified {
  1795. if res.Body != nil {
  1796. res.Body.Close()
  1797. }
  1798. return nil, &googleapi.Error{
  1799. Code: res.StatusCode,
  1800. Header: res.Header,
  1801. }
  1802. }
  1803. if err != nil {
  1804. return nil, err
  1805. }
  1806. defer googleapi.CloseBody(res)
  1807. if err := googleapi.CheckResponse(res); err != nil {
  1808. return nil, err
  1809. }
  1810. ret := &GoogleCloudServicebrokerV1alpha1__ListCatalogResponse{
  1811. ServerResponse: googleapi.ServerResponse{
  1812. Header: res.Header,
  1813. HTTPStatusCode: res.StatusCode,
  1814. },
  1815. }
  1816. target := &ret
  1817. if err := gensupport.DecodeResponse(target, res); err != nil {
  1818. return nil, err
  1819. }
  1820. return ret, nil
  1821. // {
  1822. // "description": "Lists all the Services registered with this broker for consumption for\ngiven service registry broker, which contains an set of services.\nNote, that Service producer API is separate from Broker API.",
  1823. // "flatPath": "v1alpha1/projects/{projectsId}/brokers/{brokersId}/v2/catalog",
  1824. // "httpMethod": "GET",
  1825. // "id": "servicebroker.projects.brokers.v2.catalog.list",
  1826. // "parameterOrder": [
  1827. // "parent"
  1828. // ],
  1829. // "parameters": {
  1830. // "pageSize": {
  1831. // "description": "Specifies the number of results to return per page. If there are fewer\nelements than the specified number, returns all elements.\nOptional. If unset or 0, all the results will be returned.",
  1832. // "format": "int32",
  1833. // "location": "query",
  1834. // "type": "integer"
  1835. // },
  1836. // "pageToken": {
  1837. // "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.",
  1838. // "location": "query",
  1839. // "type": "string"
  1840. // },
  1841. // "parent": {
  1842. // "description": "Parent must match `projects/[PROJECT_ID]/brokers/[BROKER_ID]`.",
  1843. // "location": "path",
  1844. // "pattern": "^projects/[^/]+/brokers/[^/]+$",
  1845. // "required": true,
  1846. // "type": "string"
  1847. // }
  1848. // },
  1849. // "path": "v1alpha1/{+parent}/v2/catalog",
  1850. // "response": {
  1851. // "$ref": "GoogleCloudServicebrokerV1alpha1__ListCatalogResponse"
  1852. // },
  1853. // "scopes": [
  1854. // "https://www.googleapis.com/auth/cloud-platform"
  1855. // ]
  1856. // }
  1857. }
  1858. // Pages invokes f for each page of results.
  1859. // A non-nil error returned from f will halt the iteration.
  1860. // The provided context supersedes any context provided to the Context method.
  1861. func (c *ProjectsBrokersV2CatalogListCall) Pages(ctx context.Context, f func(*GoogleCloudServicebrokerV1alpha1__ListCatalogResponse) error) error {
  1862. c.ctx_ = ctx
  1863. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1864. for {
  1865. x, err := c.Do()
  1866. if err != nil {
  1867. return err
  1868. }
  1869. if err := f(x); err != nil {
  1870. return err
  1871. }
  1872. if x.NextPageToken == "" {
  1873. return nil
  1874. }
  1875. c.PageToken(x.NextPageToken)
  1876. }
  1877. }
  1878. // method id "servicebroker.projects.brokers.v2.service_instances.create":
  1879. type ProjectsBrokersV2ServiceInstancesCreateCall struct {
  1880. s *Service
  1881. parent string
  1882. instanceId string
  1883. googlecloudservicebrokerv1alpha1__serviceinstance *GoogleCloudServicebrokerV1alpha1__ServiceInstance
  1884. urlParams_ gensupport.URLParams
  1885. ctx_ context.Context
  1886. header_ http.Header
  1887. }
  1888. // Create: Provisions a service instance.
  1889. // If `request.accepts_incomplete` is false and Broker cannot execute
  1890. // request
  1891. // synchronously HTTP 422 error will be returned along
  1892. // with
  1893. // FAILED_PRECONDITION status.
  1894. // If `request.accepts_incomplete` is true and the Broker decides to
  1895. // execute
  1896. // resource asynchronously then HTTP 202 response code will be returned
  1897. // and a
  1898. // valid polling operation in the response will be included.
  1899. // If Broker executes the request synchronously and it succeeds HTTP
  1900. // 201
  1901. // response will be furnished.
  1902. // If identical instance exists, then HTTP 200 response will be
  1903. // returned.
  1904. // If an instance with identical ID but mismatching parameters exists,
  1905. // then
  1906. // HTTP 409 status code will be returned.
  1907. func (r *ProjectsBrokersV2ServiceInstancesService) Create(parent string, instanceId string, googlecloudservicebrokerv1alpha1__serviceinstance *GoogleCloudServicebrokerV1alpha1__ServiceInstance) *ProjectsBrokersV2ServiceInstancesCreateCall {
  1908. c := &ProjectsBrokersV2ServiceInstancesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1909. c.parent = parent
  1910. c.instanceId = instanceId
  1911. c.googlecloudservicebrokerv1alpha1__serviceinstance = googlecloudservicebrokerv1alpha1__serviceinstance
  1912. return c
  1913. }
  1914. // AcceptsIncomplete sets the optional parameter "acceptsIncomplete":
  1915. // Value indicating that API client supports asynchronous operations.
  1916. // If
  1917. // Broker cannot execute the request synchronously HTTP 422 code will
  1918. // be
  1919. // returned to HTTP clients along with FAILED_PRECONDITION error.
  1920. // If true and broker will execute request asynchronously 202 HTTP code
  1921. // will
  1922. // be returned.
  1923. // This broker always requires this to be true as all mutator operations
  1924. // are
  1925. // asynchronous.
  1926. func (c *ProjectsBrokersV2ServiceInstancesCreateCall) AcceptsIncomplete(acceptsIncomplete bool) *ProjectsBrokersV2ServiceInstancesCreateCall {
  1927. c.urlParams_.Set("acceptsIncomplete", fmt.Sprint(acceptsIncomplete))
  1928. return c
  1929. }
  1930. // Fields allows partial responses to be retrieved. See
  1931. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1932. // for more information.
  1933. func (c *ProjectsBrokersV2ServiceInstancesCreateCall) Fields(s ...googleapi.Field) *ProjectsBrokersV2ServiceInstancesCreateCall {
  1934. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1935. return c
  1936. }
  1937. // Context sets the context to be used in this call's Do method. Any
  1938. // pending HTTP request will be aborted if the provided context is
  1939. // canceled.
  1940. func (c *ProjectsBrokersV2ServiceInstancesCreateCall) Context(ctx context.Context) *ProjectsBrokersV2ServiceInstancesCreateCall {
  1941. c.ctx_ = ctx
  1942. return c
  1943. }
  1944. // Header returns an http.Header that can be modified by the caller to
  1945. // add HTTP headers to the request.
  1946. func (c *ProjectsBrokersV2ServiceInstancesCreateCall) Header() http.Header {
  1947. if c.header_ == nil {
  1948. c.header_ = make(http.Header)
  1949. }
  1950. return c.header_
  1951. }
  1952. func (c *ProjectsBrokersV2ServiceInstancesCreateCall) doRequest(alt string) (*http.Response, error) {
  1953. reqHeaders := make(http.Header)
  1954. for k, v := range c.header_ {
  1955. reqHeaders[k] = v
  1956. }
  1957. reqHeaders.Set("User-Agent", c.s.userAgent())
  1958. var body io.Reader = nil
  1959. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudservicebrokerv1alpha1__serviceinstance)
  1960. if err != nil {
  1961. return nil, err
  1962. }
  1963. reqHeaders.Set("Content-Type", "application/json")
  1964. c.urlParams_.Set("alt", alt)
  1965. c.urlParams_.Set("prettyPrint", "false")
  1966. urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/v2/service_instances/{+instance_id}")
  1967. urls += "?" + c.urlParams_.Encode()
  1968. req, err := http.NewRequest("PUT", urls, body)
  1969. if err != nil {
  1970. return nil, err
  1971. }
  1972. req.Header = reqHeaders
  1973. googleapi.Expand(req.URL, map[string]string{
  1974. "parent": c.parent,
  1975. "instance_id": c.instanceId,
  1976. })
  1977. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1978. }
  1979. // Do executes the "servicebroker.projects.brokers.v2.service_instances.create" call.
  1980. // Exactly one of
  1981. // *GoogleCloudServicebrokerV1alpha1__CreateServiceInstanceResponse or
  1982. // error will be non-nil. Any non-2xx status code is an error. Response
  1983. // headers are in either
  1984. // *GoogleCloudServicebrokerV1alpha1__CreateServiceInstanceResponse.Serve
  1985. // rResponse.Header or (if a response was returned at all) in
  1986. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1987. // whether the returned error was because http.StatusNotModified was
  1988. // returned.
  1989. func (c *ProjectsBrokersV2ServiceInstancesCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudServicebrokerV1alpha1__CreateServiceInstanceResponse, error) {
  1990. gensupport.SetOptions(c.urlParams_, opts...)
  1991. res, err := c.doRequest("json")
  1992. if res != nil && res.StatusCode == http.StatusNotModified {
  1993. if res.Body != nil {
  1994. res.Body.Close()
  1995. }
  1996. return nil, &googleapi.Error{
  1997. Code: res.StatusCode,
  1998. Header: res.Header,
  1999. }
  2000. }
  2001. if err != nil {
  2002. return nil, err
  2003. }
  2004. defer googleapi.CloseBody(res)
  2005. if err := googleapi.CheckResponse(res); err != nil {
  2006. return nil, err
  2007. }
  2008. ret := &GoogleCloudServicebrokerV1alpha1__CreateServiceInstanceResponse{
  2009. ServerResponse: googleapi.ServerResponse{
  2010. Header: res.Header,
  2011. HTTPStatusCode: res.StatusCode,
  2012. },
  2013. }
  2014. target := &ret
  2015. if err := gensupport.DecodeResponse(target, res); err != nil {
  2016. return nil, err
  2017. }
  2018. return ret, nil
  2019. // {
  2020. // "description": "Provisions a service instance.\nIf `request.accepts_incomplete` is false and Broker cannot execute request\nsynchronously HTTP 422 error will be returned along with\nFAILED_PRECONDITION status.\nIf `request.accepts_incomplete` is true and the Broker decides to execute\nresource asynchronously then HTTP 202 response code will be returned and a\nvalid polling operation in the response will be included.\nIf Broker executes the request synchronously and it succeeds HTTP 201\nresponse will be furnished.\nIf identical instance exists, then HTTP 200 response will be returned.\nIf an instance with identical ID but mismatching parameters exists, then\nHTTP 409 status code will be returned.",
  2021. // "flatPath": "v1alpha1/projects/{projectsId}/brokers/{brokersId}/v2/service_instances/{service_instancesId}",
  2022. // "httpMethod": "PUT",
  2023. // "id": "servicebroker.projects.brokers.v2.service_instances.create",
  2024. // "parameterOrder": [
  2025. // "parent",
  2026. // "instance_id"
  2027. // ],
  2028. // "parameters": {
  2029. // "acceptsIncomplete": {
  2030. // "description": "Value indicating that API client supports asynchronous operations. If\nBroker cannot execute the request synchronously HTTP 422 code will be\nreturned to HTTP clients along with FAILED_PRECONDITION error.\nIf true and broker will execute request asynchronously 202 HTTP code will\nbe returned.\nThis broker always requires this to be true as all mutator operations are\nasynchronous.",
  2031. // "location": "query",
  2032. // "type": "boolean"
  2033. // },
  2034. // "instance_id": {
  2035. // "description": "The id of the service instance. Must be unique within GCP project.\nMaximum length is 64, GUID recommended.\nRequired.",
  2036. // "location": "path",
  2037. // "pattern": "^[^/]+$",
  2038. // "required": true,
  2039. // "type": "string"
  2040. // },
  2041. // "parent": {
  2042. // "description": "Parent must match `projects/[PROJECT_ID]/brokers/[BROKER_ID]`.",
  2043. // "location": "path",
  2044. // "pattern": "^projects/[^/]+/brokers/[^/]+$",
  2045. // "required": true,
  2046. // "type": "string"
  2047. // }
  2048. // },
  2049. // "path": "v1alpha1/{+parent}/v2/service_instances/{+instance_id}",
  2050. // "request": {
  2051. // "$ref": "GoogleCloudServicebrokerV1alpha1__ServiceInstance"
  2052. // },
  2053. // "response": {
  2054. // "$ref": "GoogleCloudServicebrokerV1alpha1__CreateServiceInstanceResponse"
  2055. // },
  2056. // "scopes": [
  2057. // "https://www.googleapis.com/auth/cloud-platform"
  2058. // ]
  2059. // }
  2060. }
  2061. // method id "servicebroker.projects.brokers.v2.service_instances.delete":
  2062. type ProjectsBrokersV2ServiceInstancesDeleteCall struct {
  2063. s *Service
  2064. parent string
  2065. instanceId string
  2066. urlParams_ gensupport.URLParams
  2067. ctx_ context.Context
  2068. header_ http.Header
  2069. }
  2070. // Delete: Deprovisions a service instance.
  2071. // For synchronous/asynchronous request details see
  2072. // CreateServiceInstance
  2073. // method.
  2074. // If service instance does not exist HTTP 410 status will be returned.
  2075. func (r *ProjectsBrokersV2ServiceInstancesService) Delete(parent string, instanceId string) *ProjectsBrokersV2ServiceInstancesDeleteCall {
  2076. c := &ProjectsBrokersV2ServiceInstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2077. c.parent = parent
  2078. c.instanceId = instanceId
  2079. return c
  2080. }
  2081. // AcceptsIncomplete sets the optional parameter "acceptsIncomplete":
  2082. // See CreateServiceInstanceRequest for details.
  2083. func (c *ProjectsBrokersV2ServiceInstancesDeleteCall) AcceptsIncomplete(acceptsIncomplete bool) *ProjectsBrokersV2ServiceInstancesDeleteCall {
  2084. c.urlParams_.Set("acceptsIncomplete", fmt.Sprint(acceptsIncomplete))
  2085. return c
  2086. }
  2087. // PlanId sets the optional parameter "planId": The plan id of the
  2088. // service instance.
  2089. func (c *ProjectsBrokersV2ServiceInstancesDeleteCall) PlanId(planId string) *ProjectsBrokersV2ServiceInstancesDeleteCall {
  2090. c.urlParams_.Set("planId", planId)
  2091. return c
  2092. }
  2093. // ServiceId sets the optional parameter "serviceId": The service id of
  2094. // the service instance.
  2095. func (c *ProjectsBrokersV2ServiceInstancesDeleteCall) ServiceId(serviceId string) *ProjectsBrokersV2ServiceInstancesDeleteCall {
  2096. c.urlParams_.Set("serviceId", serviceId)
  2097. return c
  2098. }
  2099. // Fields allows partial responses to be retrieved. See
  2100. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2101. // for more information.
  2102. func (c *ProjectsBrokersV2ServiceInstancesDeleteCall) Fields(s ...googleapi.Field) *ProjectsBrokersV2ServiceInstancesDeleteCall {
  2103. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2104. return c
  2105. }
  2106. // Context sets the context to be used in this call's Do method. Any
  2107. // pending HTTP request will be aborted if the provided context is
  2108. // canceled.
  2109. func (c *ProjectsBrokersV2ServiceInstancesDeleteCall) Context(ctx context.Context) *ProjectsBrokersV2ServiceInstancesDeleteCall {
  2110. c.ctx_ = ctx
  2111. return c
  2112. }
  2113. // Header returns an http.Header that can be modified by the caller to
  2114. // add HTTP headers to the request.
  2115. func (c *ProjectsBrokersV2ServiceInstancesDeleteCall) Header() http.Header {
  2116. if c.header_ == nil {
  2117. c.header_ = make(http.Header)
  2118. }
  2119. return c.header_
  2120. }
  2121. func (c *ProjectsBrokersV2ServiceInstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
  2122. reqHeaders := make(http.Header)
  2123. for k, v := range c.header_ {
  2124. reqHeaders[k] = v
  2125. }
  2126. reqHeaders.Set("User-Agent", c.s.userAgent())
  2127. var body io.Reader = nil
  2128. c.urlParams_.Set("alt", alt)
  2129. c.urlParams_.Set("prettyPrint", "false")
  2130. urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/v2/service_instances/{+instanceId}")
  2131. urls += "?" + c.urlParams_.Encode()
  2132. req, err := http.NewRequest("DELETE", urls, body)
  2133. if err != nil {
  2134. return nil, err
  2135. }
  2136. req.Header = reqHeaders
  2137. googleapi.Expand(req.URL, map[string]string{
  2138. "parent": c.parent,
  2139. "instanceId": c.instanceId,
  2140. })
  2141. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2142. }
  2143. // Do executes the "servicebroker.projects.brokers.v2.service_instances.delete" call.
  2144. // Exactly one of
  2145. // *GoogleCloudServicebrokerV1alpha1__DeleteServiceInstanceResponse or
  2146. // error will be non-nil. Any non-2xx status code is an error. Response
  2147. // headers are in either
  2148. // *GoogleCloudServicebrokerV1alpha1__DeleteServiceInstanceResponse.Serve
  2149. // rResponse.Header or (if a response was returned at all) in
  2150. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2151. // whether the returned error was because http.StatusNotModified was
  2152. // returned.
  2153. func (c *ProjectsBrokersV2ServiceInstancesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleCloudServicebrokerV1alpha1__DeleteServiceInstanceResponse, error) {
  2154. gensupport.SetOptions(c.urlParams_, opts...)
  2155. res, err := c.doRequest("json")
  2156. if res != nil && res.StatusCode == http.StatusNotModified {
  2157. if res.Body != nil {
  2158. res.Body.Close()
  2159. }
  2160. return nil, &googleapi.Error{
  2161. Code: res.StatusCode,
  2162. Header: res.Header,
  2163. }
  2164. }
  2165. if err != nil {
  2166. return nil, err
  2167. }
  2168. defer googleapi.CloseBody(res)
  2169. if err := googleapi.CheckResponse(res); err != nil {
  2170. return nil, err
  2171. }
  2172. ret := &GoogleCloudServicebrokerV1alpha1__DeleteServiceInstanceResponse{
  2173. ServerResponse: googleapi.ServerResponse{
  2174. Header: res.Header,
  2175. HTTPStatusCode: res.StatusCode,
  2176. },
  2177. }
  2178. target := &ret
  2179. if err := gensupport.DecodeResponse(target, res); err != nil {
  2180. return nil, err
  2181. }
  2182. return ret, nil
  2183. // {
  2184. // "description": "Deprovisions a service instance.\nFor synchronous/asynchronous request details see CreateServiceInstance\nmethod.\nIf service instance does not exist HTTP 410 status will be returned.",
  2185. // "flatPath": "v1alpha1/projects/{projectsId}/brokers/{brokersId}/v2/service_instances/{service_instancesId}",
  2186. // "httpMethod": "DELETE",
  2187. // "id": "servicebroker.projects.brokers.v2.service_instances.delete",
  2188. // "parameterOrder": [
  2189. // "parent",
  2190. // "instanceId"
  2191. // ],
  2192. // "parameters": {
  2193. // "acceptsIncomplete": {
  2194. // "description": "See CreateServiceInstanceRequest for details.",
  2195. // "location": "query",
  2196. // "type": "boolean"
  2197. // },
  2198. // "instanceId": {
  2199. // "description": "The instance id to deprovision.",
  2200. // "location": "path",
  2201. // "pattern": "^[^/]+$",
  2202. // "required": true,
  2203. // "type": "string"
  2204. // },
  2205. // "parent": {
  2206. // "description": "Parent must match `projects/[PROJECT_ID]/brokers/[BROKER_ID]`.",
  2207. // "location": "path",
  2208. // "pattern": "^projects/[^/]+/brokers/[^/]+$",
  2209. // "required": true,
  2210. // "type": "string"
  2211. // },
  2212. // "planId": {
  2213. // "description": "The plan id of the service instance.",
  2214. // "location": "query",
  2215. // "type": "string"
  2216. // },
  2217. // "serviceId": {
  2218. // "description": "The service id of the service instance.",
  2219. // "location": "query",
  2220. // "type": "string"
  2221. // }
  2222. // },
  2223. // "path": "v1alpha1/{+parent}/v2/service_instances/{+instanceId}",
  2224. // "response": {
  2225. // "$ref": "GoogleCloudServicebrokerV1alpha1__DeleteServiceInstanceResponse"
  2226. // },
  2227. // "scopes": [
  2228. // "https://www.googleapis.com/auth/cloud-platform"
  2229. // ]
  2230. // }
  2231. }
  2232. // method id "servicebroker.projects.brokers.v2.service_instances.get":
  2233. type ProjectsBrokersV2ServiceInstancesGetCall struct {
  2234. s *Service
  2235. name string
  2236. urlParams_ gensupport.URLParams
  2237. ifNoneMatch_ string
  2238. ctx_ context.Context
  2239. header_ http.Header
  2240. }
  2241. // Get: Gets the given service instance from the system.
  2242. // This API is an extension and not part of the OSB spec.
  2243. // Hence the path is a standard Google API URL.
  2244. func (r *ProjectsBrokersV2ServiceInstancesService) Get(name string) *ProjectsBrokersV2ServiceInstancesGetCall {
  2245. c := &ProjectsBrokersV2ServiceInstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2246. c.name = name
  2247. return c
  2248. }
  2249. // Fields allows partial responses to be retrieved. See
  2250. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2251. // for more information.
  2252. func (c *ProjectsBrokersV2ServiceInstancesGetCall) Fields(s ...googleapi.Field) *ProjectsBrokersV2ServiceInstancesGetCall {
  2253. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2254. return c
  2255. }
  2256. // IfNoneMatch sets the optional parameter which makes the operation
  2257. // fail if the object's ETag matches the given value. This is useful for
  2258. // getting updates only after the object has changed since the last
  2259. // request. Use googleapi.IsNotModified to check whether the response
  2260. // error from Do is the result of In-None-Match.
  2261. func (c *ProjectsBrokersV2ServiceInstancesGetCall) IfNoneMatch(entityTag string) *ProjectsBrokersV2ServiceInstancesGetCall {
  2262. c.ifNoneMatch_ = entityTag
  2263. return c
  2264. }
  2265. // Context sets the context to be used in this call's Do method. Any
  2266. // pending HTTP request will be aborted if the provided context is
  2267. // canceled.
  2268. func (c *ProjectsBrokersV2ServiceInstancesGetCall) Context(ctx context.Context) *ProjectsBrokersV2ServiceInstancesGetCall {
  2269. c.ctx_ = ctx
  2270. return c
  2271. }
  2272. // Header returns an http.Header that can be modified by the caller to
  2273. // add HTTP headers to the request.
  2274. func (c *ProjectsBrokersV2ServiceInstancesGetCall) Header() http.Header {
  2275. if c.header_ == nil {
  2276. c.header_ = make(http.Header)
  2277. }
  2278. return c.header_
  2279. }
  2280. func (c *ProjectsBrokersV2ServiceInstancesGetCall) doRequest(alt string) (*http.Response, error) {
  2281. reqHeaders := make(http.Header)
  2282. for k, v := range c.header_ {
  2283. reqHeaders[k] = v
  2284. }
  2285. reqHeaders.Set("User-Agent", c.s.userAgent())
  2286. if c.ifNoneMatch_ != "" {
  2287. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2288. }
  2289. var body io.Reader = nil
  2290. c.urlParams_.Set("alt", alt)
  2291. c.urlParams_.Set("prettyPrint", "false")
  2292. urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
  2293. urls += "?" + c.urlParams_.Encode()
  2294. req, err := http.NewRequest("GET", urls, body)
  2295. if err != nil {
  2296. return nil, err
  2297. }
  2298. req.Header = reqHeaders
  2299. googleapi.Expand(req.URL, map[string]string{
  2300. "name": c.name,
  2301. })
  2302. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2303. }
  2304. // Do executes the "servicebroker.projects.brokers.v2.service_instances.get" call.
  2305. // Exactly one of *GoogleCloudServicebrokerV1alpha1__ServiceInstance or
  2306. // error will be non-nil. Any non-2xx status code is an error. Response
  2307. // headers are in either
  2308. // *GoogleCloudServicebrokerV1alpha1__ServiceInstance.ServerResponse.Head
  2309. // er or (if a response was returned at all) in
  2310. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2311. // whether the returned error was because http.StatusNotModified was
  2312. // returned.
  2313. func (c *ProjectsBrokersV2ServiceInstancesGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudServicebrokerV1alpha1__ServiceInstance, error) {
  2314. gensupport.SetOptions(c.urlParams_, opts...)
  2315. res, err := c.doRequest("json")
  2316. if res != nil && res.StatusCode == http.StatusNotModified {
  2317. if res.Body != nil {
  2318. res.Body.Close()
  2319. }
  2320. return nil, &googleapi.Error{
  2321. Code: res.StatusCode,
  2322. Header: res.Header,
  2323. }
  2324. }
  2325. if err != nil {
  2326. return nil, err
  2327. }
  2328. defer googleapi.CloseBody(res)
  2329. if err := googleapi.CheckResponse(res); err != nil {
  2330. return nil, err
  2331. }
  2332. ret := &GoogleCloudServicebrokerV1alpha1__ServiceInstance{
  2333. ServerResponse: googleapi.ServerResponse{
  2334. Header: res.Header,
  2335. HTTPStatusCode: res.StatusCode,
  2336. },
  2337. }
  2338. target := &ret
  2339. if err := gensupport.DecodeResponse(target, res); err != nil {
  2340. return nil, err
  2341. }
  2342. return ret, nil
  2343. // {
  2344. // "description": "Gets the given service instance from the system.\nThis API is an extension and not part of the OSB spec.\nHence the path is a standard Google API URL.",
  2345. // "flatPath": "v1alpha1/projects/{projectsId}/brokers/{brokersId}/v2/service_instances/{service_instancesId}",
  2346. // "httpMethod": "GET",
  2347. // "id": "servicebroker.projects.brokers.v2.service_instances.get",
  2348. // "parameterOrder": [
  2349. // "name"
  2350. // ],
  2351. // "parameters": {
  2352. // "name": {
  2353. // "description": "The resource name of the instance to return.",
  2354. // "location": "path",
  2355. // "pattern": "^projects/[^/]+/brokers/[^/]+/v2/service_instances/[^/]+$",
  2356. // "required": true,
  2357. // "type": "string"
  2358. // }
  2359. // },
  2360. // "path": "v1alpha1/{+name}",
  2361. // "response": {
  2362. // "$ref": "GoogleCloudServicebrokerV1alpha1__ServiceInstance"
  2363. // },
  2364. // "scopes": [
  2365. // "https://www.googleapis.com/auth/cloud-platform"
  2366. // ]
  2367. // }
  2368. }
  2369. // method id "servicebroker.projects.brokers.v2.service_instances.getLast_operation":
  2370. type ProjectsBrokersV2ServiceInstancesGetLastOperationCall struct {
  2371. s *Service
  2372. parent string
  2373. instanceId string
  2374. urlParams_ gensupport.URLParams
  2375. ifNoneMatch_ string
  2376. ctx_ context.Context
  2377. header_ http.Header
  2378. }
  2379. // GetLastOperation: Returns the state of the last operation for the
  2380. // service instance.
  2381. // Only last (or current) operation can be polled.
  2382. func (r *ProjectsBrokersV2ServiceInstancesService) GetLastOperation(parent string, instanceId string) *ProjectsBrokersV2ServiceInstancesGetLastOperationCall {
  2383. c := &ProjectsBrokersV2ServiceInstancesGetLastOperationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2384. c.parent = parent
  2385. c.instanceId = instanceId
  2386. return c
  2387. }
  2388. // Operation sets the optional parameter "operation": If `operation` was
  2389. // returned during mutation operation, this field must be
  2390. // populated with the provided value.
  2391. func (c *ProjectsBrokersV2ServiceInstancesGetLastOperationCall) Operation(operation string) *ProjectsBrokersV2ServiceInstancesGetLastOperationCall {
  2392. c.urlParams_.Set("operation", operation)
  2393. return c
  2394. }
  2395. // PlanId sets the optional parameter "planId": Plan id.
  2396. func (c *ProjectsBrokersV2ServiceInstancesGetLastOperationCall) PlanId(planId string) *ProjectsBrokersV2ServiceInstancesGetLastOperationCall {
  2397. c.urlParams_.Set("planId", planId)
  2398. return c
  2399. }
  2400. // ServiceId sets the optional parameter "serviceId": Service id.
  2401. func (c *ProjectsBrokersV2ServiceInstancesGetLastOperationCall) ServiceId(serviceId string) *ProjectsBrokersV2ServiceInstancesGetLastOperationCall {
  2402. c.urlParams_.Set("serviceId", serviceId)
  2403. return c
  2404. }
  2405. // Fields allows partial responses to be retrieved. See
  2406. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2407. // for more information.
  2408. func (c *ProjectsBrokersV2ServiceInstancesGetLastOperationCall) Fields(s ...googleapi.Field) *ProjectsBrokersV2ServiceInstancesGetLastOperationCall {
  2409. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2410. return c
  2411. }
  2412. // IfNoneMatch sets the optional parameter which makes the operation
  2413. // fail if the object's ETag matches the given value. This is useful for
  2414. // getting updates only after the object has changed since the last
  2415. // request. Use googleapi.IsNotModified to check whether the response
  2416. // error from Do is the result of In-None-Match.
  2417. func (c *ProjectsBrokersV2ServiceInstancesGetLastOperationCall) IfNoneMatch(entityTag string) *ProjectsBrokersV2ServiceInstancesGetLastOperationCall {
  2418. c.ifNoneMatch_ = entityTag
  2419. return c
  2420. }
  2421. // Context sets the context to be used in this call's Do method. Any
  2422. // pending HTTP request will be aborted if the provided context is
  2423. // canceled.
  2424. func (c *ProjectsBrokersV2ServiceInstancesGetLastOperationCall) Context(ctx context.Context) *ProjectsBrokersV2ServiceInstancesGetLastOperationCall {
  2425. c.ctx_ = ctx
  2426. return c
  2427. }
  2428. // Header returns an http.Header that can be modified by the caller to
  2429. // add HTTP headers to the request.
  2430. func (c *ProjectsBrokersV2ServiceInstancesGetLastOperationCall) Header() http.Header {
  2431. if c.header_ == nil {
  2432. c.header_ = make(http.Header)
  2433. }
  2434. return c.header_
  2435. }
  2436. func (c *ProjectsBrokersV2ServiceInstancesGetLastOperationCall) doRequest(alt string) (*http.Response, error) {
  2437. reqHeaders := make(http.Header)
  2438. for k, v := range c.header_ {
  2439. reqHeaders[k] = v
  2440. }
  2441. reqHeaders.Set("User-Agent", c.s.userAgent())
  2442. if c.ifNoneMatch_ != "" {
  2443. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2444. }
  2445. var body io.Reader = nil
  2446. c.urlParams_.Set("alt", alt)
  2447. c.urlParams_.Set("prettyPrint", "false")
  2448. urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/v2/service_instances/{+instanceId}/last_operation")
  2449. urls += "?" + c.urlParams_.Encode()
  2450. req, err := http.NewRequest("GET", urls, body)
  2451. if err != nil {
  2452. return nil, err
  2453. }
  2454. req.Header = reqHeaders
  2455. googleapi.Expand(req.URL, map[string]string{
  2456. "parent": c.parent,
  2457. "instanceId": c.instanceId,
  2458. })
  2459. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2460. }
  2461. // Do executes the "servicebroker.projects.brokers.v2.service_instances.getLast_operation" call.
  2462. // Exactly one of *GoogleCloudServicebrokerV1alpha1__Operation or error
  2463. // will be non-nil. Any non-2xx status code is an error. Response
  2464. // headers are in either
  2465. // *GoogleCloudServicebrokerV1alpha1__Operation.ServerResponse.Header or
  2466. // (if a response was returned at all) in
  2467. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2468. // whether the returned error was because http.StatusNotModified was
  2469. // returned.
  2470. func (c *ProjectsBrokersV2ServiceInstancesGetLastOperationCall) Do(opts ...googleapi.CallOption) (*GoogleCloudServicebrokerV1alpha1__Operation, error) {
  2471. gensupport.SetOptions(c.urlParams_, opts...)
  2472. res, err := c.doRequest("json")
  2473. if res != nil && res.StatusCode == http.StatusNotModified {
  2474. if res.Body != nil {
  2475. res.Body.Close()
  2476. }
  2477. return nil, &googleapi.Error{
  2478. Code: res.StatusCode,
  2479. Header: res.Header,
  2480. }
  2481. }
  2482. if err != nil {
  2483. return nil, err
  2484. }
  2485. defer googleapi.CloseBody(res)
  2486. if err := googleapi.CheckResponse(res); err != nil {
  2487. return nil, err
  2488. }
  2489. ret := &GoogleCloudServicebrokerV1alpha1__Operation{
  2490. ServerResponse: googleapi.ServerResponse{
  2491. Header: res.Header,
  2492. HTTPStatusCode: res.StatusCode,
  2493. },
  2494. }
  2495. target := &ret
  2496. if err := gensupport.DecodeResponse(target, res); err != nil {
  2497. return nil, err
  2498. }
  2499. return ret, nil
  2500. // {
  2501. // "description": "Returns the state of the last operation for the service instance.\nOnly last (or current) operation can be polled.",
  2502. // "flatPath": "v1alpha1/projects/{projectsId}/brokers/{brokersId}/v2/service_instances/{service_instancesId}/last_operation",
  2503. // "httpMethod": "GET",
  2504. // "id": "servicebroker.projects.brokers.v2.service_instances.getLast_operation",
  2505. // "parameterOrder": [
  2506. // "parent",
  2507. // "instanceId"
  2508. // ],
  2509. // "parameters": {
  2510. // "instanceId": {
  2511. // "description": "The instance id for which to return the last operation status.",
  2512. // "location": "path",
  2513. // "pattern": "^[^/]+$",
  2514. // "required": true,
  2515. // "type": "string"
  2516. // },
  2517. // "operation": {
  2518. // "description": "If `operation` was returned during mutation operation, this field must be\npopulated with the provided value.",
  2519. // "location": "query",
  2520. // "type": "string"
  2521. // },
  2522. // "parent": {
  2523. // "description": "Parent must match `projects/[PROJECT_ID]/brokers/[BROKER_ID]`.",
  2524. // "location": "path",
  2525. // "pattern": "^projects/[^/]+/brokers/[^/]+$",
  2526. // "required": true,
  2527. // "type": "string"
  2528. // },
  2529. // "planId": {
  2530. // "description": "Plan id.",
  2531. // "location": "query",
  2532. // "type": "string"
  2533. // },
  2534. // "serviceId": {
  2535. // "description": "Service id.",
  2536. // "location": "query",
  2537. // "type": "string"
  2538. // }
  2539. // },
  2540. // "path": "v1alpha1/{+parent}/v2/service_instances/{+instanceId}/last_operation",
  2541. // "response": {
  2542. // "$ref": "GoogleCloudServicebrokerV1alpha1__Operation"
  2543. // },
  2544. // "scopes": [
  2545. // "https://www.googleapis.com/auth/cloud-platform"
  2546. // ]
  2547. // }
  2548. }
  2549. // method id "servicebroker.projects.brokers.v2.service_instances.patch":
  2550. type ProjectsBrokersV2ServiceInstancesPatchCall struct {
  2551. s *Service
  2552. parent string
  2553. instanceId string
  2554. googlecloudservicebrokerv1alpha1__serviceinstance *GoogleCloudServicebrokerV1alpha1__ServiceInstance
  2555. urlParams_ gensupport.URLParams
  2556. ctx_ context.Context
  2557. header_ http.Header
  2558. }
  2559. // Patch: Updates an existing service instance.
  2560. // See CreateServiceInstance for possible response codes.
  2561. func (r *ProjectsBrokersV2ServiceInstancesService) Patch(parent string, instanceId string, googlecloudservicebrokerv1alpha1__serviceinstance *GoogleCloudServicebrokerV1alpha1__ServiceInstance) *ProjectsBrokersV2ServiceInstancesPatchCall {
  2562. c := &ProjectsBrokersV2ServiceInstancesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2563. c.parent = parent
  2564. c.instanceId = instanceId
  2565. c.googlecloudservicebrokerv1alpha1__serviceinstance = googlecloudservicebrokerv1alpha1__serviceinstance
  2566. return c
  2567. }
  2568. // AcceptsIncomplete sets the optional parameter "acceptsIncomplete":
  2569. // See CreateServiceInstanceRequest for details.
  2570. func (c *ProjectsBrokersV2ServiceInstancesPatchCall) AcceptsIncomplete(acceptsIncomplete bool) *ProjectsBrokersV2ServiceInstancesPatchCall {
  2571. c.urlParams_.Set("acceptsIncomplete", fmt.Sprint(acceptsIncomplete))
  2572. return c
  2573. }
  2574. // Fields allows partial responses to be retrieved. See
  2575. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2576. // for more information.
  2577. func (c *ProjectsBrokersV2ServiceInstancesPatchCall) Fields(s ...googleapi.Field) *ProjectsBrokersV2ServiceInstancesPatchCall {
  2578. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2579. return c
  2580. }
  2581. // Context sets the context to be used in this call's Do method. Any
  2582. // pending HTTP request will be aborted if the provided context is
  2583. // canceled.
  2584. func (c *ProjectsBrokersV2ServiceInstancesPatchCall) Context(ctx context.Context) *ProjectsBrokersV2ServiceInstancesPatchCall {
  2585. c.ctx_ = ctx
  2586. return c
  2587. }
  2588. // Header returns an http.Header that can be modified by the caller to
  2589. // add HTTP headers to the request.
  2590. func (c *ProjectsBrokersV2ServiceInstancesPatchCall) Header() http.Header {
  2591. if c.header_ == nil {
  2592. c.header_ = make(http.Header)
  2593. }
  2594. return c.header_
  2595. }
  2596. func (c *ProjectsBrokersV2ServiceInstancesPatchCall) doRequest(alt string) (*http.Response, error) {
  2597. reqHeaders := make(http.Header)
  2598. for k, v := range c.header_ {
  2599. reqHeaders[k] = v
  2600. }
  2601. reqHeaders.Set("User-Agent", c.s.userAgent())
  2602. var body io.Reader = nil
  2603. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudservicebrokerv1alpha1__serviceinstance)
  2604. if err != nil {
  2605. return nil, err
  2606. }
  2607. reqHeaders.Set("Content-Type", "application/json")
  2608. c.urlParams_.Set("alt", alt)
  2609. c.urlParams_.Set("prettyPrint", "false")
  2610. urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/v2/service_instances/{+instance_id}")
  2611. urls += "?" + c.urlParams_.Encode()
  2612. req, err := http.NewRequest("PATCH", urls, body)
  2613. if err != nil {
  2614. return nil, err
  2615. }
  2616. req.Header = reqHeaders
  2617. googleapi.Expand(req.URL, map[string]string{
  2618. "parent": c.parent,
  2619. "instance_id": c.instanceId,
  2620. })
  2621. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2622. }
  2623. // Do executes the "servicebroker.projects.brokers.v2.service_instances.patch" call.
  2624. // Exactly one of
  2625. // *GoogleCloudServicebrokerV1alpha1__UpdateServiceInstanceResponse or
  2626. // error will be non-nil. Any non-2xx status code is an error. Response
  2627. // headers are in either
  2628. // *GoogleCloudServicebrokerV1alpha1__UpdateServiceInstanceResponse.Serve
  2629. // rResponse.Header or (if a response was returned at all) in
  2630. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2631. // whether the returned error was because http.StatusNotModified was
  2632. // returned.
  2633. func (c *ProjectsBrokersV2ServiceInstancesPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudServicebrokerV1alpha1__UpdateServiceInstanceResponse, error) {
  2634. gensupport.SetOptions(c.urlParams_, opts...)
  2635. res, err := c.doRequest("json")
  2636. if res != nil && res.StatusCode == http.StatusNotModified {
  2637. if res.Body != nil {
  2638. res.Body.Close()
  2639. }
  2640. return nil, &googleapi.Error{
  2641. Code: res.StatusCode,
  2642. Header: res.Header,
  2643. }
  2644. }
  2645. if err != nil {
  2646. return nil, err
  2647. }
  2648. defer googleapi.CloseBody(res)
  2649. if err := googleapi.CheckResponse(res); err != nil {
  2650. return nil, err
  2651. }
  2652. ret := &GoogleCloudServicebrokerV1alpha1__UpdateServiceInstanceResponse{
  2653. ServerResponse: googleapi.ServerResponse{
  2654. Header: res.Header,
  2655. HTTPStatusCode: res.StatusCode,
  2656. },
  2657. }
  2658. target := &ret
  2659. if err := gensupport.DecodeResponse(target, res); err != nil {
  2660. return nil, err
  2661. }
  2662. return ret, nil
  2663. // {
  2664. // "description": "Updates an existing service instance.\nSee CreateServiceInstance for possible response codes.",
  2665. // "flatPath": "v1alpha1/projects/{projectsId}/brokers/{brokersId}/v2/service_instances/{service_instancesId}",
  2666. // "httpMethod": "PATCH",
  2667. // "id": "servicebroker.projects.brokers.v2.service_instances.patch",
  2668. // "parameterOrder": [
  2669. // "parent",
  2670. // "instance_id"
  2671. // ],
  2672. // "parameters": {
  2673. // "acceptsIncomplete": {
  2674. // "description": "See CreateServiceInstanceRequest for details.",
  2675. // "location": "query",
  2676. // "type": "boolean"
  2677. // },
  2678. // "instance_id": {
  2679. // "description": "The id of the service instance. Must be unique within GCP project.\nMaximum length is 64, GUID recommended.\nRequired.",
  2680. // "location": "path",
  2681. // "pattern": "^[^/]+$",
  2682. // "required": true,
  2683. // "type": "string"
  2684. // },
  2685. // "parent": {
  2686. // "description": "Parent must match `projects/[PROJECT_ID]/brokers/[BROKER_ID]`.",
  2687. // "location": "path",
  2688. // "pattern": "^projects/[^/]+/brokers/[^/]+$",
  2689. // "required": true,
  2690. // "type": "string"
  2691. // }
  2692. // },
  2693. // "path": "v1alpha1/{+parent}/v2/service_instances/{+instance_id}",
  2694. // "request": {
  2695. // "$ref": "GoogleCloudServicebrokerV1alpha1__ServiceInstance"
  2696. // },
  2697. // "response": {
  2698. // "$ref": "GoogleCloudServicebrokerV1alpha1__UpdateServiceInstanceResponse"
  2699. // },
  2700. // "scopes": [
  2701. // "https://www.googleapis.com/auth/cloud-platform"
  2702. // ]
  2703. // }
  2704. }
  2705. // method id "servicebroker.projects.brokers.v2.service_instances.service_bindings.create":
  2706. type ProjectsBrokersV2ServiceInstancesServiceBindingsCreateCall struct {
  2707. s *Service
  2708. parent string
  2709. instanceId string
  2710. bindingId string
  2711. googlecloudservicebrokerv1alpha1__binding *GoogleCloudServicebrokerV1alpha1__Binding
  2712. urlParams_ gensupport.URLParams
  2713. ctx_ context.Context
  2714. header_ http.Header
  2715. }
  2716. // Create: CreateBinding generates a service binding to an existing
  2717. // service instance.
  2718. // See ProviServiceInstance for async operation details.
  2719. func (r *ProjectsBrokersV2ServiceInstancesServiceBindingsService) Create(parent string, instanceId string, bindingId string, googlecloudservicebrokerv1alpha1__binding *GoogleCloudServicebrokerV1alpha1__Binding) *ProjectsBrokersV2ServiceInstancesServiceBindingsCreateCall {
  2720. c := &ProjectsBrokersV2ServiceInstancesServiceBindingsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2721. c.parent = parent
  2722. c.instanceId = instanceId
  2723. c.bindingId = bindingId
  2724. c.googlecloudservicebrokerv1alpha1__binding = googlecloudservicebrokerv1alpha1__binding
  2725. return c
  2726. }
  2727. // AcceptsIncomplete sets the optional parameter "acceptsIncomplete":
  2728. // See CreateServiceInstanceRequest for details.
  2729. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsCreateCall) AcceptsIncomplete(acceptsIncomplete bool) *ProjectsBrokersV2ServiceInstancesServiceBindingsCreateCall {
  2730. c.urlParams_.Set("acceptsIncomplete", fmt.Sprint(acceptsIncomplete))
  2731. return c
  2732. }
  2733. // Fields allows partial responses to be retrieved. See
  2734. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2735. // for more information.
  2736. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsCreateCall) Fields(s ...googleapi.Field) *ProjectsBrokersV2ServiceInstancesServiceBindingsCreateCall {
  2737. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2738. return c
  2739. }
  2740. // Context sets the context to be used in this call's Do method. Any
  2741. // pending HTTP request will be aborted if the provided context is
  2742. // canceled.
  2743. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsCreateCall) Context(ctx context.Context) *ProjectsBrokersV2ServiceInstancesServiceBindingsCreateCall {
  2744. c.ctx_ = ctx
  2745. return c
  2746. }
  2747. // Header returns an http.Header that can be modified by the caller to
  2748. // add HTTP headers to the request.
  2749. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsCreateCall) Header() http.Header {
  2750. if c.header_ == nil {
  2751. c.header_ = make(http.Header)
  2752. }
  2753. return c.header_
  2754. }
  2755. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsCreateCall) doRequest(alt string) (*http.Response, error) {
  2756. reqHeaders := make(http.Header)
  2757. for k, v := range c.header_ {
  2758. reqHeaders[k] = v
  2759. }
  2760. reqHeaders.Set("User-Agent", c.s.userAgent())
  2761. var body io.Reader = nil
  2762. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudservicebrokerv1alpha1__binding)
  2763. if err != nil {
  2764. return nil, err
  2765. }
  2766. reqHeaders.Set("Content-Type", "application/json")
  2767. c.urlParams_.Set("alt", alt)
  2768. c.urlParams_.Set("prettyPrint", "false")
  2769. urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/v2/service_instances/{+instanceId}/service_bindings/{+binding_id}")
  2770. urls += "?" + c.urlParams_.Encode()
  2771. req, err := http.NewRequest("PUT", urls, body)
  2772. if err != nil {
  2773. return nil, err
  2774. }
  2775. req.Header = reqHeaders
  2776. googleapi.Expand(req.URL, map[string]string{
  2777. "parent": c.parent,
  2778. "instanceId": c.instanceId,
  2779. "binding_id": c.bindingId,
  2780. })
  2781. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2782. }
  2783. // Do executes the "servicebroker.projects.brokers.v2.service_instances.service_bindings.create" call.
  2784. // Exactly one of
  2785. // *GoogleCloudServicebrokerV1alpha1__CreateBindingResponse or error
  2786. // will be non-nil. Any non-2xx status code is an error. Response
  2787. // headers are in either
  2788. // *GoogleCloudServicebrokerV1alpha1__CreateBindingResponse.ServerRespons
  2789. // e.Header or (if a response was returned at all) in
  2790. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2791. // whether the returned error was because http.StatusNotModified was
  2792. // returned.
  2793. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudServicebrokerV1alpha1__CreateBindingResponse, error) {
  2794. gensupport.SetOptions(c.urlParams_, opts...)
  2795. res, err := c.doRequest("json")
  2796. if res != nil && res.StatusCode == http.StatusNotModified {
  2797. if res.Body != nil {
  2798. res.Body.Close()
  2799. }
  2800. return nil, &googleapi.Error{
  2801. Code: res.StatusCode,
  2802. Header: res.Header,
  2803. }
  2804. }
  2805. if err != nil {
  2806. return nil, err
  2807. }
  2808. defer googleapi.CloseBody(res)
  2809. if err := googleapi.CheckResponse(res); err != nil {
  2810. return nil, err
  2811. }
  2812. ret := &GoogleCloudServicebrokerV1alpha1__CreateBindingResponse{
  2813. ServerResponse: googleapi.ServerResponse{
  2814. Header: res.Header,
  2815. HTTPStatusCode: res.StatusCode,
  2816. },
  2817. }
  2818. target := &ret
  2819. if err := gensupport.DecodeResponse(target, res); err != nil {
  2820. return nil, err
  2821. }
  2822. return ret, nil
  2823. // {
  2824. // "description": "CreateBinding generates a service binding to an existing service instance.\nSee ProviServiceInstance for async operation details.",
  2825. // "flatPath": "v1alpha1/projects/{projectsId}/brokers/{brokersId}/v2/service_instances/{service_instancesId}/service_bindings/{service_bindingsId}",
  2826. // "httpMethod": "PUT",
  2827. // "id": "servicebroker.projects.brokers.v2.service_instances.service_bindings.create",
  2828. // "parameterOrder": [
  2829. // "parent",
  2830. // "instanceId",
  2831. // "binding_id"
  2832. // ],
  2833. // "parameters": {
  2834. // "acceptsIncomplete": {
  2835. // "description": "See CreateServiceInstanceRequest for details.",
  2836. // "location": "query",
  2837. // "type": "boolean"
  2838. // },
  2839. // "binding_id": {
  2840. // "description": "The id of the binding. Must be unique within GCP project.\nMaximum length is 64, GUID recommended.\nRequired.",
  2841. // "location": "path",
  2842. // "pattern": "^[^/]+$",
  2843. // "required": true,
  2844. // "type": "string"
  2845. // },
  2846. // "instanceId": {
  2847. // "description": "The service instance to which to bind.",
  2848. // "location": "path",
  2849. // "pattern": "^[^/]+$",
  2850. // "required": true,
  2851. // "type": "string"
  2852. // },
  2853. // "parent": {
  2854. // "description": "The GCP container.\nMust match\n`projects/[PROJECT_ID]/brokers/[BROKER_ID]`.",
  2855. // "location": "path",
  2856. // "pattern": "^projects/[^/]+/brokers/[^/]+$",
  2857. // "required": true,
  2858. // "type": "string"
  2859. // }
  2860. // },
  2861. // "path": "v1alpha1/{+parent}/v2/service_instances/{+instanceId}/service_bindings/{+binding_id}",
  2862. // "request": {
  2863. // "$ref": "GoogleCloudServicebrokerV1alpha1__Binding"
  2864. // },
  2865. // "response": {
  2866. // "$ref": "GoogleCloudServicebrokerV1alpha1__CreateBindingResponse"
  2867. // },
  2868. // "scopes": [
  2869. // "https://www.googleapis.com/auth/cloud-platform"
  2870. // ]
  2871. // }
  2872. }
  2873. // method id "servicebroker.projects.brokers.v2.service_instances.service_bindings.delete":
  2874. type ProjectsBrokersV2ServiceInstancesServiceBindingsDeleteCall struct {
  2875. s *Service
  2876. parent string
  2877. instanceId string
  2878. bindingId string
  2879. urlParams_ gensupport.URLParams
  2880. ctx_ context.Context
  2881. header_ http.Header
  2882. }
  2883. // Delete: Unbinds from a service instance.
  2884. // For synchronous/asynchronous request details see
  2885. // CreateServiceInstance
  2886. // method.
  2887. // If binding does not exist HTTP 410 status will be returned.
  2888. func (r *ProjectsBrokersV2ServiceInstancesServiceBindingsService) Delete(parent string, instanceId string, bindingId string) *ProjectsBrokersV2ServiceInstancesServiceBindingsDeleteCall {
  2889. c := &ProjectsBrokersV2ServiceInstancesServiceBindingsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2890. c.parent = parent
  2891. c.instanceId = instanceId
  2892. c.bindingId = bindingId
  2893. return c
  2894. }
  2895. // AcceptsIncomplete sets the optional parameter "acceptsIncomplete":
  2896. // See CreateServiceInstanceRequest for details.
  2897. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsDeleteCall) AcceptsIncomplete(acceptsIncomplete bool) *ProjectsBrokersV2ServiceInstancesServiceBindingsDeleteCall {
  2898. c.urlParams_.Set("acceptsIncomplete", fmt.Sprint(acceptsIncomplete))
  2899. return c
  2900. }
  2901. // PlanId sets the optional parameter "planId": The plan id of the
  2902. // service instance.
  2903. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsDeleteCall) PlanId(planId string) *ProjectsBrokersV2ServiceInstancesServiceBindingsDeleteCall {
  2904. c.urlParams_.Set("planId", planId)
  2905. return c
  2906. }
  2907. // ServiceId sets the optional parameter "serviceId": Additional query
  2908. // parameter hints.
  2909. // The service id of the service instance.
  2910. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsDeleteCall) ServiceId(serviceId string) *ProjectsBrokersV2ServiceInstancesServiceBindingsDeleteCall {
  2911. c.urlParams_.Set("serviceId", serviceId)
  2912. return c
  2913. }
  2914. // Fields allows partial responses to be retrieved. See
  2915. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2916. // for more information.
  2917. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsDeleteCall) Fields(s ...googleapi.Field) *ProjectsBrokersV2ServiceInstancesServiceBindingsDeleteCall {
  2918. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2919. return c
  2920. }
  2921. // Context sets the context to be used in this call's Do method. Any
  2922. // pending HTTP request will be aborted if the provided context is
  2923. // canceled.
  2924. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsDeleteCall) Context(ctx context.Context) *ProjectsBrokersV2ServiceInstancesServiceBindingsDeleteCall {
  2925. c.ctx_ = ctx
  2926. return c
  2927. }
  2928. // Header returns an http.Header that can be modified by the caller to
  2929. // add HTTP headers to the request.
  2930. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsDeleteCall) Header() http.Header {
  2931. if c.header_ == nil {
  2932. c.header_ = make(http.Header)
  2933. }
  2934. return c.header_
  2935. }
  2936. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsDeleteCall) doRequest(alt string) (*http.Response, error) {
  2937. reqHeaders := make(http.Header)
  2938. for k, v := range c.header_ {
  2939. reqHeaders[k] = v
  2940. }
  2941. reqHeaders.Set("User-Agent", c.s.userAgent())
  2942. var body io.Reader = nil
  2943. c.urlParams_.Set("alt", alt)
  2944. c.urlParams_.Set("prettyPrint", "false")
  2945. urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/v2/service_instances/{instanceId}/service_bindings/{bindingId}")
  2946. urls += "?" + c.urlParams_.Encode()
  2947. req, err := http.NewRequest("DELETE", urls, body)
  2948. if err != nil {
  2949. return nil, err
  2950. }
  2951. req.Header = reqHeaders
  2952. googleapi.Expand(req.URL, map[string]string{
  2953. "parent": c.parent,
  2954. "instanceId": c.instanceId,
  2955. "bindingId": c.bindingId,
  2956. })
  2957. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2958. }
  2959. // Do executes the "servicebroker.projects.brokers.v2.service_instances.service_bindings.delete" call.
  2960. // Exactly one of
  2961. // *GoogleCloudServicebrokerV1alpha1__DeleteBindingResponse or error
  2962. // will be non-nil. Any non-2xx status code is an error. Response
  2963. // headers are in either
  2964. // *GoogleCloudServicebrokerV1alpha1__DeleteBindingResponse.ServerRespons
  2965. // e.Header or (if a response was returned at all) in
  2966. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2967. // whether the returned error was because http.StatusNotModified was
  2968. // returned.
  2969. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleCloudServicebrokerV1alpha1__DeleteBindingResponse, error) {
  2970. gensupport.SetOptions(c.urlParams_, opts...)
  2971. res, err := c.doRequest("json")
  2972. if res != nil && res.StatusCode == http.StatusNotModified {
  2973. if res.Body != nil {
  2974. res.Body.Close()
  2975. }
  2976. return nil, &googleapi.Error{
  2977. Code: res.StatusCode,
  2978. Header: res.Header,
  2979. }
  2980. }
  2981. if err != nil {
  2982. return nil, err
  2983. }
  2984. defer googleapi.CloseBody(res)
  2985. if err := googleapi.CheckResponse(res); err != nil {
  2986. return nil, err
  2987. }
  2988. ret := &GoogleCloudServicebrokerV1alpha1__DeleteBindingResponse{
  2989. ServerResponse: googleapi.ServerResponse{
  2990. Header: res.Header,
  2991. HTTPStatusCode: res.StatusCode,
  2992. },
  2993. }
  2994. target := &ret
  2995. if err := gensupport.DecodeResponse(target, res); err != nil {
  2996. return nil, err
  2997. }
  2998. return ret, nil
  2999. // {
  3000. // "description": "Unbinds from a service instance.\nFor synchronous/asynchronous request details see CreateServiceInstance\nmethod.\nIf binding does not exist HTTP 410 status will be returned.",
  3001. // "flatPath": "v1alpha1/projects/{projectsId}/brokers/{brokersId}/v2/service_instances/{instanceId}/service_bindings/{bindingId}",
  3002. // "httpMethod": "DELETE",
  3003. // "id": "servicebroker.projects.brokers.v2.service_instances.service_bindings.delete",
  3004. // "parameterOrder": [
  3005. // "parent",
  3006. // "instanceId",
  3007. // "bindingId"
  3008. // ],
  3009. // "parameters": {
  3010. // "acceptsIncomplete": {
  3011. // "description": "See CreateServiceInstanceRequest for details.",
  3012. // "location": "query",
  3013. // "type": "boolean"
  3014. // },
  3015. // "bindingId": {
  3016. // "description": "The id of the binding to delete.",
  3017. // "location": "path",
  3018. // "required": true,
  3019. // "type": "string"
  3020. // },
  3021. // "instanceId": {
  3022. // "description": "The service instance id that deleted binding is bound to.",
  3023. // "location": "path",
  3024. // "required": true,
  3025. // "type": "string"
  3026. // },
  3027. // "parent": {
  3028. // "description": "Parent must match `projects/[PROJECT_ID]/brokers/[BROKER_ID]`.",
  3029. // "location": "path",
  3030. // "pattern": "^projects/[^/]+/brokers/[^/]+$",
  3031. // "required": true,
  3032. // "type": "string"
  3033. // },
  3034. // "planId": {
  3035. // "description": "The plan id of the service instance.",
  3036. // "location": "query",
  3037. // "type": "string"
  3038. // },
  3039. // "serviceId": {
  3040. // "description": "Additional query parameter hints.\nThe service id of the service instance.",
  3041. // "location": "query",
  3042. // "type": "string"
  3043. // }
  3044. // },
  3045. // "path": "v1alpha1/{+parent}/v2/service_instances/{instanceId}/service_bindings/{bindingId}",
  3046. // "response": {
  3047. // "$ref": "GoogleCloudServicebrokerV1alpha1__DeleteBindingResponse"
  3048. // },
  3049. // "scopes": [
  3050. // "https://www.googleapis.com/auth/cloud-platform"
  3051. // ]
  3052. // }
  3053. }
  3054. // method id "servicebroker.projects.brokers.v2.service_instances.service_bindings.get":
  3055. type ProjectsBrokersV2ServiceInstancesServiceBindingsGetCall struct {
  3056. s *Service
  3057. parent string
  3058. instanceId string
  3059. bindingId string
  3060. urlParams_ gensupport.URLParams
  3061. ifNoneMatch_ string
  3062. ctx_ context.Context
  3063. header_ http.Header
  3064. }
  3065. // Get: GetBinding returns the binding information.
  3066. func (r *ProjectsBrokersV2ServiceInstancesServiceBindingsService) Get(parent string, instanceId string, bindingId string) *ProjectsBrokersV2ServiceInstancesServiceBindingsGetCall {
  3067. c := &ProjectsBrokersV2ServiceInstancesServiceBindingsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3068. c.parent = parent
  3069. c.instanceId = instanceId
  3070. c.bindingId = bindingId
  3071. return c
  3072. }
  3073. // PlanId sets the optional parameter "planId": Plan id.
  3074. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsGetCall) PlanId(planId string) *ProjectsBrokersV2ServiceInstancesServiceBindingsGetCall {
  3075. c.urlParams_.Set("planId", planId)
  3076. return c
  3077. }
  3078. // ServiceId sets the optional parameter "serviceId": Service id.
  3079. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsGetCall) ServiceId(serviceId string) *ProjectsBrokersV2ServiceInstancesServiceBindingsGetCall {
  3080. c.urlParams_.Set("serviceId", serviceId)
  3081. return c
  3082. }
  3083. // Fields allows partial responses to be retrieved. See
  3084. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3085. // for more information.
  3086. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsGetCall) Fields(s ...googleapi.Field) *ProjectsBrokersV2ServiceInstancesServiceBindingsGetCall {
  3087. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3088. return c
  3089. }
  3090. // IfNoneMatch sets the optional parameter which makes the operation
  3091. // fail if the object's ETag matches the given value. This is useful for
  3092. // getting updates only after the object has changed since the last
  3093. // request. Use googleapi.IsNotModified to check whether the response
  3094. // error from Do is the result of In-None-Match.
  3095. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsGetCall) IfNoneMatch(entityTag string) *ProjectsBrokersV2ServiceInstancesServiceBindingsGetCall {
  3096. c.ifNoneMatch_ = entityTag
  3097. return c
  3098. }
  3099. // Context sets the context to be used in this call's Do method. Any
  3100. // pending HTTP request will be aborted if the provided context is
  3101. // canceled.
  3102. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsGetCall) Context(ctx context.Context) *ProjectsBrokersV2ServiceInstancesServiceBindingsGetCall {
  3103. c.ctx_ = ctx
  3104. return c
  3105. }
  3106. // Header returns an http.Header that can be modified by the caller to
  3107. // add HTTP headers to the request.
  3108. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsGetCall) Header() http.Header {
  3109. if c.header_ == nil {
  3110. c.header_ = make(http.Header)
  3111. }
  3112. return c.header_
  3113. }
  3114. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsGetCall) doRequest(alt string) (*http.Response, error) {
  3115. reqHeaders := make(http.Header)
  3116. for k, v := range c.header_ {
  3117. reqHeaders[k] = v
  3118. }
  3119. reqHeaders.Set("User-Agent", c.s.userAgent())
  3120. if c.ifNoneMatch_ != "" {
  3121. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3122. }
  3123. var body io.Reader = nil
  3124. c.urlParams_.Set("alt", alt)
  3125. c.urlParams_.Set("prettyPrint", "false")
  3126. urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/v2/service_instances/{+instanceId}/service_bindings/{+bindingId}")
  3127. urls += "?" + c.urlParams_.Encode()
  3128. req, err := http.NewRequest("GET", urls, body)
  3129. if err != nil {
  3130. return nil, err
  3131. }
  3132. req.Header = reqHeaders
  3133. googleapi.Expand(req.URL, map[string]string{
  3134. "parent": c.parent,
  3135. "instanceId": c.instanceId,
  3136. "bindingId": c.bindingId,
  3137. })
  3138. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3139. }
  3140. // Do executes the "servicebroker.projects.brokers.v2.service_instances.service_bindings.get" call.
  3141. // Exactly one of *GoogleCloudServicebrokerV1alpha1__GetBindingResponse
  3142. // or error will be non-nil. Any non-2xx status code is an error.
  3143. // Response headers are in either
  3144. // *GoogleCloudServicebrokerV1alpha1__GetBindingResponse.ServerResponse.H
  3145. // eader or (if a response was returned at all) in
  3146. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3147. // whether the returned error was because http.StatusNotModified was
  3148. // returned.
  3149. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudServicebrokerV1alpha1__GetBindingResponse, error) {
  3150. gensupport.SetOptions(c.urlParams_, opts...)
  3151. res, err := c.doRequest("json")
  3152. if res != nil && res.StatusCode == http.StatusNotModified {
  3153. if res.Body != nil {
  3154. res.Body.Close()
  3155. }
  3156. return nil, &googleapi.Error{
  3157. Code: res.StatusCode,
  3158. Header: res.Header,
  3159. }
  3160. }
  3161. if err != nil {
  3162. return nil, err
  3163. }
  3164. defer googleapi.CloseBody(res)
  3165. if err := googleapi.CheckResponse(res); err != nil {
  3166. return nil, err
  3167. }
  3168. ret := &GoogleCloudServicebrokerV1alpha1__GetBindingResponse{
  3169. ServerResponse: googleapi.ServerResponse{
  3170. Header: res.Header,
  3171. HTTPStatusCode: res.StatusCode,
  3172. },
  3173. }
  3174. target := &ret
  3175. if err := gensupport.DecodeResponse(target, res); err != nil {
  3176. return nil, err
  3177. }
  3178. return ret, nil
  3179. // {
  3180. // "description": "GetBinding returns the binding information.",
  3181. // "flatPath": "v1alpha1/projects/{projectsId}/brokers/{brokersId}/v2/service_instances/{service_instancesId}/service_bindings/{service_bindingsId}",
  3182. // "httpMethod": "GET",
  3183. // "id": "servicebroker.projects.brokers.v2.service_instances.service_bindings.get",
  3184. // "parameterOrder": [
  3185. // "parent",
  3186. // "instanceId",
  3187. // "bindingId"
  3188. // ],
  3189. // "parameters": {
  3190. // "bindingId": {
  3191. // "description": "The binding id.",
  3192. // "location": "path",
  3193. // "pattern": "^[^/]+$",
  3194. // "required": true,
  3195. // "type": "string"
  3196. // },
  3197. // "instanceId": {
  3198. // "description": "Instance id to which the binding is bound.",
  3199. // "location": "path",
  3200. // "pattern": "^[^/]+$",
  3201. // "required": true,
  3202. // "type": "string"
  3203. // },
  3204. // "parent": {
  3205. // "description": "Parent must match `projects/[PROJECT_ID]/brokers/[BROKER_ID]`.",
  3206. // "location": "path",
  3207. // "pattern": "^projects/[^/]+/brokers/[^/]+$",
  3208. // "required": true,
  3209. // "type": "string"
  3210. // },
  3211. // "planId": {
  3212. // "description": "Plan id.",
  3213. // "location": "query",
  3214. // "type": "string"
  3215. // },
  3216. // "serviceId": {
  3217. // "description": "Service id.",
  3218. // "location": "query",
  3219. // "type": "string"
  3220. // }
  3221. // },
  3222. // "path": "v1alpha1/{+parent}/v2/service_instances/{+instanceId}/service_bindings/{+bindingId}",
  3223. // "response": {
  3224. // "$ref": "GoogleCloudServicebrokerV1alpha1__GetBindingResponse"
  3225. // },
  3226. // "scopes": [
  3227. // "https://www.googleapis.com/auth/cloud-platform"
  3228. // ]
  3229. // }
  3230. }
  3231. // method id "servicebroker.projects.brokers.v2.service_instances.service_bindings.getLast_operation":
  3232. type ProjectsBrokersV2ServiceInstancesServiceBindingsGetLastOperationCall struct {
  3233. s *Service
  3234. parent string
  3235. instanceId string
  3236. bindingId string
  3237. urlParams_ gensupport.URLParams
  3238. ifNoneMatch_ string
  3239. ctx_ context.Context
  3240. header_ http.Header
  3241. }
  3242. // GetLastOperation: Returns the state of the last operation for the
  3243. // binding.
  3244. // Only last (or current) operation can be polled.
  3245. func (r *ProjectsBrokersV2ServiceInstancesServiceBindingsService) GetLastOperation(parent string, instanceId string, bindingId string) *ProjectsBrokersV2ServiceInstancesServiceBindingsGetLastOperationCall {
  3246. c := &ProjectsBrokersV2ServiceInstancesServiceBindingsGetLastOperationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3247. c.parent = parent
  3248. c.instanceId = instanceId
  3249. c.bindingId = bindingId
  3250. return c
  3251. }
  3252. // Operation sets the optional parameter "operation": If `operation` was
  3253. // returned during mutation operation, this field must be
  3254. // populated with the provided value.
  3255. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsGetLastOperationCall) Operation(operation string) *ProjectsBrokersV2ServiceInstancesServiceBindingsGetLastOperationCall {
  3256. c.urlParams_.Set("operation", operation)
  3257. return c
  3258. }
  3259. // PlanId sets the optional parameter "planId": Plan id.
  3260. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsGetLastOperationCall) PlanId(planId string) *ProjectsBrokersV2ServiceInstancesServiceBindingsGetLastOperationCall {
  3261. c.urlParams_.Set("planId", planId)
  3262. return c
  3263. }
  3264. // ServiceId sets the optional parameter "serviceId": Service id.
  3265. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsGetLastOperationCall) ServiceId(serviceId string) *ProjectsBrokersV2ServiceInstancesServiceBindingsGetLastOperationCall {
  3266. c.urlParams_.Set("serviceId", serviceId)
  3267. return c
  3268. }
  3269. // Fields allows partial responses to be retrieved. See
  3270. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3271. // for more information.
  3272. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsGetLastOperationCall) Fields(s ...googleapi.Field) *ProjectsBrokersV2ServiceInstancesServiceBindingsGetLastOperationCall {
  3273. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3274. return c
  3275. }
  3276. // IfNoneMatch sets the optional parameter which makes the operation
  3277. // fail if the object's ETag matches the given value. This is useful for
  3278. // getting updates only after the object has changed since the last
  3279. // request. Use googleapi.IsNotModified to check whether the response
  3280. // error from Do is the result of In-None-Match.
  3281. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsGetLastOperationCall) IfNoneMatch(entityTag string) *ProjectsBrokersV2ServiceInstancesServiceBindingsGetLastOperationCall {
  3282. c.ifNoneMatch_ = entityTag
  3283. return c
  3284. }
  3285. // Context sets the context to be used in this call's Do method. Any
  3286. // pending HTTP request will be aborted if the provided context is
  3287. // canceled.
  3288. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsGetLastOperationCall) Context(ctx context.Context) *ProjectsBrokersV2ServiceInstancesServiceBindingsGetLastOperationCall {
  3289. c.ctx_ = ctx
  3290. return c
  3291. }
  3292. // Header returns an http.Header that can be modified by the caller to
  3293. // add HTTP headers to the request.
  3294. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsGetLastOperationCall) Header() http.Header {
  3295. if c.header_ == nil {
  3296. c.header_ = make(http.Header)
  3297. }
  3298. return c.header_
  3299. }
  3300. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsGetLastOperationCall) doRequest(alt string) (*http.Response, error) {
  3301. reqHeaders := make(http.Header)
  3302. for k, v := range c.header_ {
  3303. reqHeaders[k] = v
  3304. }
  3305. reqHeaders.Set("User-Agent", c.s.userAgent())
  3306. if c.ifNoneMatch_ != "" {
  3307. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3308. }
  3309. var body io.Reader = nil
  3310. c.urlParams_.Set("alt", alt)
  3311. c.urlParams_.Set("prettyPrint", "false")
  3312. urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/v2/service_instances/{+instanceId}/service_bindings/{+bindingId}/last_operation")
  3313. urls += "?" + c.urlParams_.Encode()
  3314. req, err := http.NewRequest("GET", urls, body)
  3315. if err != nil {
  3316. return nil, err
  3317. }
  3318. req.Header = reqHeaders
  3319. googleapi.Expand(req.URL, map[string]string{
  3320. "parent": c.parent,
  3321. "instanceId": c.instanceId,
  3322. "bindingId": c.bindingId,
  3323. })
  3324. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3325. }
  3326. // Do executes the "servicebroker.projects.brokers.v2.service_instances.service_bindings.getLast_operation" call.
  3327. // Exactly one of *GoogleCloudServicebrokerV1alpha1__Operation or error
  3328. // will be non-nil. Any non-2xx status code is an error. Response
  3329. // headers are in either
  3330. // *GoogleCloudServicebrokerV1alpha1__Operation.ServerResponse.Header or
  3331. // (if a response was returned at all) in
  3332. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3333. // whether the returned error was because http.StatusNotModified was
  3334. // returned.
  3335. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsGetLastOperationCall) Do(opts ...googleapi.CallOption) (*GoogleCloudServicebrokerV1alpha1__Operation, error) {
  3336. gensupport.SetOptions(c.urlParams_, opts...)
  3337. res, err := c.doRequest("json")
  3338. if res != nil && res.StatusCode == http.StatusNotModified {
  3339. if res.Body != nil {
  3340. res.Body.Close()
  3341. }
  3342. return nil, &googleapi.Error{
  3343. Code: res.StatusCode,
  3344. Header: res.Header,
  3345. }
  3346. }
  3347. if err != nil {
  3348. return nil, err
  3349. }
  3350. defer googleapi.CloseBody(res)
  3351. if err := googleapi.CheckResponse(res); err != nil {
  3352. return nil, err
  3353. }
  3354. ret := &GoogleCloudServicebrokerV1alpha1__Operation{
  3355. ServerResponse: googleapi.ServerResponse{
  3356. Header: res.Header,
  3357. HTTPStatusCode: res.StatusCode,
  3358. },
  3359. }
  3360. target := &ret
  3361. if err := gensupport.DecodeResponse(target, res); err != nil {
  3362. return nil, err
  3363. }
  3364. return ret, nil
  3365. // {
  3366. // "description": "Returns the state of the last operation for the binding.\nOnly last (or current) operation can be polled.",
  3367. // "flatPath": "v1alpha1/projects/{projectsId}/brokers/{brokersId}/v2/service_instances/{service_instancesId}/service_bindings/{service_bindingsId}/last_operation",
  3368. // "httpMethod": "GET",
  3369. // "id": "servicebroker.projects.brokers.v2.service_instances.service_bindings.getLast_operation",
  3370. // "parameterOrder": [
  3371. // "parent",
  3372. // "instanceId",
  3373. // "bindingId"
  3374. // ],
  3375. // "parameters": {
  3376. // "bindingId": {
  3377. // "description": "The binding id for which to return the last operation",
  3378. // "location": "path",
  3379. // "pattern": "^[^/]+$",
  3380. // "required": true,
  3381. // "type": "string"
  3382. // },
  3383. // "instanceId": {
  3384. // "description": "The instance id that the binding is bound to.",
  3385. // "location": "path",
  3386. // "pattern": "^[^/]+$",
  3387. // "required": true,
  3388. // "type": "string"
  3389. // },
  3390. // "operation": {
  3391. // "description": "If `operation` was returned during mutation operation, this field must be\npopulated with the provided value.",
  3392. // "location": "query",
  3393. // "type": "string"
  3394. // },
  3395. // "parent": {
  3396. // "description": "Parent must match `projects/[PROJECT_ID]/brokers/[BROKER_ID]`.",
  3397. // "location": "path",
  3398. // "pattern": "^projects/[^/]+/brokers/[^/]+$",
  3399. // "required": true,
  3400. // "type": "string"
  3401. // },
  3402. // "planId": {
  3403. // "description": "Plan id.",
  3404. // "location": "query",
  3405. // "type": "string"
  3406. // },
  3407. // "serviceId": {
  3408. // "description": "Service id.",
  3409. // "location": "query",
  3410. // "type": "string"
  3411. // }
  3412. // },
  3413. // "path": "v1alpha1/{+parent}/v2/service_instances/{+instanceId}/service_bindings/{+bindingId}/last_operation",
  3414. // "response": {
  3415. // "$ref": "GoogleCloudServicebrokerV1alpha1__Operation"
  3416. // },
  3417. // "scopes": [
  3418. // "https://www.googleapis.com/auth/cloud-platform"
  3419. // ]
  3420. // }
  3421. }
  3422. // method id "servicebroker.getIamPolicy":
  3423. type V1alpha1GetIamPolicyCall struct {
  3424. s *Service
  3425. resource string
  3426. urlParams_ gensupport.URLParams
  3427. ifNoneMatch_ string
  3428. ctx_ context.Context
  3429. header_ http.Header
  3430. }
  3431. // GetIamPolicy: Gets the access control policy for a resource.
  3432. // Returns an empty policy if the resource exists and does not have a
  3433. // policy
  3434. // set.
  3435. func (r *V1alpha1Service) GetIamPolicy(resource string) *V1alpha1GetIamPolicyCall {
  3436. c := &V1alpha1GetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3437. c.resource = resource
  3438. return c
  3439. }
  3440. // Fields allows partial responses to be retrieved. See
  3441. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3442. // for more information.
  3443. func (c *V1alpha1GetIamPolicyCall) Fields(s ...googleapi.Field) *V1alpha1GetIamPolicyCall {
  3444. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3445. return c
  3446. }
  3447. // IfNoneMatch sets the optional parameter which makes the operation
  3448. // fail if the object's ETag matches the given value. This is useful for
  3449. // getting updates only after the object has changed since the last
  3450. // request. Use googleapi.IsNotModified to check whether the response
  3451. // error from Do is the result of In-None-Match.
  3452. func (c *V1alpha1GetIamPolicyCall) IfNoneMatch(entityTag string) *V1alpha1GetIamPolicyCall {
  3453. c.ifNoneMatch_ = entityTag
  3454. return c
  3455. }
  3456. // Context sets the context to be used in this call's Do method. Any
  3457. // pending HTTP request will be aborted if the provided context is
  3458. // canceled.
  3459. func (c *V1alpha1GetIamPolicyCall) Context(ctx context.Context) *V1alpha1GetIamPolicyCall {
  3460. c.ctx_ = ctx
  3461. return c
  3462. }
  3463. // Header returns an http.Header that can be modified by the caller to
  3464. // add HTTP headers to the request.
  3465. func (c *V1alpha1GetIamPolicyCall) Header() http.Header {
  3466. if c.header_ == nil {
  3467. c.header_ = make(http.Header)
  3468. }
  3469. return c.header_
  3470. }
  3471. func (c *V1alpha1GetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  3472. reqHeaders := make(http.Header)
  3473. for k, v := range c.header_ {
  3474. reqHeaders[k] = v
  3475. }
  3476. reqHeaders.Set("User-Agent", c.s.userAgent())
  3477. if c.ifNoneMatch_ != "" {
  3478. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3479. }
  3480. var body io.Reader = nil
  3481. c.urlParams_.Set("alt", alt)
  3482. c.urlParams_.Set("prettyPrint", "false")
  3483. urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+resource}:getIamPolicy")
  3484. urls += "?" + c.urlParams_.Encode()
  3485. req, err := http.NewRequest("GET", urls, body)
  3486. if err != nil {
  3487. return nil, err
  3488. }
  3489. req.Header = reqHeaders
  3490. googleapi.Expand(req.URL, map[string]string{
  3491. "resource": c.resource,
  3492. })
  3493. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3494. }
  3495. // Do executes the "servicebroker.getIamPolicy" call.
  3496. // Exactly one of *GoogleIamV1__Policy or error will be non-nil. Any
  3497. // non-2xx status code is an error. Response headers are in either
  3498. // *GoogleIamV1__Policy.ServerResponse.Header or (if a response was
  3499. // returned at all) in error.(*googleapi.Error).Header. Use
  3500. // googleapi.IsNotModified to check whether the returned error was
  3501. // because http.StatusNotModified was returned.
  3502. func (c *V1alpha1GetIamPolicyCall) Do(opts ...googleapi.CallOption) (*GoogleIamV1__Policy, error) {
  3503. gensupport.SetOptions(c.urlParams_, opts...)
  3504. res, err := c.doRequest("json")
  3505. if res != nil && res.StatusCode == http.StatusNotModified {
  3506. if res.Body != nil {
  3507. res.Body.Close()
  3508. }
  3509. return nil, &googleapi.Error{
  3510. Code: res.StatusCode,
  3511. Header: res.Header,
  3512. }
  3513. }
  3514. if err != nil {
  3515. return nil, err
  3516. }
  3517. defer googleapi.CloseBody(res)
  3518. if err := googleapi.CheckResponse(res); err != nil {
  3519. return nil, err
  3520. }
  3521. ret := &GoogleIamV1__Policy{
  3522. ServerResponse: googleapi.ServerResponse{
  3523. Header: res.Header,
  3524. HTTPStatusCode: res.StatusCode,
  3525. },
  3526. }
  3527. target := &ret
  3528. if err := gensupport.DecodeResponse(target, res); err != nil {
  3529. return nil, err
  3530. }
  3531. return ret, nil
  3532. // {
  3533. // "description": "Gets the access control policy for a resource.\nReturns an empty policy if the resource exists and does not have a policy\nset.",
  3534. // "flatPath": "v1alpha1/{v1alpha1Id}:getIamPolicy",
  3535. // "httpMethod": "GET",
  3536. // "id": "servicebroker.getIamPolicy",
  3537. // "parameterOrder": [
  3538. // "resource"
  3539. // ],
  3540. // "parameters": {
  3541. // "resource": {
  3542. // "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field.",
  3543. // "location": "path",
  3544. // "pattern": "^.+$",
  3545. // "required": true,
  3546. // "type": "string"
  3547. // }
  3548. // },
  3549. // "path": "v1alpha1/{+resource}:getIamPolicy",
  3550. // "response": {
  3551. // "$ref": "GoogleIamV1__Policy"
  3552. // },
  3553. // "scopes": [
  3554. // "https://www.googleapis.com/auth/cloud-platform"
  3555. // ]
  3556. // }
  3557. }
  3558. // method id "servicebroker.setIamPolicy":
  3559. type V1alpha1SetIamPolicyCall struct {
  3560. s *Service
  3561. resource string
  3562. googleiamv1__setiampolicyrequest *GoogleIamV1__SetIamPolicyRequest
  3563. urlParams_ gensupport.URLParams
  3564. ctx_ context.Context
  3565. header_ http.Header
  3566. }
  3567. // SetIamPolicy: Sets the access control policy on the specified
  3568. // resource. Replaces any
  3569. // existing policy.
  3570. func (r *V1alpha1Service) SetIamPolicy(resource string, googleiamv1__setiampolicyrequest *GoogleIamV1__SetIamPolicyRequest) *V1alpha1SetIamPolicyCall {
  3571. c := &V1alpha1SetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3572. c.resource = resource
  3573. c.googleiamv1__setiampolicyrequest = googleiamv1__setiampolicyrequest
  3574. return c
  3575. }
  3576. // Fields allows partial responses to be retrieved. See
  3577. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3578. // for more information.
  3579. func (c *V1alpha1SetIamPolicyCall) Fields(s ...googleapi.Field) *V1alpha1SetIamPolicyCall {
  3580. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3581. return c
  3582. }
  3583. // Context sets the context to be used in this call's Do method. Any
  3584. // pending HTTP request will be aborted if the provided context is
  3585. // canceled.
  3586. func (c *V1alpha1SetIamPolicyCall) Context(ctx context.Context) *V1alpha1SetIamPolicyCall {
  3587. c.ctx_ = ctx
  3588. return c
  3589. }
  3590. // Header returns an http.Header that can be modified by the caller to
  3591. // add HTTP headers to the request.
  3592. func (c *V1alpha1SetIamPolicyCall) Header() http.Header {
  3593. if c.header_ == nil {
  3594. c.header_ = make(http.Header)
  3595. }
  3596. return c.header_
  3597. }
  3598. func (c *V1alpha1SetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  3599. reqHeaders := make(http.Header)
  3600. for k, v := range c.header_ {
  3601. reqHeaders[k] = v
  3602. }
  3603. reqHeaders.Set("User-Agent", c.s.userAgent())
  3604. var body io.Reader = nil
  3605. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1__setiampolicyrequest)
  3606. if err != nil {
  3607. return nil, err
  3608. }
  3609. reqHeaders.Set("Content-Type", "application/json")
  3610. c.urlParams_.Set("alt", alt)
  3611. c.urlParams_.Set("prettyPrint", "false")
  3612. urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+resource}:setIamPolicy")
  3613. urls += "?" + c.urlParams_.Encode()
  3614. req, err := http.NewRequest("POST", urls, body)
  3615. if err != nil {
  3616. return nil, err
  3617. }
  3618. req.Header = reqHeaders
  3619. googleapi.Expand(req.URL, map[string]string{
  3620. "resource": c.resource,
  3621. })
  3622. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3623. }
  3624. // Do executes the "servicebroker.setIamPolicy" call.
  3625. // Exactly one of *GoogleIamV1__Policy or error will be non-nil. Any
  3626. // non-2xx status code is an error. Response headers are in either
  3627. // *GoogleIamV1__Policy.ServerResponse.Header or (if a response was
  3628. // returned at all) in error.(*googleapi.Error).Header. Use
  3629. // googleapi.IsNotModified to check whether the returned error was
  3630. // because http.StatusNotModified was returned.
  3631. func (c *V1alpha1SetIamPolicyCall) Do(opts ...googleapi.CallOption) (*GoogleIamV1__Policy, error) {
  3632. gensupport.SetOptions(c.urlParams_, opts...)
  3633. res, err := c.doRequest("json")
  3634. if res != nil && res.StatusCode == http.StatusNotModified {
  3635. if res.Body != nil {
  3636. res.Body.Close()
  3637. }
  3638. return nil, &googleapi.Error{
  3639. Code: res.StatusCode,
  3640. Header: res.Header,
  3641. }
  3642. }
  3643. if err != nil {
  3644. return nil, err
  3645. }
  3646. defer googleapi.CloseBody(res)
  3647. if err := googleapi.CheckResponse(res); err != nil {
  3648. return nil, err
  3649. }
  3650. ret := &GoogleIamV1__Policy{
  3651. ServerResponse: googleapi.ServerResponse{
  3652. Header: res.Header,
  3653. HTTPStatusCode: res.StatusCode,
  3654. },
  3655. }
  3656. target := &ret
  3657. if err := gensupport.DecodeResponse(target, res); err != nil {
  3658. return nil, err
  3659. }
  3660. return ret, nil
  3661. // {
  3662. // "description": "Sets the access control policy on the specified resource. Replaces any\nexisting policy.",
  3663. // "flatPath": "v1alpha1/{v1alpha1Id}:setIamPolicy",
  3664. // "httpMethod": "POST",
  3665. // "id": "servicebroker.setIamPolicy",
  3666. // "parameterOrder": [
  3667. // "resource"
  3668. // ],
  3669. // "parameters": {
  3670. // "resource": {
  3671. // "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field.",
  3672. // "location": "path",
  3673. // "pattern": "^.+$",
  3674. // "required": true,
  3675. // "type": "string"
  3676. // }
  3677. // },
  3678. // "path": "v1alpha1/{+resource}:setIamPolicy",
  3679. // "request": {
  3680. // "$ref": "GoogleIamV1__SetIamPolicyRequest"
  3681. // },
  3682. // "response": {
  3683. // "$ref": "GoogleIamV1__Policy"
  3684. // },
  3685. // "scopes": [
  3686. // "https://www.googleapis.com/auth/cloud-platform"
  3687. // ]
  3688. // }
  3689. }
  3690. // method id "servicebroker.testIamPermissions":
  3691. type V1alpha1TestIamPermissionsCall struct {
  3692. s *Service
  3693. resource string
  3694. googleiamv1__testiampermissionsrequest *GoogleIamV1__TestIamPermissionsRequest
  3695. urlParams_ gensupport.URLParams
  3696. ctx_ context.Context
  3697. header_ http.Header
  3698. }
  3699. // TestIamPermissions: Returns permissions that a caller has on the
  3700. // specified resource.
  3701. // If the resource does not exist, this will return an empty set
  3702. // of
  3703. // permissions, not a NOT_FOUND error.
  3704. //
  3705. // Note: This operation is designed to be used for building
  3706. // permission-aware
  3707. // UIs and command-line tools, not for authorization checking. This
  3708. // operation
  3709. // may "fail open" without warning.
  3710. func (r *V1alpha1Service) TestIamPermissions(resource string, googleiamv1__testiampermissionsrequest *GoogleIamV1__TestIamPermissionsRequest) *V1alpha1TestIamPermissionsCall {
  3711. c := &V1alpha1TestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3712. c.resource = resource
  3713. c.googleiamv1__testiampermissionsrequest = googleiamv1__testiampermissionsrequest
  3714. return c
  3715. }
  3716. // Fields allows partial responses to be retrieved. See
  3717. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3718. // for more information.
  3719. func (c *V1alpha1TestIamPermissionsCall) Fields(s ...googleapi.Field) *V1alpha1TestIamPermissionsCall {
  3720. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3721. return c
  3722. }
  3723. // Context sets the context to be used in this call's Do method. Any
  3724. // pending HTTP request will be aborted if the provided context is
  3725. // canceled.
  3726. func (c *V1alpha1TestIamPermissionsCall) Context(ctx context.Context) *V1alpha1TestIamPermissionsCall {
  3727. c.ctx_ = ctx
  3728. return c
  3729. }
  3730. // Header returns an http.Header that can be modified by the caller to
  3731. // add HTTP headers to the request.
  3732. func (c *V1alpha1TestIamPermissionsCall) Header() http.Header {
  3733. if c.header_ == nil {
  3734. c.header_ = make(http.Header)
  3735. }
  3736. return c.header_
  3737. }
  3738. func (c *V1alpha1TestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  3739. reqHeaders := make(http.Header)
  3740. for k, v := range c.header_ {
  3741. reqHeaders[k] = v
  3742. }
  3743. reqHeaders.Set("User-Agent", c.s.userAgent())
  3744. var body io.Reader = nil
  3745. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1__testiampermissionsrequest)
  3746. if err != nil {
  3747. return nil, err
  3748. }
  3749. reqHeaders.Set("Content-Type", "application/json")
  3750. c.urlParams_.Set("alt", alt)
  3751. c.urlParams_.Set("prettyPrint", "false")
  3752. urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+resource}:testIamPermissions")
  3753. urls += "?" + c.urlParams_.Encode()
  3754. req, err := http.NewRequest("POST", urls, body)
  3755. if err != nil {
  3756. return nil, err
  3757. }
  3758. req.Header = reqHeaders
  3759. googleapi.Expand(req.URL, map[string]string{
  3760. "resource": c.resource,
  3761. })
  3762. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3763. }
  3764. // Do executes the "servicebroker.testIamPermissions" call.
  3765. // Exactly one of *GoogleIamV1__TestIamPermissionsResponse or error will
  3766. // be non-nil. Any non-2xx status code is an error. Response headers are
  3767. // in either
  3768. // *GoogleIamV1__TestIamPermissionsResponse.ServerResponse.Header or (if
  3769. // a response was returned at all) in error.(*googleapi.Error).Header.
  3770. // Use googleapi.IsNotModified to check whether the returned error was
  3771. // because http.StatusNotModified was returned.
  3772. func (c *V1alpha1TestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*GoogleIamV1__TestIamPermissionsResponse, error) {
  3773. gensupport.SetOptions(c.urlParams_, opts...)
  3774. res, err := c.doRequest("json")
  3775. if res != nil && res.StatusCode == http.StatusNotModified {
  3776. if res.Body != nil {
  3777. res.Body.Close()
  3778. }
  3779. return nil, &googleapi.Error{
  3780. Code: res.StatusCode,
  3781. Header: res.Header,
  3782. }
  3783. }
  3784. if err != nil {
  3785. return nil, err
  3786. }
  3787. defer googleapi.CloseBody(res)
  3788. if err := googleapi.CheckResponse(res); err != nil {
  3789. return nil, err
  3790. }
  3791. ret := &GoogleIamV1__TestIamPermissionsResponse{
  3792. ServerResponse: googleapi.ServerResponse{
  3793. Header: res.Header,
  3794. HTTPStatusCode: res.StatusCode,
  3795. },
  3796. }
  3797. target := &ret
  3798. if err := gensupport.DecodeResponse(target, res); err != nil {
  3799. return nil, err
  3800. }
  3801. return ret, nil
  3802. // {
  3803. // "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.",
  3804. // "flatPath": "v1alpha1/{v1alpha1Id}:testIamPermissions",
  3805. // "httpMethod": "POST",
  3806. // "id": "servicebroker.testIamPermissions",
  3807. // "parameterOrder": [
  3808. // "resource"
  3809. // ],
  3810. // "parameters": {
  3811. // "resource": {
  3812. // "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.",
  3813. // "location": "path",
  3814. // "pattern": "^.+$",
  3815. // "required": true,
  3816. // "type": "string"
  3817. // }
  3818. // },
  3819. // "path": "v1alpha1/{+resource}:testIamPermissions",
  3820. // "request": {
  3821. // "$ref": "GoogleIamV1__TestIamPermissionsRequest"
  3822. // },
  3823. // "response": {
  3824. // "$ref": "GoogleIamV1__TestIamPermissionsResponse"
  3825. // },
  3826. // "scopes": [
  3827. // "https://www.googleapis.com/auth/cloud-platform"
  3828. // ]
  3829. // }
  3830. }