選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 

4028 行
150 KiB

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