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.
 
 
 

5073 lines
186 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/v1beta1"
  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/v1beta1"
  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:v1beta1"
  67. const apiName = "servicebroker"
  68. const apiVersion = "v1beta1"
  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.V1beta1 = NewV1beta1Service(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. V1beta1 *V1beta1Service
  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.V2 = NewProjectsBrokersV2Service(s)
  135. return rs
  136. }
  137. type ProjectsBrokersService struct {
  138. s *Service
  139. Instances *ProjectsBrokersInstancesService
  140. V2 *ProjectsBrokersV2Service
  141. }
  142. func NewProjectsBrokersInstancesService(s *Service) *ProjectsBrokersInstancesService {
  143. rs := &ProjectsBrokersInstancesService{s: s}
  144. rs.Bindings = NewProjectsBrokersInstancesBindingsService(s)
  145. return rs
  146. }
  147. type ProjectsBrokersInstancesService struct {
  148. s *Service
  149. Bindings *ProjectsBrokersInstancesBindingsService
  150. }
  151. func NewProjectsBrokersInstancesBindingsService(s *Service) *ProjectsBrokersInstancesBindingsService {
  152. rs := &ProjectsBrokersInstancesBindingsService{s: s}
  153. return rs
  154. }
  155. type ProjectsBrokersInstancesBindingsService struct {
  156. s *Service
  157. }
  158. func NewProjectsBrokersV2Service(s *Service) *ProjectsBrokersV2Service {
  159. rs := &ProjectsBrokersV2Service{s: s}
  160. rs.Catalog = NewProjectsBrokersV2CatalogService(s)
  161. rs.ServiceInstances = NewProjectsBrokersV2ServiceInstancesService(s)
  162. return rs
  163. }
  164. type ProjectsBrokersV2Service struct {
  165. s *Service
  166. Catalog *ProjectsBrokersV2CatalogService
  167. ServiceInstances *ProjectsBrokersV2ServiceInstancesService
  168. }
  169. func NewProjectsBrokersV2CatalogService(s *Service) *ProjectsBrokersV2CatalogService {
  170. rs := &ProjectsBrokersV2CatalogService{s: s}
  171. return rs
  172. }
  173. type ProjectsBrokersV2CatalogService struct {
  174. s *Service
  175. }
  176. func NewProjectsBrokersV2ServiceInstancesService(s *Service) *ProjectsBrokersV2ServiceInstancesService {
  177. rs := &ProjectsBrokersV2ServiceInstancesService{s: s}
  178. rs.ServiceBindings = NewProjectsBrokersV2ServiceInstancesServiceBindingsService(s)
  179. return rs
  180. }
  181. type ProjectsBrokersV2ServiceInstancesService struct {
  182. s *Service
  183. ServiceBindings *ProjectsBrokersV2ServiceInstancesServiceBindingsService
  184. }
  185. func NewProjectsBrokersV2ServiceInstancesServiceBindingsService(s *Service) *ProjectsBrokersV2ServiceInstancesServiceBindingsService {
  186. rs := &ProjectsBrokersV2ServiceInstancesServiceBindingsService{s: s}
  187. return rs
  188. }
  189. type ProjectsBrokersV2ServiceInstancesServiceBindingsService struct {
  190. s *Service
  191. }
  192. func NewV1beta1Service(s *Service) *V1beta1Service {
  193. rs := &V1beta1Service{s: s}
  194. return rs
  195. }
  196. type V1beta1Service struct {
  197. s *Service
  198. }
  199. // GoogleCloudServicebrokerV1beta1__Binding: Describes the binding.
  200. type GoogleCloudServicebrokerV1beta1__Binding struct {
  201. // BindResource: A JSON object that contains data for platform resources
  202. // associated with
  203. // the binding to be created.
  204. BindResource googleapi.RawMessage `json:"bind_resource,omitempty"`
  205. // BindingId: The id of the binding. Must be unique within GCP
  206. // project.
  207. // Maximum length is 64, GUID recommended.
  208. // Required.
  209. BindingId string `json:"binding_id,omitempty"`
  210. // CreateTime: Output only.
  211. // Timestamp for when the binding was created.
  212. CreateTime string `json:"createTime,omitempty"`
  213. // DeploymentName: Output only.
  214. // String containing the Deployment Manager deployment name that was
  215. // created
  216. // for this binding,
  217. DeploymentName string `json:"deploymentName,omitempty"`
  218. // Parameters: Configuration options for the service binding.
  219. Parameters googleapi.RawMessage `json:"parameters,omitempty"`
  220. // PlanId: The ID of the plan. See `Service` and `Plan` resources for
  221. // details.
  222. // Maximum length is 64, GUID recommended.
  223. // Required.
  224. PlanId string `json:"plan_id,omitempty"`
  225. // ResourceName: Output only.
  226. // The resource name of the binding,
  227. // e.g.
  228. // projects/project_id/brokers/broker_id/service_instances/instance_
  229. // id/bindings/binding_id.
  230. ResourceName string `json:"resourceName,omitempty"`
  231. // ServiceId: The id of the service. Must be a valid identifier of a
  232. // service
  233. // contained in the list from a `ListServices()` call.
  234. // Maximum length is 64, GUID recommended.
  235. // Required.
  236. ServiceId string `json:"service_id,omitempty"`
  237. // ForceSendFields is a list of field names (e.g. "BindResource") to
  238. // unconditionally include in API requests. By default, fields with
  239. // empty values are omitted from API requests. However, any non-pointer,
  240. // non-interface field appearing in ForceSendFields will be sent to the
  241. // server regardless of whether the field is empty or not. This may be
  242. // used to include empty fields in Patch requests.
  243. ForceSendFields []string `json:"-"`
  244. // NullFields is a list of field names (e.g. "BindResource") to include
  245. // in API requests with the JSON null value. By default, fields with
  246. // empty values are omitted from API requests. However, any field with
  247. // an empty value appearing in NullFields will be sent to the server as
  248. // null. It is an error if a field in this list has a non-empty value.
  249. // This may be used to include null fields in Patch requests.
  250. NullFields []string `json:"-"`
  251. }
  252. func (s *GoogleCloudServicebrokerV1beta1__Binding) MarshalJSON() ([]byte, error) {
  253. type NoMethod GoogleCloudServicebrokerV1beta1__Binding
  254. raw := NoMethod(*s)
  255. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  256. }
  257. // GoogleCloudServicebrokerV1beta1__Broker: Broker represents a
  258. // consumable collection of Service Registry catalogs
  259. // exposed as an OSB Broker.
  260. type GoogleCloudServicebrokerV1beta1__Broker struct {
  261. // CreateTime: Output only.
  262. // Timestamp for when the broker was created.
  263. CreateTime string `json:"createTime,omitempty"`
  264. // Name: Name of the broker in the
  265. // format:
  266. // <projects>/<project-id>/brokers/<broker>.
  267. // This allows for multiple brokers per project which can be used
  268. // to
  269. // enable having custom brokers per GKE cluster, for example.
  270. Name string `json:"name,omitempty"`
  271. // Title: User friendly title of the broker.
  272. // Limited to 1024 characters. Requests with longer titles will be
  273. // rejected.
  274. Title string `json:"title,omitempty"`
  275. // Url: Output only.
  276. // URL of the broker OSB-compliant endpoint, for
  277. // example:
  278. // https://servicebroker.googleapis.com/projects/<project>/broke
  279. // rs/<broker>
  280. Url string `json:"url,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. "CreateTime") 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. "CreateTime") to include in
  292. // API requests with the JSON null value. By default, fields with empty
  293. // values are omitted from API requests. However, any field with an
  294. // 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 *GoogleCloudServicebrokerV1beta1__Broker) MarshalJSON() ([]byte, error) {
  300. type NoMethod GoogleCloudServicebrokerV1beta1__Broker
  301. raw := NoMethod(*s)
  302. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  303. }
  304. // GoogleCloudServicebrokerV1beta1__CreateBindingResponse: Response for
  305. // the `CreateBinding()` method.
  306. type GoogleCloudServicebrokerV1beta1__CreateBindingResponse struct {
  307. // Credentials: Credentials to use the binding.
  308. Credentials googleapi.RawMessage `json:"credentials,omitempty"`
  309. // Description: Used to communicate description of the response. Usually
  310. // for non-standard
  311. // error
  312. // codes.
  313. // https://github.com/openservicebrokerapi/servicebroker/blob/mast
  314. // er/spec.md#service-broker-errors
  315. Description string `json:"description,omitempty"`
  316. // Operation: If broker executes operation asynchronously, this is the
  317. // operation ID that
  318. // can be polled to check the completion status of said operation.
  319. // This broker always executes all create/delete operations
  320. // asynchronously.
  321. Operation string `json:"operation,omitempty"`
  322. // RouteServiceUrl: A URL to which the platform may proxy requests for
  323. // the address sent with
  324. // bind_resource.route
  325. RouteServiceUrl string `json:"route_service_url,omitempty"`
  326. // SyslogDrainUrl: From where to read system logs.
  327. SyslogDrainUrl string `json:"syslog_drain_url,omitempty"`
  328. // VolumeMounts: An array of configuration for mounting volumes.
  329. VolumeMounts []googleapi.RawMessage `json:"volume_mounts,omitempty"`
  330. // ServerResponse contains the HTTP response code and headers from the
  331. // server.
  332. googleapi.ServerResponse `json:"-"`
  333. // ForceSendFields is a list of field names (e.g. "Credentials") to
  334. // unconditionally include in API requests. By default, fields with
  335. // empty values are omitted from API requests. However, any non-pointer,
  336. // non-interface field appearing in ForceSendFields will be sent to the
  337. // server regardless of whether the field is empty or not. This may be
  338. // used to include empty fields in Patch requests.
  339. ForceSendFields []string `json:"-"`
  340. // NullFields is a list of field names (e.g. "Credentials") to include
  341. // in API requests with the JSON null value. By default, fields with
  342. // empty values are omitted from API requests. However, any field with
  343. // an empty value appearing in NullFields will be sent to the server as
  344. // null. It is an error if a field in this list has a non-empty value.
  345. // This may be used to include null fields in Patch requests.
  346. NullFields []string `json:"-"`
  347. }
  348. func (s *GoogleCloudServicebrokerV1beta1__CreateBindingResponse) MarshalJSON() ([]byte, error) {
  349. type NoMethod GoogleCloudServicebrokerV1beta1__CreateBindingResponse
  350. raw := NoMethod(*s)
  351. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  352. }
  353. // GoogleCloudServicebrokerV1beta1__CreateServiceInstanceResponse:
  354. // Response for the `CreateServiceInstance()` method.
  355. type GoogleCloudServicebrokerV1beta1__CreateServiceInstanceResponse struct {
  356. // Description: Used to communicate description of the response. Usually
  357. // for non-standard
  358. // error
  359. // codes.
  360. // https://github.com/openservicebrokerapi/servicebroker/blob/mast
  361. // er/spec.md#service-broker-errors
  362. Description string `json:"description,omitempty"`
  363. // Operation: If broker executes operation asynchronously, this is the
  364. // operation ID that
  365. // can be polled to check the completion status of said operation.
  366. // This broker always will return a non-empty operation on success.
  367. Operation string `json:"operation,omitempty"`
  368. // ServerResponse contains the HTTP response code and headers from the
  369. // server.
  370. googleapi.ServerResponse `json:"-"`
  371. // ForceSendFields is a list of field names (e.g. "Description") to
  372. // unconditionally include in API requests. By default, fields with
  373. // empty values are omitted from API requests. However, any non-pointer,
  374. // non-interface field appearing in ForceSendFields will be sent to the
  375. // server regardless of whether the field is empty or not. This may be
  376. // used to include empty fields in Patch requests.
  377. ForceSendFields []string `json:"-"`
  378. // NullFields is a list of field names (e.g. "Description") to include
  379. // in API requests with the JSON null value. By default, fields with
  380. // empty values are omitted from API requests. However, any field with
  381. // an empty value appearing in NullFields will be sent to the server as
  382. // null. It is an error if a field in this list has a non-empty value.
  383. // This may be used to include null fields in Patch requests.
  384. NullFields []string `json:"-"`
  385. }
  386. func (s *GoogleCloudServicebrokerV1beta1__CreateServiceInstanceResponse) MarshalJSON() ([]byte, error) {
  387. type NoMethod GoogleCloudServicebrokerV1beta1__CreateServiceInstanceResponse
  388. raw := NoMethod(*s)
  389. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  390. }
  391. // GoogleCloudServicebrokerV1beta1__DashboardClient: Message containing
  392. // information required to activate Dashboard SSO feature.
  393. type GoogleCloudServicebrokerV1beta1__DashboardClient struct {
  394. // Id: The id of the Oauth client that the dashboard will use.
  395. Id string `json:"id,omitempty"`
  396. // RedirectUri: A URI for the service dashboard.
  397. // Validated by the OAuth token server when the dashboard requests a
  398. // token.
  399. RedirectUri string `json:"redirect_uri,omitempty"`
  400. // Secret: A secret for the dashboard client.
  401. Secret string `json:"secret,omitempty"`
  402. // ForceSendFields is a list of field names (e.g. "Id") to
  403. // unconditionally include in API requests. By default, fields with
  404. // empty values are omitted from API requests. However, any non-pointer,
  405. // non-interface field appearing in ForceSendFields will be sent to the
  406. // server regardless of whether the field is empty or not. This may be
  407. // used to include empty fields in Patch requests.
  408. ForceSendFields []string `json:"-"`
  409. // NullFields is a list of field names (e.g. "Id") to include in API
  410. // requests with the JSON null value. By default, fields with empty
  411. // values are omitted from API requests. However, any field with an
  412. // empty value appearing in NullFields will be sent to the server as
  413. // null. It is an error if a field in this list has a non-empty value.
  414. // This may be used to include null fields in Patch requests.
  415. NullFields []string `json:"-"`
  416. }
  417. func (s *GoogleCloudServicebrokerV1beta1__DashboardClient) MarshalJSON() ([]byte, error) {
  418. type NoMethod GoogleCloudServicebrokerV1beta1__DashboardClient
  419. raw := NoMethod(*s)
  420. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  421. }
  422. // GoogleCloudServicebrokerV1beta1__DeleteBindingResponse: Response for
  423. // the `DeleteBinding()` method.
  424. type GoogleCloudServicebrokerV1beta1__DeleteBindingResponse struct {
  425. // Description: Used to communicate description of the response. Usually
  426. // for non-standard
  427. // error
  428. // codes.
  429. // https://github.com/openservicebrokerapi/servicebroker/blob/mast
  430. // er/spec.md#service-broker-errors
  431. Description string `json:"description,omitempty"`
  432. // Operation: If broker executes operation asynchronously, this is the
  433. // operation ID that
  434. // can be polled to check the completion status of said operation.
  435. Operation string `json:"operation,omitempty"`
  436. // ServerResponse contains the HTTP response code and headers from the
  437. // server.
  438. googleapi.ServerResponse `json:"-"`
  439. // ForceSendFields is a list of field names (e.g. "Description") to
  440. // unconditionally include in API requests. By default, fields with
  441. // empty values are omitted from API requests. However, any non-pointer,
  442. // non-interface field appearing in ForceSendFields will be sent to the
  443. // server regardless of whether the field is empty or not. This may be
  444. // used to include empty fields in Patch requests.
  445. ForceSendFields []string `json:"-"`
  446. // NullFields is a list of field names (e.g. "Description") to include
  447. // in API requests with the JSON null value. By default, fields with
  448. // empty values are omitted from API requests. However, any field with
  449. // an empty value appearing in NullFields will be sent to the server as
  450. // null. It is an error if a field in this list has a non-empty value.
  451. // This may be used to include null fields in Patch requests.
  452. NullFields []string `json:"-"`
  453. }
  454. func (s *GoogleCloudServicebrokerV1beta1__DeleteBindingResponse) MarshalJSON() ([]byte, error) {
  455. type NoMethod GoogleCloudServicebrokerV1beta1__DeleteBindingResponse
  456. raw := NoMethod(*s)
  457. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  458. }
  459. // GoogleCloudServicebrokerV1beta1__DeleteServiceInstanceResponse:
  460. // Response for the `DeleteServiceInstance()` method.
  461. type GoogleCloudServicebrokerV1beta1__DeleteServiceInstanceResponse struct {
  462. // Description: Used to communicate description of the response. Usually
  463. // for non-standard
  464. // error
  465. // codes.
  466. // https://github.com/openservicebrokerapi/servicebroker/blob/mast
  467. // er/spec.md#service-broker-errors
  468. Description string `json:"description,omitempty"`
  469. // Operation: If broker executes operation asynchronously, this is the
  470. // operation ID that
  471. // can be polled to check the completion status of said operation.
  472. Operation string `json:"operation,omitempty"`
  473. // ServerResponse contains the HTTP response code and headers from the
  474. // server.
  475. googleapi.ServerResponse `json:"-"`
  476. // ForceSendFields is a list of field names (e.g. "Description") to
  477. // unconditionally include in API requests. By default, fields with
  478. // empty values are omitted from API requests. However, any non-pointer,
  479. // non-interface field appearing in ForceSendFields will be sent to the
  480. // server regardless of whether the field is empty or not. This may be
  481. // used to include empty fields in Patch requests.
  482. ForceSendFields []string `json:"-"`
  483. // NullFields is a list of field names (e.g. "Description") to include
  484. // in API requests with the JSON null value. By default, fields with
  485. // empty values are omitted from API requests. However, any field with
  486. // an empty value appearing in NullFields will be sent to the server as
  487. // null. It is an error if a field in this list has a non-empty value.
  488. // This may be used to include null fields in Patch requests.
  489. NullFields []string `json:"-"`
  490. }
  491. func (s *GoogleCloudServicebrokerV1beta1__DeleteServiceInstanceResponse) MarshalJSON() ([]byte, error) {
  492. type NoMethod GoogleCloudServicebrokerV1beta1__DeleteServiceInstanceResponse
  493. raw := NoMethod(*s)
  494. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  495. }
  496. // GoogleCloudServicebrokerV1beta1__GetBindingResponse: Response for the
  497. // `GetBinding()` method.
  498. type GoogleCloudServicebrokerV1beta1__GetBindingResponse struct {
  499. // Credentials: Credentials to use the binding.
  500. Credentials googleapi.RawMessage `json:"credentials,omitempty"`
  501. // DeploymentName: String containing the Deployment Manager deployment
  502. // name that was created
  503. // for this binding,
  504. DeploymentName string `json:"deploymentName,omitempty"`
  505. // Description: Used to communicate description of the response. Usually
  506. // for non-standard
  507. // error
  508. // codes.
  509. // https://github.com/openservicebrokerapi/servicebroker/blob/mast
  510. // er/spec.md#service-broker-errors
  511. Description string `json:"description,omitempty"`
  512. // ResourceName: Output only.
  513. // The resource name of the binding,
  514. // e.g.
  515. // projects/project_id/brokers/broker_id/service_instances/instance_
  516. // id/bindings/binding_id.
  517. ResourceName string `json:"resourceName,omitempty"`
  518. // RouteServiceUrl: A URL to which the platform may proxy requests for
  519. // the address sent with
  520. // bind_resource.route
  521. RouteServiceUrl string `json:"route_service_url,omitempty"`
  522. // SyslogDrainUrl: From where to read system logs.
  523. SyslogDrainUrl string `json:"syslog_drain_url,omitempty"`
  524. // VolumeMounts: An array of configurations for mounting volumes.
  525. VolumeMounts []googleapi.RawMessage `json:"volume_mounts,omitempty"`
  526. // ServerResponse contains the HTTP response code and headers from the
  527. // server.
  528. googleapi.ServerResponse `json:"-"`
  529. // ForceSendFields is a list of field names (e.g. "Credentials") to
  530. // unconditionally include in API requests. By default, fields with
  531. // empty values are omitted from API requests. However, any non-pointer,
  532. // non-interface field appearing in ForceSendFields will be sent to the
  533. // server regardless of whether the field is empty or not. This may be
  534. // used to include empty fields in Patch requests.
  535. ForceSendFields []string `json:"-"`
  536. // NullFields is a list of field names (e.g. "Credentials") to include
  537. // in API requests with the JSON null value. By default, fields with
  538. // empty values are omitted from API requests. However, any field with
  539. // an empty value appearing in NullFields will be sent to the server as
  540. // null. It is an error if a field in this list has a non-empty value.
  541. // This may be used to include null fields in Patch requests.
  542. NullFields []string `json:"-"`
  543. }
  544. func (s *GoogleCloudServicebrokerV1beta1__GetBindingResponse) MarshalJSON() ([]byte, error) {
  545. type NoMethod GoogleCloudServicebrokerV1beta1__GetBindingResponse
  546. raw := NoMethod(*s)
  547. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  548. }
  549. // GoogleCloudServicebrokerV1beta1__ListBindingsResponse: The response
  550. // for the `ListBindings()` method.
  551. type GoogleCloudServicebrokerV1beta1__ListBindingsResponse struct {
  552. // Bindings: The list of bindings in the instance.
  553. Bindings []*GoogleCloudServicebrokerV1beta1__Binding `json:"bindings,omitempty"`
  554. // Description: Used to communicate description of the response. Usually
  555. // for non-standard
  556. // error
  557. // codes.
  558. // https://github.com/openservicebrokerapi/servicebroker/blob/mast
  559. // er/spec.md#service-broker-errors
  560. Description string `json:"description,omitempty"`
  561. // NextPageToken: This token allows you to get the next page of results
  562. // for list requests.
  563. // If the number of results is larger than `pageSize`, use the
  564. // `nextPageToken`
  565. // as a value for the query parameter `pageToken` in the next list
  566. // request.
  567. // Subsequent list requests will have their own `nextPageToken` to
  568. // continue
  569. // paging through the results
  570. NextPageToken string `json:"nextPageToken,omitempty"`
  571. // ServerResponse contains the HTTP response code and headers from the
  572. // server.
  573. googleapi.ServerResponse `json:"-"`
  574. // ForceSendFields is a list of field names (e.g. "Bindings") to
  575. // unconditionally include in API requests. By default, fields with
  576. // empty values are omitted from API requests. However, any non-pointer,
  577. // non-interface field appearing in ForceSendFields will be sent to the
  578. // server regardless of whether the field is empty or not. This may be
  579. // used to include empty fields in Patch requests.
  580. ForceSendFields []string `json:"-"`
  581. // NullFields is a list of field names (e.g. "Bindings") to include in
  582. // API requests with the JSON null value. By default, fields with empty
  583. // values are omitted from API requests. However, any field with an
  584. // empty value appearing in NullFields will be sent to the server as
  585. // null. It is an error if a field in this list has a non-empty value.
  586. // This may be used to include null fields in Patch requests.
  587. NullFields []string `json:"-"`
  588. }
  589. func (s *GoogleCloudServicebrokerV1beta1__ListBindingsResponse) MarshalJSON() ([]byte, error) {
  590. type NoMethod GoogleCloudServicebrokerV1beta1__ListBindingsResponse
  591. raw := NoMethod(*s)
  592. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  593. }
  594. // GoogleCloudServicebrokerV1beta1__ListBrokersResponse: The response
  595. // for the `ListBrokers()` method.
  596. type GoogleCloudServicebrokerV1beta1__ListBrokersResponse struct {
  597. // Brokers: The list of brokers in the container.
  598. Brokers []*GoogleCloudServicebrokerV1beta1__Broker `json:"brokers,omitempty"`
  599. // NextPageToken: This token allows you to get the next page of results
  600. // for list requests.
  601. // If the number of results is larger than `pageSize`, use the
  602. // `nextPageToken`
  603. // as a value for the query parameter `pageToken` in the next list
  604. // request.
  605. // Subsequent list requests will have their own `nextPageToken` to
  606. // continue
  607. // paging through the results
  608. NextPageToken string `json:"nextPageToken,omitempty"`
  609. // ServerResponse contains the HTTP response code and headers from the
  610. // server.
  611. googleapi.ServerResponse `json:"-"`
  612. // ForceSendFields is a list of field names (e.g. "Brokers") to
  613. // unconditionally include in API requests. By default, fields with
  614. // empty values are omitted from API requests. However, any non-pointer,
  615. // non-interface field appearing in ForceSendFields will be sent to the
  616. // server regardless of whether the field is empty or not. This may be
  617. // used to include empty fields in Patch requests.
  618. ForceSendFields []string `json:"-"`
  619. // NullFields is a list of field names (e.g. "Brokers") to include in
  620. // API requests with the JSON null value. By default, fields with empty
  621. // values are omitted from API requests. However, any field with an
  622. // empty value appearing in NullFields will be sent to the server as
  623. // null. It is an error if a field in this list has a non-empty value.
  624. // This may be used to include null fields in Patch requests.
  625. NullFields []string `json:"-"`
  626. }
  627. func (s *GoogleCloudServicebrokerV1beta1__ListBrokersResponse) MarshalJSON() ([]byte, error) {
  628. type NoMethod GoogleCloudServicebrokerV1beta1__ListBrokersResponse
  629. raw := NoMethod(*s)
  630. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  631. }
  632. // GoogleCloudServicebrokerV1beta1__ListCatalogResponse: Response
  633. // message for the `ListCatalog()` method.
  634. type GoogleCloudServicebrokerV1beta1__ListCatalogResponse struct {
  635. // Description: Used to communicate description of the response. Usually
  636. // for non-standard
  637. // error
  638. // codes.
  639. // https://github.com/openservicebrokerapi/servicebroker/blob/mast
  640. // er/spec.md#service-broker-errors
  641. Description string `json:"description,omitempty"`
  642. // NextPageToken: This token allows you to get the next page of results
  643. // for list requests.
  644. // If the number of results is larger than `pageSize`, use the
  645. // `nextPageToken`
  646. // as a value for the query parameter `pageToken` in the next list
  647. // request.
  648. // Subsequent list requests will have their own `nextPageToken` to
  649. // continue
  650. // paging through the results
  651. NextPageToken string `json:"nextPageToken,omitempty"`
  652. // Services: The services available for the requested GCP project.
  653. Services []*GoogleCloudServicebrokerV1beta1__Service `json:"services,omitempty"`
  654. // ServerResponse contains the HTTP response code and headers from the
  655. // server.
  656. googleapi.ServerResponse `json:"-"`
  657. // ForceSendFields is a list of field names (e.g. "Description") to
  658. // unconditionally include in API requests. By default, fields with
  659. // empty values are omitted from API requests. However, any non-pointer,
  660. // non-interface field appearing in ForceSendFields will be sent to the
  661. // server regardless of whether the field is empty or not. This may be
  662. // used to include empty fields in Patch requests.
  663. ForceSendFields []string `json:"-"`
  664. // NullFields is a list of field names (e.g. "Description") to include
  665. // in API requests with the JSON null value. By default, fields with
  666. // empty values are omitted from API requests. However, any field with
  667. // an empty value appearing in NullFields will be sent to the server as
  668. // null. It is an error if a field in this list has a non-empty value.
  669. // This may be used to include null fields in Patch requests.
  670. NullFields []string `json:"-"`
  671. }
  672. func (s *GoogleCloudServicebrokerV1beta1__ListCatalogResponse) MarshalJSON() ([]byte, error) {
  673. type NoMethod GoogleCloudServicebrokerV1beta1__ListCatalogResponse
  674. raw := NoMethod(*s)
  675. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  676. }
  677. // GoogleCloudServicebrokerV1beta1__ListServiceInstancesResponse: The
  678. // response for the `ListServiceInstances()` method.
  679. type GoogleCloudServicebrokerV1beta1__ListServiceInstancesResponse struct {
  680. // Description: Used to communicate description of the response. Usually
  681. // for non-standard
  682. // error
  683. // codes.
  684. // https://github.com/openservicebrokerapi/servicebroker/blob/mast
  685. // er/spec.md#service-broker-errors
  686. Description string `json:"description,omitempty"`
  687. // Instances: The list of instances in the broker.
  688. Instances []*GoogleCloudServicebrokerV1beta1__ServiceInstance `json:"instances,omitempty"`
  689. // NextPageToken: This token allows you to get the next page of results
  690. // for list requests.
  691. // If the number of results is larger than `pageSize`, use the
  692. // `nextPageToken`
  693. // as a value for the query parameter `pageToken` in the next list
  694. // request.
  695. // Subsequent list requests will have their own `nextPageToken` to
  696. // continue
  697. // paging through the results
  698. NextPageToken string `json:"nextPageToken,omitempty"`
  699. // ServerResponse contains the HTTP response code and headers from the
  700. // server.
  701. googleapi.ServerResponse `json:"-"`
  702. // ForceSendFields is a list of field names (e.g. "Description") to
  703. // unconditionally include in API requests. By default, fields with
  704. // empty values are omitted from API requests. However, any non-pointer,
  705. // non-interface field appearing in ForceSendFields will be sent to the
  706. // server regardless of whether the field is empty or not. This may be
  707. // used to include empty fields in Patch requests.
  708. ForceSendFields []string `json:"-"`
  709. // NullFields is a list of field names (e.g. "Description") to include
  710. // in API requests with the JSON null value. By default, fields with
  711. // empty values are omitted from API requests. However, any field with
  712. // an empty value appearing in NullFields will be sent to the server as
  713. // null. It is an error if a field in this list has a non-empty value.
  714. // This may be used to include null fields in Patch requests.
  715. NullFields []string `json:"-"`
  716. }
  717. func (s *GoogleCloudServicebrokerV1beta1__ListServiceInstancesResponse) MarshalJSON() ([]byte, error) {
  718. type NoMethod GoogleCloudServicebrokerV1beta1__ListServiceInstancesResponse
  719. raw := NoMethod(*s)
  720. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  721. }
  722. // GoogleCloudServicebrokerV1beta1__Operation: Describes a long running
  723. // operation, which conforms to OpenService API.
  724. type GoogleCloudServicebrokerV1beta1__Operation struct {
  725. // Description: Optional description of the Operation state.
  726. Description string `json:"description,omitempty"`
  727. // State: The state of the operation.
  728. // Valid values are: "in progress", "succeeded", and "failed".
  729. State string `json:"state,omitempty"`
  730. // ServerResponse contains the HTTP response code and headers from the
  731. // server.
  732. googleapi.ServerResponse `json:"-"`
  733. // ForceSendFields is a list of field names (e.g. "Description") to
  734. // unconditionally include in API requests. By default, fields with
  735. // empty values are omitted from API requests. However, any non-pointer,
  736. // non-interface field appearing in ForceSendFields will be sent to the
  737. // server regardless of whether the field is empty or not. This may be
  738. // used to include empty fields in Patch requests.
  739. ForceSendFields []string `json:"-"`
  740. // NullFields is a list of field names (e.g. "Description") to include
  741. // in API requests with the JSON null value. By default, fields with
  742. // empty values are omitted from API requests. However, any field with
  743. // an empty value appearing in NullFields will be sent to the server as
  744. // null. It is an error if a field in this list has a non-empty value.
  745. // This may be used to include null fields in Patch requests.
  746. NullFields []string `json:"-"`
  747. }
  748. func (s *GoogleCloudServicebrokerV1beta1__Operation) MarshalJSON() ([]byte, error) {
  749. type NoMethod GoogleCloudServicebrokerV1beta1__Operation
  750. raw := NoMethod(*s)
  751. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  752. }
  753. // GoogleCloudServicebrokerV1beta1__Plan: Plan message describes a
  754. // Service Plan.
  755. type GoogleCloudServicebrokerV1beta1__Plan struct {
  756. // Bindable: Specifies whether instances of the service can be bound to
  757. // applications.
  758. // If not specified, `Service.bindable` will be presumed.
  759. Bindable bool `json:"bindable,omitempty"`
  760. // Description: Textual description of the plan. Optional.
  761. Description string `json:"description,omitempty"`
  762. // Free: Whether the service is free.
  763. Free bool `json:"free,omitempty"`
  764. // Id: ID is a globally unique identifier used to uniquely identify the
  765. // plan.
  766. // User must make no presumption about the format of this field.
  767. Id string `json:"id,omitempty"`
  768. // Metadata: A list of metadata for a service offering.
  769. // Metadata is an arbitrary JSON object.
  770. Metadata googleapi.RawMessage `json:"metadata,omitempty"`
  771. // Name: User friendly name of the plan.
  772. // The name must be globally unique within GCP project.
  773. // Note, which is different from ("This must be globally unique within
  774. // a
  775. // platform marketplace").
  776. Name string `json:"name,omitempty"`
  777. // Schemas: Schema definitions for service instances and bindings for
  778. // the plan.
  779. Schemas googleapi.RawMessage `json:"schemas,omitempty"`
  780. // ForceSendFields is a list of field names (e.g. "Bindable") to
  781. // unconditionally include in API requests. By default, fields with
  782. // empty values are omitted from API requests. However, any non-pointer,
  783. // non-interface field appearing in ForceSendFields will be sent to the
  784. // server regardless of whether the field is empty or not. This may be
  785. // used to include empty fields in Patch requests.
  786. ForceSendFields []string `json:"-"`
  787. // NullFields is a list of field names (e.g. "Bindable") to include in
  788. // API requests with the JSON null value. By default, fields with empty
  789. // values are omitted from API requests. However, any field with an
  790. // empty value appearing in NullFields will be sent to the server as
  791. // null. It is an error if a field in this list has a non-empty value.
  792. // This may be used to include null fields in Patch requests.
  793. NullFields []string `json:"-"`
  794. }
  795. func (s *GoogleCloudServicebrokerV1beta1__Plan) MarshalJSON() ([]byte, error) {
  796. type NoMethod GoogleCloudServicebrokerV1beta1__Plan
  797. raw := NoMethod(*s)
  798. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  799. }
  800. // GoogleCloudServicebrokerV1beta1__Service: The resource model mostly
  801. // follows the Open Service Broker API, as
  802. // described
  803. // here:
  804. // https://github.com/openservicebrokerapi/servicebroker/blob/maste
  805. // r/_spec.md
  806. // Though due to Google Specifics it has additional optional fields.
  807. type GoogleCloudServicebrokerV1beta1__Service struct {
  808. // Bindable: Specifies whether instances of the service can be bound to
  809. // applications.
  810. // Required.
  811. Bindable bool `json:"bindable,omitempty"`
  812. // BindingRetrievable: Whether the service provides an endpoint to get
  813. // service bindings.
  814. BindingRetrievable bool `json:"binding_retrievable,omitempty"`
  815. // BindingsRetrievable: Whether the service provides an endpoint to get
  816. // service bindings.
  817. BindingsRetrievable bool `json:"bindings_retrievable,omitempty"`
  818. // DashboardClient: Information to activate Dashboard SSO feature.
  819. DashboardClient *GoogleCloudServicebrokerV1beta1__DashboardClient `json:"dashboard_client,omitempty"`
  820. // Description: Textual description of the service. Required.
  821. Description string `json:"description,omitempty"`
  822. // Id: ID is a globally unique identifier used to uniquely identify the
  823. // service.
  824. // ID is an opaque string.
  825. Id string `json:"id,omitempty"`
  826. // InstancesRetrievable: Whether the service provides an endpoint to get
  827. // service instances.
  828. InstancesRetrievable bool `json:"instances_retrievable,omitempty"`
  829. // Metadata: A list of metadata for a service offering.
  830. // Metadata is an arbitrary JSON object.
  831. Metadata googleapi.RawMessage `json:"metadata,omitempty"`
  832. // Name: User friendly service name.
  833. // Name must match [a-z0-9]+ regexp.
  834. // The name must be globally unique within GCP project.
  835. // Note, which is different from ("This must be globally unique within
  836. // a
  837. // platform marketplace").
  838. // Required.
  839. Name string `json:"name,omitempty"`
  840. // PlanUpdateable: Whether the service supports upgrade/downgrade for
  841. // some plans.
  842. PlanUpdateable bool `json:"plan_updateable,omitempty"`
  843. // Plans: A list of plans for this service.
  844. // At least one plan is required.
  845. Plans []*GoogleCloudServicebrokerV1beta1__Plan `json:"plans,omitempty"`
  846. // Tags: Tags provide a flexible mechanism to expose a classification,
  847. // attribute, or
  848. // base technology of a service.
  849. Tags []string `json:"tags,omitempty"`
  850. // ForceSendFields is a list of field names (e.g. "Bindable") to
  851. // unconditionally include in API requests. By default, fields with
  852. // empty values are omitted from API requests. However, any non-pointer,
  853. // non-interface field appearing in ForceSendFields will be sent to the
  854. // server regardless of whether the field is empty or not. This may be
  855. // used to include empty fields in Patch requests.
  856. ForceSendFields []string `json:"-"`
  857. // NullFields is a list of field names (e.g. "Bindable") to include in
  858. // API requests with the JSON null value. By default, fields with empty
  859. // values are omitted from API requests. However, any field with an
  860. // empty value appearing in NullFields will be sent to the server as
  861. // null. It is an error if a field in this list has a non-empty value.
  862. // This may be used to include null fields in Patch requests.
  863. NullFields []string `json:"-"`
  864. }
  865. func (s *GoogleCloudServicebrokerV1beta1__Service) MarshalJSON() ([]byte, error) {
  866. type NoMethod GoogleCloudServicebrokerV1beta1__Service
  867. raw := NoMethod(*s)
  868. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  869. }
  870. // GoogleCloudServicebrokerV1beta1__ServiceInstance: Message describing
  871. // inputs to Provision and Update Service instance requests.
  872. type GoogleCloudServicebrokerV1beta1__ServiceInstance struct {
  873. // Context: Platform specific contextual information under which the
  874. // service instance
  875. // is to be provisioned. This replaces organization_guid and
  876. // space_guid.
  877. // But can also contain anything.
  878. // Currently only used for logging context information.
  879. Context googleapi.RawMessage `json:"context,omitempty"`
  880. // CreateTime: Output only.
  881. // Timestamp for when the instance was created.
  882. CreateTime string `json:"createTime,omitempty"`
  883. // DeploymentName: Output only.
  884. // String containing the Deployment Manager deployment name that was
  885. // created
  886. // for this instance,
  887. DeploymentName string `json:"deploymentName,omitempty"`
  888. // Description: To return errors when GetInstance call is done via HTTP
  889. // to be unified with
  890. // other methods.
  891. Description string `json:"description,omitempty"`
  892. // InstanceId: The id of the service instance. Must be unique within GCP
  893. // project.
  894. // Maximum length is 64, GUID recommended.
  895. // Required.
  896. InstanceId string `json:"instance_id,omitempty"`
  897. // OrganizationGuid: The platform GUID for the organization under which
  898. // the service is to be
  899. // provisioned.
  900. // Required.
  901. OrganizationGuid string `json:"organization_guid,omitempty"`
  902. // Parameters: Configuration options for the service
  903. // instance.
  904. // Parameters is JSON object serialized to string.
  905. Parameters googleapi.RawMessage `json:"parameters,omitempty"`
  906. // PlanId: The ID of the plan. See `Service` and `Plan` resources for
  907. // details.
  908. // Maximum length is 64, GUID recommended.
  909. // Required.
  910. PlanId string `json:"plan_id,omitempty"`
  911. // PreviousValues: Used only in UpdateServiceInstance request to
  912. // optionally specify previous
  913. // fields.
  914. PreviousValues googleapi.RawMessage `json:"previous_values,omitempty"`
  915. // ResourceName: Output only.
  916. // The resource name of the instance,
  917. // e.g.
  918. // projects/project_id/brokers/broker_id/service_instances/instance_
  919. // id
  920. ResourceName string `json:"resourceName,omitempty"`
  921. // ServiceId: The id of the service. Must be a valid identifier of a
  922. // service
  923. // contained in the list from a `ListServices()` call.
  924. // Maximum length is 64, GUID recommended.
  925. // Required.
  926. ServiceId string `json:"service_id,omitempty"`
  927. // SpaceGuid: The identifier for the project space within the platform
  928. // organization.
  929. // Required.
  930. SpaceGuid string `json:"space_guid,omitempty"`
  931. // ServerResponse contains the HTTP response code and headers from the
  932. // server.
  933. googleapi.ServerResponse `json:"-"`
  934. // ForceSendFields is a list of field names (e.g. "Context") 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. "Context") 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 *GoogleCloudServicebrokerV1beta1__ServiceInstance) MarshalJSON() ([]byte, error) {
  950. type NoMethod GoogleCloudServicebrokerV1beta1__ServiceInstance
  951. raw := NoMethod(*s)
  952. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  953. }
  954. // GoogleCloudServicebrokerV1beta1__UpdateServiceInstanceResponse:
  955. // Response for the `UpdateServiceInstance()` method.
  956. type GoogleCloudServicebrokerV1beta1__UpdateServiceInstanceResponse struct {
  957. // Description: Used to communicate description of the response. Usually
  958. // for non-standard
  959. // error
  960. // codes.
  961. // https://github.com/openservicebrokerapi/servicebroker/blob/mast
  962. // er/spec.md#service-broker-errors
  963. Description string `json:"description,omitempty"`
  964. // Operation: If broker executes operation asynchronously, this is the
  965. // operation ID that
  966. // can be polled to check the completion status of said operation.
  967. Operation string `json:"operation,omitempty"`
  968. // ServerResponse contains the HTTP response code and headers from the
  969. // server.
  970. googleapi.ServerResponse `json:"-"`
  971. // ForceSendFields is a list of field names (e.g. "Description") to
  972. // unconditionally include in API requests. By default, fields with
  973. // empty values are omitted from API requests. However, any non-pointer,
  974. // non-interface field appearing in ForceSendFields will be sent to the
  975. // server regardless of whether the field is empty or not. This may be
  976. // used to include empty fields in Patch requests.
  977. ForceSendFields []string `json:"-"`
  978. // NullFields is a list of field names (e.g. "Description") to include
  979. // in API requests with the JSON null value. By default, fields with
  980. // empty values are omitted from API requests. However, any field with
  981. // an empty value appearing in NullFields will be sent to the server as
  982. // null. It is an error if a field in this list has a non-empty value.
  983. // This may be used to include null fields in Patch requests.
  984. NullFields []string `json:"-"`
  985. }
  986. func (s *GoogleCloudServicebrokerV1beta1__UpdateServiceInstanceResponse) MarshalJSON() ([]byte, error) {
  987. type NoMethod GoogleCloudServicebrokerV1beta1__UpdateServiceInstanceResponse
  988. raw := NoMethod(*s)
  989. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  990. }
  991. // GoogleIamV1__Binding: Associates `members` with a `role`.
  992. type GoogleIamV1__Binding struct {
  993. // Condition: Unimplemented. The condition that is associated with this
  994. // binding.
  995. // NOTE: an unsatisfied condition will not allow user access via
  996. // current
  997. // binding. Different bindings, including their conditions, are
  998. // examined
  999. // independently.
  1000. Condition *GoogleType__Expr `json:"condition,omitempty"`
  1001. // Members: Specifies the identities requesting access for a Cloud
  1002. // Platform resource.
  1003. // `members` can have the following values:
  1004. //
  1005. // * `allUsers`: A special identifier that represents anyone who is
  1006. // on the internet; with or without a Google account.
  1007. //
  1008. // * `allAuthenticatedUsers`: A special identifier that represents
  1009. // anyone
  1010. // who is authenticated with a Google account or a service
  1011. // account.
  1012. //
  1013. // * `user:{emailid}`: An email address that represents a specific
  1014. // Google
  1015. // account. For example, `alice@gmail.com` .
  1016. //
  1017. //
  1018. // * `serviceAccount:{emailid}`: An email address that represents a
  1019. // service
  1020. // account. For example,
  1021. // `my-other-app@appspot.gserviceaccount.com`.
  1022. //
  1023. // * `group:{emailid}`: An email address that represents a Google
  1024. // group.
  1025. // For example, `admins@example.com`.
  1026. //
  1027. //
  1028. // * `domain:{domain}`: A Google Apps domain name that represents all
  1029. // the
  1030. // users of that domain. For example, `google.com` or
  1031. // `example.com`.
  1032. //
  1033. //
  1034. Members []string `json:"members,omitempty"`
  1035. // Role: Role that is assigned to `members`.
  1036. // For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
  1037. Role string `json:"role,omitempty"`
  1038. // ForceSendFields is a list of field names (e.g. "Condition") to
  1039. // unconditionally include in API requests. By default, fields with
  1040. // empty values are omitted from API requests. However, any non-pointer,
  1041. // non-interface field appearing in ForceSendFields will be sent to the
  1042. // server regardless of whether the field is empty or not. This may be
  1043. // used to include empty fields in Patch requests.
  1044. ForceSendFields []string `json:"-"`
  1045. // NullFields is a list of field names (e.g. "Condition") to include in
  1046. // API requests with the JSON null value. By default, fields with empty
  1047. // values are omitted from API requests. However, any field with an
  1048. // empty value appearing in NullFields will be sent to the server as
  1049. // null. It is an error if a field in this list has a non-empty value.
  1050. // This may be used to include null fields in Patch requests.
  1051. NullFields []string `json:"-"`
  1052. }
  1053. func (s *GoogleIamV1__Binding) MarshalJSON() ([]byte, error) {
  1054. type NoMethod GoogleIamV1__Binding
  1055. raw := NoMethod(*s)
  1056. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1057. }
  1058. // GoogleIamV1__Policy: Defines an Identity and Access Management (IAM)
  1059. // policy. It is used to
  1060. // specify access control policies for Cloud Platform resources.
  1061. //
  1062. //
  1063. // A `Policy` consists of a list of `bindings`. A `binding` binds a list
  1064. // of
  1065. // `members` to a `role`, where the members can be user accounts, Google
  1066. // groups,
  1067. // Google domains, and service accounts. A `role` is a named list of
  1068. // permissions
  1069. // defined by IAM.
  1070. //
  1071. // **JSON Example**
  1072. //
  1073. // {
  1074. // "bindings": [
  1075. // {
  1076. // "role": "roles/owner",
  1077. // "members": [
  1078. // "user:mike@example.com",
  1079. // "group:admins@example.com",
  1080. // "domain:google.com",
  1081. //
  1082. // "serviceAccount:my-other-app@appspot.gserviceaccount.com"
  1083. // ]
  1084. // },
  1085. // {
  1086. // "role": "roles/viewer",
  1087. // "members": ["user:sean@example.com"]
  1088. // }
  1089. // ]
  1090. // }
  1091. //
  1092. // **YAML Example**
  1093. //
  1094. // bindings:
  1095. // - members:
  1096. // - user:mike@example.com
  1097. // - group:admins@example.com
  1098. // - domain:google.com
  1099. // - serviceAccount:my-other-app@appspot.gserviceaccount.com
  1100. // role: roles/owner
  1101. // - members:
  1102. // - user:sean@example.com
  1103. // role: roles/viewer
  1104. //
  1105. //
  1106. // For a description of IAM and its features, see the
  1107. // [IAM developer's guide](https://cloud.google.com/iam/docs).
  1108. type GoogleIamV1__Policy struct {
  1109. // Bindings: Associates a list of `members` to a `role`.
  1110. // `bindings` with no members will result in an error.
  1111. Bindings []*GoogleIamV1__Binding `json:"bindings,omitempty"`
  1112. // Etag: `etag` is used for optimistic concurrency control as a way to
  1113. // help
  1114. // prevent simultaneous updates of a policy from overwriting each
  1115. // other.
  1116. // It is strongly suggested that systems make use of the `etag` in
  1117. // the
  1118. // read-modify-write cycle to perform policy updates in order to avoid
  1119. // race
  1120. // conditions: An `etag` is returned in the response to `getIamPolicy`,
  1121. // and
  1122. // systems are expected to put that etag in the request to
  1123. // `setIamPolicy` to
  1124. // ensure that their change will be applied to the same version of the
  1125. // policy.
  1126. //
  1127. // If no `etag` is provided in the call to `setIamPolicy`, then the
  1128. // existing
  1129. // policy is overwritten blindly.
  1130. Etag string `json:"etag,omitempty"`
  1131. // Version: Deprecated.
  1132. Version int64 `json:"version,omitempty"`
  1133. // ServerResponse contains the HTTP response code and headers from the
  1134. // server.
  1135. googleapi.ServerResponse `json:"-"`
  1136. // ForceSendFields is a list of field names (e.g. "Bindings") to
  1137. // unconditionally include in API requests. By default, fields with
  1138. // empty values are omitted from API requests. However, any non-pointer,
  1139. // non-interface field appearing in ForceSendFields will be sent to the
  1140. // server regardless of whether the field is empty or not. This may be
  1141. // used to include empty fields in Patch requests.
  1142. ForceSendFields []string `json:"-"`
  1143. // NullFields is a list of field names (e.g. "Bindings") to include in
  1144. // API requests with the JSON null value. By default, fields with empty
  1145. // values are omitted from API requests. However, any field with an
  1146. // empty value appearing in NullFields will be sent to the server as
  1147. // null. It is an error if a field in this list has a non-empty value.
  1148. // This may be used to include null fields in Patch requests.
  1149. NullFields []string `json:"-"`
  1150. }
  1151. func (s *GoogleIamV1__Policy) MarshalJSON() ([]byte, error) {
  1152. type NoMethod GoogleIamV1__Policy
  1153. raw := NoMethod(*s)
  1154. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1155. }
  1156. // GoogleIamV1__SetIamPolicyRequest: Request message for `SetIamPolicy`
  1157. // method.
  1158. type GoogleIamV1__SetIamPolicyRequest struct {
  1159. // Policy: REQUIRED: The complete policy to be applied to the
  1160. // `resource`. The size of
  1161. // the policy is limited to a few 10s of KB. An empty policy is a
  1162. // valid policy but certain Cloud Platform services (such as
  1163. // Projects)
  1164. // might reject them.
  1165. Policy *GoogleIamV1__Policy `json:"policy,omitempty"`
  1166. // ForceSendFields is a list of field names (e.g. "Policy") to
  1167. // unconditionally include in API requests. By default, fields with
  1168. // empty values are omitted from API requests. However, any non-pointer,
  1169. // non-interface field appearing in ForceSendFields will be sent to the
  1170. // server regardless of whether the field is empty or not. This may be
  1171. // used to include empty fields in Patch requests.
  1172. ForceSendFields []string `json:"-"`
  1173. // NullFields is a list of field names (e.g. "Policy") to include in API
  1174. // requests with the JSON null value. By default, fields with empty
  1175. // values are omitted from API requests. However, any field with an
  1176. // empty value appearing in NullFields will be sent to the server as
  1177. // null. It is an error if a field in this list has a non-empty value.
  1178. // This may be used to include null fields in Patch requests.
  1179. NullFields []string `json:"-"`
  1180. }
  1181. func (s *GoogleIamV1__SetIamPolicyRequest) MarshalJSON() ([]byte, error) {
  1182. type NoMethod GoogleIamV1__SetIamPolicyRequest
  1183. raw := NoMethod(*s)
  1184. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1185. }
  1186. // GoogleIamV1__TestIamPermissionsRequest: Request message for
  1187. // `TestIamPermissions` method.
  1188. type GoogleIamV1__TestIamPermissionsRequest struct {
  1189. // Permissions: The set of permissions to check for the `resource`.
  1190. // Permissions with
  1191. // wildcards (such as '*' or 'storage.*') are not allowed. For
  1192. // more
  1193. // information see
  1194. // [IAM
  1195. // Overview](https://cloud.google.com/iam/docs/overview#permissions).
  1196. Permissions []string `json:"permissions,omitempty"`
  1197. // ForceSendFields is a list of field names (e.g. "Permissions") to
  1198. // unconditionally include in API requests. By default, fields with
  1199. // empty values are omitted from API requests. However, any non-pointer,
  1200. // non-interface field appearing in ForceSendFields will be sent to the
  1201. // server regardless of whether the field is empty or not. This may be
  1202. // used to include empty fields in Patch requests.
  1203. ForceSendFields []string `json:"-"`
  1204. // NullFields is a list of field names (e.g. "Permissions") to include
  1205. // in API requests with the JSON null value. By default, fields with
  1206. // empty values are omitted from API requests. However, any field with
  1207. // an empty value appearing in NullFields will be sent to the server as
  1208. // null. It is an error if a field in this list has a non-empty value.
  1209. // This may be used to include null fields in Patch requests.
  1210. NullFields []string `json:"-"`
  1211. }
  1212. func (s *GoogleIamV1__TestIamPermissionsRequest) MarshalJSON() ([]byte, error) {
  1213. type NoMethod GoogleIamV1__TestIamPermissionsRequest
  1214. raw := NoMethod(*s)
  1215. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1216. }
  1217. // GoogleIamV1__TestIamPermissionsResponse: Response message for
  1218. // `TestIamPermissions` method.
  1219. type GoogleIamV1__TestIamPermissionsResponse struct {
  1220. // Permissions: A subset of `TestPermissionsRequest.permissions` that
  1221. // the caller is
  1222. // allowed.
  1223. Permissions []string `json:"permissions,omitempty"`
  1224. // ServerResponse contains the HTTP response code and headers from the
  1225. // server.
  1226. googleapi.ServerResponse `json:"-"`
  1227. // ForceSendFields is a list of field names (e.g. "Permissions") to
  1228. // unconditionally include in API requests. By default, fields with
  1229. // empty values are omitted from API requests. However, any non-pointer,
  1230. // non-interface field appearing in ForceSendFields will be sent to the
  1231. // server regardless of whether the field is empty or not. This may be
  1232. // used to include empty fields in Patch requests.
  1233. ForceSendFields []string `json:"-"`
  1234. // NullFields is a list of field names (e.g. "Permissions") to include
  1235. // in API requests with the JSON null value. By default, fields with
  1236. // empty values are omitted from API requests. However, any field with
  1237. // an empty value appearing in NullFields will be sent to the server as
  1238. // null. It is an error if a field in this list has a non-empty value.
  1239. // This may be used to include null fields in Patch requests.
  1240. NullFields []string `json:"-"`
  1241. }
  1242. func (s *GoogleIamV1__TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
  1243. type NoMethod GoogleIamV1__TestIamPermissionsResponse
  1244. raw := NoMethod(*s)
  1245. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1246. }
  1247. // GoogleProtobuf__Empty: A generic empty message that you can re-use to
  1248. // avoid defining duplicated
  1249. // empty messages in your APIs. A typical example is to use it as the
  1250. // request
  1251. // or the response type of an API method. For instance:
  1252. //
  1253. // service Foo {
  1254. // rpc Bar(google.protobuf.Empty) returns
  1255. // (google.protobuf.Empty);
  1256. // }
  1257. //
  1258. // The JSON representation for `Empty` is empty JSON object `{}`.
  1259. type GoogleProtobuf__Empty struct {
  1260. // ServerResponse contains the HTTP response code and headers from the
  1261. // server.
  1262. googleapi.ServerResponse `json:"-"`
  1263. }
  1264. // GoogleType__Expr: Represents an expression text. Example:
  1265. //
  1266. // title: "User account presence"
  1267. // description: "Determines whether the request has a user account"
  1268. // expression: "size(request.user) > 0"
  1269. type GoogleType__Expr struct {
  1270. // Description: An optional description of the expression. This is a
  1271. // longer text which
  1272. // describes the expression, e.g. when hovered over it in a UI.
  1273. Description string `json:"description,omitempty"`
  1274. // Expression: Textual representation of an expression in
  1275. // Common Expression Language syntax.
  1276. //
  1277. // The application context of the containing message determines
  1278. // which
  1279. // well-known feature set of CEL is supported.
  1280. Expression string `json:"expression,omitempty"`
  1281. // Location: An optional string indicating the location of the
  1282. // expression for error
  1283. // reporting, e.g. a file name and a position in the file.
  1284. Location string `json:"location,omitempty"`
  1285. // Title: An optional title for the expression, i.e. a short string
  1286. // describing
  1287. // its purpose. This can be used e.g. in UIs which allow to enter
  1288. // the
  1289. // expression.
  1290. Title string `json:"title,omitempty"`
  1291. // ForceSendFields is a list of field names (e.g. "Description") to
  1292. // unconditionally include in API requests. By default, fields with
  1293. // empty values are omitted from API requests. However, any non-pointer,
  1294. // non-interface field appearing in ForceSendFields will be sent to the
  1295. // server regardless of whether the field is empty or not. This may be
  1296. // used to include empty fields in Patch requests.
  1297. ForceSendFields []string `json:"-"`
  1298. // NullFields is a list of field names (e.g. "Description") to include
  1299. // in API requests with the JSON null value. By default, fields with
  1300. // empty values are omitted from API requests. However, any field with
  1301. // an empty value appearing in NullFields will be sent to the server as
  1302. // null. It is an error if a field in this list has a non-empty value.
  1303. // This may be used to include null fields in Patch requests.
  1304. NullFields []string `json:"-"`
  1305. }
  1306. func (s *GoogleType__Expr) MarshalJSON() ([]byte, error) {
  1307. type NoMethod GoogleType__Expr
  1308. raw := NoMethod(*s)
  1309. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1310. }
  1311. // method id "servicebroker.projects.brokers.create":
  1312. type ProjectsBrokersCreateCall struct {
  1313. s *Service
  1314. parent string
  1315. googlecloudservicebrokerv1beta1__broker *GoogleCloudServicebrokerV1beta1__Broker
  1316. urlParams_ gensupport.URLParams
  1317. ctx_ context.Context
  1318. header_ http.Header
  1319. }
  1320. // Create: CreateBroker creates a Broker.
  1321. func (r *ProjectsBrokersService) Create(parent string, googlecloudservicebrokerv1beta1__broker *GoogleCloudServicebrokerV1beta1__Broker) *ProjectsBrokersCreateCall {
  1322. c := &ProjectsBrokersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1323. c.parent = parent
  1324. c.googlecloudservicebrokerv1beta1__broker = googlecloudservicebrokerv1beta1__broker
  1325. return c
  1326. }
  1327. // Fields allows partial responses to be retrieved. See
  1328. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1329. // for more information.
  1330. func (c *ProjectsBrokersCreateCall) Fields(s ...googleapi.Field) *ProjectsBrokersCreateCall {
  1331. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1332. return c
  1333. }
  1334. // Context sets the context to be used in this call's Do method. Any
  1335. // pending HTTP request will be aborted if the provided context is
  1336. // canceled.
  1337. func (c *ProjectsBrokersCreateCall) Context(ctx context.Context) *ProjectsBrokersCreateCall {
  1338. c.ctx_ = ctx
  1339. return c
  1340. }
  1341. // Header returns an http.Header that can be modified by the caller to
  1342. // add HTTP headers to the request.
  1343. func (c *ProjectsBrokersCreateCall) Header() http.Header {
  1344. if c.header_ == nil {
  1345. c.header_ = make(http.Header)
  1346. }
  1347. return c.header_
  1348. }
  1349. func (c *ProjectsBrokersCreateCall) doRequest(alt string) (*http.Response, error) {
  1350. reqHeaders := make(http.Header)
  1351. for k, v := range c.header_ {
  1352. reqHeaders[k] = v
  1353. }
  1354. reqHeaders.Set("User-Agent", c.s.userAgent())
  1355. var body io.Reader = nil
  1356. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudservicebrokerv1beta1__broker)
  1357. if err != nil {
  1358. return nil, err
  1359. }
  1360. reqHeaders.Set("Content-Type", "application/json")
  1361. c.urlParams_.Set("alt", alt)
  1362. c.urlParams_.Set("prettyPrint", "false")
  1363. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/brokers")
  1364. urls += "?" + c.urlParams_.Encode()
  1365. req, err := http.NewRequest("POST", urls, body)
  1366. if err != nil {
  1367. return nil, err
  1368. }
  1369. req.Header = reqHeaders
  1370. googleapi.Expand(req.URL, map[string]string{
  1371. "parent": c.parent,
  1372. })
  1373. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1374. }
  1375. // Do executes the "servicebroker.projects.brokers.create" call.
  1376. // Exactly one of *GoogleCloudServicebrokerV1beta1__Broker or error will
  1377. // be non-nil. Any non-2xx status code is an error. Response headers are
  1378. // in either
  1379. // *GoogleCloudServicebrokerV1beta1__Broker.ServerResponse.Header or (if
  1380. // a response was returned at all) in error.(*googleapi.Error).Header.
  1381. // Use googleapi.IsNotModified to check whether the returned error was
  1382. // because http.StatusNotModified was returned.
  1383. func (c *ProjectsBrokersCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudServicebrokerV1beta1__Broker, error) {
  1384. gensupport.SetOptions(c.urlParams_, opts...)
  1385. res, err := c.doRequest("json")
  1386. if res != nil && res.StatusCode == http.StatusNotModified {
  1387. if res.Body != nil {
  1388. res.Body.Close()
  1389. }
  1390. return nil, &googleapi.Error{
  1391. Code: res.StatusCode,
  1392. Header: res.Header,
  1393. }
  1394. }
  1395. if err != nil {
  1396. return nil, err
  1397. }
  1398. defer googleapi.CloseBody(res)
  1399. if err := googleapi.CheckResponse(res); err != nil {
  1400. return nil, err
  1401. }
  1402. ret := &GoogleCloudServicebrokerV1beta1__Broker{
  1403. ServerResponse: googleapi.ServerResponse{
  1404. Header: res.Header,
  1405. HTTPStatusCode: res.StatusCode,
  1406. },
  1407. }
  1408. target := &ret
  1409. if err := gensupport.DecodeResponse(target, res); err != nil {
  1410. return nil, err
  1411. }
  1412. return ret, nil
  1413. // {
  1414. // "description": "CreateBroker creates a Broker.",
  1415. // "flatPath": "v1beta1/projects/{projectsId}/brokers",
  1416. // "httpMethod": "POST",
  1417. // "id": "servicebroker.projects.brokers.create",
  1418. // "parameterOrder": [
  1419. // "parent"
  1420. // ],
  1421. // "parameters": {
  1422. // "parent": {
  1423. // "description": "The project in which to create broker.",
  1424. // "location": "path",
  1425. // "pattern": "^projects/[^/]+$",
  1426. // "required": true,
  1427. // "type": "string"
  1428. // }
  1429. // },
  1430. // "path": "v1beta1/{+parent}/brokers",
  1431. // "request": {
  1432. // "$ref": "GoogleCloudServicebrokerV1beta1__Broker"
  1433. // },
  1434. // "response": {
  1435. // "$ref": "GoogleCloudServicebrokerV1beta1__Broker"
  1436. // },
  1437. // "scopes": [
  1438. // "https://www.googleapis.com/auth/cloud-platform"
  1439. // ]
  1440. // }
  1441. }
  1442. // method id "servicebroker.projects.brokers.delete":
  1443. type ProjectsBrokersDeleteCall struct {
  1444. s *Service
  1445. name string
  1446. urlParams_ gensupport.URLParams
  1447. ctx_ context.Context
  1448. header_ http.Header
  1449. }
  1450. // Delete: DeleteBroker deletes a Broker.
  1451. func (r *ProjectsBrokersService) Delete(name string) *ProjectsBrokersDeleteCall {
  1452. c := &ProjectsBrokersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1453. c.name = name
  1454. return c
  1455. }
  1456. // Fields allows partial responses to be retrieved. See
  1457. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1458. // for more information.
  1459. func (c *ProjectsBrokersDeleteCall) Fields(s ...googleapi.Field) *ProjectsBrokersDeleteCall {
  1460. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1461. return c
  1462. }
  1463. // Context sets the context to be used in this call's Do method. Any
  1464. // pending HTTP request will be aborted if the provided context is
  1465. // canceled.
  1466. func (c *ProjectsBrokersDeleteCall) Context(ctx context.Context) *ProjectsBrokersDeleteCall {
  1467. c.ctx_ = ctx
  1468. return c
  1469. }
  1470. // Header returns an http.Header that can be modified by the caller to
  1471. // add HTTP headers to the request.
  1472. func (c *ProjectsBrokersDeleteCall) Header() http.Header {
  1473. if c.header_ == nil {
  1474. c.header_ = make(http.Header)
  1475. }
  1476. return c.header_
  1477. }
  1478. func (c *ProjectsBrokersDeleteCall) doRequest(alt string) (*http.Response, error) {
  1479. reqHeaders := make(http.Header)
  1480. for k, v := range c.header_ {
  1481. reqHeaders[k] = v
  1482. }
  1483. reqHeaders.Set("User-Agent", c.s.userAgent())
  1484. var body io.Reader = nil
  1485. c.urlParams_.Set("alt", alt)
  1486. c.urlParams_.Set("prettyPrint", "false")
  1487. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  1488. urls += "?" + c.urlParams_.Encode()
  1489. req, err := http.NewRequest("DELETE", urls, body)
  1490. if err != nil {
  1491. return nil, err
  1492. }
  1493. req.Header = reqHeaders
  1494. googleapi.Expand(req.URL, map[string]string{
  1495. "name": c.name,
  1496. })
  1497. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1498. }
  1499. // Do executes the "servicebroker.projects.brokers.delete" call.
  1500. // Exactly one of *GoogleProtobuf__Empty or error will be non-nil. Any
  1501. // non-2xx status code is an error. Response headers are in either
  1502. // *GoogleProtobuf__Empty.ServerResponse.Header or (if a response was
  1503. // returned at all) in error.(*googleapi.Error).Header. Use
  1504. // googleapi.IsNotModified to check whether the returned error was
  1505. // because http.StatusNotModified was returned.
  1506. func (c *ProjectsBrokersDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobuf__Empty, error) {
  1507. gensupport.SetOptions(c.urlParams_, opts...)
  1508. res, err := c.doRequest("json")
  1509. if res != nil && res.StatusCode == http.StatusNotModified {
  1510. if res.Body != nil {
  1511. res.Body.Close()
  1512. }
  1513. return nil, &googleapi.Error{
  1514. Code: res.StatusCode,
  1515. Header: res.Header,
  1516. }
  1517. }
  1518. if err != nil {
  1519. return nil, err
  1520. }
  1521. defer googleapi.CloseBody(res)
  1522. if err := googleapi.CheckResponse(res); err != nil {
  1523. return nil, err
  1524. }
  1525. ret := &GoogleProtobuf__Empty{
  1526. ServerResponse: googleapi.ServerResponse{
  1527. Header: res.Header,
  1528. HTTPStatusCode: res.StatusCode,
  1529. },
  1530. }
  1531. target := &ret
  1532. if err := gensupport.DecodeResponse(target, res); err != nil {
  1533. return nil, err
  1534. }
  1535. return ret, nil
  1536. // {
  1537. // "description": "DeleteBroker deletes a Broker.",
  1538. // "flatPath": "v1beta1/projects/{projectsId}/brokers/{brokersId}",
  1539. // "httpMethod": "DELETE",
  1540. // "id": "servicebroker.projects.brokers.delete",
  1541. // "parameterOrder": [
  1542. // "name"
  1543. // ],
  1544. // "parameters": {
  1545. // "name": {
  1546. // "description": "The broker to delete.",
  1547. // "location": "path",
  1548. // "pattern": "^projects/[^/]+/brokers/[^/]+$",
  1549. // "required": true,
  1550. // "type": "string"
  1551. // }
  1552. // },
  1553. // "path": "v1beta1/{+name}",
  1554. // "response": {
  1555. // "$ref": "GoogleProtobuf__Empty"
  1556. // },
  1557. // "scopes": [
  1558. // "https://www.googleapis.com/auth/cloud-platform"
  1559. // ]
  1560. // }
  1561. }
  1562. // method id "servicebroker.projects.brokers.list":
  1563. type ProjectsBrokersListCall struct {
  1564. s *Service
  1565. parent string
  1566. urlParams_ gensupport.URLParams
  1567. ifNoneMatch_ string
  1568. ctx_ context.Context
  1569. header_ http.Header
  1570. }
  1571. // List: ListBrokers lists brokers.
  1572. func (r *ProjectsBrokersService) List(parent string) *ProjectsBrokersListCall {
  1573. c := &ProjectsBrokersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1574. c.parent = parent
  1575. return c
  1576. }
  1577. // PageSize sets the optional parameter "pageSize": Specifies the number
  1578. // of results to return per page. If there are fewer
  1579. // elements than the specified number, returns all elements.
  1580. // Acceptable values are 0 to 200, inclusive. (Default: 100)
  1581. func (c *ProjectsBrokersListCall) PageSize(pageSize int64) *ProjectsBrokersListCall {
  1582. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1583. return c
  1584. }
  1585. // PageToken sets the optional parameter "pageToken": Specifies a page
  1586. // token to use. Set `pageToken` to a `nextPageToken`
  1587. // returned by a previous list request to get the next page of results.
  1588. func (c *ProjectsBrokersListCall) PageToken(pageToken string) *ProjectsBrokersListCall {
  1589. c.urlParams_.Set("pageToken", pageToken)
  1590. return c
  1591. }
  1592. // Fields allows partial responses to be retrieved. See
  1593. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1594. // for more information.
  1595. func (c *ProjectsBrokersListCall) Fields(s ...googleapi.Field) *ProjectsBrokersListCall {
  1596. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1597. return c
  1598. }
  1599. // IfNoneMatch sets the optional parameter which makes the operation
  1600. // fail if the object's ETag matches the given value. This is useful for
  1601. // getting updates only after the object has changed since the last
  1602. // request. Use googleapi.IsNotModified to check whether the response
  1603. // error from Do is the result of In-None-Match.
  1604. func (c *ProjectsBrokersListCall) IfNoneMatch(entityTag string) *ProjectsBrokersListCall {
  1605. c.ifNoneMatch_ = entityTag
  1606. return c
  1607. }
  1608. // Context sets the context to be used in this call's Do method. Any
  1609. // pending HTTP request will be aborted if the provided context is
  1610. // canceled.
  1611. func (c *ProjectsBrokersListCall) Context(ctx context.Context) *ProjectsBrokersListCall {
  1612. c.ctx_ = ctx
  1613. return c
  1614. }
  1615. // Header returns an http.Header that can be modified by the caller to
  1616. // add HTTP headers to the request.
  1617. func (c *ProjectsBrokersListCall) Header() http.Header {
  1618. if c.header_ == nil {
  1619. c.header_ = make(http.Header)
  1620. }
  1621. return c.header_
  1622. }
  1623. func (c *ProjectsBrokersListCall) doRequest(alt string) (*http.Response, error) {
  1624. reqHeaders := make(http.Header)
  1625. for k, v := range c.header_ {
  1626. reqHeaders[k] = v
  1627. }
  1628. reqHeaders.Set("User-Agent", c.s.userAgent())
  1629. if c.ifNoneMatch_ != "" {
  1630. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1631. }
  1632. var body io.Reader = nil
  1633. c.urlParams_.Set("alt", alt)
  1634. c.urlParams_.Set("prettyPrint", "false")
  1635. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/brokers")
  1636. urls += "?" + c.urlParams_.Encode()
  1637. req, err := http.NewRequest("GET", urls, body)
  1638. if err != nil {
  1639. return nil, err
  1640. }
  1641. req.Header = reqHeaders
  1642. googleapi.Expand(req.URL, map[string]string{
  1643. "parent": c.parent,
  1644. })
  1645. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1646. }
  1647. // Do executes the "servicebroker.projects.brokers.list" call.
  1648. // Exactly one of *GoogleCloudServicebrokerV1beta1__ListBrokersResponse
  1649. // or error will be non-nil. Any non-2xx status code is an error.
  1650. // Response headers are in either
  1651. // *GoogleCloudServicebrokerV1beta1__ListBrokersResponse.ServerResponse.H
  1652. // eader or (if a response was returned at all) in
  1653. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1654. // whether the returned error was because http.StatusNotModified was
  1655. // returned.
  1656. func (c *ProjectsBrokersListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudServicebrokerV1beta1__ListBrokersResponse, error) {
  1657. gensupport.SetOptions(c.urlParams_, opts...)
  1658. res, err := c.doRequest("json")
  1659. if res != nil && res.StatusCode == http.StatusNotModified {
  1660. if res.Body != nil {
  1661. res.Body.Close()
  1662. }
  1663. return nil, &googleapi.Error{
  1664. Code: res.StatusCode,
  1665. Header: res.Header,
  1666. }
  1667. }
  1668. if err != nil {
  1669. return nil, err
  1670. }
  1671. defer googleapi.CloseBody(res)
  1672. if err := googleapi.CheckResponse(res); err != nil {
  1673. return nil, err
  1674. }
  1675. ret := &GoogleCloudServicebrokerV1beta1__ListBrokersResponse{
  1676. ServerResponse: googleapi.ServerResponse{
  1677. Header: res.Header,
  1678. HTTPStatusCode: res.StatusCode,
  1679. },
  1680. }
  1681. target := &ret
  1682. if err := gensupport.DecodeResponse(target, res); err != nil {
  1683. return nil, err
  1684. }
  1685. return ret, nil
  1686. // {
  1687. // "description": "ListBrokers lists brokers.",
  1688. // "flatPath": "v1beta1/projects/{projectsId}/brokers",
  1689. // "httpMethod": "GET",
  1690. // "id": "servicebroker.projects.brokers.list",
  1691. // "parameterOrder": [
  1692. // "parent"
  1693. // ],
  1694. // "parameters": {
  1695. // "pageSize": {
  1696. // "description": "Specifies the number of results to return per page. If there are fewer\nelements than the specified number, returns all elements.\nOptional. Acceptable values are 0 to 200, inclusive. (Default: 100)",
  1697. // "format": "int32",
  1698. // "location": "query",
  1699. // "type": "integer"
  1700. // },
  1701. // "pageToken": {
  1702. // "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.",
  1703. // "location": "query",
  1704. // "type": "string"
  1705. // },
  1706. // "parent": {
  1707. // "description": "Parent must match `projects/[PROJECT_ID]/brokers`.",
  1708. // "location": "path",
  1709. // "pattern": "^projects/[^/]+$",
  1710. // "required": true,
  1711. // "type": "string"
  1712. // }
  1713. // },
  1714. // "path": "v1beta1/{+parent}/brokers",
  1715. // "response": {
  1716. // "$ref": "GoogleCloudServicebrokerV1beta1__ListBrokersResponse"
  1717. // },
  1718. // "scopes": [
  1719. // "https://www.googleapis.com/auth/cloud-platform"
  1720. // ]
  1721. // }
  1722. }
  1723. // Pages invokes f for each page of results.
  1724. // A non-nil error returned from f will halt the iteration.
  1725. // The provided context supersedes any context provided to the Context method.
  1726. func (c *ProjectsBrokersListCall) Pages(ctx context.Context, f func(*GoogleCloudServicebrokerV1beta1__ListBrokersResponse) error) error {
  1727. c.ctx_ = ctx
  1728. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1729. for {
  1730. x, err := c.Do()
  1731. if err != nil {
  1732. return err
  1733. }
  1734. if err := f(x); err != nil {
  1735. return err
  1736. }
  1737. if x.NextPageToken == "" {
  1738. return nil
  1739. }
  1740. c.PageToken(x.NextPageToken)
  1741. }
  1742. }
  1743. // method id "servicebroker.projects.brokers.instances.get":
  1744. type ProjectsBrokersInstancesGetCall struct {
  1745. s *Service
  1746. name string
  1747. urlParams_ gensupport.URLParams
  1748. ifNoneMatch_ string
  1749. ctx_ context.Context
  1750. header_ http.Header
  1751. }
  1752. // Get: Gets the given service instance from the system.
  1753. // The API call accepts both OSB style API and standard google style
  1754. // API
  1755. // resource path.
  1756. // i.e. both `projects/*/brokers/*/instances/*`
  1757. // and `projects/*/brokers/*/v2/service_instances/*` are acceptable
  1758. // paths.
  1759. func (r *ProjectsBrokersInstancesService) Get(name string) *ProjectsBrokersInstancesGetCall {
  1760. c := &ProjectsBrokersInstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1761. c.name = name
  1762. return c
  1763. }
  1764. // Fields allows partial responses to be retrieved. See
  1765. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1766. // for more information.
  1767. func (c *ProjectsBrokersInstancesGetCall) Fields(s ...googleapi.Field) *ProjectsBrokersInstancesGetCall {
  1768. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1769. return c
  1770. }
  1771. // IfNoneMatch sets the optional parameter which makes the operation
  1772. // fail if the object's ETag matches the given value. This is useful for
  1773. // getting updates only after the object has changed since the last
  1774. // request. Use googleapi.IsNotModified to check whether the response
  1775. // error from Do is the result of In-None-Match.
  1776. func (c *ProjectsBrokersInstancesGetCall) IfNoneMatch(entityTag string) *ProjectsBrokersInstancesGetCall {
  1777. c.ifNoneMatch_ = entityTag
  1778. return c
  1779. }
  1780. // Context sets the context to be used in this call's Do method. Any
  1781. // pending HTTP request will be aborted if the provided context is
  1782. // canceled.
  1783. func (c *ProjectsBrokersInstancesGetCall) Context(ctx context.Context) *ProjectsBrokersInstancesGetCall {
  1784. c.ctx_ = ctx
  1785. return c
  1786. }
  1787. // Header returns an http.Header that can be modified by the caller to
  1788. // add HTTP headers to the request.
  1789. func (c *ProjectsBrokersInstancesGetCall) Header() http.Header {
  1790. if c.header_ == nil {
  1791. c.header_ = make(http.Header)
  1792. }
  1793. return c.header_
  1794. }
  1795. func (c *ProjectsBrokersInstancesGetCall) doRequest(alt string) (*http.Response, error) {
  1796. reqHeaders := make(http.Header)
  1797. for k, v := range c.header_ {
  1798. reqHeaders[k] = v
  1799. }
  1800. reqHeaders.Set("User-Agent", c.s.userAgent())
  1801. if c.ifNoneMatch_ != "" {
  1802. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1803. }
  1804. var body io.Reader = nil
  1805. c.urlParams_.Set("alt", alt)
  1806. c.urlParams_.Set("prettyPrint", "false")
  1807. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  1808. urls += "?" + c.urlParams_.Encode()
  1809. req, err := http.NewRequest("GET", urls, body)
  1810. if err != nil {
  1811. return nil, err
  1812. }
  1813. req.Header = reqHeaders
  1814. googleapi.Expand(req.URL, map[string]string{
  1815. "name": c.name,
  1816. })
  1817. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1818. }
  1819. // Do executes the "servicebroker.projects.brokers.instances.get" call.
  1820. // Exactly one of *GoogleCloudServicebrokerV1beta1__ServiceInstance or
  1821. // error will be non-nil. Any non-2xx status code is an error. Response
  1822. // headers are in either
  1823. // *GoogleCloudServicebrokerV1beta1__ServiceInstance.ServerResponse.Heade
  1824. // r or (if a response was returned at all) in
  1825. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1826. // whether the returned error was because http.StatusNotModified was
  1827. // returned.
  1828. func (c *ProjectsBrokersInstancesGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudServicebrokerV1beta1__ServiceInstance, error) {
  1829. gensupport.SetOptions(c.urlParams_, opts...)
  1830. res, err := c.doRequest("json")
  1831. if res != nil && res.StatusCode == http.StatusNotModified {
  1832. if res.Body != nil {
  1833. res.Body.Close()
  1834. }
  1835. return nil, &googleapi.Error{
  1836. Code: res.StatusCode,
  1837. Header: res.Header,
  1838. }
  1839. }
  1840. if err != nil {
  1841. return nil, err
  1842. }
  1843. defer googleapi.CloseBody(res)
  1844. if err := googleapi.CheckResponse(res); err != nil {
  1845. return nil, err
  1846. }
  1847. ret := &GoogleCloudServicebrokerV1beta1__ServiceInstance{
  1848. ServerResponse: googleapi.ServerResponse{
  1849. Header: res.Header,
  1850. HTTPStatusCode: res.StatusCode,
  1851. },
  1852. }
  1853. target := &ret
  1854. if err := gensupport.DecodeResponse(target, res); err != nil {
  1855. return nil, err
  1856. }
  1857. return ret, nil
  1858. // {
  1859. // "description": "Gets the given service instance from the system.\nThe API call accepts both OSB style API and standard google style API\nresource path.\ni.e. both `projects/*/brokers/*/instances/*`\n and `projects/*/brokers/*/v2/service_instances/*` are acceptable paths.",
  1860. // "flatPath": "v1beta1/projects/{projectsId}/brokers/{brokersId}/instances/{instancesId}",
  1861. // "httpMethod": "GET",
  1862. // "id": "servicebroker.projects.brokers.instances.get",
  1863. // "parameterOrder": [
  1864. // "name"
  1865. // ],
  1866. // "parameters": {
  1867. // "name": {
  1868. // "description": "The resource name of the instance to return.\nName must match\n`projects/[PROJECT_ID]/brokers/[BROKER_ID]/` +\n`v2/service_instances/[INSTANCE_ID]`\nor\n`projects/[PROJECT_ID]/brokers/[BROKER_ID]/instances/[INSTANCE_ID]`.",
  1869. // "location": "path",
  1870. // "pattern": "^projects/[^/]+/brokers/[^/]+/instances/[^/]+$",
  1871. // "required": true,
  1872. // "type": "string"
  1873. // }
  1874. // },
  1875. // "path": "v1beta1/{+name}",
  1876. // "response": {
  1877. // "$ref": "GoogleCloudServicebrokerV1beta1__ServiceInstance"
  1878. // },
  1879. // "scopes": [
  1880. // "https://www.googleapis.com/auth/cloud-platform"
  1881. // ]
  1882. // }
  1883. }
  1884. // method id "servicebroker.projects.brokers.instances.getLast_operation":
  1885. type ProjectsBrokersInstancesGetLastOperationCall struct {
  1886. s *Service
  1887. name string
  1888. urlParams_ gensupport.URLParams
  1889. ifNoneMatch_ string
  1890. ctx_ context.Context
  1891. header_ http.Header
  1892. }
  1893. // GetLastOperation: Returns the state of the last operation for the
  1894. // service instance.
  1895. // Only last (or current) operation can be polled.
  1896. func (r *ProjectsBrokersInstancesService) GetLastOperation(name string) *ProjectsBrokersInstancesGetLastOperationCall {
  1897. c := &ProjectsBrokersInstancesGetLastOperationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1898. c.name = name
  1899. return c
  1900. }
  1901. // Operation sets the optional parameter "operation": If `operation` was
  1902. // returned during mutation operation, this field must be
  1903. // populated with the provided value.
  1904. func (c *ProjectsBrokersInstancesGetLastOperationCall) Operation(operation string) *ProjectsBrokersInstancesGetLastOperationCall {
  1905. c.urlParams_.Set("operation", operation)
  1906. return c
  1907. }
  1908. // PlanId sets the optional parameter "planId": Plan id.
  1909. func (c *ProjectsBrokersInstancesGetLastOperationCall) PlanId(planId string) *ProjectsBrokersInstancesGetLastOperationCall {
  1910. c.urlParams_.Set("planId", planId)
  1911. return c
  1912. }
  1913. // ServiceId sets the optional parameter "serviceId": Service id.
  1914. func (c *ProjectsBrokersInstancesGetLastOperationCall) ServiceId(serviceId string) *ProjectsBrokersInstancesGetLastOperationCall {
  1915. c.urlParams_.Set("serviceId", serviceId)
  1916. return c
  1917. }
  1918. // Fields allows partial responses to be retrieved. See
  1919. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1920. // for more information.
  1921. func (c *ProjectsBrokersInstancesGetLastOperationCall) Fields(s ...googleapi.Field) *ProjectsBrokersInstancesGetLastOperationCall {
  1922. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1923. return c
  1924. }
  1925. // IfNoneMatch sets the optional parameter which makes the operation
  1926. // fail if the object's ETag matches the given value. This is useful for
  1927. // getting updates only after the object has changed since the last
  1928. // request. Use googleapi.IsNotModified to check whether the response
  1929. // error from Do is the result of In-None-Match.
  1930. func (c *ProjectsBrokersInstancesGetLastOperationCall) IfNoneMatch(entityTag string) *ProjectsBrokersInstancesGetLastOperationCall {
  1931. c.ifNoneMatch_ = entityTag
  1932. return c
  1933. }
  1934. // Context sets the context to be used in this call's Do method. Any
  1935. // pending HTTP request will be aborted if the provided context is
  1936. // canceled.
  1937. func (c *ProjectsBrokersInstancesGetLastOperationCall) Context(ctx context.Context) *ProjectsBrokersInstancesGetLastOperationCall {
  1938. c.ctx_ = ctx
  1939. return c
  1940. }
  1941. // Header returns an http.Header that can be modified by the caller to
  1942. // add HTTP headers to the request.
  1943. func (c *ProjectsBrokersInstancesGetLastOperationCall) Header() http.Header {
  1944. if c.header_ == nil {
  1945. c.header_ = make(http.Header)
  1946. }
  1947. return c.header_
  1948. }
  1949. func (c *ProjectsBrokersInstancesGetLastOperationCall) doRequest(alt string) (*http.Response, error) {
  1950. reqHeaders := make(http.Header)
  1951. for k, v := range c.header_ {
  1952. reqHeaders[k] = v
  1953. }
  1954. reqHeaders.Set("User-Agent", c.s.userAgent())
  1955. if c.ifNoneMatch_ != "" {
  1956. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1957. }
  1958. var body io.Reader = nil
  1959. c.urlParams_.Set("alt", alt)
  1960. c.urlParams_.Set("prettyPrint", "false")
  1961. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/last_operation")
  1962. urls += "?" + c.urlParams_.Encode()
  1963. req, err := http.NewRequest("GET", urls, body)
  1964. if err != nil {
  1965. return nil, err
  1966. }
  1967. req.Header = reqHeaders
  1968. googleapi.Expand(req.URL, map[string]string{
  1969. "name": c.name,
  1970. })
  1971. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1972. }
  1973. // Do executes the "servicebroker.projects.brokers.instances.getLast_operation" call.
  1974. // Exactly one of *GoogleCloudServicebrokerV1beta1__Operation or error
  1975. // will be non-nil. Any non-2xx status code is an error. Response
  1976. // headers are in either
  1977. // *GoogleCloudServicebrokerV1beta1__Operation.ServerResponse.Header or
  1978. // (if a response was returned at all) in
  1979. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1980. // whether the returned error was because http.StatusNotModified was
  1981. // returned.
  1982. func (c *ProjectsBrokersInstancesGetLastOperationCall) Do(opts ...googleapi.CallOption) (*GoogleCloudServicebrokerV1beta1__Operation, error) {
  1983. gensupport.SetOptions(c.urlParams_, opts...)
  1984. res, err := c.doRequest("json")
  1985. if res != nil && res.StatusCode == http.StatusNotModified {
  1986. if res.Body != nil {
  1987. res.Body.Close()
  1988. }
  1989. return nil, &googleapi.Error{
  1990. Code: res.StatusCode,
  1991. Header: res.Header,
  1992. }
  1993. }
  1994. if err != nil {
  1995. return nil, err
  1996. }
  1997. defer googleapi.CloseBody(res)
  1998. if err := googleapi.CheckResponse(res); err != nil {
  1999. return nil, err
  2000. }
  2001. ret := &GoogleCloudServicebrokerV1beta1__Operation{
  2002. ServerResponse: googleapi.ServerResponse{
  2003. Header: res.Header,
  2004. HTTPStatusCode: res.StatusCode,
  2005. },
  2006. }
  2007. target := &ret
  2008. if err := gensupport.DecodeResponse(target, res); err != nil {
  2009. return nil, err
  2010. }
  2011. return ret, nil
  2012. // {
  2013. // "description": "Returns the state of the last operation for the service instance.\nOnly last (or current) operation can be polled.",
  2014. // "flatPath": "v1beta1/projects/{projectsId}/brokers/{brokersId}/instances/{instancesId}/last_operation",
  2015. // "httpMethod": "GET",
  2016. // "id": "servicebroker.projects.brokers.instances.getLast_operation",
  2017. // "parameterOrder": [
  2018. // "name"
  2019. // ],
  2020. // "parameters": {
  2021. // "name": {
  2022. // "description": "Name must match\n`projects/[PROJECT_ID]/brokers/[BROKER_ID]/v2/`+\n `service_instances/[INSTANCE_ID]`.",
  2023. // "location": "path",
  2024. // "pattern": "^projects/[^/]+/brokers/[^/]+/instances/[^/]+$",
  2025. // "required": true,
  2026. // "type": "string"
  2027. // },
  2028. // "operation": {
  2029. // "description": "If `operation` was returned during mutation operation, this field must be\npopulated with the provided value.",
  2030. // "location": "query",
  2031. // "type": "string"
  2032. // },
  2033. // "planId": {
  2034. // "description": "Plan id.",
  2035. // "location": "query",
  2036. // "type": "string"
  2037. // },
  2038. // "serviceId": {
  2039. // "description": "Service id.",
  2040. // "location": "query",
  2041. // "type": "string"
  2042. // }
  2043. // },
  2044. // "path": "v1beta1/{+name}/last_operation",
  2045. // "response": {
  2046. // "$ref": "GoogleCloudServicebrokerV1beta1__Operation"
  2047. // },
  2048. // "scopes": [
  2049. // "https://www.googleapis.com/auth/cloud-platform"
  2050. // ]
  2051. // }
  2052. }
  2053. // method id "servicebroker.projects.brokers.instances.list":
  2054. type ProjectsBrokersInstancesListCall struct {
  2055. s *Service
  2056. parent string
  2057. urlParams_ gensupport.URLParams
  2058. ifNoneMatch_ string
  2059. ctx_ context.Context
  2060. header_ http.Header
  2061. }
  2062. // List: Lists all the instances in the brokers
  2063. // This API is an extension and not part of the OSB spec.
  2064. // Hence the path is a standard Google API URL.
  2065. func (r *ProjectsBrokersInstancesService) List(parent string) *ProjectsBrokersInstancesListCall {
  2066. c := &ProjectsBrokersInstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2067. c.parent = parent
  2068. return c
  2069. }
  2070. // PageSize sets the optional parameter "pageSize": Specifies the number
  2071. // of results to return per page. If there are fewer
  2072. // elements than the specified number, returns all elements.
  2073. // Acceptable values are 0 to 200, inclusive. (Default: 100)
  2074. func (c *ProjectsBrokersInstancesListCall) PageSize(pageSize int64) *ProjectsBrokersInstancesListCall {
  2075. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2076. return c
  2077. }
  2078. // PageToken sets the optional parameter "pageToken": Specifies a page
  2079. // token to use. Set `pageToken` to a `nextPageToken`
  2080. // returned by a previous list request to get the next page of results.
  2081. func (c *ProjectsBrokersInstancesListCall) PageToken(pageToken string) *ProjectsBrokersInstancesListCall {
  2082. c.urlParams_.Set("pageToken", pageToken)
  2083. return c
  2084. }
  2085. // Fields allows partial responses to be retrieved. See
  2086. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2087. // for more information.
  2088. func (c *ProjectsBrokersInstancesListCall) Fields(s ...googleapi.Field) *ProjectsBrokersInstancesListCall {
  2089. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2090. return c
  2091. }
  2092. // IfNoneMatch sets the optional parameter which makes the operation
  2093. // fail if the object's ETag matches the given value. This is useful for
  2094. // getting updates only after the object has changed since the last
  2095. // request. Use googleapi.IsNotModified to check whether the response
  2096. // error from Do is the result of In-None-Match.
  2097. func (c *ProjectsBrokersInstancesListCall) IfNoneMatch(entityTag string) *ProjectsBrokersInstancesListCall {
  2098. c.ifNoneMatch_ = entityTag
  2099. return c
  2100. }
  2101. // Context sets the context to be used in this call's Do method. Any
  2102. // pending HTTP request will be aborted if the provided context is
  2103. // canceled.
  2104. func (c *ProjectsBrokersInstancesListCall) Context(ctx context.Context) *ProjectsBrokersInstancesListCall {
  2105. c.ctx_ = ctx
  2106. return c
  2107. }
  2108. // Header returns an http.Header that can be modified by the caller to
  2109. // add HTTP headers to the request.
  2110. func (c *ProjectsBrokersInstancesListCall) Header() http.Header {
  2111. if c.header_ == nil {
  2112. c.header_ = make(http.Header)
  2113. }
  2114. return c.header_
  2115. }
  2116. func (c *ProjectsBrokersInstancesListCall) doRequest(alt string) (*http.Response, error) {
  2117. reqHeaders := make(http.Header)
  2118. for k, v := range c.header_ {
  2119. reqHeaders[k] = v
  2120. }
  2121. reqHeaders.Set("User-Agent", c.s.userAgent())
  2122. if c.ifNoneMatch_ != "" {
  2123. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2124. }
  2125. var body io.Reader = nil
  2126. c.urlParams_.Set("alt", alt)
  2127. c.urlParams_.Set("prettyPrint", "false")
  2128. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/instances")
  2129. urls += "?" + c.urlParams_.Encode()
  2130. req, err := http.NewRequest("GET", urls, body)
  2131. if err != nil {
  2132. return nil, err
  2133. }
  2134. req.Header = reqHeaders
  2135. googleapi.Expand(req.URL, map[string]string{
  2136. "parent": c.parent,
  2137. })
  2138. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2139. }
  2140. // Do executes the "servicebroker.projects.brokers.instances.list" call.
  2141. // Exactly one of
  2142. // *GoogleCloudServicebrokerV1beta1__ListServiceInstancesResponse or
  2143. // error will be non-nil. Any non-2xx status code is an error. Response
  2144. // headers are in either
  2145. // *GoogleCloudServicebrokerV1beta1__ListServiceInstancesResponse.ServerR
  2146. // esponse.Header or (if a response was returned at all) in
  2147. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2148. // whether the returned error was because http.StatusNotModified was
  2149. // returned.
  2150. func (c *ProjectsBrokersInstancesListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudServicebrokerV1beta1__ListServiceInstancesResponse, error) {
  2151. gensupport.SetOptions(c.urlParams_, opts...)
  2152. res, err := c.doRequest("json")
  2153. if res != nil && res.StatusCode == http.StatusNotModified {
  2154. if res.Body != nil {
  2155. res.Body.Close()
  2156. }
  2157. return nil, &googleapi.Error{
  2158. Code: res.StatusCode,
  2159. Header: res.Header,
  2160. }
  2161. }
  2162. if err != nil {
  2163. return nil, err
  2164. }
  2165. defer googleapi.CloseBody(res)
  2166. if err := googleapi.CheckResponse(res); err != nil {
  2167. return nil, err
  2168. }
  2169. ret := &GoogleCloudServicebrokerV1beta1__ListServiceInstancesResponse{
  2170. ServerResponse: googleapi.ServerResponse{
  2171. Header: res.Header,
  2172. HTTPStatusCode: res.StatusCode,
  2173. },
  2174. }
  2175. target := &ret
  2176. if err := gensupport.DecodeResponse(target, res); err != nil {
  2177. return nil, err
  2178. }
  2179. return ret, nil
  2180. // {
  2181. // "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.",
  2182. // "flatPath": "v1beta1/projects/{projectsId}/brokers/{brokersId}/instances",
  2183. // "httpMethod": "GET",
  2184. // "id": "servicebroker.projects.brokers.instances.list",
  2185. // "parameterOrder": [
  2186. // "parent"
  2187. // ],
  2188. // "parameters": {
  2189. // "pageSize": {
  2190. // "description": "Specifies the number of results to return per page. If there are fewer\nelements than the specified number, returns all elements.\nOptional. Acceptable values are 0 to 200, inclusive. (Default: 100)",
  2191. // "format": "int32",
  2192. // "location": "query",
  2193. // "type": "integer"
  2194. // },
  2195. // "pageToken": {
  2196. // "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.",
  2197. // "location": "query",
  2198. // "type": "string"
  2199. // },
  2200. // "parent": {
  2201. // "description": "Parent must match `projects/[PROJECT_ID]/brokers/[BROKER_ID]`.",
  2202. // "location": "path",
  2203. // "pattern": "^projects/[^/]+/brokers/[^/]+$",
  2204. // "required": true,
  2205. // "type": "string"
  2206. // }
  2207. // },
  2208. // "path": "v1beta1/{+parent}/instances",
  2209. // "response": {
  2210. // "$ref": "GoogleCloudServicebrokerV1beta1__ListServiceInstancesResponse"
  2211. // },
  2212. // "scopes": [
  2213. // "https://www.googleapis.com/auth/cloud-platform"
  2214. // ]
  2215. // }
  2216. }
  2217. // Pages invokes f for each page of results.
  2218. // A non-nil error returned from f will halt the iteration.
  2219. // The provided context supersedes any context provided to the Context method.
  2220. func (c *ProjectsBrokersInstancesListCall) Pages(ctx context.Context, f func(*GoogleCloudServicebrokerV1beta1__ListServiceInstancesResponse) error) error {
  2221. c.ctx_ = ctx
  2222. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2223. for {
  2224. x, err := c.Do()
  2225. if err != nil {
  2226. return err
  2227. }
  2228. if err := f(x); err != nil {
  2229. return err
  2230. }
  2231. if x.NextPageToken == "" {
  2232. return nil
  2233. }
  2234. c.PageToken(x.NextPageToken)
  2235. }
  2236. }
  2237. // method id "servicebroker.projects.brokers.instances.bindings.getLast_operation":
  2238. type ProjectsBrokersInstancesBindingsGetLastOperationCall struct {
  2239. s *Service
  2240. name string
  2241. urlParams_ gensupport.URLParams
  2242. ifNoneMatch_ string
  2243. ctx_ context.Context
  2244. header_ http.Header
  2245. }
  2246. // GetLastOperation: Returns the state of the last operation for the
  2247. // binding.
  2248. // Only last (or current) operation can be polled.
  2249. func (r *ProjectsBrokersInstancesBindingsService) GetLastOperation(name string) *ProjectsBrokersInstancesBindingsGetLastOperationCall {
  2250. c := &ProjectsBrokersInstancesBindingsGetLastOperationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2251. c.name = name
  2252. return c
  2253. }
  2254. // Operation sets the optional parameter "operation": If `operation` was
  2255. // returned during mutation operation, this field must be
  2256. // populated with the provided value.
  2257. func (c *ProjectsBrokersInstancesBindingsGetLastOperationCall) Operation(operation string) *ProjectsBrokersInstancesBindingsGetLastOperationCall {
  2258. c.urlParams_.Set("operation", operation)
  2259. return c
  2260. }
  2261. // PlanId sets the optional parameter "planId": Plan id.
  2262. func (c *ProjectsBrokersInstancesBindingsGetLastOperationCall) PlanId(planId string) *ProjectsBrokersInstancesBindingsGetLastOperationCall {
  2263. c.urlParams_.Set("planId", planId)
  2264. return c
  2265. }
  2266. // ServiceId sets the optional parameter "serviceId": Service id.
  2267. func (c *ProjectsBrokersInstancesBindingsGetLastOperationCall) ServiceId(serviceId string) *ProjectsBrokersInstancesBindingsGetLastOperationCall {
  2268. c.urlParams_.Set("serviceId", serviceId)
  2269. return c
  2270. }
  2271. // Fields allows partial responses to be retrieved. See
  2272. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2273. // for more information.
  2274. func (c *ProjectsBrokersInstancesBindingsGetLastOperationCall) Fields(s ...googleapi.Field) *ProjectsBrokersInstancesBindingsGetLastOperationCall {
  2275. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2276. return c
  2277. }
  2278. // IfNoneMatch sets the optional parameter which makes the operation
  2279. // fail if the object's ETag matches the given value. This is useful for
  2280. // getting updates only after the object has changed since the last
  2281. // request. Use googleapi.IsNotModified to check whether the response
  2282. // error from Do is the result of In-None-Match.
  2283. func (c *ProjectsBrokersInstancesBindingsGetLastOperationCall) IfNoneMatch(entityTag string) *ProjectsBrokersInstancesBindingsGetLastOperationCall {
  2284. c.ifNoneMatch_ = entityTag
  2285. return c
  2286. }
  2287. // Context sets the context to be used in this call's Do method. Any
  2288. // pending HTTP request will be aborted if the provided context is
  2289. // canceled.
  2290. func (c *ProjectsBrokersInstancesBindingsGetLastOperationCall) Context(ctx context.Context) *ProjectsBrokersInstancesBindingsGetLastOperationCall {
  2291. c.ctx_ = ctx
  2292. return c
  2293. }
  2294. // Header returns an http.Header that can be modified by the caller to
  2295. // add HTTP headers to the request.
  2296. func (c *ProjectsBrokersInstancesBindingsGetLastOperationCall) Header() http.Header {
  2297. if c.header_ == nil {
  2298. c.header_ = make(http.Header)
  2299. }
  2300. return c.header_
  2301. }
  2302. func (c *ProjectsBrokersInstancesBindingsGetLastOperationCall) doRequest(alt string) (*http.Response, error) {
  2303. reqHeaders := make(http.Header)
  2304. for k, v := range c.header_ {
  2305. reqHeaders[k] = v
  2306. }
  2307. reqHeaders.Set("User-Agent", c.s.userAgent())
  2308. if c.ifNoneMatch_ != "" {
  2309. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2310. }
  2311. var body io.Reader = nil
  2312. c.urlParams_.Set("alt", alt)
  2313. c.urlParams_.Set("prettyPrint", "false")
  2314. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/last_operation")
  2315. urls += "?" + c.urlParams_.Encode()
  2316. req, err := http.NewRequest("GET", urls, body)
  2317. if err != nil {
  2318. return nil, err
  2319. }
  2320. req.Header = reqHeaders
  2321. googleapi.Expand(req.URL, map[string]string{
  2322. "name": c.name,
  2323. })
  2324. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2325. }
  2326. // Do executes the "servicebroker.projects.brokers.instances.bindings.getLast_operation" call.
  2327. // Exactly one of *GoogleCloudServicebrokerV1beta1__Operation or error
  2328. // will be non-nil. Any non-2xx status code is an error. Response
  2329. // headers are in either
  2330. // *GoogleCloudServicebrokerV1beta1__Operation.ServerResponse.Header or
  2331. // (if a response was returned at all) in
  2332. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2333. // whether the returned error was because http.StatusNotModified was
  2334. // returned.
  2335. func (c *ProjectsBrokersInstancesBindingsGetLastOperationCall) Do(opts ...googleapi.CallOption) (*GoogleCloudServicebrokerV1beta1__Operation, error) {
  2336. gensupport.SetOptions(c.urlParams_, opts...)
  2337. res, err := c.doRequest("json")
  2338. if res != nil && res.StatusCode == http.StatusNotModified {
  2339. if res.Body != nil {
  2340. res.Body.Close()
  2341. }
  2342. return nil, &googleapi.Error{
  2343. Code: res.StatusCode,
  2344. Header: res.Header,
  2345. }
  2346. }
  2347. if err != nil {
  2348. return nil, err
  2349. }
  2350. defer googleapi.CloseBody(res)
  2351. if err := googleapi.CheckResponse(res); err != nil {
  2352. return nil, err
  2353. }
  2354. ret := &GoogleCloudServicebrokerV1beta1__Operation{
  2355. ServerResponse: googleapi.ServerResponse{
  2356. Header: res.Header,
  2357. HTTPStatusCode: res.StatusCode,
  2358. },
  2359. }
  2360. target := &ret
  2361. if err := gensupport.DecodeResponse(target, res); err != nil {
  2362. return nil, err
  2363. }
  2364. return ret, nil
  2365. // {
  2366. // "description": "Returns the state of the last operation for the binding.\nOnly last (or current) operation can be polled.",
  2367. // "flatPath": "v1beta1/projects/{projectsId}/brokers/{brokersId}/instances/{instancesId}/bindings/{bindingsId}/last_operation",
  2368. // "httpMethod": "GET",
  2369. // "id": "servicebroker.projects.brokers.instances.bindings.getLast_operation",
  2370. // "parameterOrder": [
  2371. // "name"
  2372. // ],
  2373. // "parameters": {
  2374. // "name": {
  2375. // "description": "Name must match\n`projects/[PROJECT_ID]/brokers/[BROKER_ID]/v2/service_instances/[INSTANCE_ID]/service_binding/[BINDING_ID]`.",
  2376. // "location": "path",
  2377. // "pattern": "^projects/[^/]+/brokers/[^/]+/instances/[^/]+/bindings/[^/]+$",
  2378. // "required": true,
  2379. // "type": "string"
  2380. // },
  2381. // "operation": {
  2382. // "description": "If `operation` was returned during mutation operation, this field must be\npopulated with the provided value.",
  2383. // "location": "query",
  2384. // "type": "string"
  2385. // },
  2386. // "planId": {
  2387. // "description": "Plan id.",
  2388. // "location": "query",
  2389. // "type": "string"
  2390. // },
  2391. // "serviceId": {
  2392. // "description": "Service id.",
  2393. // "location": "query",
  2394. // "type": "string"
  2395. // }
  2396. // },
  2397. // "path": "v1beta1/{+name}/last_operation",
  2398. // "response": {
  2399. // "$ref": "GoogleCloudServicebrokerV1beta1__Operation"
  2400. // },
  2401. // "scopes": [
  2402. // "https://www.googleapis.com/auth/cloud-platform"
  2403. // ]
  2404. // }
  2405. }
  2406. // method id "servicebroker.projects.brokers.instances.bindings.list":
  2407. type ProjectsBrokersInstancesBindingsListCall struct {
  2408. s *Service
  2409. parent string
  2410. urlParams_ gensupport.URLParams
  2411. ifNoneMatch_ string
  2412. ctx_ context.Context
  2413. header_ http.Header
  2414. }
  2415. // List: Lists all the bindings in the instance.
  2416. func (r *ProjectsBrokersInstancesBindingsService) List(parent string) *ProjectsBrokersInstancesBindingsListCall {
  2417. c := &ProjectsBrokersInstancesBindingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2418. c.parent = parent
  2419. return c
  2420. }
  2421. // PageSize sets the optional parameter "pageSize": Specifies the number
  2422. // of results to return per page. If there are fewer
  2423. // elements than the specified number, returns all elements.
  2424. // Acceptable values are 0 to 200, inclusive. (Default: 100)
  2425. func (c *ProjectsBrokersInstancesBindingsListCall) PageSize(pageSize int64) *ProjectsBrokersInstancesBindingsListCall {
  2426. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2427. return c
  2428. }
  2429. // PageToken sets the optional parameter "pageToken": Specifies a page
  2430. // token to use. Set `pageToken` to a `nextPageToken`
  2431. // returned by a previous list request to get the next page of results.
  2432. func (c *ProjectsBrokersInstancesBindingsListCall) PageToken(pageToken string) *ProjectsBrokersInstancesBindingsListCall {
  2433. c.urlParams_.Set("pageToken", pageToken)
  2434. return c
  2435. }
  2436. // Fields allows partial responses to be retrieved. See
  2437. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2438. // for more information.
  2439. func (c *ProjectsBrokersInstancesBindingsListCall) Fields(s ...googleapi.Field) *ProjectsBrokersInstancesBindingsListCall {
  2440. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2441. return c
  2442. }
  2443. // IfNoneMatch sets the optional parameter which makes the operation
  2444. // fail if the object's ETag matches the given value. This is useful for
  2445. // getting updates only after the object has changed since the last
  2446. // request. Use googleapi.IsNotModified to check whether the response
  2447. // error from Do is the result of In-None-Match.
  2448. func (c *ProjectsBrokersInstancesBindingsListCall) IfNoneMatch(entityTag string) *ProjectsBrokersInstancesBindingsListCall {
  2449. c.ifNoneMatch_ = entityTag
  2450. return c
  2451. }
  2452. // Context sets the context to be used in this call's Do method. Any
  2453. // pending HTTP request will be aborted if the provided context is
  2454. // canceled.
  2455. func (c *ProjectsBrokersInstancesBindingsListCall) Context(ctx context.Context) *ProjectsBrokersInstancesBindingsListCall {
  2456. c.ctx_ = ctx
  2457. return c
  2458. }
  2459. // Header returns an http.Header that can be modified by the caller to
  2460. // add HTTP headers to the request.
  2461. func (c *ProjectsBrokersInstancesBindingsListCall) Header() http.Header {
  2462. if c.header_ == nil {
  2463. c.header_ = make(http.Header)
  2464. }
  2465. return c.header_
  2466. }
  2467. func (c *ProjectsBrokersInstancesBindingsListCall) doRequest(alt string) (*http.Response, error) {
  2468. reqHeaders := make(http.Header)
  2469. for k, v := range c.header_ {
  2470. reqHeaders[k] = v
  2471. }
  2472. reqHeaders.Set("User-Agent", c.s.userAgent())
  2473. if c.ifNoneMatch_ != "" {
  2474. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2475. }
  2476. var body io.Reader = nil
  2477. c.urlParams_.Set("alt", alt)
  2478. c.urlParams_.Set("prettyPrint", "false")
  2479. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/bindings")
  2480. urls += "?" + c.urlParams_.Encode()
  2481. req, err := http.NewRequest("GET", urls, body)
  2482. if err != nil {
  2483. return nil, err
  2484. }
  2485. req.Header = reqHeaders
  2486. googleapi.Expand(req.URL, map[string]string{
  2487. "parent": c.parent,
  2488. })
  2489. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2490. }
  2491. // Do executes the "servicebroker.projects.brokers.instances.bindings.list" call.
  2492. // Exactly one of *GoogleCloudServicebrokerV1beta1__ListBindingsResponse
  2493. // or error will be non-nil. Any non-2xx status code is an error.
  2494. // Response headers are in either
  2495. // *GoogleCloudServicebrokerV1beta1__ListBindingsResponse.ServerResponse.
  2496. // Header or (if a response was returned at all) in
  2497. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2498. // whether the returned error was because http.StatusNotModified was
  2499. // returned.
  2500. func (c *ProjectsBrokersInstancesBindingsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudServicebrokerV1beta1__ListBindingsResponse, error) {
  2501. gensupport.SetOptions(c.urlParams_, opts...)
  2502. res, err := c.doRequest("json")
  2503. if res != nil && res.StatusCode == http.StatusNotModified {
  2504. if res.Body != nil {
  2505. res.Body.Close()
  2506. }
  2507. return nil, &googleapi.Error{
  2508. Code: res.StatusCode,
  2509. Header: res.Header,
  2510. }
  2511. }
  2512. if err != nil {
  2513. return nil, err
  2514. }
  2515. defer googleapi.CloseBody(res)
  2516. if err := googleapi.CheckResponse(res); err != nil {
  2517. return nil, err
  2518. }
  2519. ret := &GoogleCloudServicebrokerV1beta1__ListBindingsResponse{
  2520. ServerResponse: googleapi.ServerResponse{
  2521. Header: res.Header,
  2522. HTTPStatusCode: res.StatusCode,
  2523. },
  2524. }
  2525. target := &ret
  2526. if err := gensupport.DecodeResponse(target, res); err != nil {
  2527. return nil, err
  2528. }
  2529. return ret, nil
  2530. // {
  2531. // "description": "Lists all the bindings in the instance.",
  2532. // "flatPath": "v1beta1/projects/{projectsId}/brokers/{brokersId}/instances/{instancesId}/bindings",
  2533. // "httpMethod": "GET",
  2534. // "id": "servicebroker.projects.brokers.instances.bindings.list",
  2535. // "parameterOrder": [
  2536. // "parent"
  2537. // ],
  2538. // "parameters": {
  2539. // "pageSize": {
  2540. // "description": "Specifies the number of results to return per page. If there are fewer\nelements than the specified number, returns all elements.\nOptional. Acceptable values are 0 to 200, inclusive. (Default: 100)",
  2541. // "format": "int32",
  2542. // "location": "query",
  2543. // "type": "integer"
  2544. // },
  2545. // "pageToken": {
  2546. // "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.",
  2547. // "location": "query",
  2548. // "type": "string"
  2549. // },
  2550. // "parent": {
  2551. // "description": "Parent must match\n`projects/[PROJECT_ID]/brokers/[BROKER_ID]/` +\n`v2/service_instances/[INSTANCE_ID]`\nor\n`projects/[PROJECT_ID]/brokers/[BROKER_ID]/instances/[INSTANCE_ID]`.",
  2552. // "location": "path",
  2553. // "pattern": "^projects/[^/]+/brokers/[^/]+/instances/[^/]+$",
  2554. // "required": true,
  2555. // "type": "string"
  2556. // }
  2557. // },
  2558. // "path": "v1beta1/{+parent}/bindings",
  2559. // "response": {
  2560. // "$ref": "GoogleCloudServicebrokerV1beta1__ListBindingsResponse"
  2561. // },
  2562. // "scopes": [
  2563. // "https://www.googleapis.com/auth/cloud-platform"
  2564. // ]
  2565. // }
  2566. }
  2567. // Pages invokes f for each page of results.
  2568. // A non-nil error returned from f will halt the iteration.
  2569. // The provided context supersedes any context provided to the Context method.
  2570. func (c *ProjectsBrokersInstancesBindingsListCall) Pages(ctx context.Context, f func(*GoogleCloudServicebrokerV1beta1__ListBindingsResponse) error) error {
  2571. c.ctx_ = ctx
  2572. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2573. for {
  2574. x, err := c.Do()
  2575. if err != nil {
  2576. return err
  2577. }
  2578. if err := f(x); err != nil {
  2579. return err
  2580. }
  2581. if x.NextPageToken == "" {
  2582. return nil
  2583. }
  2584. c.PageToken(x.NextPageToken)
  2585. }
  2586. }
  2587. // method id "servicebroker.projects.brokers.v2.catalog.list":
  2588. type ProjectsBrokersV2CatalogListCall struct {
  2589. s *Service
  2590. parent string
  2591. urlParams_ gensupport.URLParams
  2592. ifNoneMatch_ string
  2593. ctx_ context.Context
  2594. header_ http.Header
  2595. }
  2596. // List: Lists all the Services registered with this broker for
  2597. // consumption for
  2598. // given service registry broker, which contains an set of
  2599. // services.
  2600. // Note, that Service producer API is separate from Broker API.
  2601. func (r *ProjectsBrokersV2CatalogService) List(parent string) *ProjectsBrokersV2CatalogListCall {
  2602. c := &ProjectsBrokersV2CatalogListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2603. c.parent = parent
  2604. return c
  2605. }
  2606. // PageSize sets the optional parameter "pageSize": Specifies the number
  2607. // of results to return per page. If there are fewer
  2608. // elements than the specified number, returns all elements.
  2609. // If unset or 0, all the results will be returned.
  2610. func (c *ProjectsBrokersV2CatalogListCall) PageSize(pageSize int64) *ProjectsBrokersV2CatalogListCall {
  2611. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2612. return c
  2613. }
  2614. // PageToken sets the optional parameter "pageToken": Specifies a page
  2615. // token to use. Set `pageToken` to a `nextPageToken`
  2616. // returned by a previous list request to get the next page of results.
  2617. func (c *ProjectsBrokersV2CatalogListCall) PageToken(pageToken string) *ProjectsBrokersV2CatalogListCall {
  2618. c.urlParams_.Set("pageToken", pageToken)
  2619. return c
  2620. }
  2621. // Fields allows partial responses to be retrieved. See
  2622. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2623. // for more information.
  2624. func (c *ProjectsBrokersV2CatalogListCall) Fields(s ...googleapi.Field) *ProjectsBrokersV2CatalogListCall {
  2625. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2626. return c
  2627. }
  2628. // IfNoneMatch sets the optional parameter which makes the operation
  2629. // fail if the object's ETag matches the given value. This is useful for
  2630. // getting updates only after the object has changed since the last
  2631. // request. Use googleapi.IsNotModified to check whether the response
  2632. // error from Do is the result of In-None-Match.
  2633. func (c *ProjectsBrokersV2CatalogListCall) IfNoneMatch(entityTag string) *ProjectsBrokersV2CatalogListCall {
  2634. c.ifNoneMatch_ = entityTag
  2635. return c
  2636. }
  2637. // Context sets the context to be used in this call's Do method. Any
  2638. // pending HTTP request will be aborted if the provided context is
  2639. // canceled.
  2640. func (c *ProjectsBrokersV2CatalogListCall) Context(ctx context.Context) *ProjectsBrokersV2CatalogListCall {
  2641. c.ctx_ = ctx
  2642. return c
  2643. }
  2644. // Header returns an http.Header that can be modified by the caller to
  2645. // add HTTP headers to the request.
  2646. func (c *ProjectsBrokersV2CatalogListCall) Header() http.Header {
  2647. if c.header_ == nil {
  2648. c.header_ = make(http.Header)
  2649. }
  2650. return c.header_
  2651. }
  2652. func (c *ProjectsBrokersV2CatalogListCall) doRequest(alt string) (*http.Response, error) {
  2653. reqHeaders := make(http.Header)
  2654. for k, v := range c.header_ {
  2655. reqHeaders[k] = v
  2656. }
  2657. reqHeaders.Set("User-Agent", c.s.userAgent())
  2658. if c.ifNoneMatch_ != "" {
  2659. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2660. }
  2661. var body io.Reader = nil
  2662. c.urlParams_.Set("alt", alt)
  2663. c.urlParams_.Set("prettyPrint", "false")
  2664. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/v2/catalog")
  2665. urls += "?" + c.urlParams_.Encode()
  2666. req, err := http.NewRequest("GET", urls, body)
  2667. if err != nil {
  2668. return nil, err
  2669. }
  2670. req.Header = reqHeaders
  2671. googleapi.Expand(req.URL, map[string]string{
  2672. "parent": c.parent,
  2673. })
  2674. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2675. }
  2676. // Do executes the "servicebroker.projects.brokers.v2.catalog.list" call.
  2677. // Exactly one of *GoogleCloudServicebrokerV1beta1__ListCatalogResponse
  2678. // or error will be non-nil. Any non-2xx status code is an error.
  2679. // Response headers are in either
  2680. // *GoogleCloudServicebrokerV1beta1__ListCatalogResponse.ServerResponse.H
  2681. // eader or (if a response was returned at all) in
  2682. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2683. // whether the returned error was because http.StatusNotModified was
  2684. // returned.
  2685. func (c *ProjectsBrokersV2CatalogListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudServicebrokerV1beta1__ListCatalogResponse, error) {
  2686. gensupport.SetOptions(c.urlParams_, opts...)
  2687. res, err := c.doRequest("json")
  2688. if res != nil && res.StatusCode == http.StatusNotModified {
  2689. if res.Body != nil {
  2690. res.Body.Close()
  2691. }
  2692. return nil, &googleapi.Error{
  2693. Code: res.StatusCode,
  2694. Header: res.Header,
  2695. }
  2696. }
  2697. if err != nil {
  2698. return nil, err
  2699. }
  2700. defer googleapi.CloseBody(res)
  2701. if err := googleapi.CheckResponse(res); err != nil {
  2702. return nil, err
  2703. }
  2704. ret := &GoogleCloudServicebrokerV1beta1__ListCatalogResponse{
  2705. ServerResponse: googleapi.ServerResponse{
  2706. Header: res.Header,
  2707. HTTPStatusCode: res.StatusCode,
  2708. },
  2709. }
  2710. target := &ret
  2711. if err := gensupport.DecodeResponse(target, res); err != nil {
  2712. return nil, err
  2713. }
  2714. return ret, nil
  2715. // {
  2716. // "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.",
  2717. // "flatPath": "v1beta1/projects/{projectsId}/brokers/{brokersId}/v2/catalog",
  2718. // "httpMethod": "GET",
  2719. // "id": "servicebroker.projects.brokers.v2.catalog.list",
  2720. // "parameterOrder": [
  2721. // "parent"
  2722. // ],
  2723. // "parameters": {
  2724. // "pageSize": {
  2725. // "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.",
  2726. // "format": "int32",
  2727. // "location": "query",
  2728. // "type": "integer"
  2729. // },
  2730. // "pageToken": {
  2731. // "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.",
  2732. // "location": "query",
  2733. // "type": "string"
  2734. // },
  2735. // "parent": {
  2736. // "description": "Parent must match `projects/[PROJECT_ID]/brokers/[BROKER_ID]`.",
  2737. // "location": "path",
  2738. // "pattern": "^projects/[^/]+/brokers/[^/]+$",
  2739. // "required": true,
  2740. // "type": "string"
  2741. // }
  2742. // },
  2743. // "path": "v1beta1/{+parent}/v2/catalog",
  2744. // "response": {
  2745. // "$ref": "GoogleCloudServicebrokerV1beta1__ListCatalogResponse"
  2746. // },
  2747. // "scopes": [
  2748. // "https://www.googleapis.com/auth/cloud-platform"
  2749. // ]
  2750. // }
  2751. }
  2752. // Pages invokes f for each page of results.
  2753. // A non-nil error returned from f will halt the iteration.
  2754. // The provided context supersedes any context provided to the Context method.
  2755. func (c *ProjectsBrokersV2CatalogListCall) Pages(ctx context.Context, f func(*GoogleCloudServicebrokerV1beta1__ListCatalogResponse) error) error {
  2756. c.ctx_ = ctx
  2757. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2758. for {
  2759. x, err := c.Do()
  2760. if err != nil {
  2761. return err
  2762. }
  2763. if err := f(x); err != nil {
  2764. return err
  2765. }
  2766. if x.NextPageToken == "" {
  2767. return nil
  2768. }
  2769. c.PageToken(x.NextPageToken)
  2770. }
  2771. }
  2772. // method id "servicebroker.projects.brokers.v2.service_instances.create":
  2773. type ProjectsBrokersV2ServiceInstancesCreateCall struct {
  2774. s *Service
  2775. parent string
  2776. instanceId string
  2777. googlecloudservicebrokerv1beta1__serviceinstance *GoogleCloudServicebrokerV1beta1__ServiceInstance
  2778. urlParams_ gensupport.URLParams
  2779. ctx_ context.Context
  2780. header_ http.Header
  2781. }
  2782. // Create: Provisions a service instance.
  2783. // If `request.accepts_incomplete` is false and Broker cannot execute
  2784. // request
  2785. // synchronously HTTP 422 error will be returned along
  2786. // with
  2787. // FAILED_PRECONDITION status.
  2788. // If `request.accepts_incomplete` is true and the Broker decides to
  2789. // execute
  2790. // resource asynchronously then HTTP 202 response code will be returned
  2791. // and a
  2792. // valid polling operation in the response will be included.
  2793. // If Broker executes the request synchronously and it succeeds HTTP
  2794. // 201
  2795. // response will be furnished.
  2796. // If identical instance exists, then HTTP 200 response will be
  2797. // returned.
  2798. // If an instance with identical ID but mismatching parameters exists,
  2799. // then
  2800. // HTTP 409 status code will be returned.
  2801. func (r *ProjectsBrokersV2ServiceInstancesService) Create(parent string, instanceId string, googlecloudservicebrokerv1beta1__serviceinstance *GoogleCloudServicebrokerV1beta1__ServiceInstance) *ProjectsBrokersV2ServiceInstancesCreateCall {
  2802. c := &ProjectsBrokersV2ServiceInstancesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2803. c.parent = parent
  2804. c.instanceId = instanceId
  2805. c.googlecloudservicebrokerv1beta1__serviceinstance = googlecloudservicebrokerv1beta1__serviceinstance
  2806. return c
  2807. }
  2808. // AcceptsIncomplete sets the optional parameter "acceptsIncomplete":
  2809. // Value indicating that API client supports asynchronous operations.
  2810. // If
  2811. // Broker cannot execute the request synchronously HTTP 422 code will
  2812. // be
  2813. // returned to HTTP clients along with FAILED_PRECONDITION error.
  2814. // If true and broker will execute request asynchronously 202 HTTP code
  2815. // will
  2816. // be returned.
  2817. // This broker always requires this to be true as all mutator operations
  2818. // are
  2819. // asynchronous.
  2820. func (c *ProjectsBrokersV2ServiceInstancesCreateCall) AcceptsIncomplete(acceptsIncomplete bool) *ProjectsBrokersV2ServiceInstancesCreateCall {
  2821. c.urlParams_.Set("acceptsIncomplete", fmt.Sprint(acceptsIncomplete))
  2822. return c
  2823. }
  2824. // Fields allows partial responses to be retrieved. See
  2825. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2826. // for more information.
  2827. func (c *ProjectsBrokersV2ServiceInstancesCreateCall) Fields(s ...googleapi.Field) *ProjectsBrokersV2ServiceInstancesCreateCall {
  2828. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2829. return c
  2830. }
  2831. // Context sets the context to be used in this call's Do method. Any
  2832. // pending HTTP request will be aborted if the provided context is
  2833. // canceled.
  2834. func (c *ProjectsBrokersV2ServiceInstancesCreateCall) Context(ctx context.Context) *ProjectsBrokersV2ServiceInstancesCreateCall {
  2835. c.ctx_ = ctx
  2836. return c
  2837. }
  2838. // Header returns an http.Header that can be modified by the caller to
  2839. // add HTTP headers to the request.
  2840. func (c *ProjectsBrokersV2ServiceInstancesCreateCall) Header() http.Header {
  2841. if c.header_ == nil {
  2842. c.header_ = make(http.Header)
  2843. }
  2844. return c.header_
  2845. }
  2846. func (c *ProjectsBrokersV2ServiceInstancesCreateCall) doRequest(alt string) (*http.Response, error) {
  2847. reqHeaders := make(http.Header)
  2848. for k, v := range c.header_ {
  2849. reqHeaders[k] = v
  2850. }
  2851. reqHeaders.Set("User-Agent", c.s.userAgent())
  2852. var body io.Reader = nil
  2853. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudservicebrokerv1beta1__serviceinstance)
  2854. if err != nil {
  2855. return nil, err
  2856. }
  2857. reqHeaders.Set("Content-Type", "application/json")
  2858. c.urlParams_.Set("alt", alt)
  2859. c.urlParams_.Set("prettyPrint", "false")
  2860. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/v2/service_instances/{+instance_id}")
  2861. urls += "?" + c.urlParams_.Encode()
  2862. req, err := http.NewRequest("PUT", urls, body)
  2863. if err != nil {
  2864. return nil, err
  2865. }
  2866. req.Header = reqHeaders
  2867. googleapi.Expand(req.URL, map[string]string{
  2868. "parent": c.parent,
  2869. "instance_id": c.instanceId,
  2870. })
  2871. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2872. }
  2873. // Do executes the "servicebroker.projects.brokers.v2.service_instances.create" call.
  2874. // Exactly one of
  2875. // *GoogleCloudServicebrokerV1beta1__CreateServiceInstanceResponse or
  2876. // error will be non-nil. Any non-2xx status code is an error. Response
  2877. // headers are in either
  2878. // *GoogleCloudServicebrokerV1beta1__CreateServiceInstanceResponse.Server
  2879. // Response.Header or (if a response was returned at all) in
  2880. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2881. // whether the returned error was because http.StatusNotModified was
  2882. // returned.
  2883. func (c *ProjectsBrokersV2ServiceInstancesCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudServicebrokerV1beta1__CreateServiceInstanceResponse, error) {
  2884. gensupport.SetOptions(c.urlParams_, opts...)
  2885. res, err := c.doRequest("json")
  2886. if res != nil && res.StatusCode == http.StatusNotModified {
  2887. if res.Body != nil {
  2888. res.Body.Close()
  2889. }
  2890. return nil, &googleapi.Error{
  2891. Code: res.StatusCode,
  2892. Header: res.Header,
  2893. }
  2894. }
  2895. if err != nil {
  2896. return nil, err
  2897. }
  2898. defer googleapi.CloseBody(res)
  2899. if err := googleapi.CheckResponse(res); err != nil {
  2900. return nil, err
  2901. }
  2902. ret := &GoogleCloudServicebrokerV1beta1__CreateServiceInstanceResponse{
  2903. ServerResponse: googleapi.ServerResponse{
  2904. Header: res.Header,
  2905. HTTPStatusCode: res.StatusCode,
  2906. },
  2907. }
  2908. target := &ret
  2909. if err := gensupport.DecodeResponse(target, res); err != nil {
  2910. return nil, err
  2911. }
  2912. return ret, nil
  2913. // {
  2914. // "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.",
  2915. // "flatPath": "v1beta1/projects/{projectsId}/brokers/{brokersId}/v2/service_instances/{service_instancesId}",
  2916. // "httpMethod": "PUT",
  2917. // "id": "servicebroker.projects.brokers.v2.service_instances.create",
  2918. // "parameterOrder": [
  2919. // "parent",
  2920. // "instance_id"
  2921. // ],
  2922. // "parameters": {
  2923. // "acceptsIncomplete": {
  2924. // "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.",
  2925. // "location": "query",
  2926. // "type": "boolean"
  2927. // },
  2928. // "instance_id": {
  2929. // "description": "The id of the service instance. Must be unique within GCP project.\nMaximum length is 64, GUID recommended.\nRequired.",
  2930. // "location": "path",
  2931. // "pattern": "^[^/]+$",
  2932. // "required": true,
  2933. // "type": "string"
  2934. // },
  2935. // "parent": {
  2936. // "description": "Parent must match `projects/[PROJECT_ID]/brokers/[BROKER_ID]`.",
  2937. // "location": "path",
  2938. // "pattern": "^projects/[^/]+/brokers/[^/]+$",
  2939. // "required": true,
  2940. // "type": "string"
  2941. // }
  2942. // },
  2943. // "path": "v1beta1/{+parent}/v2/service_instances/{+instance_id}",
  2944. // "request": {
  2945. // "$ref": "GoogleCloudServicebrokerV1beta1__ServiceInstance"
  2946. // },
  2947. // "response": {
  2948. // "$ref": "GoogleCloudServicebrokerV1beta1__CreateServiceInstanceResponse"
  2949. // },
  2950. // "scopes": [
  2951. // "https://www.googleapis.com/auth/cloud-platform"
  2952. // ]
  2953. // }
  2954. }
  2955. // method id "servicebroker.projects.brokers.v2.service_instances.delete":
  2956. type ProjectsBrokersV2ServiceInstancesDeleteCall struct {
  2957. s *Service
  2958. name string
  2959. urlParams_ gensupport.URLParams
  2960. ctx_ context.Context
  2961. header_ http.Header
  2962. }
  2963. // Delete: Deprovisions a service instance.
  2964. // For synchronous/asynchronous request details see
  2965. // CreateServiceInstance
  2966. // method.
  2967. // If service instance does not exist HTTP 410 status will be returned.
  2968. func (r *ProjectsBrokersV2ServiceInstancesService) Delete(name string) *ProjectsBrokersV2ServiceInstancesDeleteCall {
  2969. c := &ProjectsBrokersV2ServiceInstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2970. c.name = name
  2971. return c
  2972. }
  2973. // AcceptsIncomplete sets the optional parameter "acceptsIncomplete":
  2974. // See CreateServiceInstanceRequest for details.
  2975. func (c *ProjectsBrokersV2ServiceInstancesDeleteCall) AcceptsIncomplete(acceptsIncomplete bool) *ProjectsBrokersV2ServiceInstancesDeleteCall {
  2976. c.urlParams_.Set("acceptsIncomplete", fmt.Sprint(acceptsIncomplete))
  2977. return c
  2978. }
  2979. // PlanId sets the optional parameter "planId": The plan id of the
  2980. // service instance.
  2981. func (c *ProjectsBrokersV2ServiceInstancesDeleteCall) PlanId(planId string) *ProjectsBrokersV2ServiceInstancesDeleteCall {
  2982. c.urlParams_.Set("planId", planId)
  2983. return c
  2984. }
  2985. // ServiceId sets the optional parameter "serviceId": The service id of
  2986. // the service instance.
  2987. func (c *ProjectsBrokersV2ServiceInstancesDeleteCall) ServiceId(serviceId string) *ProjectsBrokersV2ServiceInstancesDeleteCall {
  2988. c.urlParams_.Set("serviceId", serviceId)
  2989. return c
  2990. }
  2991. // Fields allows partial responses to be retrieved. See
  2992. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2993. // for more information.
  2994. func (c *ProjectsBrokersV2ServiceInstancesDeleteCall) Fields(s ...googleapi.Field) *ProjectsBrokersV2ServiceInstancesDeleteCall {
  2995. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2996. return c
  2997. }
  2998. // Context sets the context to be used in this call's Do method. Any
  2999. // pending HTTP request will be aborted if the provided context is
  3000. // canceled.
  3001. func (c *ProjectsBrokersV2ServiceInstancesDeleteCall) Context(ctx context.Context) *ProjectsBrokersV2ServiceInstancesDeleteCall {
  3002. c.ctx_ = ctx
  3003. return c
  3004. }
  3005. // Header returns an http.Header that can be modified by the caller to
  3006. // add HTTP headers to the request.
  3007. func (c *ProjectsBrokersV2ServiceInstancesDeleteCall) Header() http.Header {
  3008. if c.header_ == nil {
  3009. c.header_ = make(http.Header)
  3010. }
  3011. return c.header_
  3012. }
  3013. func (c *ProjectsBrokersV2ServiceInstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
  3014. reqHeaders := make(http.Header)
  3015. for k, v := range c.header_ {
  3016. reqHeaders[k] = v
  3017. }
  3018. reqHeaders.Set("User-Agent", c.s.userAgent())
  3019. var body io.Reader = nil
  3020. c.urlParams_.Set("alt", alt)
  3021. c.urlParams_.Set("prettyPrint", "false")
  3022. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  3023. urls += "?" + c.urlParams_.Encode()
  3024. req, err := http.NewRequest("DELETE", urls, body)
  3025. if err != nil {
  3026. return nil, err
  3027. }
  3028. req.Header = reqHeaders
  3029. googleapi.Expand(req.URL, map[string]string{
  3030. "name": c.name,
  3031. })
  3032. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3033. }
  3034. // Do executes the "servicebroker.projects.brokers.v2.service_instances.delete" call.
  3035. // Exactly one of
  3036. // *GoogleCloudServicebrokerV1beta1__DeleteServiceInstanceResponse or
  3037. // error will be non-nil. Any non-2xx status code is an error. Response
  3038. // headers are in either
  3039. // *GoogleCloudServicebrokerV1beta1__DeleteServiceInstanceResponse.Server
  3040. // Response.Header or (if a response was returned at all) in
  3041. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3042. // whether the returned error was because http.StatusNotModified was
  3043. // returned.
  3044. func (c *ProjectsBrokersV2ServiceInstancesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleCloudServicebrokerV1beta1__DeleteServiceInstanceResponse, error) {
  3045. gensupport.SetOptions(c.urlParams_, opts...)
  3046. res, err := c.doRequest("json")
  3047. if res != nil && res.StatusCode == http.StatusNotModified {
  3048. if res.Body != nil {
  3049. res.Body.Close()
  3050. }
  3051. return nil, &googleapi.Error{
  3052. Code: res.StatusCode,
  3053. Header: res.Header,
  3054. }
  3055. }
  3056. if err != nil {
  3057. return nil, err
  3058. }
  3059. defer googleapi.CloseBody(res)
  3060. if err := googleapi.CheckResponse(res); err != nil {
  3061. return nil, err
  3062. }
  3063. ret := &GoogleCloudServicebrokerV1beta1__DeleteServiceInstanceResponse{
  3064. ServerResponse: googleapi.ServerResponse{
  3065. Header: res.Header,
  3066. HTTPStatusCode: res.StatusCode,
  3067. },
  3068. }
  3069. target := &ret
  3070. if err := gensupport.DecodeResponse(target, res); err != nil {
  3071. return nil, err
  3072. }
  3073. return ret, nil
  3074. // {
  3075. // "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.",
  3076. // "flatPath": "v1beta1/projects/{projectsId}/brokers/{brokersId}/v2/service_instances/{service_instancesId}",
  3077. // "httpMethod": "DELETE",
  3078. // "id": "servicebroker.projects.brokers.v2.service_instances.delete",
  3079. // "parameterOrder": [
  3080. // "name"
  3081. // ],
  3082. // "parameters": {
  3083. // "acceptsIncomplete": {
  3084. // "description": "See CreateServiceInstanceRequest for details.",
  3085. // "location": "query",
  3086. // "type": "boolean"
  3087. // },
  3088. // "name": {
  3089. // "description": "Name must match\n`projects/[PROJECT_ID]/brokers/[BROKER_ID]/` +\n`v2/service_instances/[INSTANCE_ID]`\nor\n`projects/[PROJECT_ID]/brokers/[BROKER_ID]/instances/[INSTANCE_ID]`.",
  3090. // "location": "path",
  3091. // "pattern": "^projects/[^/]+/brokers/[^/]+/v2/service_instances/[^/]+$",
  3092. // "required": true,
  3093. // "type": "string"
  3094. // },
  3095. // "planId": {
  3096. // "description": "The plan id of the service instance.",
  3097. // "location": "query",
  3098. // "type": "string"
  3099. // },
  3100. // "serviceId": {
  3101. // "description": "The service id of the service instance.",
  3102. // "location": "query",
  3103. // "type": "string"
  3104. // }
  3105. // },
  3106. // "path": "v1beta1/{+name}",
  3107. // "response": {
  3108. // "$ref": "GoogleCloudServicebrokerV1beta1__DeleteServiceInstanceResponse"
  3109. // },
  3110. // "scopes": [
  3111. // "https://www.googleapis.com/auth/cloud-platform"
  3112. // ]
  3113. // }
  3114. }
  3115. // method id "servicebroker.projects.brokers.v2.service_instances.get":
  3116. type ProjectsBrokersV2ServiceInstancesGetCall struct {
  3117. s *Service
  3118. name string
  3119. urlParams_ gensupport.URLParams
  3120. ifNoneMatch_ string
  3121. ctx_ context.Context
  3122. header_ http.Header
  3123. }
  3124. // Get: Gets the given service instance from the system.
  3125. // The API call accepts both OSB style API and standard google style
  3126. // API
  3127. // resource path.
  3128. // i.e. both `projects/*/brokers/*/instances/*`
  3129. // and `projects/*/brokers/*/v2/service_instances/*` are acceptable
  3130. // paths.
  3131. func (r *ProjectsBrokersV2ServiceInstancesService) Get(name string) *ProjectsBrokersV2ServiceInstancesGetCall {
  3132. c := &ProjectsBrokersV2ServiceInstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3133. c.name = name
  3134. return c
  3135. }
  3136. // Fields allows partial responses to be retrieved. See
  3137. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3138. // for more information.
  3139. func (c *ProjectsBrokersV2ServiceInstancesGetCall) Fields(s ...googleapi.Field) *ProjectsBrokersV2ServiceInstancesGetCall {
  3140. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3141. return c
  3142. }
  3143. // IfNoneMatch sets the optional parameter which makes the operation
  3144. // fail if the object's ETag matches the given value. This is useful for
  3145. // getting updates only after the object has changed since the last
  3146. // request. Use googleapi.IsNotModified to check whether the response
  3147. // error from Do is the result of In-None-Match.
  3148. func (c *ProjectsBrokersV2ServiceInstancesGetCall) IfNoneMatch(entityTag string) *ProjectsBrokersV2ServiceInstancesGetCall {
  3149. c.ifNoneMatch_ = entityTag
  3150. return c
  3151. }
  3152. // Context sets the context to be used in this call's Do method. Any
  3153. // pending HTTP request will be aborted if the provided context is
  3154. // canceled.
  3155. func (c *ProjectsBrokersV2ServiceInstancesGetCall) Context(ctx context.Context) *ProjectsBrokersV2ServiceInstancesGetCall {
  3156. c.ctx_ = ctx
  3157. return c
  3158. }
  3159. // Header returns an http.Header that can be modified by the caller to
  3160. // add HTTP headers to the request.
  3161. func (c *ProjectsBrokersV2ServiceInstancesGetCall) Header() http.Header {
  3162. if c.header_ == nil {
  3163. c.header_ = make(http.Header)
  3164. }
  3165. return c.header_
  3166. }
  3167. func (c *ProjectsBrokersV2ServiceInstancesGetCall) doRequest(alt string) (*http.Response, error) {
  3168. reqHeaders := make(http.Header)
  3169. for k, v := range c.header_ {
  3170. reqHeaders[k] = v
  3171. }
  3172. reqHeaders.Set("User-Agent", c.s.userAgent())
  3173. if c.ifNoneMatch_ != "" {
  3174. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3175. }
  3176. var body io.Reader = nil
  3177. c.urlParams_.Set("alt", alt)
  3178. c.urlParams_.Set("prettyPrint", "false")
  3179. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  3180. urls += "?" + c.urlParams_.Encode()
  3181. req, err := http.NewRequest("GET", urls, body)
  3182. if err != nil {
  3183. return nil, err
  3184. }
  3185. req.Header = reqHeaders
  3186. googleapi.Expand(req.URL, map[string]string{
  3187. "name": c.name,
  3188. })
  3189. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3190. }
  3191. // Do executes the "servicebroker.projects.brokers.v2.service_instances.get" call.
  3192. // Exactly one of *GoogleCloudServicebrokerV1beta1__ServiceInstance or
  3193. // error will be non-nil. Any non-2xx status code is an error. Response
  3194. // headers are in either
  3195. // *GoogleCloudServicebrokerV1beta1__ServiceInstance.ServerResponse.Heade
  3196. // r or (if a response was returned at all) in
  3197. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3198. // whether the returned error was because http.StatusNotModified was
  3199. // returned.
  3200. func (c *ProjectsBrokersV2ServiceInstancesGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudServicebrokerV1beta1__ServiceInstance, error) {
  3201. gensupport.SetOptions(c.urlParams_, opts...)
  3202. res, err := c.doRequest("json")
  3203. if res != nil && res.StatusCode == http.StatusNotModified {
  3204. if res.Body != nil {
  3205. res.Body.Close()
  3206. }
  3207. return nil, &googleapi.Error{
  3208. Code: res.StatusCode,
  3209. Header: res.Header,
  3210. }
  3211. }
  3212. if err != nil {
  3213. return nil, err
  3214. }
  3215. defer googleapi.CloseBody(res)
  3216. if err := googleapi.CheckResponse(res); err != nil {
  3217. return nil, err
  3218. }
  3219. ret := &GoogleCloudServicebrokerV1beta1__ServiceInstance{
  3220. ServerResponse: googleapi.ServerResponse{
  3221. Header: res.Header,
  3222. HTTPStatusCode: res.StatusCode,
  3223. },
  3224. }
  3225. target := &ret
  3226. if err := gensupport.DecodeResponse(target, res); err != nil {
  3227. return nil, err
  3228. }
  3229. return ret, nil
  3230. // {
  3231. // "description": "Gets the given service instance from the system.\nThe API call accepts both OSB style API and standard google style API\nresource path.\ni.e. both `projects/*/brokers/*/instances/*`\n and `projects/*/brokers/*/v2/service_instances/*` are acceptable paths.",
  3232. // "flatPath": "v1beta1/projects/{projectsId}/brokers/{brokersId}/v2/service_instances/{service_instancesId}",
  3233. // "httpMethod": "GET",
  3234. // "id": "servicebroker.projects.brokers.v2.service_instances.get",
  3235. // "parameterOrder": [
  3236. // "name"
  3237. // ],
  3238. // "parameters": {
  3239. // "name": {
  3240. // "description": "The resource name of the instance to return.\nName must match\n`projects/[PROJECT_ID]/brokers/[BROKER_ID]/` +\n`v2/service_instances/[INSTANCE_ID]`\nor\n`projects/[PROJECT_ID]/brokers/[BROKER_ID]/instances/[INSTANCE_ID]`.",
  3241. // "location": "path",
  3242. // "pattern": "^projects/[^/]+/brokers/[^/]+/v2/service_instances/[^/]+$",
  3243. // "required": true,
  3244. // "type": "string"
  3245. // }
  3246. // },
  3247. // "path": "v1beta1/{+name}",
  3248. // "response": {
  3249. // "$ref": "GoogleCloudServicebrokerV1beta1__ServiceInstance"
  3250. // },
  3251. // "scopes": [
  3252. // "https://www.googleapis.com/auth/cloud-platform"
  3253. // ]
  3254. // }
  3255. }
  3256. // method id "servicebroker.projects.brokers.v2.service_instances.getLast_operation":
  3257. type ProjectsBrokersV2ServiceInstancesGetLastOperationCall struct {
  3258. s *Service
  3259. name string
  3260. urlParams_ gensupport.URLParams
  3261. ifNoneMatch_ string
  3262. ctx_ context.Context
  3263. header_ http.Header
  3264. }
  3265. // GetLastOperation: Returns the state of the last operation for the
  3266. // service instance.
  3267. // Only last (or current) operation can be polled.
  3268. func (r *ProjectsBrokersV2ServiceInstancesService) GetLastOperation(name string) *ProjectsBrokersV2ServiceInstancesGetLastOperationCall {
  3269. c := &ProjectsBrokersV2ServiceInstancesGetLastOperationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3270. c.name = name
  3271. return c
  3272. }
  3273. // Operation sets the optional parameter "operation": If `operation` was
  3274. // returned during mutation operation, this field must be
  3275. // populated with the provided value.
  3276. func (c *ProjectsBrokersV2ServiceInstancesGetLastOperationCall) Operation(operation string) *ProjectsBrokersV2ServiceInstancesGetLastOperationCall {
  3277. c.urlParams_.Set("operation", operation)
  3278. return c
  3279. }
  3280. // PlanId sets the optional parameter "planId": Plan id.
  3281. func (c *ProjectsBrokersV2ServiceInstancesGetLastOperationCall) PlanId(planId string) *ProjectsBrokersV2ServiceInstancesGetLastOperationCall {
  3282. c.urlParams_.Set("planId", planId)
  3283. return c
  3284. }
  3285. // ServiceId sets the optional parameter "serviceId": Service id.
  3286. func (c *ProjectsBrokersV2ServiceInstancesGetLastOperationCall) ServiceId(serviceId string) *ProjectsBrokersV2ServiceInstancesGetLastOperationCall {
  3287. c.urlParams_.Set("serviceId", serviceId)
  3288. return c
  3289. }
  3290. // Fields allows partial responses to be retrieved. See
  3291. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3292. // for more information.
  3293. func (c *ProjectsBrokersV2ServiceInstancesGetLastOperationCall) Fields(s ...googleapi.Field) *ProjectsBrokersV2ServiceInstancesGetLastOperationCall {
  3294. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3295. return c
  3296. }
  3297. // IfNoneMatch sets the optional parameter which makes the operation
  3298. // fail if the object's ETag matches the given value. This is useful for
  3299. // getting updates only after the object has changed since the last
  3300. // request. Use googleapi.IsNotModified to check whether the response
  3301. // error from Do is the result of In-None-Match.
  3302. func (c *ProjectsBrokersV2ServiceInstancesGetLastOperationCall) IfNoneMatch(entityTag string) *ProjectsBrokersV2ServiceInstancesGetLastOperationCall {
  3303. c.ifNoneMatch_ = entityTag
  3304. return c
  3305. }
  3306. // Context sets the context to be used in this call's Do method. Any
  3307. // pending HTTP request will be aborted if the provided context is
  3308. // canceled.
  3309. func (c *ProjectsBrokersV2ServiceInstancesGetLastOperationCall) Context(ctx context.Context) *ProjectsBrokersV2ServiceInstancesGetLastOperationCall {
  3310. c.ctx_ = ctx
  3311. return c
  3312. }
  3313. // Header returns an http.Header that can be modified by the caller to
  3314. // add HTTP headers to the request.
  3315. func (c *ProjectsBrokersV2ServiceInstancesGetLastOperationCall) Header() http.Header {
  3316. if c.header_ == nil {
  3317. c.header_ = make(http.Header)
  3318. }
  3319. return c.header_
  3320. }
  3321. func (c *ProjectsBrokersV2ServiceInstancesGetLastOperationCall) doRequest(alt string) (*http.Response, error) {
  3322. reqHeaders := make(http.Header)
  3323. for k, v := range c.header_ {
  3324. reqHeaders[k] = v
  3325. }
  3326. reqHeaders.Set("User-Agent", c.s.userAgent())
  3327. if c.ifNoneMatch_ != "" {
  3328. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3329. }
  3330. var body io.Reader = nil
  3331. c.urlParams_.Set("alt", alt)
  3332. c.urlParams_.Set("prettyPrint", "false")
  3333. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/last_operation")
  3334. urls += "?" + c.urlParams_.Encode()
  3335. req, err := http.NewRequest("GET", urls, body)
  3336. if err != nil {
  3337. return nil, err
  3338. }
  3339. req.Header = reqHeaders
  3340. googleapi.Expand(req.URL, map[string]string{
  3341. "name": c.name,
  3342. })
  3343. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3344. }
  3345. // Do executes the "servicebroker.projects.brokers.v2.service_instances.getLast_operation" call.
  3346. // Exactly one of *GoogleCloudServicebrokerV1beta1__Operation or error
  3347. // will be non-nil. Any non-2xx status code is an error. Response
  3348. // headers are in either
  3349. // *GoogleCloudServicebrokerV1beta1__Operation.ServerResponse.Header or
  3350. // (if a response was returned at all) in
  3351. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3352. // whether the returned error was because http.StatusNotModified was
  3353. // returned.
  3354. func (c *ProjectsBrokersV2ServiceInstancesGetLastOperationCall) Do(opts ...googleapi.CallOption) (*GoogleCloudServicebrokerV1beta1__Operation, error) {
  3355. gensupport.SetOptions(c.urlParams_, opts...)
  3356. res, err := c.doRequest("json")
  3357. if res != nil && res.StatusCode == http.StatusNotModified {
  3358. if res.Body != nil {
  3359. res.Body.Close()
  3360. }
  3361. return nil, &googleapi.Error{
  3362. Code: res.StatusCode,
  3363. Header: res.Header,
  3364. }
  3365. }
  3366. if err != nil {
  3367. return nil, err
  3368. }
  3369. defer googleapi.CloseBody(res)
  3370. if err := googleapi.CheckResponse(res); err != nil {
  3371. return nil, err
  3372. }
  3373. ret := &GoogleCloudServicebrokerV1beta1__Operation{
  3374. ServerResponse: googleapi.ServerResponse{
  3375. Header: res.Header,
  3376. HTTPStatusCode: res.StatusCode,
  3377. },
  3378. }
  3379. target := &ret
  3380. if err := gensupport.DecodeResponse(target, res); err != nil {
  3381. return nil, err
  3382. }
  3383. return ret, nil
  3384. // {
  3385. // "description": "Returns the state of the last operation for the service instance.\nOnly last (or current) operation can be polled.",
  3386. // "flatPath": "v1beta1/projects/{projectsId}/brokers/{brokersId}/v2/service_instances/{service_instancesId}/last_operation",
  3387. // "httpMethod": "GET",
  3388. // "id": "servicebroker.projects.brokers.v2.service_instances.getLast_operation",
  3389. // "parameterOrder": [
  3390. // "name"
  3391. // ],
  3392. // "parameters": {
  3393. // "name": {
  3394. // "description": "Name must match\n`projects/[PROJECT_ID]/brokers/[BROKER_ID]/v2/`+\n `service_instances/[INSTANCE_ID]`.",
  3395. // "location": "path",
  3396. // "pattern": "^projects/[^/]+/brokers/[^/]+/v2/service_instances/[^/]+$",
  3397. // "required": true,
  3398. // "type": "string"
  3399. // },
  3400. // "operation": {
  3401. // "description": "If `operation` was returned during mutation operation, this field must be\npopulated with the provided value.",
  3402. // "location": "query",
  3403. // "type": "string"
  3404. // },
  3405. // "planId": {
  3406. // "description": "Plan id.",
  3407. // "location": "query",
  3408. // "type": "string"
  3409. // },
  3410. // "serviceId": {
  3411. // "description": "Service id.",
  3412. // "location": "query",
  3413. // "type": "string"
  3414. // }
  3415. // },
  3416. // "path": "v1beta1/{+name}/last_operation",
  3417. // "response": {
  3418. // "$ref": "GoogleCloudServicebrokerV1beta1__Operation"
  3419. // },
  3420. // "scopes": [
  3421. // "https://www.googleapis.com/auth/cloud-platform"
  3422. // ]
  3423. // }
  3424. }
  3425. // method id "servicebroker.projects.brokers.v2.service_instances.patch":
  3426. type ProjectsBrokersV2ServiceInstancesPatchCall struct {
  3427. s *Service
  3428. name string
  3429. googlecloudservicebrokerv1beta1__serviceinstance *GoogleCloudServicebrokerV1beta1__ServiceInstance
  3430. urlParams_ gensupport.URLParams
  3431. ctx_ context.Context
  3432. header_ http.Header
  3433. }
  3434. // Patch: Updates an existing service instance.
  3435. // See CreateServiceInstance for possible response codes.
  3436. func (r *ProjectsBrokersV2ServiceInstancesService) Patch(name string, googlecloudservicebrokerv1beta1__serviceinstance *GoogleCloudServicebrokerV1beta1__ServiceInstance) *ProjectsBrokersV2ServiceInstancesPatchCall {
  3437. c := &ProjectsBrokersV2ServiceInstancesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3438. c.name = name
  3439. c.googlecloudservicebrokerv1beta1__serviceinstance = googlecloudservicebrokerv1beta1__serviceinstance
  3440. return c
  3441. }
  3442. // AcceptsIncomplete sets the optional parameter "acceptsIncomplete":
  3443. // See CreateServiceInstanceRequest for details.
  3444. func (c *ProjectsBrokersV2ServiceInstancesPatchCall) AcceptsIncomplete(acceptsIncomplete bool) *ProjectsBrokersV2ServiceInstancesPatchCall {
  3445. c.urlParams_.Set("acceptsIncomplete", fmt.Sprint(acceptsIncomplete))
  3446. return c
  3447. }
  3448. // Fields allows partial responses to be retrieved. See
  3449. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3450. // for more information.
  3451. func (c *ProjectsBrokersV2ServiceInstancesPatchCall) Fields(s ...googleapi.Field) *ProjectsBrokersV2ServiceInstancesPatchCall {
  3452. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3453. return c
  3454. }
  3455. // Context sets the context to be used in this call's Do method. Any
  3456. // pending HTTP request will be aborted if the provided context is
  3457. // canceled.
  3458. func (c *ProjectsBrokersV2ServiceInstancesPatchCall) Context(ctx context.Context) *ProjectsBrokersV2ServiceInstancesPatchCall {
  3459. c.ctx_ = ctx
  3460. return c
  3461. }
  3462. // Header returns an http.Header that can be modified by the caller to
  3463. // add HTTP headers to the request.
  3464. func (c *ProjectsBrokersV2ServiceInstancesPatchCall) Header() http.Header {
  3465. if c.header_ == nil {
  3466. c.header_ = make(http.Header)
  3467. }
  3468. return c.header_
  3469. }
  3470. func (c *ProjectsBrokersV2ServiceInstancesPatchCall) doRequest(alt string) (*http.Response, error) {
  3471. reqHeaders := make(http.Header)
  3472. for k, v := range c.header_ {
  3473. reqHeaders[k] = v
  3474. }
  3475. reqHeaders.Set("User-Agent", c.s.userAgent())
  3476. var body io.Reader = nil
  3477. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudservicebrokerv1beta1__serviceinstance)
  3478. if err != nil {
  3479. return nil, err
  3480. }
  3481. reqHeaders.Set("Content-Type", "application/json")
  3482. c.urlParams_.Set("alt", alt)
  3483. c.urlParams_.Set("prettyPrint", "false")
  3484. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  3485. urls += "?" + c.urlParams_.Encode()
  3486. req, err := http.NewRequest("PATCH", urls, body)
  3487. if err != nil {
  3488. return nil, err
  3489. }
  3490. req.Header = reqHeaders
  3491. googleapi.Expand(req.URL, map[string]string{
  3492. "name": c.name,
  3493. })
  3494. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3495. }
  3496. // Do executes the "servicebroker.projects.brokers.v2.service_instances.patch" call.
  3497. // Exactly one of
  3498. // *GoogleCloudServicebrokerV1beta1__UpdateServiceInstanceResponse or
  3499. // error will be non-nil. Any non-2xx status code is an error. Response
  3500. // headers are in either
  3501. // *GoogleCloudServicebrokerV1beta1__UpdateServiceInstanceResponse.Server
  3502. // Response.Header or (if a response was returned at all) in
  3503. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3504. // whether the returned error was because http.StatusNotModified was
  3505. // returned.
  3506. func (c *ProjectsBrokersV2ServiceInstancesPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudServicebrokerV1beta1__UpdateServiceInstanceResponse, error) {
  3507. gensupport.SetOptions(c.urlParams_, opts...)
  3508. res, err := c.doRequest("json")
  3509. if res != nil && res.StatusCode == http.StatusNotModified {
  3510. if res.Body != nil {
  3511. res.Body.Close()
  3512. }
  3513. return nil, &googleapi.Error{
  3514. Code: res.StatusCode,
  3515. Header: res.Header,
  3516. }
  3517. }
  3518. if err != nil {
  3519. return nil, err
  3520. }
  3521. defer googleapi.CloseBody(res)
  3522. if err := googleapi.CheckResponse(res); err != nil {
  3523. return nil, err
  3524. }
  3525. ret := &GoogleCloudServicebrokerV1beta1__UpdateServiceInstanceResponse{
  3526. ServerResponse: googleapi.ServerResponse{
  3527. Header: res.Header,
  3528. HTTPStatusCode: res.StatusCode,
  3529. },
  3530. }
  3531. target := &ret
  3532. if err := gensupport.DecodeResponse(target, res); err != nil {
  3533. return nil, err
  3534. }
  3535. return ret, nil
  3536. // {
  3537. // "description": "Updates an existing service instance.\nSee CreateServiceInstance for possible response codes.",
  3538. // "flatPath": "v1beta1/projects/{projectsId}/brokers/{brokersId}/v2/service_instances/{service_instancesId}",
  3539. // "httpMethod": "PATCH",
  3540. // "id": "servicebroker.projects.brokers.v2.service_instances.patch",
  3541. // "parameterOrder": [
  3542. // "name"
  3543. // ],
  3544. // "parameters": {
  3545. // "acceptsIncomplete": {
  3546. // "description": "See CreateServiceInstanceRequest for details.",
  3547. // "location": "query",
  3548. // "type": "boolean"
  3549. // },
  3550. // "name": {
  3551. // "description": "Name must match\n`projects/[PROJECT_ID]/brokers/[BROKER_ID]/v2/service_instances/[INSTANCE_ID]`.",
  3552. // "location": "path",
  3553. // "pattern": "^projects/[^/]+/brokers/[^/]+/v2/service_instances/[^/]+$",
  3554. // "required": true,
  3555. // "type": "string"
  3556. // }
  3557. // },
  3558. // "path": "v1beta1/{+name}",
  3559. // "request": {
  3560. // "$ref": "GoogleCloudServicebrokerV1beta1__ServiceInstance"
  3561. // },
  3562. // "response": {
  3563. // "$ref": "GoogleCloudServicebrokerV1beta1__UpdateServiceInstanceResponse"
  3564. // },
  3565. // "scopes": [
  3566. // "https://www.googleapis.com/auth/cloud-platform"
  3567. // ]
  3568. // }
  3569. }
  3570. // method id "servicebroker.projects.brokers.v2.service_instances.service_bindings.create":
  3571. type ProjectsBrokersV2ServiceInstancesServiceBindingsCreateCall struct {
  3572. s *Service
  3573. parent string
  3574. bindingId string
  3575. googlecloudservicebrokerv1beta1__binding *GoogleCloudServicebrokerV1beta1__Binding
  3576. urlParams_ gensupport.URLParams
  3577. ctx_ context.Context
  3578. header_ http.Header
  3579. }
  3580. // Create: CreateBinding generates a service binding to an existing
  3581. // service instance.
  3582. // See ProviServiceInstance for async operation details.
  3583. func (r *ProjectsBrokersV2ServiceInstancesServiceBindingsService) Create(parent string, bindingId string, googlecloudservicebrokerv1beta1__binding *GoogleCloudServicebrokerV1beta1__Binding) *ProjectsBrokersV2ServiceInstancesServiceBindingsCreateCall {
  3584. c := &ProjectsBrokersV2ServiceInstancesServiceBindingsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3585. c.parent = parent
  3586. c.bindingId = bindingId
  3587. c.googlecloudservicebrokerv1beta1__binding = googlecloudservicebrokerv1beta1__binding
  3588. return c
  3589. }
  3590. // AcceptsIncomplete sets the optional parameter "acceptsIncomplete":
  3591. // See CreateServiceInstanceRequest for details.
  3592. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsCreateCall) AcceptsIncomplete(acceptsIncomplete bool) *ProjectsBrokersV2ServiceInstancesServiceBindingsCreateCall {
  3593. c.urlParams_.Set("acceptsIncomplete", fmt.Sprint(acceptsIncomplete))
  3594. return c
  3595. }
  3596. // Fields allows partial responses to be retrieved. See
  3597. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3598. // for more information.
  3599. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsCreateCall) Fields(s ...googleapi.Field) *ProjectsBrokersV2ServiceInstancesServiceBindingsCreateCall {
  3600. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3601. return c
  3602. }
  3603. // Context sets the context to be used in this call's Do method. Any
  3604. // pending HTTP request will be aborted if the provided context is
  3605. // canceled.
  3606. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsCreateCall) Context(ctx context.Context) *ProjectsBrokersV2ServiceInstancesServiceBindingsCreateCall {
  3607. c.ctx_ = ctx
  3608. return c
  3609. }
  3610. // Header returns an http.Header that can be modified by the caller to
  3611. // add HTTP headers to the request.
  3612. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsCreateCall) Header() http.Header {
  3613. if c.header_ == nil {
  3614. c.header_ = make(http.Header)
  3615. }
  3616. return c.header_
  3617. }
  3618. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsCreateCall) doRequest(alt string) (*http.Response, error) {
  3619. reqHeaders := make(http.Header)
  3620. for k, v := range c.header_ {
  3621. reqHeaders[k] = v
  3622. }
  3623. reqHeaders.Set("User-Agent", c.s.userAgent())
  3624. var body io.Reader = nil
  3625. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudservicebrokerv1beta1__binding)
  3626. if err != nil {
  3627. return nil, err
  3628. }
  3629. reqHeaders.Set("Content-Type", "application/json")
  3630. c.urlParams_.Set("alt", alt)
  3631. c.urlParams_.Set("prettyPrint", "false")
  3632. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/service_bindings/{+binding_id}")
  3633. urls += "?" + c.urlParams_.Encode()
  3634. req, err := http.NewRequest("PUT", urls, body)
  3635. if err != nil {
  3636. return nil, err
  3637. }
  3638. req.Header = reqHeaders
  3639. googleapi.Expand(req.URL, map[string]string{
  3640. "parent": c.parent,
  3641. "binding_id": c.bindingId,
  3642. })
  3643. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3644. }
  3645. // Do executes the "servicebroker.projects.brokers.v2.service_instances.service_bindings.create" call.
  3646. // Exactly one of
  3647. // *GoogleCloudServicebrokerV1beta1__CreateBindingResponse or error will
  3648. // be non-nil. Any non-2xx status code is an error. Response headers are
  3649. // in either
  3650. // *GoogleCloudServicebrokerV1beta1__CreateBindingResponse.ServerResponse
  3651. // .Header or (if a response was returned at all) in
  3652. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3653. // whether the returned error was because http.StatusNotModified was
  3654. // returned.
  3655. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudServicebrokerV1beta1__CreateBindingResponse, error) {
  3656. gensupport.SetOptions(c.urlParams_, opts...)
  3657. res, err := c.doRequest("json")
  3658. if res != nil && res.StatusCode == http.StatusNotModified {
  3659. if res.Body != nil {
  3660. res.Body.Close()
  3661. }
  3662. return nil, &googleapi.Error{
  3663. Code: res.StatusCode,
  3664. Header: res.Header,
  3665. }
  3666. }
  3667. if err != nil {
  3668. return nil, err
  3669. }
  3670. defer googleapi.CloseBody(res)
  3671. if err := googleapi.CheckResponse(res); err != nil {
  3672. return nil, err
  3673. }
  3674. ret := &GoogleCloudServicebrokerV1beta1__CreateBindingResponse{
  3675. ServerResponse: googleapi.ServerResponse{
  3676. Header: res.Header,
  3677. HTTPStatusCode: res.StatusCode,
  3678. },
  3679. }
  3680. target := &ret
  3681. if err := gensupport.DecodeResponse(target, res); err != nil {
  3682. return nil, err
  3683. }
  3684. return ret, nil
  3685. // {
  3686. // "description": "CreateBinding generates a service binding to an existing service instance.\nSee ProviServiceInstance for async operation details.",
  3687. // "flatPath": "v1beta1/projects/{projectsId}/brokers/{brokersId}/v2/service_instances/{service_instancesId}/service_bindings/{service_bindingsId}",
  3688. // "httpMethod": "PUT",
  3689. // "id": "servicebroker.projects.brokers.v2.service_instances.service_bindings.create",
  3690. // "parameterOrder": [
  3691. // "parent",
  3692. // "binding_id"
  3693. // ],
  3694. // "parameters": {
  3695. // "acceptsIncomplete": {
  3696. // "description": "See CreateServiceInstanceRequest for details.",
  3697. // "location": "query",
  3698. // "type": "boolean"
  3699. // },
  3700. // "binding_id": {
  3701. // "description": "The id of the binding. Must be unique within GCP project.\nMaximum length is 64, GUID recommended.\nRequired.",
  3702. // "location": "path",
  3703. // "pattern": "^[^/]+$",
  3704. // "required": true,
  3705. // "type": "string"
  3706. // },
  3707. // "parent": {
  3708. // "description": "The GCP container.\nMust match\n`projects/[PROJECT_ID]/brokers/[BROKER_ID]/v2/service_instances/[INSTANCE_ID]`.",
  3709. // "location": "path",
  3710. // "pattern": "^projects/[^/]+/brokers/[^/]+/v2/service_instances/[^/]+$",
  3711. // "required": true,
  3712. // "type": "string"
  3713. // }
  3714. // },
  3715. // "path": "v1beta1/{+parent}/service_bindings/{+binding_id}",
  3716. // "request": {
  3717. // "$ref": "GoogleCloudServicebrokerV1beta1__Binding"
  3718. // },
  3719. // "response": {
  3720. // "$ref": "GoogleCloudServicebrokerV1beta1__CreateBindingResponse"
  3721. // },
  3722. // "scopes": [
  3723. // "https://www.googleapis.com/auth/cloud-platform"
  3724. // ]
  3725. // }
  3726. }
  3727. // method id "servicebroker.projects.brokers.v2.service_instances.service_bindings.delete":
  3728. type ProjectsBrokersV2ServiceInstancesServiceBindingsDeleteCall struct {
  3729. s *Service
  3730. name string
  3731. urlParams_ gensupport.URLParams
  3732. ctx_ context.Context
  3733. header_ http.Header
  3734. }
  3735. // Delete: Unbinds from a service instance.
  3736. // For synchronous/asynchronous request details see
  3737. // CreateServiceInstance
  3738. // method.
  3739. // If binding does not exist HTTP 410 status will be returned.
  3740. func (r *ProjectsBrokersV2ServiceInstancesServiceBindingsService) Delete(name string) *ProjectsBrokersV2ServiceInstancesServiceBindingsDeleteCall {
  3741. c := &ProjectsBrokersV2ServiceInstancesServiceBindingsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3742. c.name = name
  3743. return c
  3744. }
  3745. // AcceptsIncomplete sets the optional parameter "acceptsIncomplete":
  3746. // See CreateServiceInstanceRequest for details.
  3747. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsDeleteCall) AcceptsIncomplete(acceptsIncomplete bool) *ProjectsBrokersV2ServiceInstancesServiceBindingsDeleteCall {
  3748. c.urlParams_.Set("acceptsIncomplete", fmt.Sprint(acceptsIncomplete))
  3749. return c
  3750. }
  3751. // PlanId sets the optional parameter "planId": The plan id of the
  3752. // service instance.
  3753. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsDeleteCall) PlanId(planId string) *ProjectsBrokersV2ServiceInstancesServiceBindingsDeleteCall {
  3754. c.urlParams_.Set("planId", planId)
  3755. return c
  3756. }
  3757. // ServiceId sets the optional parameter "serviceId": Additional query
  3758. // parameter hints.
  3759. // The service id of the service instance.
  3760. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsDeleteCall) ServiceId(serviceId string) *ProjectsBrokersV2ServiceInstancesServiceBindingsDeleteCall {
  3761. c.urlParams_.Set("serviceId", serviceId)
  3762. return c
  3763. }
  3764. // Fields allows partial responses to be retrieved. See
  3765. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3766. // for more information.
  3767. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsDeleteCall) Fields(s ...googleapi.Field) *ProjectsBrokersV2ServiceInstancesServiceBindingsDeleteCall {
  3768. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3769. return c
  3770. }
  3771. // Context sets the context to be used in this call's Do method. Any
  3772. // pending HTTP request will be aborted if the provided context is
  3773. // canceled.
  3774. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsDeleteCall) Context(ctx context.Context) *ProjectsBrokersV2ServiceInstancesServiceBindingsDeleteCall {
  3775. c.ctx_ = ctx
  3776. return c
  3777. }
  3778. // Header returns an http.Header that can be modified by the caller to
  3779. // add HTTP headers to the request.
  3780. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsDeleteCall) Header() http.Header {
  3781. if c.header_ == nil {
  3782. c.header_ = make(http.Header)
  3783. }
  3784. return c.header_
  3785. }
  3786. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsDeleteCall) doRequest(alt string) (*http.Response, error) {
  3787. reqHeaders := make(http.Header)
  3788. for k, v := range c.header_ {
  3789. reqHeaders[k] = v
  3790. }
  3791. reqHeaders.Set("User-Agent", c.s.userAgent())
  3792. var body io.Reader = nil
  3793. c.urlParams_.Set("alt", alt)
  3794. c.urlParams_.Set("prettyPrint", "false")
  3795. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  3796. urls += "?" + c.urlParams_.Encode()
  3797. req, err := http.NewRequest("DELETE", urls, body)
  3798. if err != nil {
  3799. return nil, err
  3800. }
  3801. req.Header = reqHeaders
  3802. googleapi.Expand(req.URL, map[string]string{
  3803. "name": c.name,
  3804. })
  3805. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3806. }
  3807. // Do executes the "servicebroker.projects.brokers.v2.service_instances.service_bindings.delete" call.
  3808. // Exactly one of
  3809. // *GoogleCloudServicebrokerV1beta1__DeleteBindingResponse or error will
  3810. // be non-nil. Any non-2xx status code is an error. Response headers are
  3811. // in either
  3812. // *GoogleCloudServicebrokerV1beta1__DeleteBindingResponse.ServerResponse
  3813. // .Header or (if a response was returned at all) in
  3814. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3815. // whether the returned error was because http.StatusNotModified was
  3816. // returned.
  3817. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleCloudServicebrokerV1beta1__DeleteBindingResponse, error) {
  3818. gensupport.SetOptions(c.urlParams_, opts...)
  3819. res, err := c.doRequest("json")
  3820. if res != nil && res.StatusCode == http.StatusNotModified {
  3821. if res.Body != nil {
  3822. res.Body.Close()
  3823. }
  3824. return nil, &googleapi.Error{
  3825. Code: res.StatusCode,
  3826. Header: res.Header,
  3827. }
  3828. }
  3829. if err != nil {
  3830. return nil, err
  3831. }
  3832. defer googleapi.CloseBody(res)
  3833. if err := googleapi.CheckResponse(res); err != nil {
  3834. return nil, err
  3835. }
  3836. ret := &GoogleCloudServicebrokerV1beta1__DeleteBindingResponse{
  3837. ServerResponse: googleapi.ServerResponse{
  3838. Header: res.Header,
  3839. HTTPStatusCode: res.StatusCode,
  3840. },
  3841. }
  3842. target := &ret
  3843. if err := gensupport.DecodeResponse(target, res); err != nil {
  3844. return nil, err
  3845. }
  3846. return ret, nil
  3847. // {
  3848. // "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.",
  3849. // "flatPath": "v1beta1/projects/{projectsId}/brokers/{brokersId}/v2/service_instances/{service_instancesId}/service_bindings/{service_bindingsId}",
  3850. // "httpMethod": "DELETE",
  3851. // "id": "servicebroker.projects.brokers.v2.service_instances.service_bindings.delete",
  3852. // "parameterOrder": [
  3853. // "name"
  3854. // ],
  3855. // "parameters": {
  3856. // "acceptsIncomplete": {
  3857. // "description": "See CreateServiceInstanceRequest for details.",
  3858. // "location": "query",
  3859. // "type": "boolean"
  3860. // },
  3861. // "name": {
  3862. // "description": "Name must match\n`projects/[PROJECT_ID]/brokers/[BROKER_ID]/`\n`v2/service_instances/[INSTANCE_ID]/service_bindings/[BINDING_ID]`\nor\n`projects/[PROJECT_ID]/brokers/[BROKER_ID]/`\n`/instances/[INSTANCE_ID]/bindings/[BINDING_ID]`.",
  3863. // "location": "path",
  3864. // "pattern": "^projects/[^/]+/brokers/[^/]+/v2/service_instances/[^/]+/service_bindings/[^/]+$",
  3865. // "required": true,
  3866. // "type": "string"
  3867. // },
  3868. // "planId": {
  3869. // "description": "The plan id of the service instance.",
  3870. // "location": "query",
  3871. // "type": "string"
  3872. // },
  3873. // "serviceId": {
  3874. // "description": "Additional query parameter hints.\nThe service id of the service instance.",
  3875. // "location": "query",
  3876. // "type": "string"
  3877. // }
  3878. // },
  3879. // "path": "v1beta1/{+name}",
  3880. // "response": {
  3881. // "$ref": "GoogleCloudServicebrokerV1beta1__DeleteBindingResponse"
  3882. // },
  3883. // "scopes": [
  3884. // "https://www.googleapis.com/auth/cloud-platform"
  3885. // ]
  3886. // }
  3887. }
  3888. // method id "servicebroker.projects.brokers.v2.service_instances.service_bindings.get":
  3889. type ProjectsBrokersV2ServiceInstancesServiceBindingsGetCall struct {
  3890. s *Service
  3891. name string
  3892. urlParams_ gensupport.URLParams
  3893. ifNoneMatch_ string
  3894. ctx_ context.Context
  3895. header_ http.Header
  3896. }
  3897. // Get: GetBinding returns the binding information.
  3898. func (r *ProjectsBrokersV2ServiceInstancesServiceBindingsService) Get(name string) *ProjectsBrokersV2ServiceInstancesServiceBindingsGetCall {
  3899. c := &ProjectsBrokersV2ServiceInstancesServiceBindingsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3900. c.name = name
  3901. return c
  3902. }
  3903. // PlanId sets the optional parameter "planId": Plan id.
  3904. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsGetCall) PlanId(planId string) *ProjectsBrokersV2ServiceInstancesServiceBindingsGetCall {
  3905. c.urlParams_.Set("planId", planId)
  3906. return c
  3907. }
  3908. // ServiceId sets the optional parameter "serviceId": Service id.
  3909. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsGetCall) ServiceId(serviceId string) *ProjectsBrokersV2ServiceInstancesServiceBindingsGetCall {
  3910. c.urlParams_.Set("serviceId", serviceId)
  3911. return c
  3912. }
  3913. // Fields allows partial responses to be retrieved. See
  3914. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3915. // for more information.
  3916. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsGetCall) Fields(s ...googleapi.Field) *ProjectsBrokersV2ServiceInstancesServiceBindingsGetCall {
  3917. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3918. return c
  3919. }
  3920. // IfNoneMatch sets the optional parameter which makes the operation
  3921. // fail if the object's ETag matches the given value. This is useful for
  3922. // getting updates only after the object has changed since the last
  3923. // request. Use googleapi.IsNotModified to check whether the response
  3924. // error from Do is the result of In-None-Match.
  3925. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsGetCall) IfNoneMatch(entityTag string) *ProjectsBrokersV2ServiceInstancesServiceBindingsGetCall {
  3926. c.ifNoneMatch_ = entityTag
  3927. return c
  3928. }
  3929. // Context sets the context to be used in this call's Do method. Any
  3930. // pending HTTP request will be aborted if the provided context is
  3931. // canceled.
  3932. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsGetCall) Context(ctx context.Context) *ProjectsBrokersV2ServiceInstancesServiceBindingsGetCall {
  3933. c.ctx_ = ctx
  3934. return c
  3935. }
  3936. // Header returns an http.Header that can be modified by the caller to
  3937. // add HTTP headers to the request.
  3938. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsGetCall) Header() http.Header {
  3939. if c.header_ == nil {
  3940. c.header_ = make(http.Header)
  3941. }
  3942. return c.header_
  3943. }
  3944. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsGetCall) doRequest(alt string) (*http.Response, error) {
  3945. reqHeaders := make(http.Header)
  3946. for k, v := range c.header_ {
  3947. reqHeaders[k] = v
  3948. }
  3949. reqHeaders.Set("User-Agent", c.s.userAgent())
  3950. if c.ifNoneMatch_ != "" {
  3951. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3952. }
  3953. var body io.Reader = nil
  3954. c.urlParams_.Set("alt", alt)
  3955. c.urlParams_.Set("prettyPrint", "false")
  3956. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  3957. urls += "?" + c.urlParams_.Encode()
  3958. req, err := http.NewRequest("GET", urls, body)
  3959. if err != nil {
  3960. return nil, err
  3961. }
  3962. req.Header = reqHeaders
  3963. googleapi.Expand(req.URL, map[string]string{
  3964. "name": c.name,
  3965. })
  3966. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3967. }
  3968. // Do executes the "servicebroker.projects.brokers.v2.service_instances.service_bindings.get" call.
  3969. // Exactly one of *GoogleCloudServicebrokerV1beta1__GetBindingResponse
  3970. // or error will be non-nil. Any non-2xx status code is an error.
  3971. // Response headers are in either
  3972. // *GoogleCloudServicebrokerV1beta1__GetBindingResponse.ServerResponse.He
  3973. // ader or (if a response was returned at all) in
  3974. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3975. // whether the returned error was because http.StatusNotModified was
  3976. // returned.
  3977. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudServicebrokerV1beta1__GetBindingResponse, error) {
  3978. gensupport.SetOptions(c.urlParams_, opts...)
  3979. res, err := c.doRequest("json")
  3980. if res != nil && res.StatusCode == http.StatusNotModified {
  3981. if res.Body != nil {
  3982. res.Body.Close()
  3983. }
  3984. return nil, &googleapi.Error{
  3985. Code: res.StatusCode,
  3986. Header: res.Header,
  3987. }
  3988. }
  3989. if err != nil {
  3990. return nil, err
  3991. }
  3992. defer googleapi.CloseBody(res)
  3993. if err := googleapi.CheckResponse(res); err != nil {
  3994. return nil, err
  3995. }
  3996. ret := &GoogleCloudServicebrokerV1beta1__GetBindingResponse{
  3997. ServerResponse: googleapi.ServerResponse{
  3998. Header: res.Header,
  3999. HTTPStatusCode: res.StatusCode,
  4000. },
  4001. }
  4002. target := &ret
  4003. if err := gensupport.DecodeResponse(target, res); err != nil {
  4004. return nil, err
  4005. }
  4006. return ret, nil
  4007. // {
  4008. // "description": "GetBinding returns the binding information.",
  4009. // "flatPath": "v1beta1/projects/{projectsId}/brokers/{brokersId}/v2/service_instances/{service_instancesId}/service_bindings/{service_bindingsId}",
  4010. // "httpMethod": "GET",
  4011. // "id": "servicebroker.projects.brokers.v2.service_instances.service_bindings.get",
  4012. // "parameterOrder": [
  4013. // "name"
  4014. // ],
  4015. // "parameters": {
  4016. // "name": {
  4017. // "description": "Name must match\n`projects/[PROJECT_ID]/brokers/[BROKER_ID]/v2/service_instances/[INSTANCE_ID]/service_bindings`.",
  4018. // "location": "path",
  4019. // "pattern": "^projects/[^/]+/brokers/[^/]+/v2/service_instances/[^/]+/service_bindings/[^/]+$",
  4020. // "required": true,
  4021. // "type": "string"
  4022. // },
  4023. // "planId": {
  4024. // "description": "Plan id.",
  4025. // "location": "query",
  4026. // "type": "string"
  4027. // },
  4028. // "serviceId": {
  4029. // "description": "Service id.",
  4030. // "location": "query",
  4031. // "type": "string"
  4032. // }
  4033. // },
  4034. // "path": "v1beta1/{+name}",
  4035. // "response": {
  4036. // "$ref": "GoogleCloudServicebrokerV1beta1__GetBindingResponse"
  4037. // },
  4038. // "scopes": [
  4039. // "https://www.googleapis.com/auth/cloud-platform"
  4040. // ]
  4041. // }
  4042. }
  4043. // method id "servicebroker.projects.brokers.v2.service_instances.service_bindings.getLast_operation":
  4044. type ProjectsBrokersV2ServiceInstancesServiceBindingsGetLastOperationCall struct {
  4045. s *Service
  4046. name string
  4047. urlParams_ gensupport.URLParams
  4048. ifNoneMatch_ string
  4049. ctx_ context.Context
  4050. header_ http.Header
  4051. }
  4052. // GetLastOperation: Returns the state of the last operation for the
  4053. // binding.
  4054. // Only last (or current) operation can be polled.
  4055. func (r *ProjectsBrokersV2ServiceInstancesServiceBindingsService) GetLastOperation(name string) *ProjectsBrokersV2ServiceInstancesServiceBindingsGetLastOperationCall {
  4056. c := &ProjectsBrokersV2ServiceInstancesServiceBindingsGetLastOperationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4057. c.name = name
  4058. return c
  4059. }
  4060. // Operation sets the optional parameter "operation": If `operation` was
  4061. // returned during mutation operation, this field must be
  4062. // populated with the provided value.
  4063. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsGetLastOperationCall) Operation(operation string) *ProjectsBrokersV2ServiceInstancesServiceBindingsGetLastOperationCall {
  4064. c.urlParams_.Set("operation", operation)
  4065. return c
  4066. }
  4067. // PlanId sets the optional parameter "planId": Plan id.
  4068. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsGetLastOperationCall) PlanId(planId string) *ProjectsBrokersV2ServiceInstancesServiceBindingsGetLastOperationCall {
  4069. c.urlParams_.Set("planId", planId)
  4070. return c
  4071. }
  4072. // ServiceId sets the optional parameter "serviceId": Service id.
  4073. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsGetLastOperationCall) ServiceId(serviceId string) *ProjectsBrokersV2ServiceInstancesServiceBindingsGetLastOperationCall {
  4074. c.urlParams_.Set("serviceId", serviceId)
  4075. return c
  4076. }
  4077. // Fields allows partial responses to be retrieved. See
  4078. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4079. // for more information.
  4080. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsGetLastOperationCall) Fields(s ...googleapi.Field) *ProjectsBrokersV2ServiceInstancesServiceBindingsGetLastOperationCall {
  4081. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4082. return c
  4083. }
  4084. // IfNoneMatch sets the optional parameter which makes the operation
  4085. // fail if the object's ETag matches the given value. This is useful for
  4086. // getting updates only after the object has changed since the last
  4087. // request. Use googleapi.IsNotModified to check whether the response
  4088. // error from Do is the result of In-None-Match.
  4089. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsGetLastOperationCall) IfNoneMatch(entityTag string) *ProjectsBrokersV2ServiceInstancesServiceBindingsGetLastOperationCall {
  4090. c.ifNoneMatch_ = entityTag
  4091. return c
  4092. }
  4093. // Context sets the context to be used in this call's Do method. Any
  4094. // pending HTTP request will be aborted if the provided context is
  4095. // canceled.
  4096. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsGetLastOperationCall) Context(ctx context.Context) *ProjectsBrokersV2ServiceInstancesServiceBindingsGetLastOperationCall {
  4097. c.ctx_ = ctx
  4098. return c
  4099. }
  4100. // Header returns an http.Header that can be modified by the caller to
  4101. // add HTTP headers to the request.
  4102. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsGetLastOperationCall) Header() http.Header {
  4103. if c.header_ == nil {
  4104. c.header_ = make(http.Header)
  4105. }
  4106. return c.header_
  4107. }
  4108. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsGetLastOperationCall) doRequest(alt string) (*http.Response, error) {
  4109. reqHeaders := make(http.Header)
  4110. for k, v := range c.header_ {
  4111. reqHeaders[k] = v
  4112. }
  4113. reqHeaders.Set("User-Agent", c.s.userAgent())
  4114. if c.ifNoneMatch_ != "" {
  4115. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4116. }
  4117. var body io.Reader = nil
  4118. c.urlParams_.Set("alt", alt)
  4119. c.urlParams_.Set("prettyPrint", "false")
  4120. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/last_operation")
  4121. urls += "?" + c.urlParams_.Encode()
  4122. req, err := http.NewRequest("GET", urls, body)
  4123. if err != nil {
  4124. return nil, err
  4125. }
  4126. req.Header = reqHeaders
  4127. googleapi.Expand(req.URL, map[string]string{
  4128. "name": c.name,
  4129. })
  4130. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4131. }
  4132. // Do executes the "servicebroker.projects.brokers.v2.service_instances.service_bindings.getLast_operation" call.
  4133. // Exactly one of *GoogleCloudServicebrokerV1beta1__Operation or error
  4134. // will be non-nil. Any non-2xx status code is an error. Response
  4135. // headers are in either
  4136. // *GoogleCloudServicebrokerV1beta1__Operation.ServerResponse.Header or
  4137. // (if a response was returned at all) in
  4138. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4139. // whether the returned error was because http.StatusNotModified was
  4140. // returned.
  4141. func (c *ProjectsBrokersV2ServiceInstancesServiceBindingsGetLastOperationCall) Do(opts ...googleapi.CallOption) (*GoogleCloudServicebrokerV1beta1__Operation, error) {
  4142. gensupport.SetOptions(c.urlParams_, opts...)
  4143. res, err := c.doRequest("json")
  4144. if res != nil && res.StatusCode == http.StatusNotModified {
  4145. if res.Body != nil {
  4146. res.Body.Close()
  4147. }
  4148. return nil, &googleapi.Error{
  4149. Code: res.StatusCode,
  4150. Header: res.Header,
  4151. }
  4152. }
  4153. if err != nil {
  4154. return nil, err
  4155. }
  4156. defer googleapi.CloseBody(res)
  4157. if err := googleapi.CheckResponse(res); err != nil {
  4158. return nil, err
  4159. }
  4160. ret := &GoogleCloudServicebrokerV1beta1__Operation{
  4161. ServerResponse: googleapi.ServerResponse{
  4162. Header: res.Header,
  4163. HTTPStatusCode: res.StatusCode,
  4164. },
  4165. }
  4166. target := &ret
  4167. if err := gensupport.DecodeResponse(target, res); err != nil {
  4168. return nil, err
  4169. }
  4170. return ret, nil
  4171. // {
  4172. // "description": "Returns the state of the last operation for the binding.\nOnly last (or current) operation can be polled.",
  4173. // "flatPath": "v1beta1/projects/{projectsId}/brokers/{brokersId}/v2/service_instances/{service_instancesId}/service_bindings/{service_bindingsId}/last_operation",
  4174. // "httpMethod": "GET",
  4175. // "id": "servicebroker.projects.brokers.v2.service_instances.service_bindings.getLast_operation",
  4176. // "parameterOrder": [
  4177. // "name"
  4178. // ],
  4179. // "parameters": {
  4180. // "name": {
  4181. // "description": "Name must match\n`projects/[PROJECT_ID]/brokers/[BROKER_ID]/v2/service_instances/[INSTANCE_ID]/service_binding/[BINDING_ID]`.",
  4182. // "location": "path",
  4183. // "pattern": "^projects/[^/]+/brokers/[^/]+/v2/service_instances/[^/]+/service_bindings/[^/]+$",
  4184. // "required": true,
  4185. // "type": "string"
  4186. // },
  4187. // "operation": {
  4188. // "description": "If `operation` was returned during mutation operation, this field must be\npopulated with the provided value.",
  4189. // "location": "query",
  4190. // "type": "string"
  4191. // },
  4192. // "planId": {
  4193. // "description": "Plan id.",
  4194. // "location": "query",
  4195. // "type": "string"
  4196. // },
  4197. // "serviceId": {
  4198. // "description": "Service id.",
  4199. // "location": "query",
  4200. // "type": "string"
  4201. // }
  4202. // },
  4203. // "path": "v1beta1/{+name}/last_operation",
  4204. // "response": {
  4205. // "$ref": "GoogleCloudServicebrokerV1beta1__Operation"
  4206. // },
  4207. // "scopes": [
  4208. // "https://www.googleapis.com/auth/cloud-platform"
  4209. // ]
  4210. // }
  4211. }
  4212. // method id "servicebroker.getIamPolicy":
  4213. type V1beta1GetIamPolicyCall struct {
  4214. s *Service
  4215. resource string
  4216. urlParams_ gensupport.URLParams
  4217. ifNoneMatch_ string
  4218. ctx_ context.Context
  4219. header_ http.Header
  4220. }
  4221. // GetIamPolicy: Gets the access control policy for a resource.
  4222. // Returns an empty policy if the resource exists and does not have a
  4223. // policy
  4224. // set.
  4225. func (r *V1beta1Service) GetIamPolicy(resource string) *V1beta1GetIamPolicyCall {
  4226. c := &V1beta1GetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4227. c.resource = resource
  4228. return c
  4229. }
  4230. // Fields allows partial responses to be retrieved. See
  4231. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4232. // for more information.
  4233. func (c *V1beta1GetIamPolicyCall) Fields(s ...googleapi.Field) *V1beta1GetIamPolicyCall {
  4234. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4235. return c
  4236. }
  4237. // IfNoneMatch sets the optional parameter which makes the operation
  4238. // fail if the object's ETag matches the given value. This is useful for
  4239. // getting updates only after the object has changed since the last
  4240. // request. Use googleapi.IsNotModified to check whether the response
  4241. // error from Do is the result of In-None-Match.
  4242. func (c *V1beta1GetIamPolicyCall) IfNoneMatch(entityTag string) *V1beta1GetIamPolicyCall {
  4243. c.ifNoneMatch_ = entityTag
  4244. return c
  4245. }
  4246. // Context sets the context to be used in this call's Do method. Any
  4247. // pending HTTP request will be aborted if the provided context is
  4248. // canceled.
  4249. func (c *V1beta1GetIamPolicyCall) Context(ctx context.Context) *V1beta1GetIamPolicyCall {
  4250. c.ctx_ = ctx
  4251. return c
  4252. }
  4253. // Header returns an http.Header that can be modified by the caller to
  4254. // add HTTP headers to the request.
  4255. func (c *V1beta1GetIamPolicyCall) Header() http.Header {
  4256. if c.header_ == nil {
  4257. c.header_ = make(http.Header)
  4258. }
  4259. return c.header_
  4260. }
  4261. func (c *V1beta1GetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  4262. reqHeaders := make(http.Header)
  4263. for k, v := range c.header_ {
  4264. reqHeaders[k] = v
  4265. }
  4266. reqHeaders.Set("User-Agent", c.s.userAgent())
  4267. if c.ifNoneMatch_ != "" {
  4268. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4269. }
  4270. var body io.Reader = nil
  4271. c.urlParams_.Set("alt", alt)
  4272. c.urlParams_.Set("prettyPrint", "false")
  4273. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy")
  4274. urls += "?" + c.urlParams_.Encode()
  4275. req, err := http.NewRequest("GET", urls, body)
  4276. if err != nil {
  4277. return nil, err
  4278. }
  4279. req.Header = reqHeaders
  4280. googleapi.Expand(req.URL, map[string]string{
  4281. "resource": c.resource,
  4282. })
  4283. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4284. }
  4285. // Do executes the "servicebroker.getIamPolicy" call.
  4286. // Exactly one of *GoogleIamV1__Policy or error will be non-nil. Any
  4287. // non-2xx status code is an error. Response headers are in either
  4288. // *GoogleIamV1__Policy.ServerResponse.Header or (if a response was
  4289. // returned at all) in error.(*googleapi.Error).Header. Use
  4290. // googleapi.IsNotModified to check whether the returned error was
  4291. // because http.StatusNotModified was returned.
  4292. func (c *V1beta1GetIamPolicyCall) Do(opts ...googleapi.CallOption) (*GoogleIamV1__Policy, error) {
  4293. gensupport.SetOptions(c.urlParams_, opts...)
  4294. res, err := c.doRequest("json")
  4295. if res != nil && res.StatusCode == http.StatusNotModified {
  4296. if res.Body != nil {
  4297. res.Body.Close()
  4298. }
  4299. return nil, &googleapi.Error{
  4300. Code: res.StatusCode,
  4301. Header: res.Header,
  4302. }
  4303. }
  4304. if err != nil {
  4305. return nil, err
  4306. }
  4307. defer googleapi.CloseBody(res)
  4308. if err := googleapi.CheckResponse(res); err != nil {
  4309. return nil, err
  4310. }
  4311. ret := &GoogleIamV1__Policy{
  4312. ServerResponse: googleapi.ServerResponse{
  4313. Header: res.Header,
  4314. HTTPStatusCode: res.StatusCode,
  4315. },
  4316. }
  4317. target := &ret
  4318. if err := gensupport.DecodeResponse(target, res); err != nil {
  4319. return nil, err
  4320. }
  4321. return ret, nil
  4322. // {
  4323. // "description": "Gets the access control policy for a resource.\nReturns an empty policy if the resource exists and does not have a policy\nset.",
  4324. // "flatPath": "v1beta1/{v1beta1Id}:getIamPolicy",
  4325. // "httpMethod": "GET",
  4326. // "id": "servicebroker.getIamPolicy",
  4327. // "parameterOrder": [
  4328. // "resource"
  4329. // ],
  4330. // "parameters": {
  4331. // "resource": {
  4332. // "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field.",
  4333. // "location": "path",
  4334. // "pattern": "^.+$",
  4335. // "required": true,
  4336. // "type": "string"
  4337. // }
  4338. // },
  4339. // "path": "v1beta1/{+resource}:getIamPolicy",
  4340. // "response": {
  4341. // "$ref": "GoogleIamV1__Policy"
  4342. // },
  4343. // "scopes": [
  4344. // "https://www.googleapis.com/auth/cloud-platform"
  4345. // ]
  4346. // }
  4347. }
  4348. // method id "servicebroker.setIamPolicy":
  4349. type V1beta1SetIamPolicyCall struct {
  4350. s *Service
  4351. resource string
  4352. googleiamv1__setiampolicyrequest *GoogleIamV1__SetIamPolicyRequest
  4353. urlParams_ gensupport.URLParams
  4354. ctx_ context.Context
  4355. header_ http.Header
  4356. }
  4357. // SetIamPolicy: Sets the access control policy on the specified
  4358. // resource. Replaces any
  4359. // existing policy.
  4360. func (r *V1beta1Service) SetIamPolicy(resource string, googleiamv1__setiampolicyrequest *GoogleIamV1__SetIamPolicyRequest) *V1beta1SetIamPolicyCall {
  4361. c := &V1beta1SetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4362. c.resource = resource
  4363. c.googleiamv1__setiampolicyrequest = googleiamv1__setiampolicyrequest
  4364. return c
  4365. }
  4366. // Fields allows partial responses to be retrieved. See
  4367. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4368. // for more information.
  4369. func (c *V1beta1SetIamPolicyCall) Fields(s ...googleapi.Field) *V1beta1SetIamPolicyCall {
  4370. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4371. return c
  4372. }
  4373. // Context sets the context to be used in this call's Do method. Any
  4374. // pending HTTP request will be aborted if the provided context is
  4375. // canceled.
  4376. func (c *V1beta1SetIamPolicyCall) Context(ctx context.Context) *V1beta1SetIamPolicyCall {
  4377. c.ctx_ = ctx
  4378. return c
  4379. }
  4380. // Header returns an http.Header that can be modified by the caller to
  4381. // add HTTP headers to the request.
  4382. func (c *V1beta1SetIamPolicyCall) Header() http.Header {
  4383. if c.header_ == nil {
  4384. c.header_ = make(http.Header)
  4385. }
  4386. return c.header_
  4387. }
  4388. func (c *V1beta1SetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  4389. reqHeaders := make(http.Header)
  4390. for k, v := range c.header_ {
  4391. reqHeaders[k] = v
  4392. }
  4393. reqHeaders.Set("User-Agent", c.s.userAgent())
  4394. var body io.Reader = nil
  4395. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1__setiampolicyrequest)
  4396. if err != nil {
  4397. return nil, err
  4398. }
  4399. reqHeaders.Set("Content-Type", "application/json")
  4400. c.urlParams_.Set("alt", alt)
  4401. c.urlParams_.Set("prettyPrint", "false")
  4402. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:setIamPolicy")
  4403. urls += "?" + c.urlParams_.Encode()
  4404. req, err := http.NewRequest("POST", urls, body)
  4405. if err != nil {
  4406. return nil, err
  4407. }
  4408. req.Header = reqHeaders
  4409. googleapi.Expand(req.URL, map[string]string{
  4410. "resource": c.resource,
  4411. })
  4412. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4413. }
  4414. // Do executes the "servicebroker.setIamPolicy" call.
  4415. // Exactly one of *GoogleIamV1__Policy or error will be non-nil. Any
  4416. // non-2xx status code is an error. Response headers are in either
  4417. // *GoogleIamV1__Policy.ServerResponse.Header or (if a response was
  4418. // returned at all) in error.(*googleapi.Error).Header. Use
  4419. // googleapi.IsNotModified to check whether the returned error was
  4420. // because http.StatusNotModified was returned.
  4421. func (c *V1beta1SetIamPolicyCall) Do(opts ...googleapi.CallOption) (*GoogleIamV1__Policy, error) {
  4422. gensupport.SetOptions(c.urlParams_, opts...)
  4423. res, err := c.doRequest("json")
  4424. if res != nil && res.StatusCode == http.StatusNotModified {
  4425. if res.Body != nil {
  4426. res.Body.Close()
  4427. }
  4428. return nil, &googleapi.Error{
  4429. Code: res.StatusCode,
  4430. Header: res.Header,
  4431. }
  4432. }
  4433. if err != nil {
  4434. return nil, err
  4435. }
  4436. defer googleapi.CloseBody(res)
  4437. if err := googleapi.CheckResponse(res); err != nil {
  4438. return nil, err
  4439. }
  4440. ret := &GoogleIamV1__Policy{
  4441. ServerResponse: googleapi.ServerResponse{
  4442. Header: res.Header,
  4443. HTTPStatusCode: res.StatusCode,
  4444. },
  4445. }
  4446. target := &ret
  4447. if err := gensupport.DecodeResponse(target, res); err != nil {
  4448. return nil, err
  4449. }
  4450. return ret, nil
  4451. // {
  4452. // "description": "Sets the access control policy on the specified resource. Replaces any\nexisting policy.",
  4453. // "flatPath": "v1beta1/{v1beta1Id}:setIamPolicy",
  4454. // "httpMethod": "POST",
  4455. // "id": "servicebroker.setIamPolicy",
  4456. // "parameterOrder": [
  4457. // "resource"
  4458. // ],
  4459. // "parameters": {
  4460. // "resource": {
  4461. // "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field.",
  4462. // "location": "path",
  4463. // "pattern": "^.+$",
  4464. // "required": true,
  4465. // "type": "string"
  4466. // }
  4467. // },
  4468. // "path": "v1beta1/{+resource}:setIamPolicy",
  4469. // "request": {
  4470. // "$ref": "GoogleIamV1__SetIamPolicyRequest"
  4471. // },
  4472. // "response": {
  4473. // "$ref": "GoogleIamV1__Policy"
  4474. // },
  4475. // "scopes": [
  4476. // "https://www.googleapis.com/auth/cloud-platform"
  4477. // ]
  4478. // }
  4479. }
  4480. // method id "servicebroker.testIamPermissions":
  4481. type V1beta1TestIamPermissionsCall struct {
  4482. s *Service
  4483. resource string
  4484. googleiamv1__testiampermissionsrequest *GoogleIamV1__TestIamPermissionsRequest
  4485. urlParams_ gensupport.URLParams
  4486. ctx_ context.Context
  4487. header_ http.Header
  4488. }
  4489. // TestIamPermissions: Returns permissions that a caller has on the
  4490. // specified resource.
  4491. // If the resource does not exist, this will return an empty set
  4492. // of
  4493. // permissions, not a NOT_FOUND error.
  4494. //
  4495. // Note: This operation is designed to be used for building
  4496. // permission-aware
  4497. // UIs and command-line tools, not for authorization checking. This
  4498. // operation
  4499. // may "fail open" without warning.
  4500. func (r *V1beta1Service) TestIamPermissions(resource string, googleiamv1__testiampermissionsrequest *GoogleIamV1__TestIamPermissionsRequest) *V1beta1TestIamPermissionsCall {
  4501. c := &V1beta1TestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4502. c.resource = resource
  4503. c.googleiamv1__testiampermissionsrequest = googleiamv1__testiampermissionsrequest
  4504. return c
  4505. }
  4506. // Fields allows partial responses to be retrieved. See
  4507. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4508. // for more information.
  4509. func (c *V1beta1TestIamPermissionsCall) Fields(s ...googleapi.Field) *V1beta1TestIamPermissionsCall {
  4510. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4511. return c
  4512. }
  4513. // Context sets the context to be used in this call's Do method. Any
  4514. // pending HTTP request will be aborted if the provided context is
  4515. // canceled.
  4516. func (c *V1beta1TestIamPermissionsCall) Context(ctx context.Context) *V1beta1TestIamPermissionsCall {
  4517. c.ctx_ = ctx
  4518. return c
  4519. }
  4520. // Header returns an http.Header that can be modified by the caller to
  4521. // add HTTP headers to the request.
  4522. func (c *V1beta1TestIamPermissionsCall) Header() http.Header {
  4523. if c.header_ == nil {
  4524. c.header_ = make(http.Header)
  4525. }
  4526. return c.header_
  4527. }
  4528. func (c *V1beta1TestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  4529. reqHeaders := make(http.Header)
  4530. for k, v := range c.header_ {
  4531. reqHeaders[k] = v
  4532. }
  4533. reqHeaders.Set("User-Agent", c.s.userAgent())
  4534. var body io.Reader = nil
  4535. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1__testiampermissionsrequest)
  4536. if err != nil {
  4537. return nil, err
  4538. }
  4539. reqHeaders.Set("Content-Type", "application/json")
  4540. c.urlParams_.Set("alt", alt)
  4541. c.urlParams_.Set("prettyPrint", "false")
  4542. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:testIamPermissions")
  4543. urls += "?" + c.urlParams_.Encode()
  4544. req, err := http.NewRequest("POST", urls, body)
  4545. if err != nil {
  4546. return nil, err
  4547. }
  4548. req.Header = reqHeaders
  4549. googleapi.Expand(req.URL, map[string]string{
  4550. "resource": c.resource,
  4551. })
  4552. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4553. }
  4554. // Do executes the "servicebroker.testIamPermissions" call.
  4555. // Exactly one of *GoogleIamV1__TestIamPermissionsResponse or error will
  4556. // be non-nil. Any non-2xx status code is an error. Response headers are
  4557. // in either
  4558. // *GoogleIamV1__TestIamPermissionsResponse.ServerResponse.Header or (if
  4559. // a response was returned at all) in error.(*googleapi.Error).Header.
  4560. // Use googleapi.IsNotModified to check whether the returned error was
  4561. // because http.StatusNotModified was returned.
  4562. func (c *V1beta1TestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*GoogleIamV1__TestIamPermissionsResponse, error) {
  4563. gensupport.SetOptions(c.urlParams_, opts...)
  4564. res, err := c.doRequest("json")
  4565. if res != nil && res.StatusCode == http.StatusNotModified {
  4566. if res.Body != nil {
  4567. res.Body.Close()
  4568. }
  4569. return nil, &googleapi.Error{
  4570. Code: res.StatusCode,
  4571. Header: res.Header,
  4572. }
  4573. }
  4574. if err != nil {
  4575. return nil, err
  4576. }
  4577. defer googleapi.CloseBody(res)
  4578. if err := googleapi.CheckResponse(res); err != nil {
  4579. return nil, err
  4580. }
  4581. ret := &GoogleIamV1__TestIamPermissionsResponse{
  4582. ServerResponse: googleapi.ServerResponse{
  4583. Header: res.Header,
  4584. HTTPStatusCode: res.StatusCode,
  4585. },
  4586. }
  4587. target := &ret
  4588. if err := gensupport.DecodeResponse(target, res); err != nil {
  4589. return nil, err
  4590. }
  4591. return ret, nil
  4592. // {
  4593. // "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.",
  4594. // "flatPath": "v1beta1/{v1beta1Id}:testIamPermissions",
  4595. // "httpMethod": "POST",
  4596. // "id": "servicebroker.testIamPermissions",
  4597. // "parameterOrder": [
  4598. // "resource"
  4599. // ],
  4600. // "parameters": {
  4601. // "resource": {
  4602. // "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.",
  4603. // "location": "path",
  4604. // "pattern": "^.+$",
  4605. // "required": true,
  4606. // "type": "string"
  4607. // }
  4608. // },
  4609. // "path": "v1beta1/{+resource}:testIamPermissions",
  4610. // "request": {
  4611. // "$ref": "GoogleIamV1__TestIamPermissionsRequest"
  4612. // },
  4613. // "response": {
  4614. // "$ref": "GoogleIamV1__TestIamPermissionsResponse"
  4615. // },
  4616. // "scopes": [
  4617. // "https://www.googleapis.com/auth/cloud-platform"
  4618. // ]
  4619. // }
  4620. }