Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 

2405 wiersze
84 KiB

  1. // Package redis provides access to the Cloud Memorystore for Redis API.
  2. //
  3. // See https://cloud.google.com/memorystore/docs/redis/
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/redis/v1beta1"
  8. // ...
  9. // redisService, err := redis.New(oauthHttpClient)
  10. package redis // import "google.golang.org/api/redis/v1beta1"
  11. import (
  12. "bytes"
  13. "encoding/json"
  14. "errors"
  15. "fmt"
  16. context "golang.org/x/net/context"
  17. ctxhttp "golang.org/x/net/context/ctxhttp"
  18. gensupport "google.golang.org/api/gensupport"
  19. googleapi "google.golang.org/api/googleapi"
  20. "io"
  21. "net/http"
  22. "net/url"
  23. "strconv"
  24. "strings"
  25. )
  26. // Always reference these packages, just in case the auto-generated code
  27. // below doesn't.
  28. var _ = bytes.NewBuffer
  29. var _ = strconv.Itoa
  30. var _ = fmt.Sprintf
  31. var _ = json.NewDecoder
  32. var _ = io.Copy
  33. var _ = url.Parse
  34. var _ = gensupport.MarshalJSON
  35. var _ = googleapi.Version
  36. var _ = errors.New
  37. var _ = strings.Replace
  38. var _ = context.Canceled
  39. var _ = ctxhttp.Do
  40. const apiId = "redis:v1beta1"
  41. const apiName = "redis"
  42. const apiVersion = "v1beta1"
  43. const basePath = "https://redis.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. return s, nil
  56. }
  57. type Service struct {
  58. client *http.Client
  59. BasePath string // API endpoint base URL
  60. UserAgent string // optional additional User-Agent fragment
  61. Projects *ProjectsService
  62. }
  63. func (s *Service) userAgent() string {
  64. if s.UserAgent == "" {
  65. return googleapi.UserAgent
  66. }
  67. return googleapi.UserAgent + " " + s.UserAgent
  68. }
  69. func NewProjectsService(s *Service) *ProjectsService {
  70. rs := &ProjectsService{s: s}
  71. rs.Locations = NewProjectsLocationsService(s)
  72. return rs
  73. }
  74. type ProjectsService struct {
  75. s *Service
  76. Locations *ProjectsLocationsService
  77. }
  78. func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
  79. rs := &ProjectsLocationsService{s: s}
  80. rs.Instances = NewProjectsLocationsInstancesService(s)
  81. rs.Operations = NewProjectsLocationsOperationsService(s)
  82. return rs
  83. }
  84. type ProjectsLocationsService struct {
  85. s *Service
  86. Instances *ProjectsLocationsInstancesService
  87. Operations *ProjectsLocationsOperationsService
  88. }
  89. func NewProjectsLocationsInstancesService(s *Service) *ProjectsLocationsInstancesService {
  90. rs := &ProjectsLocationsInstancesService{s: s}
  91. return rs
  92. }
  93. type ProjectsLocationsInstancesService struct {
  94. s *Service
  95. }
  96. func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService {
  97. rs := &ProjectsLocationsOperationsService{s: s}
  98. return rs
  99. }
  100. type ProjectsLocationsOperationsService struct {
  101. s *Service
  102. }
  103. // GoogleCloudCommonOperationMetadata: Represents the metadata of the
  104. // long-running operation.
  105. type GoogleCloudCommonOperationMetadata struct {
  106. // ApiVersion: [Output only] API version used to start the operation.
  107. ApiVersion string `json:"apiVersion,omitempty"`
  108. // CancelRequested: [Output only] Identifies whether the user has
  109. // requested cancellation
  110. // of the operation. Operations that have successfully been
  111. // cancelled
  112. // have Operation.error value with a google.rpc.Status.code of
  113. // 1,
  114. // corresponding to `Code.CANCELLED`.
  115. CancelRequested bool `json:"cancelRequested,omitempty"`
  116. // CreateTime: [Output only] The time the operation was created.
  117. CreateTime string `json:"createTime,omitempty"`
  118. // EndTime: [Output only] The time the operation finished running.
  119. EndTime string `json:"endTime,omitempty"`
  120. // StatusDetail: [Output only] Human-readable status of the operation,
  121. // if any.
  122. StatusDetail string `json:"statusDetail,omitempty"`
  123. // Target: [Output only] Server-defined resource path for the target of
  124. // the operation.
  125. Target string `json:"target,omitempty"`
  126. // Verb: [Output only] Name of the verb executed by the operation.
  127. Verb string `json:"verb,omitempty"`
  128. // ForceSendFields is a list of field names (e.g. "ApiVersion") to
  129. // unconditionally include in API requests. By default, fields with
  130. // empty values are omitted from API requests. However, any non-pointer,
  131. // non-interface field appearing in ForceSendFields will be sent to the
  132. // server regardless of whether the field is empty or not. This may be
  133. // used to include empty fields in Patch requests.
  134. ForceSendFields []string `json:"-"`
  135. // NullFields is a list of field names (e.g. "ApiVersion") to include in
  136. // API requests with the JSON null value. By default, fields with empty
  137. // values are omitted from API requests. However, any field with an
  138. // empty value appearing in NullFields will be sent to the server as
  139. // null. It is an error if a field in this list has a non-empty value.
  140. // This may be used to include null fields in Patch requests.
  141. NullFields []string `json:"-"`
  142. }
  143. func (s *GoogleCloudCommonOperationMetadata) MarshalJSON() ([]byte, error) {
  144. type NoMethod GoogleCloudCommonOperationMetadata
  145. raw := NoMethod(*s)
  146. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  147. }
  148. // GoogleCloudRedisV1beta1LocationMetadata: This location metadata
  149. // represents additional configuration options for a
  150. // given location where a Redis instance may be created. All fields are
  151. // output
  152. // only. It is returned as content of
  153. // the
  154. // `google.cloud.location.Location.metadata` field.
  155. type GoogleCloudRedisV1beta1LocationMetadata struct {
  156. // AvailableZones: Output only. The set of available zones in the
  157. // location. The map is keyed
  158. // by the lowercase ID of each zone, as defined by GCE. These keys can
  159. // be
  160. // specified in `location_id` or `alternative_location_id` fields
  161. // when
  162. // creating a Redis instance.
  163. AvailableZones map[string]GoogleCloudRedisV1beta1ZoneMetadata `json:"availableZones,omitempty"`
  164. // ForceSendFields is a list of field names (e.g. "AvailableZones") to
  165. // unconditionally include in API requests. By default, fields with
  166. // empty values are omitted from API requests. However, any non-pointer,
  167. // non-interface field appearing in ForceSendFields will be sent to the
  168. // server regardless of whether the field is empty or not. This may be
  169. // used to include empty fields in Patch requests.
  170. ForceSendFields []string `json:"-"`
  171. // NullFields is a list of field names (e.g. "AvailableZones") to
  172. // include in API requests with the JSON null value. By default, fields
  173. // with empty values are omitted from API requests. However, any field
  174. // with an empty value appearing in NullFields will be sent to the
  175. // server as null. It is an error if a field in this list has a
  176. // non-empty value. This may be used to include null fields in Patch
  177. // requests.
  178. NullFields []string `json:"-"`
  179. }
  180. func (s *GoogleCloudRedisV1beta1LocationMetadata) MarshalJSON() ([]byte, error) {
  181. type NoMethod GoogleCloudRedisV1beta1LocationMetadata
  182. raw := NoMethod(*s)
  183. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  184. }
  185. // GoogleCloudRedisV1beta1ZoneMetadata: Defines specific information for
  186. // a particular zone. Currently empty and
  187. // reserved for future use only.
  188. type GoogleCloudRedisV1beta1ZoneMetadata struct {
  189. }
  190. // Instance: A Google Cloud Redis instance.
  191. type Instance struct {
  192. // AlternativeLocationId: Optional. Only applicable to STANDARD_HA tier
  193. // which protects the instance
  194. // against zonal failures by provisioning it across two zones. If
  195. // provided, it
  196. // must be a different zone from the one provided in [location_id].
  197. AlternativeLocationId string `json:"alternativeLocationId,omitempty"`
  198. // AuthorizedNetwork: Optional. The full name of the Google Compute
  199. // Engine
  200. // [network](/compute/docs/networks-and-firewalls#networks) to which
  201. // the
  202. // instance is connected. If left unspecified, the `default`
  203. // network
  204. // will be used.
  205. AuthorizedNetwork string `json:"authorizedNetwork,omitempty"`
  206. // CreateTime: Output only. The time the instance was created.
  207. CreateTime string `json:"createTime,omitempty"`
  208. // CurrentLocationId: Output only. The current zone where the Redis
  209. // endpoint is placed. For Basic
  210. // Tier instances, this will always be the same as the
  211. // [location_id]
  212. // provided by the user at creation time. For Standard Tier
  213. // instances,
  214. // this can be either [location_id] or [alternative_location_id] and
  215. // can
  216. // change after a failover event.
  217. CurrentLocationId string `json:"currentLocationId,omitempty"`
  218. // DisplayName: An arbitrary and optional user-provided name for the
  219. // instance.
  220. DisplayName string `json:"displayName,omitempty"`
  221. // Host: Output only. Hostname or IP address of the exposed Redis
  222. // endpoint used by
  223. // clients to connect to the service.
  224. Host string `json:"host,omitempty"`
  225. // Labels: Resource labels to represent user provided metadata
  226. Labels map[string]string `json:"labels,omitempty"`
  227. // LocationId: Optional. The zone where the instance will be
  228. // provisioned. If not provided,
  229. // the service will choose a zone for the instance. For STANDARD_HA
  230. // tier,
  231. // instances will be created across two zones for protection against
  232. // zonal
  233. // failures. If [alternative_location_id] is also provided, it must
  234. // be
  235. // different from [location_id].
  236. LocationId string `json:"locationId,omitempty"`
  237. // MemorySizeGb: Required. Redis memory size in GiB.
  238. MemorySizeGb int64 `json:"memorySizeGb,omitempty"`
  239. // Name: Required. Unique name of the resource in this scope including
  240. // project and
  241. // location using the form:
  242. //
  243. // `projects/{project_id}/locations/{location_id}/instances/{instance_id}
  244. // `
  245. //
  246. // Note: Redis instances are managed and addressed at regional level
  247. // so
  248. // location_id here refers to a GCP region; however, users may choose
  249. // which
  250. // specific zone (or collection of zones for cross-zone instances) an
  251. // instance
  252. // should be provisioned in. Refer to [location_id]
  253. // and
  254. // [alternative_location_id] fields for more details.
  255. Name string `json:"name,omitempty"`
  256. // Port: Output only. The port number of the exposed Redis endpoint.
  257. Port int64 `json:"port,omitempty"`
  258. // RedisConfigs: Optional. Redis configuration parameters, according
  259. // to
  260. // http://redis.io/topics/config. Currently, the only supported
  261. // parameters
  262. // are:
  263. //
  264. // * maxmemory-policy
  265. // * notify-keyspace-events
  266. RedisConfigs map[string]string `json:"redisConfigs,omitempty"`
  267. // RedisVersion: Optional. The version of Redis software.
  268. // If not provided, latest supported version will be used. Updating
  269. // the
  270. // version will perform an upgrade/downgrade to the new version.
  271. // Currently,
  272. // the supported values are `REDIS_3_2` for Redis 3.2.
  273. RedisVersion string `json:"redisVersion,omitempty"`
  274. // ReservedIpRange: Optional. The CIDR range of internal addresses that
  275. // are reserved for this
  276. // instance. If not provided, the service will choose an unused /29
  277. // block,
  278. // for example, 10.0.0.0/29 or 192.168.0.0/29. Ranges must be unique
  279. // and non-overlapping with existing subnets in an authorized network.
  280. ReservedIpRange string `json:"reservedIpRange,omitempty"`
  281. // State: Output only. The current state of this instance.
  282. //
  283. // Possible values:
  284. // "STATE_UNSPECIFIED" - Not set.
  285. // "CREATING" - Redis instance is being created.
  286. // "READY" - Redis instance has been created and is fully usable.
  287. // "UPDATING" - Redis instance configuration is being updated. Certain
  288. // kinds of updates
  289. // may cause the instance to become unusable while the update is
  290. // in
  291. // progress.
  292. // "DELETING" - Redis instance is being deleted.
  293. // "REPAIRING" - Redis instance is being repaired and may be unusable.
  294. // Details can be
  295. // found in the `status_message` field.
  296. // "MAINTENANCE" - Maintenance is being performed on this Redis
  297. // instance.
  298. // "EXPORTING" - Redis instance is exporting data.
  299. // "IMPORTING" - Redis instance is importing data (availability may be
  300. // affected).
  301. State string `json:"state,omitempty"`
  302. // StatusMessage: Output only. Additional information about the current
  303. // status of this
  304. // instance, if available.
  305. StatusMessage string `json:"statusMessage,omitempty"`
  306. // Tier: Required. The service tier of the instance.
  307. //
  308. // Possible values:
  309. // "TIER_UNSPECIFIED" - Not set.
  310. // "BASIC" - BASIC tier: standalone instance
  311. // "STANDARD_HA" - STANDARD_HA tier: highly available primary/replica
  312. // instances
  313. Tier string `json:"tier,omitempty"`
  314. // ServerResponse contains the HTTP response code and headers from the
  315. // server.
  316. googleapi.ServerResponse `json:"-"`
  317. // ForceSendFields is a list of field names (e.g.
  318. // "AlternativeLocationId") to unconditionally include in API requests.
  319. // By default, fields with empty values are omitted from API requests.
  320. // However, any non-pointer, non-interface field appearing in
  321. // ForceSendFields will be sent to the server regardless of whether the
  322. // field is empty or not. This may be used to include empty fields in
  323. // Patch requests.
  324. ForceSendFields []string `json:"-"`
  325. // NullFields is a list of field names (e.g. "AlternativeLocationId") to
  326. // include in API requests with the JSON null value. By default, fields
  327. // with empty values are omitted from API requests. However, any field
  328. // with an empty value appearing in NullFields will be sent to the
  329. // server as null. It is an error if a field in this list has a
  330. // non-empty value. This may be used to include null fields in Patch
  331. // requests.
  332. NullFields []string `json:"-"`
  333. }
  334. func (s *Instance) MarshalJSON() ([]byte, error) {
  335. type NoMethod Instance
  336. raw := NoMethod(*s)
  337. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  338. }
  339. // ListInstancesResponse: Response for ListInstances.
  340. type ListInstancesResponse struct {
  341. // Instances: A list of Redis instances in the project in the specified
  342. // location,
  343. // or across all locations.
  344. //
  345. // If the `location_id` in the parent field of the request is "-", all
  346. // regions
  347. // available to the project are queried, and the results aggregated.
  348. // If in such an aggregated query a location is unavailable, a dummy
  349. // Redis
  350. // entry is included in the response with the "name" field set to a
  351. // value of
  352. // the form projects/{project_id}/locations/{location_id}/instances/-
  353. // and the
  354. // "status" field set to ERROR and "status_message" field set to
  355. // "location not
  356. // available for ListInstances".
  357. Instances []*Instance `json:"instances,omitempty"`
  358. // NextPageToken: Token to retrieve the next page of results, or empty
  359. // if there are no more
  360. // results in the list.
  361. NextPageToken string `json:"nextPageToken,omitempty"`
  362. // ServerResponse contains the HTTP response code and headers from the
  363. // server.
  364. googleapi.ServerResponse `json:"-"`
  365. // ForceSendFields is a list of field names (e.g. "Instances") to
  366. // unconditionally include in API requests. By default, fields with
  367. // empty values are omitted from API requests. However, any non-pointer,
  368. // non-interface field appearing in ForceSendFields will be sent to the
  369. // server regardless of whether the field is empty or not. This may be
  370. // used to include empty fields in Patch requests.
  371. ForceSendFields []string `json:"-"`
  372. // NullFields is a list of field names (e.g. "Instances") to include in
  373. // API requests with the JSON null value. By default, fields with empty
  374. // values are omitted from API requests. However, any field with an
  375. // empty value appearing in NullFields will be sent to the server as
  376. // null. It is an error if a field in this list has a non-empty value.
  377. // This may be used to include null fields in Patch requests.
  378. NullFields []string `json:"-"`
  379. }
  380. func (s *ListInstancesResponse) MarshalJSON() ([]byte, error) {
  381. type NoMethod ListInstancesResponse
  382. raw := NoMethod(*s)
  383. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  384. }
  385. // ListLocationsResponse: The response message for
  386. // Locations.ListLocations.
  387. type ListLocationsResponse struct {
  388. // Locations: A list of locations that matches the specified filter in
  389. // the request.
  390. Locations []*Location `json:"locations,omitempty"`
  391. // NextPageToken: The standard List next-page token.
  392. NextPageToken string `json:"nextPageToken,omitempty"`
  393. // ServerResponse contains the HTTP response code and headers from the
  394. // server.
  395. googleapi.ServerResponse `json:"-"`
  396. // ForceSendFields is a list of field names (e.g. "Locations") to
  397. // unconditionally include in API requests. By default, fields with
  398. // empty values are omitted from API requests. However, any non-pointer,
  399. // non-interface field appearing in ForceSendFields will be sent to the
  400. // server regardless of whether the field is empty or not. This may be
  401. // used to include empty fields in Patch requests.
  402. ForceSendFields []string `json:"-"`
  403. // NullFields is a list of field names (e.g. "Locations") to include in
  404. // API requests with the JSON null value. By default, fields with empty
  405. // values are omitted from API requests. However, any field with an
  406. // empty value appearing in NullFields will be sent to the server as
  407. // null. It is an error if a field in this list has a non-empty value.
  408. // This may be used to include null fields in Patch requests.
  409. NullFields []string `json:"-"`
  410. }
  411. func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) {
  412. type NoMethod ListLocationsResponse
  413. raw := NoMethod(*s)
  414. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  415. }
  416. // ListOperationsResponse: The response message for
  417. // Operations.ListOperations.
  418. type ListOperationsResponse struct {
  419. // NextPageToken: The standard List next-page token.
  420. NextPageToken string `json:"nextPageToken,omitempty"`
  421. // Operations: A list of operations that matches the specified filter in
  422. // the request.
  423. Operations []*Operation `json:"operations,omitempty"`
  424. // ServerResponse contains the HTTP response code and headers from the
  425. // server.
  426. googleapi.ServerResponse `json:"-"`
  427. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  428. // unconditionally include in API requests. By default, fields with
  429. // empty values are omitted from API requests. However, any non-pointer,
  430. // non-interface field appearing in ForceSendFields will be sent to the
  431. // server regardless of whether the field is empty or not. This may be
  432. // used to include empty fields in Patch requests.
  433. ForceSendFields []string `json:"-"`
  434. // NullFields is a list of field names (e.g. "NextPageToken") to include
  435. // in API requests with the JSON null value. By default, fields with
  436. // empty values are omitted from API requests. However, any field with
  437. // an empty value appearing in NullFields will be sent to the server as
  438. // null. It is an error if a field in this list has a non-empty value.
  439. // This may be used to include null fields in Patch requests.
  440. NullFields []string `json:"-"`
  441. }
  442. func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
  443. type NoMethod ListOperationsResponse
  444. raw := NoMethod(*s)
  445. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  446. }
  447. // Location: A resource that represents Google Cloud Platform location.
  448. type Location struct {
  449. // DisplayName: The friendly name for this location, typically a nearby
  450. // city name.
  451. // For example, "Tokyo".
  452. DisplayName string `json:"displayName,omitempty"`
  453. // Labels: Cross-service attributes for the location. For example
  454. //
  455. // {"cloud.googleapis.com/region": "us-east1"}
  456. Labels map[string]string `json:"labels,omitempty"`
  457. // LocationId: The canonical id for this location. For example:
  458. // "us-east1".
  459. LocationId string `json:"locationId,omitempty"`
  460. // Metadata: Service-specific metadata. For example the available
  461. // capacity at the given
  462. // location.
  463. Metadata googleapi.RawMessage `json:"metadata,omitempty"`
  464. // Name: Resource name for the location, which may vary between
  465. // implementations.
  466. // For example: "projects/example-project/locations/us-east1"
  467. Name string `json:"name,omitempty"`
  468. // ServerResponse contains the HTTP response code and headers from the
  469. // server.
  470. googleapi.ServerResponse `json:"-"`
  471. // ForceSendFields is a list of field names (e.g. "DisplayName") to
  472. // unconditionally include in API requests. By default, fields with
  473. // empty values are omitted from API requests. However, any non-pointer,
  474. // non-interface field appearing in ForceSendFields will be sent to the
  475. // server regardless of whether the field is empty or not. This may be
  476. // used to include empty fields in Patch requests.
  477. ForceSendFields []string `json:"-"`
  478. // NullFields is a list of field names (e.g. "DisplayName") to include
  479. // in API requests with the JSON null value. By default, fields with
  480. // empty values are omitted from API requests. However, any field with
  481. // an empty value appearing in NullFields will be sent to the server as
  482. // null. It is an error if a field in this list has a non-empty value.
  483. // This may be used to include null fields in Patch requests.
  484. NullFields []string `json:"-"`
  485. }
  486. func (s *Location) MarshalJSON() ([]byte, error) {
  487. type NoMethod Location
  488. raw := NoMethod(*s)
  489. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  490. }
  491. // LocationMetadata: This location metadata represents additional
  492. // configuration options for a
  493. // given location where a Redis instance may be created. All fields are
  494. // output
  495. // only. It is returned as content of
  496. // the
  497. // `google.cloud.location.Location.metadata` field.
  498. type LocationMetadata struct {
  499. // AvailableZones: Output only. The set of available zones in the
  500. // location. The map is keyed
  501. // by the lowercase ID of each zone, as defined by GCE. These keys can
  502. // be
  503. // specified in `location_id` or `alternative_location_id` fields
  504. // when
  505. // creating a Redis instance.
  506. AvailableZones map[string]ZoneMetadata `json:"availableZones,omitempty"`
  507. // ForceSendFields is a list of field names (e.g. "AvailableZones") to
  508. // unconditionally include in API requests. By default, fields with
  509. // empty values are omitted from API requests. However, any non-pointer,
  510. // non-interface field appearing in ForceSendFields will be sent to the
  511. // server regardless of whether the field is empty or not. This may be
  512. // used to include empty fields in Patch requests.
  513. ForceSendFields []string `json:"-"`
  514. // NullFields is a list of field names (e.g. "AvailableZones") to
  515. // include in API requests with the JSON null value. By default, fields
  516. // with empty values are omitted from API requests. However, any field
  517. // with an empty value appearing in NullFields will be sent to the
  518. // server as null. It is an error if a field in this list has a
  519. // non-empty value. This may be used to include null fields in Patch
  520. // requests.
  521. NullFields []string `json:"-"`
  522. }
  523. func (s *LocationMetadata) MarshalJSON() ([]byte, error) {
  524. type NoMethod LocationMetadata
  525. raw := NoMethod(*s)
  526. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  527. }
  528. // Operation: This resource represents a long-running operation that is
  529. // the result of a
  530. // network API call.
  531. type Operation struct {
  532. // Done: If the value is `false`, it means the operation is still in
  533. // progress.
  534. // If `true`, the operation is completed, and either `error` or
  535. // `response` is
  536. // available.
  537. Done bool `json:"done,omitempty"`
  538. // Error: The error result of the operation in case of failure or
  539. // cancellation.
  540. Error *Status `json:"error,omitempty"`
  541. // Metadata: Service-specific metadata associated with the operation.
  542. // It typically
  543. // contains progress information and common metadata such as create
  544. // time.
  545. // Some services might not provide such metadata. Any method that
  546. // returns a
  547. // long-running operation should document the metadata type, if any.
  548. Metadata googleapi.RawMessage `json:"metadata,omitempty"`
  549. // Name: The server-assigned name, which is only unique within the same
  550. // service that
  551. // originally returns it. If you use the default HTTP mapping,
  552. // the
  553. // `name` should have the format of `operations/some/unique/name`.
  554. Name string `json:"name,omitempty"`
  555. // Response: The normal response of the operation in case of success.
  556. // If the original
  557. // method returns no data on success, such as `Delete`, the response
  558. // is
  559. // `google.protobuf.Empty`. If the original method is
  560. // standard
  561. // `Get`/`Create`/`Update`, the response should be the resource. For
  562. // other
  563. // methods, the response should have the type `XxxResponse`, where
  564. // `Xxx`
  565. // is the original method name. For example, if the original method
  566. // name
  567. // is `TakeSnapshot()`, the inferred response type
  568. // is
  569. // `TakeSnapshotResponse`.
  570. Response googleapi.RawMessage `json:"response,omitempty"`
  571. // ServerResponse contains the HTTP response code and headers from the
  572. // server.
  573. googleapi.ServerResponse `json:"-"`
  574. // ForceSendFields is a list of field names (e.g. "Done") to
  575. // unconditionally include in API requests. By default, fields with
  576. // empty values are omitted from API requests. However, any non-pointer,
  577. // non-interface field appearing in ForceSendFields will be sent to the
  578. // server regardless of whether the field is empty or not. This may be
  579. // used to include empty fields in Patch requests.
  580. ForceSendFields []string `json:"-"`
  581. // NullFields is a list of field names (e.g. "Done") to include in API
  582. // requests with the JSON null value. By default, fields with empty
  583. // values are omitted from API requests. However, any field with an
  584. // empty value appearing in NullFields will be sent to the server as
  585. // null. It is an error if a field in this list has a non-empty value.
  586. // This may be used to include null fields in Patch requests.
  587. NullFields []string `json:"-"`
  588. }
  589. func (s *Operation) MarshalJSON() ([]byte, error) {
  590. type NoMethod Operation
  591. raw := NoMethod(*s)
  592. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  593. }
  594. // OperationMetadata: This operation metadata represents the state of
  595. // operations that may have
  596. // happened or are happening on the instance. All fields are output
  597. // only. It is
  598. // returned as content of the `google.longrunning.Operation.metadata`
  599. // field. The
  600. // `google.longrunning.Operation.name` field will be of the
  601. // form
  602. // `projects/{project_id}/locations/{location_id}/operations/{operat
  603. // ion_id}` and
  604. // the name for a `ListOperations` request will be of the
  605. // form
  606. // `projects/{project_id}/locations/{location_id}`
  607. //
  608. // On a ListOperations request where {location_id} is "-", all
  609. // regions
  610. // available to the {project_id} are queried and the results aggregated.
  611. // If a
  612. // location is not available, a dummy `google.longrunning.Operation`
  613. // entry will
  614. // be included in the `operations` field of the response, with the
  615. // `name` field
  616. // set to a value of the
  617. // form
  618. // `projects/{project_id}/locations/{location_id}/operations/-` and the
  619. // `done`
  620. // field will be set and the `result.error` field set with the `code`
  621. // field set
  622. // to `google.rpc.Code.DEADLINE_EXCEEDED` and the `message` field set
  623. // to
  624. // `location unavailable for ListOperations`. The Operation metadata`
  625. // field
  626. // will not be set for such a dummy operation.
  627. type OperationMetadata struct {
  628. // CreateTime: Output only. The time the operation was created.
  629. CreateTime string `json:"createTime,omitempty"`
  630. // Detail: Output only. Detailed operation progress, if available.
  631. Detail string `json:"detail,omitempty"`
  632. // EndTime: Output only. The time the operation was completed.
  633. EndTime string `json:"endTime,omitempty"`
  634. // OperationType: Output only. The operation type.
  635. //
  636. // Possible values:
  637. // "TYPE_UNSPECIFIED" - Not set.
  638. // "CREATE_REDIS_INSTANCE" - Redis instance is being created.
  639. // "UPDATE_REDIS_INSTANCE" - Redis instance is being updated.
  640. // "DELETE_REDIS_INSTANCE" - Redis instance is being deleted.
  641. // "REPAIR_REDIS_INSTANCE" - Redis instance is being repaired.
  642. // "MAINTENANCE_FOR_REDIS_INSTANCE" - Redis instance is being in
  643. // maintenance.
  644. OperationType string `json:"operationType,omitempty"`
  645. // StartTime: Output only. The time the operation was started.
  646. StartTime string `json:"startTime,omitempty"`
  647. // State: Output only. The current state of the operation.
  648. //
  649. // Possible values:
  650. // "STATUS_UNSPECIFIED" - Not set.
  651. // "PENDING" - The operation has been created.
  652. // "RUNNING" - The operation is currently running.
  653. // "FAILED" - The operation has failed or was cancelled.
  654. // "DONE" - The operation completed successfully.
  655. State string `json:"state,omitempty"`
  656. // Target: Output only. Server-defined resource path for the target of
  657. // the operation.
  658. Target string `json:"target,omitempty"`
  659. // ForceSendFields is a list of field names (e.g. "CreateTime") to
  660. // unconditionally include in API requests. By default, fields with
  661. // empty values are omitted from API requests. However, any non-pointer,
  662. // non-interface field appearing in ForceSendFields will be sent to the
  663. // server regardless of whether the field is empty or not. This may be
  664. // used to include empty fields in Patch requests.
  665. ForceSendFields []string `json:"-"`
  666. // NullFields is a list of field names (e.g. "CreateTime") to include in
  667. // API requests with the JSON null value. By default, fields with empty
  668. // values are omitted from API requests. However, any field with an
  669. // empty value appearing in NullFields will be sent to the server as
  670. // null. It is an error if a field in this list has a non-empty value.
  671. // This may be used to include null fields in Patch requests.
  672. NullFields []string `json:"-"`
  673. }
  674. func (s *OperationMetadata) MarshalJSON() ([]byte, error) {
  675. type NoMethod OperationMetadata
  676. raw := NoMethod(*s)
  677. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  678. }
  679. // Status: The `Status` type defines a logical error model that is
  680. // suitable for different
  681. // programming environments, including REST APIs and RPC APIs. It is
  682. // used by
  683. // [gRPC](https://github.com/grpc). The error model is designed to
  684. // be:
  685. //
  686. // - Simple to use and understand for most users
  687. // - Flexible enough to meet unexpected needs
  688. //
  689. // # Overview
  690. //
  691. // The `Status` message contains three pieces of data: error code, error
  692. // message,
  693. // and error details. The error code should be an enum value
  694. // of
  695. // google.rpc.Code, but it may accept additional error codes if needed.
  696. // The
  697. // error message should be a developer-facing English message that
  698. // helps
  699. // developers *understand* and *resolve* the error. If a localized
  700. // user-facing
  701. // error message is needed, put the localized message in the error
  702. // details or
  703. // localize it in the client. The optional error details may contain
  704. // arbitrary
  705. // information about the error. There is a predefined set of error
  706. // detail types
  707. // in the package `google.rpc` that can be used for common error
  708. // conditions.
  709. //
  710. // # Language mapping
  711. //
  712. // The `Status` message is the logical representation of the error
  713. // model, but it
  714. // is not necessarily the actual wire format. When the `Status` message
  715. // is
  716. // exposed in different client libraries and different wire protocols,
  717. // it can be
  718. // mapped differently. For example, it will likely be mapped to some
  719. // exceptions
  720. // in Java, but more likely mapped to some error codes in C.
  721. //
  722. // # Other uses
  723. //
  724. // The error model and the `Status` message can be used in a variety
  725. // of
  726. // environments, either with or without APIs, to provide a
  727. // consistent developer experience across different
  728. // environments.
  729. //
  730. // Example uses of this error model include:
  731. //
  732. // - Partial errors. If a service needs to return partial errors to the
  733. // client,
  734. // it may embed the `Status` in the normal response to indicate the
  735. // partial
  736. // errors.
  737. //
  738. // - Workflow errors. A typical workflow has multiple steps. Each step
  739. // may
  740. // have a `Status` message for error reporting.
  741. //
  742. // - Batch operations. If a client uses batch request and batch
  743. // response, the
  744. // `Status` message should be used directly inside batch response,
  745. // one for
  746. // each error sub-response.
  747. //
  748. // - Asynchronous operations. If an API call embeds asynchronous
  749. // operation
  750. // results in its response, the status of those operations should
  751. // be
  752. // represented directly using the `Status` message.
  753. //
  754. // - Logging. If some API errors are stored in logs, the message
  755. // `Status` could
  756. // be used directly after any stripping needed for security/privacy
  757. // reasons.
  758. type Status struct {
  759. // Code: The status code, which should be an enum value of
  760. // google.rpc.Code.
  761. Code int64 `json:"code,omitempty"`
  762. // Details: A list of messages that carry the error details. There is a
  763. // common set of
  764. // message types for APIs to use.
  765. Details []googleapi.RawMessage `json:"details,omitempty"`
  766. // Message: A developer-facing error message, which should be in
  767. // English. Any
  768. // user-facing error message should be localized and sent in
  769. // the
  770. // google.rpc.Status.details field, or localized by the client.
  771. Message string `json:"message,omitempty"`
  772. // ForceSendFields is a list of field names (e.g. "Code") to
  773. // unconditionally include in API requests. By default, fields with
  774. // empty values are omitted from API requests. However, any non-pointer,
  775. // non-interface field appearing in ForceSendFields will be sent to the
  776. // server regardless of whether the field is empty or not. This may be
  777. // used to include empty fields in Patch requests.
  778. ForceSendFields []string `json:"-"`
  779. // NullFields is a list of field names (e.g. "Code") to include in API
  780. // requests with the JSON null value. By default, fields with empty
  781. // values are omitted from API requests. However, any field with an
  782. // empty value appearing in NullFields will be sent to the server as
  783. // null. It is an error if a field in this list has a non-empty value.
  784. // This may be used to include null fields in Patch requests.
  785. NullFields []string `json:"-"`
  786. }
  787. func (s *Status) MarshalJSON() ([]byte, error) {
  788. type NoMethod Status
  789. raw := NoMethod(*s)
  790. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  791. }
  792. // ZoneMetadata: Defines specific information for a particular zone.
  793. // Currently empty and
  794. // reserved for future use only.
  795. type ZoneMetadata struct {
  796. }
  797. // method id "redis.projects.locations.get":
  798. type ProjectsLocationsGetCall struct {
  799. s *Service
  800. name string
  801. urlParams_ gensupport.URLParams
  802. ifNoneMatch_ string
  803. ctx_ context.Context
  804. header_ http.Header
  805. }
  806. // Get: Gets information about a location.
  807. func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall {
  808. c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  809. c.name = name
  810. return c
  811. }
  812. // Fields allows partial responses to be retrieved. See
  813. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  814. // for more information.
  815. func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall {
  816. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  817. return c
  818. }
  819. // IfNoneMatch sets the optional parameter which makes the operation
  820. // fail if the object's ETag matches the given value. This is useful for
  821. // getting updates only after the object has changed since the last
  822. // request. Use googleapi.IsNotModified to check whether the response
  823. // error from Do is the result of In-None-Match.
  824. func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall {
  825. c.ifNoneMatch_ = entityTag
  826. return c
  827. }
  828. // Context sets the context to be used in this call's Do method. Any
  829. // pending HTTP request will be aborted if the provided context is
  830. // canceled.
  831. func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall {
  832. c.ctx_ = ctx
  833. return c
  834. }
  835. // Header returns an http.Header that can be modified by the caller to
  836. // add HTTP headers to the request.
  837. func (c *ProjectsLocationsGetCall) Header() http.Header {
  838. if c.header_ == nil {
  839. c.header_ = make(http.Header)
  840. }
  841. return c.header_
  842. }
  843. func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
  844. reqHeaders := make(http.Header)
  845. for k, v := range c.header_ {
  846. reqHeaders[k] = v
  847. }
  848. reqHeaders.Set("User-Agent", c.s.userAgent())
  849. if c.ifNoneMatch_ != "" {
  850. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  851. }
  852. var body io.Reader = nil
  853. c.urlParams_.Set("alt", alt)
  854. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  855. urls += "?" + c.urlParams_.Encode()
  856. req, _ := http.NewRequest("GET", urls, body)
  857. req.Header = reqHeaders
  858. googleapi.Expand(req.URL, map[string]string{
  859. "name": c.name,
  860. })
  861. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  862. }
  863. // Do executes the "redis.projects.locations.get" call.
  864. // Exactly one of *Location or error will be non-nil. Any non-2xx status
  865. // code is an error. Response headers are in either
  866. // *Location.ServerResponse.Header or (if a response was returned at
  867. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  868. // to check whether the returned error was because
  869. // http.StatusNotModified was returned.
  870. func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
  871. gensupport.SetOptions(c.urlParams_, opts...)
  872. res, err := c.doRequest("json")
  873. if res != nil && res.StatusCode == http.StatusNotModified {
  874. if res.Body != nil {
  875. res.Body.Close()
  876. }
  877. return nil, &googleapi.Error{
  878. Code: res.StatusCode,
  879. Header: res.Header,
  880. }
  881. }
  882. if err != nil {
  883. return nil, err
  884. }
  885. defer googleapi.CloseBody(res)
  886. if err := googleapi.CheckResponse(res); err != nil {
  887. return nil, err
  888. }
  889. ret := &Location{
  890. ServerResponse: googleapi.ServerResponse{
  891. Header: res.Header,
  892. HTTPStatusCode: res.StatusCode,
  893. },
  894. }
  895. target := &ret
  896. if err := gensupport.DecodeResponse(target, res); err != nil {
  897. return nil, err
  898. }
  899. return ret, nil
  900. // {
  901. // "description": "Gets information about a location.",
  902. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}",
  903. // "httpMethod": "GET",
  904. // "id": "redis.projects.locations.get",
  905. // "parameterOrder": [
  906. // "name"
  907. // ],
  908. // "parameters": {
  909. // "name": {
  910. // "description": "Resource name for the location.",
  911. // "location": "path",
  912. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  913. // "required": true,
  914. // "type": "string"
  915. // }
  916. // },
  917. // "path": "v1beta1/{+name}",
  918. // "response": {
  919. // "$ref": "Location"
  920. // },
  921. // "scopes": [
  922. // "https://www.googleapis.com/auth/cloud-platform"
  923. // ]
  924. // }
  925. }
  926. // method id "redis.projects.locations.list":
  927. type ProjectsLocationsListCall struct {
  928. s *Service
  929. name string
  930. urlParams_ gensupport.URLParams
  931. ifNoneMatch_ string
  932. ctx_ context.Context
  933. header_ http.Header
  934. }
  935. // List: Lists information about the supported locations for this
  936. // service.
  937. func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall {
  938. c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  939. c.name = name
  940. return c
  941. }
  942. // Filter sets the optional parameter "filter": The standard list
  943. // filter.
  944. func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall {
  945. c.urlParams_.Set("filter", filter)
  946. return c
  947. }
  948. // PageSize sets the optional parameter "pageSize": The standard list
  949. // page size.
  950. func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall {
  951. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  952. return c
  953. }
  954. // PageToken sets the optional parameter "pageToken": The standard list
  955. // page token.
  956. func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall {
  957. c.urlParams_.Set("pageToken", pageToken)
  958. return c
  959. }
  960. // Fields allows partial responses to be retrieved. See
  961. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  962. // for more information.
  963. func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
  964. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  965. return c
  966. }
  967. // IfNoneMatch sets the optional parameter which makes the operation
  968. // fail if the object's ETag matches the given value. This is useful for
  969. // getting updates only after the object has changed since the last
  970. // request. Use googleapi.IsNotModified to check whether the response
  971. // error from Do is the result of In-None-Match.
  972. func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
  973. c.ifNoneMatch_ = entityTag
  974. return c
  975. }
  976. // Context sets the context to be used in this call's Do method. Any
  977. // pending HTTP request will be aborted if the provided context is
  978. // canceled.
  979. func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
  980. c.ctx_ = ctx
  981. return c
  982. }
  983. // Header returns an http.Header that can be modified by the caller to
  984. // add HTTP headers to the request.
  985. func (c *ProjectsLocationsListCall) Header() http.Header {
  986. if c.header_ == nil {
  987. c.header_ = make(http.Header)
  988. }
  989. return c.header_
  990. }
  991. func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
  992. reqHeaders := make(http.Header)
  993. for k, v := range c.header_ {
  994. reqHeaders[k] = v
  995. }
  996. reqHeaders.Set("User-Agent", c.s.userAgent())
  997. if c.ifNoneMatch_ != "" {
  998. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  999. }
  1000. var body io.Reader = nil
  1001. c.urlParams_.Set("alt", alt)
  1002. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/locations")
  1003. urls += "?" + c.urlParams_.Encode()
  1004. req, _ := http.NewRequest("GET", urls, body)
  1005. req.Header = reqHeaders
  1006. googleapi.Expand(req.URL, map[string]string{
  1007. "name": c.name,
  1008. })
  1009. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1010. }
  1011. // Do executes the "redis.projects.locations.list" call.
  1012. // Exactly one of *ListLocationsResponse or error will be non-nil. Any
  1013. // non-2xx status code is an error. Response headers are in either
  1014. // *ListLocationsResponse.ServerResponse.Header or (if a response was
  1015. // returned at all) in error.(*googleapi.Error).Header. Use
  1016. // googleapi.IsNotModified to check whether the returned error was
  1017. // because http.StatusNotModified was returned.
  1018. func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
  1019. gensupport.SetOptions(c.urlParams_, opts...)
  1020. res, err := c.doRequest("json")
  1021. if res != nil && res.StatusCode == http.StatusNotModified {
  1022. if res.Body != nil {
  1023. res.Body.Close()
  1024. }
  1025. return nil, &googleapi.Error{
  1026. Code: res.StatusCode,
  1027. Header: res.Header,
  1028. }
  1029. }
  1030. if err != nil {
  1031. return nil, err
  1032. }
  1033. defer googleapi.CloseBody(res)
  1034. if err := googleapi.CheckResponse(res); err != nil {
  1035. return nil, err
  1036. }
  1037. ret := &ListLocationsResponse{
  1038. ServerResponse: googleapi.ServerResponse{
  1039. Header: res.Header,
  1040. HTTPStatusCode: res.StatusCode,
  1041. },
  1042. }
  1043. target := &ret
  1044. if err := gensupport.DecodeResponse(target, res); err != nil {
  1045. return nil, err
  1046. }
  1047. return ret, nil
  1048. // {
  1049. // "description": "Lists information about the supported locations for this service.",
  1050. // "flatPath": "v1beta1/projects/{projectsId}/locations",
  1051. // "httpMethod": "GET",
  1052. // "id": "redis.projects.locations.list",
  1053. // "parameterOrder": [
  1054. // "name"
  1055. // ],
  1056. // "parameters": {
  1057. // "filter": {
  1058. // "description": "The standard list filter.",
  1059. // "location": "query",
  1060. // "type": "string"
  1061. // },
  1062. // "name": {
  1063. // "description": "The resource that owns the locations collection, if applicable.",
  1064. // "location": "path",
  1065. // "pattern": "^projects/[^/]+$",
  1066. // "required": true,
  1067. // "type": "string"
  1068. // },
  1069. // "pageSize": {
  1070. // "description": "The standard list page size.",
  1071. // "format": "int32",
  1072. // "location": "query",
  1073. // "type": "integer"
  1074. // },
  1075. // "pageToken": {
  1076. // "description": "The standard list page token.",
  1077. // "location": "query",
  1078. // "type": "string"
  1079. // }
  1080. // },
  1081. // "path": "v1beta1/{+name}/locations",
  1082. // "response": {
  1083. // "$ref": "ListLocationsResponse"
  1084. // },
  1085. // "scopes": [
  1086. // "https://www.googleapis.com/auth/cloud-platform"
  1087. // ]
  1088. // }
  1089. }
  1090. // Pages invokes f for each page of results.
  1091. // A non-nil error returned from f will halt the iteration.
  1092. // The provided context supersedes any context provided to the Context method.
  1093. func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
  1094. c.ctx_ = ctx
  1095. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1096. for {
  1097. x, err := c.Do()
  1098. if err != nil {
  1099. return err
  1100. }
  1101. if err := f(x); err != nil {
  1102. return err
  1103. }
  1104. if x.NextPageToken == "" {
  1105. return nil
  1106. }
  1107. c.PageToken(x.NextPageToken)
  1108. }
  1109. }
  1110. // method id "redis.projects.locations.instances.create":
  1111. type ProjectsLocationsInstancesCreateCall struct {
  1112. s *Service
  1113. parent string
  1114. instance *Instance
  1115. urlParams_ gensupport.URLParams
  1116. ctx_ context.Context
  1117. header_ http.Header
  1118. }
  1119. // Create: Creates a Redis instance based on the specified tier and
  1120. // memory size.
  1121. //
  1122. // By default, the instance is accessible from the project's
  1123. // [default
  1124. // network](/compute/docs/networks-and-firewalls#networks).
  1125. //
  1126. // The creation is executed asynchronously and callers may check the
  1127. // returned
  1128. // operation to track its progress. Once the operation is completed the
  1129. // Redis
  1130. // instance will be fully functional. Completed longrunning.Operation
  1131. // will
  1132. // contain the new instance object in the response field.
  1133. //
  1134. // The returned operation is automatically deleted after a few hours, so
  1135. // there
  1136. // is no need to call DeleteOperation.
  1137. func (r *ProjectsLocationsInstancesService) Create(parent string, instance *Instance) *ProjectsLocationsInstancesCreateCall {
  1138. c := &ProjectsLocationsInstancesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1139. c.parent = parent
  1140. c.instance = instance
  1141. return c
  1142. }
  1143. // InstanceId sets the optional parameter "instanceId": Required. The
  1144. // logical name of the Redis instance in the customer project
  1145. // with the following restrictions:
  1146. //
  1147. // * Must contain only lowercase letters, numbers, and hyphens.
  1148. // * Must start with a letter.
  1149. // * Must be between 1-40 characters.
  1150. // * Must end with a number or a letter.
  1151. // * Must be unique within the customer project / location
  1152. func (c *ProjectsLocationsInstancesCreateCall) InstanceId(instanceId string) *ProjectsLocationsInstancesCreateCall {
  1153. c.urlParams_.Set("instanceId", instanceId)
  1154. return c
  1155. }
  1156. // Fields allows partial responses to be retrieved. See
  1157. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1158. // for more information.
  1159. func (c *ProjectsLocationsInstancesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesCreateCall {
  1160. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1161. return c
  1162. }
  1163. // Context sets the context to be used in this call's Do method. Any
  1164. // pending HTTP request will be aborted if the provided context is
  1165. // canceled.
  1166. func (c *ProjectsLocationsInstancesCreateCall) Context(ctx context.Context) *ProjectsLocationsInstancesCreateCall {
  1167. c.ctx_ = ctx
  1168. return c
  1169. }
  1170. // Header returns an http.Header that can be modified by the caller to
  1171. // add HTTP headers to the request.
  1172. func (c *ProjectsLocationsInstancesCreateCall) Header() http.Header {
  1173. if c.header_ == nil {
  1174. c.header_ = make(http.Header)
  1175. }
  1176. return c.header_
  1177. }
  1178. func (c *ProjectsLocationsInstancesCreateCall) doRequest(alt string) (*http.Response, error) {
  1179. reqHeaders := make(http.Header)
  1180. for k, v := range c.header_ {
  1181. reqHeaders[k] = v
  1182. }
  1183. reqHeaders.Set("User-Agent", c.s.userAgent())
  1184. var body io.Reader = nil
  1185. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance)
  1186. if err != nil {
  1187. return nil, err
  1188. }
  1189. reqHeaders.Set("Content-Type", "application/json")
  1190. c.urlParams_.Set("alt", alt)
  1191. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/instances")
  1192. urls += "?" + c.urlParams_.Encode()
  1193. req, _ := http.NewRequest("POST", urls, body)
  1194. req.Header = reqHeaders
  1195. googleapi.Expand(req.URL, map[string]string{
  1196. "parent": c.parent,
  1197. })
  1198. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1199. }
  1200. // Do executes the "redis.projects.locations.instances.create" call.
  1201. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  1202. // status code is an error. Response headers are in either
  1203. // *Operation.ServerResponse.Header or (if a response was returned at
  1204. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1205. // to check whether the returned error was because
  1206. // http.StatusNotModified was returned.
  1207. func (c *ProjectsLocationsInstancesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1208. gensupport.SetOptions(c.urlParams_, opts...)
  1209. res, err := c.doRequest("json")
  1210. if res != nil && res.StatusCode == http.StatusNotModified {
  1211. if res.Body != nil {
  1212. res.Body.Close()
  1213. }
  1214. return nil, &googleapi.Error{
  1215. Code: res.StatusCode,
  1216. Header: res.Header,
  1217. }
  1218. }
  1219. if err != nil {
  1220. return nil, err
  1221. }
  1222. defer googleapi.CloseBody(res)
  1223. if err := googleapi.CheckResponse(res); err != nil {
  1224. return nil, err
  1225. }
  1226. ret := &Operation{
  1227. ServerResponse: googleapi.ServerResponse{
  1228. Header: res.Header,
  1229. HTTPStatusCode: res.StatusCode,
  1230. },
  1231. }
  1232. target := &ret
  1233. if err := gensupport.DecodeResponse(target, res); err != nil {
  1234. return nil, err
  1235. }
  1236. return ret, nil
  1237. // {
  1238. // "description": "Creates a Redis instance based on the specified tier and memory size.\n\nBy default, the instance is accessible from the project's\n[default network](/compute/docs/networks-and-firewalls#networks).\n\nThe creation is executed asynchronously and callers may check the returned\noperation to track its progress. Once the operation is completed the Redis\ninstance will be fully functional. Completed longrunning.Operation will\ncontain the new instance object in the response field.\n\nThe returned operation is automatically deleted after a few hours, so there\nis no need to call DeleteOperation.",
  1239. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/instances",
  1240. // "httpMethod": "POST",
  1241. // "id": "redis.projects.locations.instances.create",
  1242. // "parameterOrder": [
  1243. // "parent"
  1244. // ],
  1245. // "parameters": {
  1246. // "instanceId": {
  1247. // "description": "Required. The logical name of the Redis instance in the customer project\nwith the following restrictions:\n\n* Must contain only lowercase letters, numbers, and hyphens.\n* Must start with a letter.\n* Must be between 1-40 characters.\n* Must end with a number or a letter.\n* Must be unique within the customer project / location",
  1248. // "location": "query",
  1249. // "type": "string"
  1250. // },
  1251. // "parent": {
  1252. // "description": "Required. The resource name of the instance location using the form:\n `projects/{project_id}/locations/{location_id}`\nwhere `location_id` refers to a GCP region",
  1253. // "location": "path",
  1254. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  1255. // "required": true,
  1256. // "type": "string"
  1257. // }
  1258. // },
  1259. // "path": "v1beta1/{+parent}/instances",
  1260. // "request": {
  1261. // "$ref": "Instance"
  1262. // },
  1263. // "response": {
  1264. // "$ref": "Operation"
  1265. // },
  1266. // "scopes": [
  1267. // "https://www.googleapis.com/auth/cloud-platform"
  1268. // ]
  1269. // }
  1270. }
  1271. // method id "redis.projects.locations.instances.delete":
  1272. type ProjectsLocationsInstancesDeleteCall struct {
  1273. s *Service
  1274. name string
  1275. urlParams_ gensupport.URLParams
  1276. ctx_ context.Context
  1277. header_ http.Header
  1278. }
  1279. // Delete: Deletes a specific Redis instance. Instance stops serving
  1280. // and data is
  1281. // deleted.
  1282. func (r *ProjectsLocationsInstancesService) Delete(name string) *ProjectsLocationsInstancesDeleteCall {
  1283. c := &ProjectsLocationsInstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1284. c.name = name
  1285. return c
  1286. }
  1287. // Fields allows partial responses to be retrieved. See
  1288. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1289. // for more information.
  1290. func (c *ProjectsLocationsInstancesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesDeleteCall {
  1291. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1292. return c
  1293. }
  1294. // Context sets the context to be used in this call's Do method. Any
  1295. // pending HTTP request will be aborted if the provided context is
  1296. // canceled.
  1297. func (c *ProjectsLocationsInstancesDeleteCall) Context(ctx context.Context) *ProjectsLocationsInstancesDeleteCall {
  1298. c.ctx_ = ctx
  1299. return c
  1300. }
  1301. // Header returns an http.Header that can be modified by the caller to
  1302. // add HTTP headers to the request.
  1303. func (c *ProjectsLocationsInstancesDeleteCall) Header() http.Header {
  1304. if c.header_ == nil {
  1305. c.header_ = make(http.Header)
  1306. }
  1307. return c.header_
  1308. }
  1309. func (c *ProjectsLocationsInstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
  1310. reqHeaders := make(http.Header)
  1311. for k, v := range c.header_ {
  1312. reqHeaders[k] = v
  1313. }
  1314. reqHeaders.Set("User-Agent", c.s.userAgent())
  1315. var body io.Reader = nil
  1316. c.urlParams_.Set("alt", alt)
  1317. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  1318. urls += "?" + c.urlParams_.Encode()
  1319. req, _ := http.NewRequest("DELETE", urls, body)
  1320. req.Header = reqHeaders
  1321. googleapi.Expand(req.URL, map[string]string{
  1322. "name": c.name,
  1323. })
  1324. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1325. }
  1326. // Do executes the "redis.projects.locations.instances.delete" call.
  1327. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  1328. // status code is an error. Response headers are in either
  1329. // *Operation.ServerResponse.Header or (if a response was returned at
  1330. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1331. // to check whether the returned error was because
  1332. // http.StatusNotModified was returned.
  1333. func (c *ProjectsLocationsInstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1334. gensupport.SetOptions(c.urlParams_, opts...)
  1335. res, err := c.doRequest("json")
  1336. if res != nil && res.StatusCode == http.StatusNotModified {
  1337. if res.Body != nil {
  1338. res.Body.Close()
  1339. }
  1340. return nil, &googleapi.Error{
  1341. Code: res.StatusCode,
  1342. Header: res.Header,
  1343. }
  1344. }
  1345. if err != nil {
  1346. return nil, err
  1347. }
  1348. defer googleapi.CloseBody(res)
  1349. if err := googleapi.CheckResponse(res); err != nil {
  1350. return nil, err
  1351. }
  1352. ret := &Operation{
  1353. ServerResponse: googleapi.ServerResponse{
  1354. Header: res.Header,
  1355. HTTPStatusCode: res.StatusCode,
  1356. },
  1357. }
  1358. target := &ret
  1359. if err := gensupport.DecodeResponse(target, res); err != nil {
  1360. return nil, err
  1361. }
  1362. return ret, nil
  1363. // {
  1364. // "description": "Deletes a specific Redis instance. Instance stops serving and data is\ndeleted.",
  1365. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/instances/{instancesId}",
  1366. // "httpMethod": "DELETE",
  1367. // "id": "redis.projects.locations.instances.delete",
  1368. // "parameterOrder": [
  1369. // "name"
  1370. // ],
  1371. // "parameters": {
  1372. // "name": {
  1373. // "description": "Required. Redis instance resource name using the form:\n `projects/{project_id}/locations/{location_id}/instances/{instance_id}`\nwhere `location_id` refers to a GCP region",
  1374. // "location": "path",
  1375. // "pattern": "^projects/[^/]+/locations/[^/]+/instances/[^/]+$",
  1376. // "required": true,
  1377. // "type": "string"
  1378. // }
  1379. // },
  1380. // "path": "v1beta1/{+name}",
  1381. // "response": {
  1382. // "$ref": "Operation"
  1383. // },
  1384. // "scopes": [
  1385. // "https://www.googleapis.com/auth/cloud-platform"
  1386. // ]
  1387. // }
  1388. }
  1389. // method id "redis.projects.locations.instances.get":
  1390. type ProjectsLocationsInstancesGetCall struct {
  1391. s *Service
  1392. name string
  1393. urlParams_ gensupport.URLParams
  1394. ifNoneMatch_ string
  1395. ctx_ context.Context
  1396. header_ http.Header
  1397. }
  1398. // Get: Gets the details of a specific Redis instance.
  1399. func (r *ProjectsLocationsInstancesService) Get(name string) *ProjectsLocationsInstancesGetCall {
  1400. c := &ProjectsLocationsInstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1401. c.name = name
  1402. return c
  1403. }
  1404. // Fields allows partial responses to be retrieved. See
  1405. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1406. // for more information.
  1407. func (c *ProjectsLocationsInstancesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesGetCall {
  1408. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1409. return c
  1410. }
  1411. // IfNoneMatch sets the optional parameter which makes the operation
  1412. // fail if the object's ETag matches the given value. This is useful for
  1413. // getting updates only after the object has changed since the last
  1414. // request. Use googleapi.IsNotModified to check whether the response
  1415. // error from Do is the result of In-None-Match.
  1416. func (c *ProjectsLocationsInstancesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsInstancesGetCall {
  1417. c.ifNoneMatch_ = entityTag
  1418. return c
  1419. }
  1420. // Context sets the context to be used in this call's Do method. Any
  1421. // pending HTTP request will be aborted if the provided context is
  1422. // canceled.
  1423. func (c *ProjectsLocationsInstancesGetCall) Context(ctx context.Context) *ProjectsLocationsInstancesGetCall {
  1424. c.ctx_ = ctx
  1425. return c
  1426. }
  1427. // Header returns an http.Header that can be modified by the caller to
  1428. // add HTTP headers to the request.
  1429. func (c *ProjectsLocationsInstancesGetCall) Header() http.Header {
  1430. if c.header_ == nil {
  1431. c.header_ = make(http.Header)
  1432. }
  1433. return c.header_
  1434. }
  1435. func (c *ProjectsLocationsInstancesGetCall) doRequest(alt string) (*http.Response, error) {
  1436. reqHeaders := make(http.Header)
  1437. for k, v := range c.header_ {
  1438. reqHeaders[k] = v
  1439. }
  1440. reqHeaders.Set("User-Agent", c.s.userAgent())
  1441. if c.ifNoneMatch_ != "" {
  1442. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1443. }
  1444. var body io.Reader = nil
  1445. c.urlParams_.Set("alt", alt)
  1446. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  1447. urls += "?" + c.urlParams_.Encode()
  1448. req, _ := http.NewRequest("GET", urls, body)
  1449. req.Header = reqHeaders
  1450. googleapi.Expand(req.URL, map[string]string{
  1451. "name": c.name,
  1452. })
  1453. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1454. }
  1455. // Do executes the "redis.projects.locations.instances.get" call.
  1456. // Exactly one of *Instance or error will be non-nil. Any non-2xx status
  1457. // code is an error. Response headers are in either
  1458. // *Instance.ServerResponse.Header or (if a response was returned at
  1459. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1460. // to check whether the returned error was because
  1461. // http.StatusNotModified was returned.
  1462. func (c *ProjectsLocationsInstancesGetCall) Do(opts ...googleapi.CallOption) (*Instance, error) {
  1463. gensupport.SetOptions(c.urlParams_, opts...)
  1464. res, err := c.doRequest("json")
  1465. if res != nil && res.StatusCode == http.StatusNotModified {
  1466. if res.Body != nil {
  1467. res.Body.Close()
  1468. }
  1469. return nil, &googleapi.Error{
  1470. Code: res.StatusCode,
  1471. Header: res.Header,
  1472. }
  1473. }
  1474. if err != nil {
  1475. return nil, err
  1476. }
  1477. defer googleapi.CloseBody(res)
  1478. if err := googleapi.CheckResponse(res); err != nil {
  1479. return nil, err
  1480. }
  1481. ret := &Instance{
  1482. ServerResponse: googleapi.ServerResponse{
  1483. Header: res.Header,
  1484. HTTPStatusCode: res.StatusCode,
  1485. },
  1486. }
  1487. target := &ret
  1488. if err := gensupport.DecodeResponse(target, res); err != nil {
  1489. return nil, err
  1490. }
  1491. return ret, nil
  1492. // {
  1493. // "description": "Gets the details of a specific Redis instance.",
  1494. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/instances/{instancesId}",
  1495. // "httpMethod": "GET",
  1496. // "id": "redis.projects.locations.instances.get",
  1497. // "parameterOrder": [
  1498. // "name"
  1499. // ],
  1500. // "parameters": {
  1501. // "name": {
  1502. // "description": "Required. Redis instance resource name using the form:\n `projects/{project_id}/locations/{location_id}/instances/{instance_id}`\nwhere `location_id` refers to a GCP region",
  1503. // "location": "path",
  1504. // "pattern": "^projects/[^/]+/locations/[^/]+/instances/[^/]+$",
  1505. // "required": true,
  1506. // "type": "string"
  1507. // }
  1508. // },
  1509. // "path": "v1beta1/{+name}",
  1510. // "response": {
  1511. // "$ref": "Instance"
  1512. // },
  1513. // "scopes": [
  1514. // "https://www.googleapis.com/auth/cloud-platform"
  1515. // ]
  1516. // }
  1517. }
  1518. // method id "redis.projects.locations.instances.list":
  1519. type ProjectsLocationsInstancesListCall struct {
  1520. s *Service
  1521. parent string
  1522. urlParams_ gensupport.URLParams
  1523. ifNoneMatch_ string
  1524. ctx_ context.Context
  1525. header_ http.Header
  1526. }
  1527. // List: Lists all Redis instances owned by a project in either the
  1528. // specified
  1529. // location (region) or all locations.
  1530. //
  1531. // The location should have the following format:
  1532. // * `projects/{project_id}/locations/{location_id}`
  1533. //
  1534. // If `location_id` is specified as `-` (wildcard), then all
  1535. // regions
  1536. // available to the project are queried, and the results are aggregated.
  1537. func (r *ProjectsLocationsInstancesService) List(parent string) *ProjectsLocationsInstancesListCall {
  1538. c := &ProjectsLocationsInstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1539. c.parent = parent
  1540. return c
  1541. }
  1542. // PageSize sets the optional parameter "pageSize": The maximum number
  1543. // of items to return.
  1544. //
  1545. // If not specified, a default value of 1000 will be used by the
  1546. // service.
  1547. // Regardless of the page_size value, the response may include a partial
  1548. // list
  1549. // and a caller should only rely on response's
  1550. // next_page_token
  1551. // to determine if there are more instances left to be queried.
  1552. func (c *ProjectsLocationsInstancesListCall) PageSize(pageSize int64) *ProjectsLocationsInstancesListCall {
  1553. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1554. return c
  1555. }
  1556. // PageToken sets the optional parameter "pageToken": The
  1557. // next_page_token value returned from a previous List request,
  1558. // if any.
  1559. func (c *ProjectsLocationsInstancesListCall) PageToken(pageToken string) *ProjectsLocationsInstancesListCall {
  1560. c.urlParams_.Set("pageToken", pageToken)
  1561. return c
  1562. }
  1563. // Fields allows partial responses to be retrieved. See
  1564. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1565. // for more information.
  1566. func (c *ProjectsLocationsInstancesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesListCall {
  1567. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1568. return c
  1569. }
  1570. // IfNoneMatch sets the optional parameter which makes the operation
  1571. // fail if the object's ETag matches the given value. This is useful for
  1572. // getting updates only after the object has changed since the last
  1573. // request. Use googleapi.IsNotModified to check whether the response
  1574. // error from Do is the result of In-None-Match.
  1575. func (c *ProjectsLocationsInstancesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsInstancesListCall {
  1576. c.ifNoneMatch_ = entityTag
  1577. return c
  1578. }
  1579. // Context sets the context to be used in this call's Do method. Any
  1580. // pending HTTP request will be aborted if the provided context is
  1581. // canceled.
  1582. func (c *ProjectsLocationsInstancesListCall) Context(ctx context.Context) *ProjectsLocationsInstancesListCall {
  1583. c.ctx_ = ctx
  1584. return c
  1585. }
  1586. // Header returns an http.Header that can be modified by the caller to
  1587. // add HTTP headers to the request.
  1588. func (c *ProjectsLocationsInstancesListCall) Header() http.Header {
  1589. if c.header_ == nil {
  1590. c.header_ = make(http.Header)
  1591. }
  1592. return c.header_
  1593. }
  1594. func (c *ProjectsLocationsInstancesListCall) doRequest(alt string) (*http.Response, error) {
  1595. reqHeaders := make(http.Header)
  1596. for k, v := range c.header_ {
  1597. reqHeaders[k] = v
  1598. }
  1599. reqHeaders.Set("User-Agent", c.s.userAgent())
  1600. if c.ifNoneMatch_ != "" {
  1601. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1602. }
  1603. var body io.Reader = nil
  1604. c.urlParams_.Set("alt", alt)
  1605. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/instances")
  1606. urls += "?" + c.urlParams_.Encode()
  1607. req, _ := http.NewRequest("GET", urls, body)
  1608. req.Header = reqHeaders
  1609. googleapi.Expand(req.URL, map[string]string{
  1610. "parent": c.parent,
  1611. })
  1612. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1613. }
  1614. // Do executes the "redis.projects.locations.instances.list" call.
  1615. // Exactly one of *ListInstancesResponse or error will be non-nil. Any
  1616. // non-2xx status code is an error. Response headers are in either
  1617. // *ListInstancesResponse.ServerResponse.Header or (if a response was
  1618. // returned at all) in error.(*googleapi.Error).Header. Use
  1619. // googleapi.IsNotModified to check whether the returned error was
  1620. // because http.StatusNotModified was returned.
  1621. func (c *ProjectsLocationsInstancesListCall) Do(opts ...googleapi.CallOption) (*ListInstancesResponse, error) {
  1622. gensupport.SetOptions(c.urlParams_, opts...)
  1623. res, err := c.doRequest("json")
  1624. if res != nil && res.StatusCode == http.StatusNotModified {
  1625. if res.Body != nil {
  1626. res.Body.Close()
  1627. }
  1628. return nil, &googleapi.Error{
  1629. Code: res.StatusCode,
  1630. Header: res.Header,
  1631. }
  1632. }
  1633. if err != nil {
  1634. return nil, err
  1635. }
  1636. defer googleapi.CloseBody(res)
  1637. if err := googleapi.CheckResponse(res); err != nil {
  1638. return nil, err
  1639. }
  1640. ret := &ListInstancesResponse{
  1641. ServerResponse: googleapi.ServerResponse{
  1642. Header: res.Header,
  1643. HTTPStatusCode: res.StatusCode,
  1644. },
  1645. }
  1646. target := &ret
  1647. if err := gensupport.DecodeResponse(target, res); err != nil {
  1648. return nil, err
  1649. }
  1650. return ret, nil
  1651. // {
  1652. // "description": "Lists all Redis instances owned by a project in either the specified\nlocation (region) or all locations.\n\nThe location should have the following format:\n* `projects/{project_id}/locations/{location_id}`\n\nIf `location_id` is specified as `-` (wildcard), then all regions\navailable to the project are queried, and the results are aggregated.",
  1653. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/instances",
  1654. // "httpMethod": "GET",
  1655. // "id": "redis.projects.locations.instances.list",
  1656. // "parameterOrder": [
  1657. // "parent"
  1658. // ],
  1659. // "parameters": {
  1660. // "pageSize": {
  1661. // "description": "The maximum number of items to return.\n\nIf not specified, a default value of 1000 will be used by the service.\nRegardless of the page_size value, the response may include a partial list\nand a caller should only rely on response's\nnext_page_token\nto determine if there are more instances left to be queried.",
  1662. // "format": "int32",
  1663. // "location": "query",
  1664. // "type": "integer"
  1665. // },
  1666. // "pageToken": {
  1667. // "description": "The next_page_token value returned from a previous List request,\nif any.",
  1668. // "location": "query",
  1669. // "type": "string"
  1670. // },
  1671. // "parent": {
  1672. // "description": "Required. The resource name of the instance location using the form:\n `projects/{project_id}/locations/{location_id}`\nwhere `location_id` refers to a GCP region",
  1673. // "location": "path",
  1674. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  1675. // "required": true,
  1676. // "type": "string"
  1677. // }
  1678. // },
  1679. // "path": "v1beta1/{+parent}/instances",
  1680. // "response": {
  1681. // "$ref": "ListInstancesResponse"
  1682. // },
  1683. // "scopes": [
  1684. // "https://www.googleapis.com/auth/cloud-platform"
  1685. // ]
  1686. // }
  1687. }
  1688. // Pages invokes f for each page of results.
  1689. // A non-nil error returned from f will halt the iteration.
  1690. // The provided context supersedes any context provided to the Context method.
  1691. func (c *ProjectsLocationsInstancesListCall) Pages(ctx context.Context, f func(*ListInstancesResponse) error) error {
  1692. c.ctx_ = ctx
  1693. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1694. for {
  1695. x, err := c.Do()
  1696. if err != nil {
  1697. return err
  1698. }
  1699. if err := f(x); err != nil {
  1700. return err
  1701. }
  1702. if x.NextPageToken == "" {
  1703. return nil
  1704. }
  1705. c.PageToken(x.NextPageToken)
  1706. }
  1707. }
  1708. // method id "redis.projects.locations.instances.patch":
  1709. type ProjectsLocationsInstancesPatchCall struct {
  1710. s *Service
  1711. name string
  1712. instance *Instance
  1713. urlParams_ gensupport.URLParams
  1714. ctx_ context.Context
  1715. header_ http.Header
  1716. }
  1717. // Patch: Updates the metadata and configuration of a specific Redis
  1718. // instance.
  1719. //
  1720. // Completed longrunning.Operation will contain the new instance
  1721. // object
  1722. // in the response field. The returned operation is automatically
  1723. // deleted
  1724. // after a few hours, so there is no need to call DeleteOperation.
  1725. func (r *ProjectsLocationsInstancesService) Patch(name string, instance *Instance) *ProjectsLocationsInstancesPatchCall {
  1726. c := &ProjectsLocationsInstancesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1727. c.name = name
  1728. c.instance = instance
  1729. return c
  1730. }
  1731. // UpdateMask sets the optional parameter "updateMask": Required. Mask
  1732. // of fields to update. At least one path must be supplied in
  1733. // this field. The elements of the repeated paths field may only include
  1734. // these
  1735. // fields from Instance:
  1736. //
  1737. // * `displayName`
  1738. // * `labels`
  1739. // * `memorySizeGb`
  1740. // * `redisConfig`
  1741. func (c *ProjectsLocationsInstancesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsInstancesPatchCall {
  1742. c.urlParams_.Set("updateMask", updateMask)
  1743. return c
  1744. }
  1745. // Fields allows partial responses to be retrieved. See
  1746. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1747. // for more information.
  1748. func (c *ProjectsLocationsInstancesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesPatchCall {
  1749. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1750. return c
  1751. }
  1752. // Context sets the context to be used in this call's Do method. Any
  1753. // pending HTTP request will be aborted if the provided context is
  1754. // canceled.
  1755. func (c *ProjectsLocationsInstancesPatchCall) Context(ctx context.Context) *ProjectsLocationsInstancesPatchCall {
  1756. c.ctx_ = ctx
  1757. return c
  1758. }
  1759. // Header returns an http.Header that can be modified by the caller to
  1760. // add HTTP headers to the request.
  1761. func (c *ProjectsLocationsInstancesPatchCall) Header() http.Header {
  1762. if c.header_ == nil {
  1763. c.header_ = make(http.Header)
  1764. }
  1765. return c.header_
  1766. }
  1767. func (c *ProjectsLocationsInstancesPatchCall) doRequest(alt string) (*http.Response, error) {
  1768. reqHeaders := make(http.Header)
  1769. for k, v := range c.header_ {
  1770. reqHeaders[k] = v
  1771. }
  1772. reqHeaders.Set("User-Agent", c.s.userAgent())
  1773. var body io.Reader = nil
  1774. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance)
  1775. if err != nil {
  1776. return nil, err
  1777. }
  1778. reqHeaders.Set("Content-Type", "application/json")
  1779. c.urlParams_.Set("alt", alt)
  1780. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  1781. urls += "?" + c.urlParams_.Encode()
  1782. req, _ := http.NewRequest("PATCH", urls, body)
  1783. req.Header = reqHeaders
  1784. googleapi.Expand(req.URL, map[string]string{
  1785. "name": c.name,
  1786. })
  1787. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1788. }
  1789. // Do executes the "redis.projects.locations.instances.patch" call.
  1790. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  1791. // status code is an error. Response headers are in either
  1792. // *Operation.ServerResponse.Header or (if a response was returned at
  1793. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1794. // to check whether the returned error was because
  1795. // http.StatusNotModified was returned.
  1796. func (c *ProjectsLocationsInstancesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1797. gensupport.SetOptions(c.urlParams_, opts...)
  1798. res, err := c.doRequest("json")
  1799. if res != nil && res.StatusCode == http.StatusNotModified {
  1800. if res.Body != nil {
  1801. res.Body.Close()
  1802. }
  1803. return nil, &googleapi.Error{
  1804. Code: res.StatusCode,
  1805. Header: res.Header,
  1806. }
  1807. }
  1808. if err != nil {
  1809. return nil, err
  1810. }
  1811. defer googleapi.CloseBody(res)
  1812. if err := googleapi.CheckResponse(res); err != nil {
  1813. return nil, err
  1814. }
  1815. ret := &Operation{
  1816. ServerResponse: googleapi.ServerResponse{
  1817. Header: res.Header,
  1818. HTTPStatusCode: res.StatusCode,
  1819. },
  1820. }
  1821. target := &ret
  1822. if err := gensupport.DecodeResponse(target, res); err != nil {
  1823. return nil, err
  1824. }
  1825. return ret, nil
  1826. // {
  1827. // "description": "Updates the metadata and configuration of a specific Redis instance.\n\nCompleted longrunning.Operation will contain the new instance object\nin the response field. The returned operation is automatically deleted\nafter a few hours, so there is no need to call DeleteOperation.",
  1828. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/instances/{instancesId}",
  1829. // "httpMethod": "PATCH",
  1830. // "id": "redis.projects.locations.instances.patch",
  1831. // "parameterOrder": [
  1832. // "name"
  1833. // ],
  1834. // "parameters": {
  1835. // "name": {
  1836. // "description": "Required. Unique name of the resource in this scope including project and\nlocation using the form:\n `projects/{project_id}/locations/{location_id}/instances/{instance_id}`\n\nNote: Redis instances are managed and addressed at regional level so\nlocation_id here refers to a GCP region; however, users may choose which\nspecific zone (or collection of zones for cross-zone instances) an instance\nshould be provisioned in. Refer to [location_id] and\n[alternative_location_id] fields for more details.",
  1837. // "location": "path",
  1838. // "pattern": "^projects/[^/]+/locations/[^/]+/instances/[^/]+$",
  1839. // "required": true,
  1840. // "type": "string"
  1841. // },
  1842. // "updateMask": {
  1843. // "description": "Required. Mask of fields to update. At least one path must be supplied in\nthis field. The elements of the repeated paths field may only include these\nfields from Instance:\n\n * `displayName`\n * `labels`\n * `memorySizeGb`\n * `redisConfig`",
  1844. // "format": "google-fieldmask",
  1845. // "location": "query",
  1846. // "type": "string"
  1847. // }
  1848. // },
  1849. // "path": "v1beta1/{+name}",
  1850. // "request": {
  1851. // "$ref": "Instance"
  1852. // },
  1853. // "response": {
  1854. // "$ref": "Operation"
  1855. // },
  1856. // "scopes": [
  1857. // "https://www.googleapis.com/auth/cloud-platform"
  1858. // ]
  1859. // }
  1860. }
  1861. // method id "redis.projects.locations.operations.get":
  1862. type ProjectsLocationsOperationsGetCall struct {
  1863. s *Service
  1864. name string
  1865. urlParams_ gensupport.URLParams
  1866. ifNoneMatch_ string
  1867. ctx_ context.Context
  1868. header_ http.Header
  1869. }
  1870. // Get: Gets the latest state of a long-running operation. Clients can
  1871. // use this
  1872. // method to poll the operation result at intervals as recommended by
  1873. // the API
  1874. // service.
  1875. func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall {
  1876. c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1877. c.name = name
  1878. return c
  1879. }
  1880. // Fields allows partial responses to be retrieved. See
  1881. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1882. // for more information.
  1883. func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall {
  1884. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1885. return c
  1886. }
  1887. // IfNoneMatch sets the optional parameter which makes the operation
  1888. // fail if the object's ETag matches the given value. This is useful for
  1889. // getting updates only after the object has changed since the last
  1890. // request. Use googleapi.IsNotModified to check whether the response
  1891. // error from Do is the result of In-None-Match.
  1892. func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall {
  1893. c.ifNoneMatch_ = entityTag
  1894. return c
  1895. }
  1896. // Context sets the context to be used in this call's Do method. Any
  1897. // pending HTTP request will be aborted if the provided context is
  1898. // canceled.
  1899. func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall {
  1900. c.ctx_ = ctx
  1901. return c
  1902. }
  1903. // Header returns an http.Header that can be modified by the caller to
  1904. // add HTTP headers to the request.
  1905. func (c *ProjectsLocationsOperationsGetCall) Header() http.Header {
  1906. if c.header_ == nil {
  1907. c.header_ = make(http.Header)
  1908. }
  1909. return c.header_
  1910. }
  1911. func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  1912. reqHeaders := make(http.Header)
  1913. for k, v := range c.header_ {
  1914. reqHeaders[k] = v
  1915. }
  1916. reqHeaders.Set("User-Agent", c.s.userAgent())
  1917. if c.ifNoneMatch_ != "" {
  1918. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1919. }
  1920. var body io.Reader = nil
  1921. c.urlParams_.Set("alt", alt)
  1922. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  1923. urls += "?" + c.urlParams_.Encode()
  1924. req, _ := http.NewRequest("GET", urls, body)
  1925. req.Header = reqHeaders
  1926. googleapi.Expand(req.URL, map[string]string{
  1927. "name": c.name,
  1928. })
  1929. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1930. }
  1931. // Do executes the "redis.projects.locations.operations.get" call.
  1932. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  1933. // status code is an error. Response headers are in either
  1934. // *Operation.ServerResponse.Header or (if a response was returned at
  1935. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1936. // to check whether the returned error was because
  1937. // http.StatusNotModified was returned.
  1938. func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1939. gensupport.SetOptions(c.urlParams_, opts...)
  1940. res, err := c.doRequest("json")
  1941. if res != nil && res.StatusCode == http.StatusNotModified {
  1942. if res.Body != nil {
  1943. res.Body.Close()
  1944. }
  1945. return nil, &googleapi.Error{
  1946. Code: res.StatusCode,
  1947. Header: res.Header,
  1948. }
  1949. }
  1950. if err != nil {
  1951. return nil, err
  1952. }
  1953. defer googleapi.CloseBody(res)
  1954. if err := googleapi.CheckResponse(res); err != nil {
  1955. return nil, err
  1956. }
  1957. ret := &Operation{
  1958. ServerResponse: googleapi.ServerResponse{
  1959. Header: res.Header,
  1960. HTTPStatusCode: res.StatusCode,
  1961. },
  1962. }
  1963. target := &ret
  1964. if err := gensupport.DecodeResponse(target, res); err != nil {
  1965. return nil, err
  1966. }
  1967. return ret, nil
  1968. // {
  1969. // "description": "Gets the latest state of a long-running operation. Clients can use this\nmethod to poll the operation result at intervals as recommended by the API\nservice.",
  1970. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}",
  1971. // "httpMethod": "GET",
  1972. // "id": "redis.projects.locations.operations.get",
  1973. // "parameterOrder": [
  1974. // "name"
  1975. // ],
  1976. // "parameters": {
  1977. // "name": {
  1978. // "description": "The name of the operation resource.",
  1979. // "location": "path",
  1980. // "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$",
  1981. // "required": true,
  1982. // "type": "string"
  1983. // }
  1984. // },
  1985. // "path": "v1beta1/{+name}",
  1986. // "response": {
  1987. // "$ref": "Operation"
  1988. // },
  1989. // "scopes": [
  1990. // "https://www.googleapis.com/auth/cloud-platform"
  1991. // ]
  1992. // }
  1993. }
  1994. // method id "redis.projects.locations.operations.list":
  1995. type ProjectsLocationsOperationsListCall struct {
  1996. s *Service
  1997. name string
  1998. urlParams_ gensupport.URLParams
  1999. ifNoneMatch_ string
  2000. ctx_ context.Context
  2001. header_ http.Header
  2002. }
  2003. // List: Lists operations that match the specified filter in the
  2004. // request. If the
  2005. // server doesn't support this method, it returns
  2006. // `UNIMPLEMENTED`.
  2007. //
  2008. // NOTE: the `name` binding allows API services to override the
  2009. // binding
  2010. // to use different resource name schemes, such as `users/*/operations`.
  2011. // To
  2012. // override the binding, API services can add a binding such
  2013. // as
  2014. // "/v1/{name=users/*}/operations" to their service configuration.
  2015. // For backwards compatibility, the default name includes the
  2016. // operations
  2017. // collection id, however overriding users must ensure the name
  2018. // binding
  2019. // is the parent resource, without the operations collection id.
  2020. func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall {
  2021. c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2022. c.name = name
  2023. return c
  2024. }
  2025. // Filter sets the optional parameter "filter": The standard list
  2026. // filter.
  2027. func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall {
  2028. c.urlParams_.Set("filter", filter)
  2029. return c
  2030. }
  2031. // PageSize sets the optional parameter "pageSize": The standard list
  2032. // page size.
  2033. func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall {
  2034. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2035. return c
  2036. }
  2037. // PageToken sets the optional parameter "pageToken": The standard list
  2038. // page token.
  2039. func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall {
  2040. c.urlParams_.Set("pageToken", pageToken)
  2041. return c
  2042. }
  2043. // Fields allows partial responses to be retrieved. See
  2044. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2045. // for more information.
  2046. func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall {
  2047. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2048. return c
  2049. }
  2050. // IfNoneMatch sets the optional parameter which makes the operation
  2051. // fail if the object's ETag matches the given value. This is useful for
  2052. // getting updates only after the object has changed since the last
  2053. // request. Use googleapi.IsNotModified to check whether the response
  2054. // error from Do is the result of In-None-Match.
  2055. func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall {
  2056. c.ifNoneMatch_ = entityTag
  2057. return c
  2058. }
  2059. // Context sets the context to be used in this call's Do method. Any
  2060. // pending HTTP request will be aborted if the provided context is
  2061. // canceled.
  2062. func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall {
  2063. c.ctx_ = ctx
  2064. return c
  2065. }
  2066. // Header returns an http.Header that can be modified by the caller to
  2067. // add HTTP headers to the request.
  2068. func (c *ProjectsLocationsOperationsListCall) Header() http.Header {
  2069. if c.header_ == nil {
  2070. c.header_ = make(http.Header)
  2071. }
  2072. return c.header_
  2073. }
  2074. func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) {
  2075. reqHeaders := make(http.Header)
  2076. for k, v := range c.header_ {
  2077. reqHeaders[k] = v
  2078. }
  2079. reqHeaders.Set("User-Agent", c.s.userAgent())
  2080. if c.ifNoneMatch_ != "" {
  2081. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2082. }
  2083. var body io.Reader = nil
  2084. c.urlParams_.Set("alt", alt)
  2085. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations")
  2086. urls += "?" + c.urlParams_.Encode()
  2087. req, _ := http.NewRequest("GET", urls, body)
  2088. req.Header = reqHeaders
  2089. googleapi.Expand(req.URL, map[string]string{
  2090. "name": c.name,
  2091. })
  2092. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2093. }
  2094. // Do executes the "redis.projects.locations.operations.list" call.
  2095. // Exactly one of *ListOperationsResponse or error will be non-nil. Any
  2096. // non-2xx status code is an error. Response headers are in either
  2097. // *ListOperationsResponse.ServerResponse.Header or (if a response was
  2098. // returned at all) in error.(*googleapi.Error).Header. Use
  2099. // googleapi.IsNotModified to check whether the returned error was
  2100. // because http.StatusNotModified was returned.
  2101. func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
  2102. gensupport.SetOptions(c.urlParams_, opts...)
  2103. res, err := c.doRequest("json")
  2104. if res != nil && res.StatusCode == http.StatusNotModified {
  2105. if res.Body != nil {
  2106. res.Body.Close()
  2107. }
  2108. return nil, &googleapi.Error{
  2109. Code: res.StatusCode,
  2110. Header: res.Header,
  2111. }
  2112. }
  2113. if err != nil {
  2114. return nil, err
  2115. }
  2116. defer googleapi.CloseBody(res)
  2117. if err := googleapi.CheckResponse(res); err != nil {
  2118. return nil, err
  2119. }
  2120. ret := &ListOperationsResponse{
  2121. ServerResponse: googleapi.ServerResponse{
  2122. Header: res.Header,
  2123. HTTPStatusCode: res.StatusCode,
  2124. },
  2125. }
  2126. target := &ret
  2127. if err := gensupport.DecodeResponse(target, res); err != nil {
  2128. return nil, err
  2129. }
  2130. return ret, nil
  2131. // {
  2132. // "description": "Lists operations that match the specified filter in the request. If the\nserver doesn't support this method, it returns `UNIMPLEMENTED`.\n\nNOTE: the `name` binding allows API services to override the binding\nto use different resource name schemes, such as `users/*/operations`. To\noverride the binding, API services can add a binding such as\n`\"/v1/{name=users/*}/operations\"` to their service configuration.\nFor backwards compatibility, the default name includes the operations\ncollection id, however overriding users must ensure the name binding\nis the parent resource, without the operations collection id.",
  2133. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/operations",
  2134. // "httpMethod": "GET",
  2135. // "id": "redis.projects.locations.operations.list",
  2136. // "parameterOrder": [
  2137. // "name"
  2138. // ],
  2139. // "parameters": {
  2140. // "filter": {
  2141. // "description": "The standard list filter.",
  2142. // "location": "query",
  2143. // "type": "string"
  2144. // },
  2145. // "name": {
  2146. // "description": "The name of the operation's parent resource.",
  2147. // "location": "path",
  2148. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  2149. // "required": true,
  2150. // "type": "string"
  2151. // },
  2152. // "pageSize": {
  2153. // "description": "The standard list page size.",
  2154. // "format": "int32",
  2155. // "location": "query",
  2156. // "type": "integer"
  2157. // },
  2158. // "pageToken": {
  2159. // "description": "The standard list page token.",
  2160. // "location": "query",
  2161. // "type": "string"
  2162. // }
  2163. // },
  2164. // "path": "v1beta1/{+name}/operations",
  2165. // "response": {
  2166. // "$ref": "ListOperationsResponse"
  2167. // },
  2168. // "scopes": [
  2169. // "https://www.googleapis.com/auth/cloud-platform"
  2170. // ]
  2171. // }
  2172. }
  2173. // Pages invokes f for each page of results.
  2174. // A non-nil error returned from f will halt the iteration.
  2175. // The provided context supersedes any context provided to the Context method.
  2176. func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
  2177. c.ctx_ = ctx
  2178. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2179. for {
  2180. x, err := c.Do()
  2181. if err != nil {
  2182. return err
  2183. }
  2184. if err := f(x); err != nil {
  2185. return err
  2186. }
  2187. if x.NextPageToken == "" {
  2188. return nil
  2189. }
  2190. c.PageToken(x.NextPageToken)
  2191. }
  2192. }