From 6ee6a57e1d6d483d952b155a563616dae741a4df Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 1 Apr 2024 00:22:15 -0700 Subject: [PATCH] feat(all): auto-regenerate discovery clients (#2503) --- api-list.json | 15 + batch/v1/batch-api.json | 8 +- batch/v1/batch-gen.go | 20 +- discovery/v1/discovery-api.json | 4 + discovery/v1/discovery-gen.go | 8 +- metastore/v1alpha/metastore-api.json | 432 +++++- metastore/v1alpha/metastore-gen.go | 1462 +++++++++++++++++- metastore/v1beta/metastore-api.json | 432 +++++- metastore/v1beta/metastore-gen.go | 1462 +++++++++++++++++- redis/v1/redis-api.json | 26 +- redis/v1/redis-gen.go | 29 + redis/v1beta1/redis-api.json | 26 +- redis/v1beta1/redis-gen.go | 29 + solar/v1/solar-api.json | 926 ++++++++++++ solar/v1/solar-gen.go | 2061 ++++++++++++++++++++++++++ 15 files changed, 6861 insertions(+), 79 deletions(-) create mode 100644 solar/v1/solar-api.json create mode 100644 solar/v1/solar-gen.go diff --git a/api-list.json b/api-list.json index cf9af9ad70a..b92080586a7 100644 --- a/api-list.json +++ b/api-list.json @@ -5632,6 +5632,21 @@ "documentationLink": "https://developers.google.com/nest/device-access", "preferred": true }, + { + "kind": "discovery#directoryItem", + "id": "solar:v1", + "name": "solar", + "version": "v1", + "title": "Solar API", + "description": "Solar API.", + "discoveryRestUrl": "https://solar.googleapis.com/$discovery/rest?version=v1", + "icons": { + "x16": "https://www.gstatic.com/images/branding/product/1x/googleg_16dp.png", + "x32": "https://www.gstatic.com/images/branding/product/1x/googleg_32dp.png" + }, + "documentationLink": "https://developers.google.com/maps/documentation/solar", + "preferred": true + }, { "kind": "discovery#directoryItem", "id": "sourcerepo:v1", diff --git a/batch/v1/batch-api.json b/batch/v1/batch-api.json index 2c4dccb5eff..d4367872b62 100644 --- a/batch/v1/batch-api.json +++ b/batch/v1/batch-api.json @@ -561,7 +561,7 @@ } } }, - "revision": "20240315", + "revision": "20240324", "rootUrl": "https://batch.googleapis.com/", "schemas": { "Accelerator": { @@ -996,7 +996,7 @@ }, "serviceAccount": { "$ref": "ServiceAccount", - "description": "Service account that VMs will run as." + "description": "Defines the service account for Batch-created VMs. If omitted, the [default Compute Engine service account](https://cloud.google.com/compute/docs/access/service-accounts#default_service_account) is used. Must match the service account specified in any used instance template configured in the Batch job. Includes the following fields: * email: The service account's email address. If not set, the default Compute Engine service account is used. * scopes: Additional OAuth scopes to grant the service account, beyond the default cloud-platform scope. (list of strings)" }, "tags": { "description": "Optional. Tags applied to the VM instances. The tags identify valid sources or targets for network firewalls. Each tag must be 1-63 characters long, and comply with [RFC1035](https://www.ietf.org/rfc/rfc1035.txt).", @@ -1961,11 +1961,11 @@ "id": "ServiceAccount", "properties": { "email": { - "description": "Email address of the service account. If not specified, the default Compute Engine service account for the project will be used. If instance template is being used, the service account has to be specified in the instance template and it has to match the email field here.", + "description": "Email address of the service account.", "type": "string" }, "scopes": { - "description": "List of scopes to be enabled for this service account on the VM, in addition to the cloud-platform API scope that will be added by default.", + "description": "List of scopes to be enabled for this service account.", "items": { "type": "string" }, diff --git a/batch/v1/batch-gen.go b/batch/v1/batch-gen.go index c5d0d2f5e59..d667ec1d411 100644 --- a/batch/v1/batch-gen.go +++ b/batch/v1/batch-gen.go @@ -882,7 +882,15 @@ type AllocationPolicy struct { // Placement: The placement policy. Placement *PlacementPolicy `json:"placement,omitempty"` - // ServiceAccount: Service account that VMs will run as. + // ServiceAccount: Defines the service account for Batch-created VMs. If + // omitted, the default Compute Engine service account + // (https://cloud.google.com/compute/docs/access/service-accounts#default_service_account) + // is used. Must match the service account specified in any used + // instance template configured in the Batch job. Includes the following + // fields: * email: The service account's email address. If not set, the + // default Compute Engine service account is used. * scopes: Additional + // OAuth scopes to grant the service account, beyond the default + // cloud-platform scope. (list of strings) ServiceAccount *ServiceAccount `json:"serviceAccount,omitempty"` // Tags: Optional. Tags applied to the VM instances. The tags identify @@ -2562,16 +2570,10 @@ func (s *Script) MarshalJSON() ([]byte, error) { // ServiceAccount: Carries information about a Google Cloud service // account. type ServiceAccount struct { - // Email: Email address of the service account. If not specified, the - // default Compute Engine service account for the project will be used. - // If instance template is being used, the service account has to be - // specified in the instance template and it has to match the email - // field here. + // Email: Email address of the service account. Email string `json:"email,omitempty"` - // Scopes: List of scopes to be enabled for this service account on the - // VM, in addition to the cloud-platform API scope that will be added by - // default. + // Scopes: List of scopes to be enabled for this service account. Scopes []string `json:"scopes,omitempty"` // ForceSendFields is a list of field names (e.g. "Email") to diff --git a/discovery/v1/discovery-api.json b/discovery/v1/discovery-api.json index 03fef01a27a..7f089290534 100644 --- a/discovery/v1/discovery-api.json +++ b/discovery/v1/discovery-api.json @@ -555,6 +555,10 @@ "RestMethod": { "id": "RestMethod", "properties": { + "apiVersion": { + "description": "The API Version of this method, as passed in via the `X-Goog-Api-Version` header or `$apiVersion` query parameter.", + "type": "string" + }, "deprecated": { "description": "Whether this method is deprecated.", "type": "boolean" diff --git a/discovery/v1/discovery-gen.go b/discovery/v1/discovery-gen.go index 9f171093462..be0220a487b 100644 --- a/discovery/v1/discovery-gen.go +++ b/discovery/v1/discovery-gen.go @@ -764,6 +764,10 @@ func (s *RestDescriptionIcons) MarshalJSON() ([]byte, error) { } type RestMethod struct { + // ApiVersion: The API Version of this method, as passed in via the + // `X-Goog-Api-Version` header or `$apiVersion` query parameter. + ApiVersion string `json:"apiVersion,omitempty"` + // Deprecated -- Whether this method is deprecated. Deprecated bool `json:"deprecated,omitempty"` @@ -824,7 +828,7 @@ type RestMethod struct { // if the method supports media download. UseMediaDownloadService bool `json:"useMediaDownloadService,omitempty"` - // ForceSendFields is a list of field names (e.g. "Deprecated") to + // ForceSendFields is a list of field names (e.g. "ApiVersion") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -832,7 +836,7 @@ type RestMethod struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Deprecated") to include in + // NullFields is a list of field names (e.g. "ApiVersion") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as diff --git a/metastore/v1alpha/metastore-api.json b/metastore/v1alpha/metastore-api.json index 5957a8bea55..3f0e40465e8 100644 --- a/metastore/v1alpha/metastore-api.json +++ b/metastore/v1alpha/metastore-api.json @@ -627,6 +627,62 @@ "https://www.googleapis.com/auth/cloud-platform" ] }, + "cancelMigration": { + "description": "Cancels the ongoing Managed Migration process.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/services/{servicesId}:cancelMigration", + "httpMethod": "POST", + "id": "metastore.projects.locations.services.cancelMigration", + "parameterOrder": [ + "service" + ], + "parameters": { + "service": { + "description": "Required. The relative resource name of the metastore service to cancel the ongoing migration to, in the following format:projects/{project_id}/locations/{location_id}/services/{service_id}.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/services/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+service}:cancelMigration", + "request": { + "$ref": "CancelMigrationRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "completeMigration": { + "description": "Completes the managed migration process. The Dataproc Metastore service will switch to using its own backend database after successful migration.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/services/{servicesId}:completeMigration", + "httpMethod": "POST", + "id": "metastore.projects.locations.services.completeMigration", + "parameterOrder": [ + "service" + ], + "parameters": { + "service": { + "description": "Required. The relative resource name of the metastore service to complete the migration to, in the following format:projects/{project_id}/locations/{location_id}/services/{service_id}.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/services/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+service}:completeMigration", + "request": { + "$ref": "CompleteMigrationRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "create": { "description": "Creates a metastore service in a project and location.", "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/services", @@ -1004,6 +1060,34 @@ "https://www.googleapis.com/auth/cloud-platform" ] }, + "startMigration": { + "description": "Starts the Managed Migration process.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/services/{servicesId}:startMigration", + "httpMethod": "POST", + "id": "metastore.projects.locations.services.startMigration", + "parameterOrder": [ + "service" + ], + "parameters": { + "service": { + "description": "Required. The relative resource name of the metastore service to start migrating to, in the following format:projects/{project_id}/locations/{location_id}/services/{service_id}.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/services/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+service}:startMigration", + "request": { + "$ref": "StartMigrationRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "testIamPermissions": { "description": "Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may \"fail open\" without warning.", "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/services/{servicesId}:testIamPermissions", @@ -1599,6 +1683,111 @@ ] } } + }, + "migrationExecutions": { + "methods": { + "delete": { + "description": "Deletes a single migration execution.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/services/{servicesId}/migrationExecutions/{migrationExecutionsId}", + "httpMethod": "DELETE", + "id": "metastore.projects.locations.services.migrationExecutions.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The relative resource name of the migrationExecution to delete, in the following form:projects/{project_number}/locations/{location_id}/services/{service_id}/migrationExecutions/{migration_execution_id}.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/services/[^/]+/migrationExecutions/[^/]+$", + "required": true, + "type": "string" + }, + "requestId": { + "description": "Optional. A request ID. Specify a unique request ID to allow the server to ignore the request if it has completed. The server will ignore subsequent requests that provide a duplicate request ID for at least 60 minutes after the first request.For example, if an initial request times out, followed by another request with the same request ID, the server ignores the second request to prevent the creation of duplicate commitments.The request ID must be a valid UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.", + "location": "query", + "type": "string" + } + }, + "path": "v1alpha/{+name}", + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "description": "Gets details of a single migration execution.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/services/{servicesId}/migrationExecutions/{migrationExecutionsId}", + "httpMethod": "GET", + "id": "metastore.projects.locations.services.migrationExecutions.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The relative resource name of the migration execution to retrieve, in the following form:projects/{project_number}/locations/{location_id}/services/{service_id}/migrationExecutions/{migration_execution_id}.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/services/[^/]+/migrationExecutions/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+name}", + "response": { + "$ref": "MigrationExecution" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "description": "Lists migration executions on a service.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/services/{servicesId}/migrationExecutions", + "httpMethod": "GET", + "id": "metastore.projects.locations.services.migrationExecutions.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "filter": { + "description": "Optional. The filter to apply to list results.", + "location": "query", + "type": "string" + }, + "orderBy": { + "description": "Optional. Specify the ordering of results as described in Sorting Order (https://cloud.google.com/apis/design/design_patterns#sorting_order). If not specified, the results will be sorted in the default order.", + "location": "query", + "type": "string" + }, + "pageSize": { + "description": "Optional. The maximum number of migration executions to return. The response may contain less than the maximum number. If unspecified, no more than 500 migration executions are returned. The maximum value is 1000; values above 1000 are changed to 1000.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. A page token, received from a previous DataprocMetastore.ListMigrationExecutions call. Provide this token to retrieve the subsequent page.To retrieve the first page, supply an empty page token.When paginating, other parameters provided to DataprocMetastore.ListMigrationExecutions must match the call that provided the page token.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The relative resource name of the service whose migration executions to list, in the following form:projects/{project_number}/locations/{location_id}/services/{service_id}/migrationExecutions.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/services/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+parent}/migrationExecutions", + "response": { + "$ref": "ListMigrationExecutionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } } } } @@ -1607,7 +1796,7 @@ } } }, - "revision": "20240312", + "revision": "20240325", "rootUrl": "https://metastore.googleapis.com/", "schemas": { "AlterMetadataResourceLocationRequest": { @@ -1835,12 +2024,136 @@ }, "type": "object" }, + "CancelMigrationRequest": { + "description": "Request message for DataprocMetastore.CancelMigration.", + "id": "CancelMigrationRequest", + "properties": {}, + "type": "object" + }, + "CancelMigrationResponse": { + "description": "Response message for DataprocMetastore.CancelMigration.", + "id": "CancelMigrationResponse", + "properties": { + "migrationExecution": { + "description": "The relative resource name of the migration execution, in the following form:projects/{project_number}/locations/{location_id}/services/{service_id}/migrationExecutions/{migration_execution_id}.", + "type": "string" + } + }, + "type": "object" + }, "CancelOperationRequest": { "description": "The request message for Operations.CancelOperation.", "id": "CancelOperationRequest", "properties": {}, "type": "object" }, + "CdcConfig": { + "description": "Configuration information to start the Change Data Capture (CDC) streams from customer database to backend database of Dataproc Metastore.", + "id": "CdcConfig", + "properties": { + "bucket": { + "description": "Optional. The bucket to write the intermediate stream event data in. The bucket name must be without any prefix like \"gs://\". See the bucket naming requirements (https://cloud.google.com/storage/docs/buckets#naming). This field is optional. If not set, the Artifacts Cloud Storage bucket will be used.", + "type": "string" + }, + "password": { + "description": "Required. Input only. The password for the user that Datastream service should use for the MySQL connection. This field is not returned on request.", + "type": "string" + }, + "reverseProxySubnet": { + "description": "Required. The URL of the subnetwork resource to create the VM instance hosting the reverse proxy in. More context in https://cloud.google.com/datastream/docs/private-connectivity#reverse-csql-proxy The subnetwork should reside in the network provided in the request that Datastream will peer to and should be in the same region as Datastream, in the following format. projects/{project_id}/regions/{region_id}/subnetworks/{subnetwork_id}", + "type": "string" + }, + "rootPath": { + "description": "Optional. The root path inside the Cloud Storage bucket. The stream event data will be written to this path. The default value is /migration.", + "type": "string" + }, + "subnetIpRange": { + "description": "Required. A /29 CIDR IP range for peering with datastream.", + "type": "string" + }, + "username": { + "description": "Required. The username that the Datastream service should use for the MySQL connection.", + "type": "string" + }, + "vpcNetwork": { + "description": "Required. Fully qualified name of the Cloud SQL instance's VPC network or the shared VPC network that Datastream will peer to, in the following format: projects/{project_id}/locations/global/networks/{network_id}. More context in https://cloud.google.com/datastream/docs/network-connectivity-options#privateconnectivity", + "type": "string" + } + }, + "type": "object" + }, + "CloudSQLConnectionConfig": { + "description": "Configuration information to establish customer database connection before the cutover phase of migration", + "id": "CloudSQLConnectionConfig", + "properties": { + "hiveDatabaseName": { + "description": "Required. The hive database name.", + "type": "string" + }, + "instanceConnectionName": { + "description": "Required. Cloud SQL database connection name (project_id:region:instance_name)", + "type": "string" + }, + "ipAddress": { + "description": "Required. The private IP address of the Cloud SQL instance.", + "type": "string" + }, + "natSubnet": { + "description": "Required. The relative resource name of the subnetwork to be used for Private Service Connect. Note that this cannot be a regular subnet and is used only for NAT. (https://cloud.google.com/vpc/docs/about-vpc-hosted-services#psc-subnets) This subnet is used to publish the SOCKS5 proxy service. The subnet size must be at least /29 and it should reside in a network through which the Cloud SQL instance is accessible. The resource name should be in the format, projects/{project_id}/regions/{region_id}/subnetworks/{subnetwork_id}", + "type": "string" + }, + "password": { + "description": "Required. Input only. The password for the user that Dataproc Metastore service will be using to connect to the database. This field is not returned on request.", + "type": "string" + }, + "port": { + "description": "Required. The network port of the database.", + "format": "int32", + "type": "integer" + }, + "proxySubnet": { + "description": "Required. The relative resource name of the subnetwork to deploy the SOCKS5 proxy service in. The subnetwork should reside in a network through which the Cloud SQL instance is accessible. The resource name should be in the format, projects/{project_id}/regions/{region_id}/subnetworks/{subnetwork_id}", + "type": "string" + }, + "username": { + "description": "Required. The username that Dataproc Metastore service will use to connect to the database.", + "type": "string" + } + }, + "type": "object" + }, + "CloudSQLMigrationConfig": { + "description": "Configuration information for migrating from self-managed hive metastore on GCP using Cloud SQL as the backend database to DPMS.", + "id": "CloudSQLMigrationConfig", + "properties": { + "cdcConfig": { + "$ref": "CdcConfig", + "description": "Required. Configuration information to start the Change Data Capture (CDC) streams from customer database to backend database of Dataproc Metastore. Dataproc Metastore switches to using its backend database after the cutover phase of migration." + }, + "cloudSqlConnectionConfig": { + "$ref": "CloudSQLConnectionConfig", + "description": "Required. Configuration information to establish customer database connection before the cutover phase of migration" + } + }, + "type": "object" + }, + "CompleteMigrationRequest": { + "description": "Request message for DataprocMetastore.CompleteMigration.", + "id": "CompleteMigrationRequest", + "properties": {}, + "type": "object" + }, + "CompleteMigrationResponse": { + "description": "Response message for DataprocMetastore.CompleteMigration.", + "id": "CompleteMigrationResponse", + "properties": { + "migrationExecution": { + "description": "The relative resource name of the migration execution, in the following form:projects/{project_number}/locations/{location_id}/services/{service_id}/migrationExecutions/{migration_execution_id}.", + "type": "string" + } + }, + "type": "object" + }, "Consumer": { "description": "Contains information of the customer's network configurations.", "id": "Consumer", @@ -1941,7 +2254,7 @@ "id": "EncryptionConfig", "properties": { "kmsKey": { - "description": "The fully qualified customer provided Cloud KMS key name to use for customer data encryption, in the following form:projects/{project_number}/locations/{location_id}/keyRings/{key_ring_id}/cryptoKeys/{crypto_key_id}.", + "description": "The fully qualified customer provided Cloud KMS key name to use for customer data encryption, in the following format:projects/{project_number}/locations/{location_id}/keyRings/{key_ring_id}/cryptoKeys/{crypto_key_id}.", "type": "string" } }, @@ -2312,6 +2625,31 @@ }, "type": "object" }, + "ListMigrationExecutionsResponse": { + "description": "Response message for DataprocMetastore.ListMigrationExecutions.", + "id": "ListMigrationExecutionsResponse", + "properties": { + "migrationExecutions": { + "description": "The migration executions on the specified service.", + "items": { + "$ref": "MigrationExecution" + }, + "type": "array" + }, + "nextPageToken": { + "description": "A token that can be sent as page_token to retrieve the next page. If this field is omitted, there are no subsequent pages.", + "type": "string" + }, + "unreachable": { + "description": "Locations that could not be reached.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, "ListOperationsResponse": { "description": "The response message for Operations.ListOperations.", "id": "ListOperationsResponse", @@ -2595,6 +2933,81 @@ }, "type": "object" }, + "MigrationExecution": { + "description": "The details of a migration execution resource.", + "id": "MigrationExecution", + "properties": { + "cloudSqlMigrationConfig": { + "$ref": "CloudSQLMigrationConfig", + "description": "Configuration information specific to migrating from self-managed hive metastore on GCP using Cloud SQL as the backend database to DPMS." + }, + "createTime": { + "description": "Output only. The time when the migration execution was started.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "endTime": { + "description": "Output only. The time when the migration execution finished.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "name": { + "description": "Output only. The relative resource name of the migration execution, in the following form: projects/{project_number}/locations/{location_id}/services/{service_id}/migrationExecutions/{migration_execution_id}", + "readOnly": true, + "type": "string" + }, + "phase": { + "description": "Output only. The current phase of the migration execution.", + "enum": [ + "PHASE_UNSPECIFIED", + "REPLICATION", + "CUTOVER" + ], + "enumDescriptions": [ + "The phase of the migration execution is unknown.", + "Replication phase refers to the migration phase when Dataproc Metastore is running a pipeline to replicate changes in the customer database to its backend database. During this phase, Dataproc Metastore uses the customer database as the hive metastore backend database.", + "Cutover phase refers to the migration phase when Dataproc Metastore switches to using its own backend database. Migration enters this phase when customer is done migrating all their clusters/workloads to DPMS and triggers CompleteMigration." + ], + "readOnly": true, + "type": "string" + }, + "state": { + "description": "Output only. The current state of the migration execution.", + "enum": [ + "STATE_UNSPECIFIED", + "STARTING", + "RUNNING", + "CANCELLING", + "AWAITING_USER_ACTION", + "SUCCEEDED", + "FAILED", + "CANCELLED", + "DELETING" + ], + "enumDescriptions": [ + "The state of the migration execution is unknown.", + "The migration execution is starting.", + "The migration execution is running.", + "The migration execution is in the process of being cancelled.", + "The migration execution is awaiting user action.", + "The migration execution has completed successfully.", + "The migration execution has failed.", + "The migration execution is cancelled.", + "The migration execution is being deleted." + ], + "readOnly": true, + "type": "string" + }, + "stateMessage": { + "description": "Output only. Additional information about the current state of the migration execution.", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, "MoveTableToDatabaseRequest": { "description": "Request message for DataprocMetastore.MoveTableToDatabase.", "id": "MoveTableToDatabaseRequest", @@ -3162,6 +3575,21 @@ }, "type": "object" }, + "StartMigrationRequest": { + "description": "Request message for DataprocMetastore.StartMigration.", + "id": "StartMigrationRequest", + "properties": { + "migrationExecution": { + "$ref": "MigrationExecution", + "description": "Required. The configuration details for the migration." + }, + "requestId": { + "description": "Optional. A request ID. Specify a unique request ID to allow the server to ignore the request if it has completed. The server will ignore subsequent requests that provide a duplicate request ID for at least 60 minutes after the first request.For example, if an initial request times out, followed by another request with the same request ID, the server ignores the second request to prevent the creation of duplicate commitments.The request ID must be a valid UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.", + "type": "string" + } + }, + "type": "object" + }, "Status": { "description": "The Status type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by gRPC (https://github.com/grpc). Each Status message contains three pieces of data: error code, error message, and error details.You can find out more about this error model and how to work with it in the API Design Guide (https://cloud.google.com/apis/design/errors).", "id": "Status", diff --git a/metastore/v1alpha/metastore-gen.go b/metastore/v1alpha/metastore-gen.go index 464fc8cb280..a620fcd8689 100644 --- a/metastore/v1alpha/metastore-gen.go +++ b/metastore/v1alpha/metastore-gen.go @@ -208,6 +208,7 @@ func NewProjectsLocationsServicesService(s *APIService) *ProjectsLocationsServic rs.Backups = NewProjectsLocationsServicesBackupsService(s) rs.Databases = NewProjectsLocationsServicesDatabasesService(s) rs.MetadataImports = NewProjectsLocationsServicesMetadataImportsService(s) + rs.MigrationExecutions = NewProjectsLocationsServicesMigrationExecutionsService(s) return rs } @@ -219,6 +220,8 @@ type ProjectsLocationsServicesService struct { Databases *ProjectsLocationsServicesDatabasesService MetadataImports *ProjectsLocationsServicesMetadataImportsService + + MigrationExecutions *ProjectsLocationsServicesMigrationExecutionsService } func NewProjectsLocationsServicesBackupsService(s *APIService) *ProjectsLocationsServicesBackupsService { @@ -260,6 +263,15 @@ type ProjectsLocationsServicesMetadataImportsService struct { s *APIService } +func NewProjectsLocationsServicesMigrationExecutionsService(s *APIService) *ProjectsLocationsServicesMigrationExecutionsService { + rs := &ProjectsLocationsServicesMigrationExecutionsService{s: s} + return rs +} + +type ProjectsLocationsServicesMigrationExecutionsService struct { + s *APIService +} + // AlterMetadataResourceLocationRequest: Request message for // DataprocMetastore.AlterMetadataResourceLocation. type AlterMetadataResourceLocationRequest struct { @@ -701,11 +713,263 @@ func (s *Binding) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// CancelMigrationRequest: Request message for +// DataprocMetastore.CancelMigration. +type CancelMigrationRequest struct { +} + +// CancelMigrationResponse: Response message for +// DataprocMetastore.CancelMigration. +type CancelMigrationResponse struct { + // MigrationExecution: The relative resource name of the migration + // execution, in the following + // form:projects/{project_number}/locations/{location_id}/services/{servi + // ce_id}/migrationExecutions/{migration_execution_id}. + MigrationExecution string `json:"migrationExecution,omitempty"` + + // ForceSendFields is a list of field names (e.g. "MigrationExecution") + // to unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "MigrationExecution") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *CancelMigrationResponse) MarshalJSON() ([]byte, error) { + type NoMethod CancelMigrationResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // CancelOperationRequest: The request message for // Operations.CancelOperation. type CancelOperationRequest struct { } +// CdcConfig: Configuration information to start the Change Data Capture +// (CDC) streams from customer database to backend database of Dataproc +// Metastore. +type CdcConfig struct { + // Bucket: Optional. The bucket to write the intermediate stream event + // data in. The bucket name must be without any prefix like "gs://". See + // the bucket naming requirements + // (https://cloud.google.com/storage/docs/buckets#naming). This field is + // optional. If not set, the Artifacts Cloud Storage bucket will be + // used. + Bucket string `json:"bucket,omitempty"` + + // Password: Required. Input only. The password for the user that + // Datastream service should use for the MySQL connection. This field is + // not returned on request. + Password string `json:"password,omitempty"` + + // ReverseProxySubnet: Required. The URL of the subnetwork resource to + // create the VM instance hosting the reverse proxy in. More context in + // https://cloud.google.com/datastream/docs/private-connectivity#reverse-csql-proxy + // The subnetwork should reside in the network provided in the request + // that Datastream will peer to and should be in the same region as + // Datastream, in the following format. + // projects/{project_id}/regions/{region_id}/subnetworks/{subnetwork_id} + ReverseProxySubnet string `json:"reverseProxySubnet,omitempty"` + + // RootPath: Optional. The root path inside the Cloud Storage bucket. + // The stream event data will be written to this path. The default value + // is /migration. + RootPath string `json:"rootPath,omitempty"` + + // SubnetIpRange: Required. A /29 CIDR IP range for peering with + // datastream. + SubnetIpRange string `json:"subnetIpRange,omitempty"` + + // Username: Required. The username that the Datastream service should + // use for the MySQL connection. + Username string `json:"username,omitempty"` + + // VpcNetwork: Required. Fully qualified name of the Cloud SQL + // instance's VPC network or the shared VPC network that Datastream will + // peer to, in the following format: + // projects/{project_id}/locations/global/networks/{network_id}. More + // context in + // https://cloud.google.com/datastream/docs/network-connectivity-options#privateconnectivity + VpcNetwork string `json:"vpcNetwork,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Bucket") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Bucket") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *CdcConfig) MarshalJSON() ([]byte, error) { + type NoMethod CdcConfig + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// CloudSQLConnectionConfig: Configuration information to establish +// customer database connection before the cutover phase of migration +type CloudSQLConnectionConfig struct { + // HiveDatabaseName: Required. The hive database name. + HiveDatabaseName string `json:"hiveDatabaseName,omitempty"` + + // InstanceConnectionName: Required. Cloud SQL database connection name + // (project_id:region:instance_name) + InstanceConnectionName string `json:"instanceConnectionName,omitempty"` + + // IpAddress: Required. The private IP address of the Cloud SQL + // instance. + IpAddress string `json:"ipAddress,omitempty"` + + // NatSubnet: Required. The relative resource name of the subnetwork to + // be used for Private Service Connect. Note that this cannot be a + // regular subnet and is used only for NAT. + // (https://cloud.google.com/vpc/docs/about-vpc-hosted-services#psc-subnets) + // This subnet is used to publish the SOCKS5 proxy service. The subnet + // size must be at least /29 and it should reside in a network through + // which the Cloud SQL instance is accessible. The resource name should + // be in the format, + // projects/{project_id}/regions/{region_id}/subnetworks/{subnetwork_id} + NatSubnet string `json:"natSubnet,omitempty"` + + // Password: Required. Input only. The password for the user that + // Dataproc Metastore service will be using to connect to the database. + // This field is not returned on request. + Password string `json:"password,omitempty"` + + // Port: Required. The network port of the database. + Port int64 `json:"port,omitempty"` + + // ProxySubnet: Required. The relative resource name of the subnetwork + // to deploy the SOCKS5 proxy service in. The subnetwork should reside + // in a network through which the Cloud SQL instance is accessible. The + // resource name should be in the format, + // projects/{project_id}/regions/{region_id}/subnetworks/{subnetwork_id} + ProxySubnet string `json:"proxySubnet,omitempty"` + + // Username: Required. The username that Dataproc Metastore service will + // use to connect to the database. + Username string `json:"username,omitempty"` + + // ForceSendFields is a list of field names (e.g. "HiveDatabaseName") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "HiveDatabaseName") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *CloudSQLConnectionConfig) MarshalJSON() ([]byte, error) { + type NoMethod CloudSQLConnectionConfig + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// CloudSQLMigrationConfig: Configuration information for migrating from +// self-managed hive metastore on GCP using Cloud SQL as the backend +// database to DPMS. +type CloudSQLMigrationConfig struct { + // CdcConfig: Required. Configuration information to start the Change + // Data Capture (CDC) streams from customer database to backend database + // of Dataproc Metastore. Dataproc Metastore switches to using its + // backend database after the cutover phase of migration. + CdcConfig *CdcConfig `json:"cdcConfig,omitempty"` + + // CloudSqlConnectionConfig: Required. Configuration information to + // establish customer database connection before the cutover phase of + // migration + CloudSqlConnectionConfig *CloudSQLConnectionConfig `json:"cloudSqlConnectionConfig,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CdcConfig") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CdcConfig") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *CloudSQLMigrationConfig) MarshalJSON() ([]byte, error) { + type NoMethod CloudSQLMigrationConfig + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// CompleteMigrationRequest: Request message for +// DataprocMetastore.CompleteMigration. +type CompleteMigrationRequest struct { +} + +// CompleteMigrationResponse: Response message for +// DataprocMetastore.CompleteMigration. +type CompleteMigrationResponse struct { + // MigrationExecution: The relative resource name of the migration + // execution, in the following + // form:projects/{project_number}/locations/{location_id}/services/{servi + // ce_id}/migrationExecutions/{migration_execution_id}. + MigrationExecution string `json:"migrationExecution,omitempty"` + + // ForceSendFields is a list of field names (e.g. "MigrationExecution") + // to unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "MigrationExecution") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *CompleteMigrationResponse) MarshalJSON() ([]byte, error) { + type NoMethod CompleteMigrationResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // Consumer: Contains information of the customer's network // configurations. type Consumer struct { @@ -878,8 +1142,8 @@ type Empty struct { type EncryptionConfig struct { // KmsKey: The fully qualified customer provided Cloud KMS key name to // use for customer data encryption, in the following - // form:projects/{project_number}/locations/{location_id}/keyRings/{key_r - // ing_id}/cryptoKeys/{crypto_key_id}. + // format:projects/{project_number}/locations/{location_id}/keyRings/{key + // _ring_id}/cryptoKeys/{crypto_key_id}. KmsKey string `json:"kmsKey,omitempty"` // ForceSendFields is a list of field names (e.g. "KmsKey") to @@ -1510,6 +1774,48 @@ func (s *ListMetadataImportsResponse) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// ListMigrationExecutionsResponse: Response message for +// DataprocMetastore.ListMigrationExecutions. +type ListMigrationExecutionsResponse struct { + // MigrationExecutions: The migration executions on the specified + // service. + MigrationExecutions []*MigrationExecution `json:"migrationExecutions,omitempty"` + + // NextPageToken: A token that can be sent as page_token to retrieve the + // next page. If this field is omitted, there are no subsequent pages. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Unreachable: Locations that could not be reached. + Unreachable []string `json:"unreachable,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "MigrationExecutions") + // to unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "MigrationExecutions") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *ListMigrationExecutionsResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListMigrationExecutionsResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // ListOperationsResponse: The response message for // Operations.ListOperations. type ListOperationsResponse struct { @@ -1902,6 +2208,92 @@ func (s *MetadataManagementActivity) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// MigrationExecution: The details of a migration execution resource. +type MigrationExecution struct { + // CloudSqlMigrationConfig: Configuration information specific to + // migrating from self-managed hive metastore on GCP using Cloud SQL as + // the backend database to DPMS. + CloudSqlMigrationConfig *CloudSQLMigrationConfig `json:"cloudSqlMigrationConfig,omitempty"` + + // CreateTime: Output only. The time when the migration execution was + // started. + CreateTime string `json:"createTime,omitempty"` + + // EndTime: Output only. The time when the migration execution finished. + EndTime string `json:"endTime,omitempty"` + + // Name: Output only. The relative resource name of the migration + // execution, in the following form: + // projects/{project_number}/locations/{location_id}/services/{service_id + // }/migrationExecutions/{migration_execution_id} + Name string `json:"name,omitempty"` + + // Phase: Output only. The current phase of the migration execution. + // + // Possible values: + // "PHASE_UNSPECIFIED" - The phase of the migration execution is + // unknown. + // "REPLICATION" - Replication phase refers to the migration phase + // when Dataproc Metastore is running a pipeline to replicate changes in + // the customer database to its backend database. During this phase, + // Dataproc Metastore uses the customer database as the hive metastore + // backend database. + // "CUTOVER" - Cutover phase refers to the migration phase when + // Dataproc Metastore switches to using its own backend database. + // Migration enters this phase when customer is done migrating all their + // clusters/workloads to DPMS and triggers CompleteMigration. + Phase string `json:"phase,omitempty"` + + // State: Output only. The current state of the migration execution. + // + // Possible values: + // "STATE_UNSPECIFIED" - The state of the migration execution is + // unknown. + // "STARTING" - The migration execution is starting. + // "RUNNING" - The migration execution is running. + // "CANCELLING" - The migration execution is in the process of being + // cancelled. + // "AWAITING_USER_ACTION" - The migration execution is awaiting user + // action. + // "SUCCEEDED" - The migration execution has completed successfully. + // "FAILED" - The migration execution has failed. + // "CANCELLED" - The migration execution is cancelled. + // "DELETING" - The migration execution is being deleted. + State string `json:"state,omitempty"` + + // StateMessage: Output only. Additional information about the current + // state of the migration execution. + StateMessage string `json:"stateMessage,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "CloudSqlMigrationConfig") to unconditionally include in API + // requests. By default, fields with empty or default values are omitted + // from API requests. However, any non-pointer, non-interface field + // appearing in ForceSendFields will be sent to the server regardless of + // whether the field is empty or not. This may be used to include empty + // fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CloudSqlMigrationConfig") + // to include in API requests with the JSON null value. By default, + // fields with empty values are omitted from API requests. However, any + // field with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *MigrationExecution) MarshalJSON() ([]byte, error) { + type NoMethod MigrationExecution + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // MoveTableToDatabaseRequest: Request message for // DataprocMetastore.MoveTableToDatabase. type MoveTableToDatabaseRequest struct { @@ -2829,6 +3221,49 @@ func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// StartMigrationRequest: Request message for +// DataprocMetastore.StartMigration. +type StartMigrationRequest struct { + // MigrationExecution: Required. The configuration details for the + // migration. + MigrationExecution *MigrationExecution `json:"migrationExecution,omitempty"` + + // RequestId: Optional. A request ID. Specify a unique request ID to + // allow the server to ignore the request if it has completed. The + // server will ignore subsequent requests that provide a duplicate + // request ID for at least 60 minutes after the first request.For + // example, if an initial request times out, followed by another request + // with the same request ID, the server ignores the second request to + // prevent the creation of duplicate commitments.The request ID must be + // a valid UUID + // (https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) + // A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. + RequestId string `json:"requestId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "MigrationExecution") + // to unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "MigrationExecution") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *StartMigrationRequest) MarshalJSON() ([]byte, error) { + type NoMethod StartMigrationRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // Status: The Status type defines a logical error model that is // suitable for different programming environments, including REST APIs // and RPC APIs. It is used by gRPC (https://github.com/grpc). Each @@ -5627,41 +6062,333 @@ func (c *ProjectsLocationsServicesAlterTablePropertiesCall) Do(opts ...googleapi } -// method id "metastore.projects.locations.services.create": +// method id "metastore.projects.locations.services.cancelMigration": -type ProjectsLocationsServicesCreateCall struct { - s *APIService - parent string - service *Service - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsServicesCancelMigrationCall struct { + s *APIService + service string + cancelmigrationrequest *CancelMigrationRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Create: Creates a metastore service in a project and location. +// CancelMigration: Cancels the ongoing Managed Migration process. // -// - parent: The relative resource name of the location in which to -// create a metastore service, in the following -// form:projects/{project_number}/locations/{location_id}. -func (r *ProjectsLocationsServicesService) Create(parent string, service *Service) *ProjectsLocationsServicesCreateCall { - c := &ProjectsLocationsServicesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent +// - service: The relative resource name of the metastore service to +// cancel the ongoing migration to, in the following +// format:projects/{project_id}/locations/{location_id}/services/{servi +// ce_id}. +func (r *ProjectsLocationsServicesService) CancelMigration(service string, cancelmigrationrequest *CancelMigrationRequest) *ProjectsLocationsServicesCancelMigrationCall { + c := &ProjectsLocationsServicesCancelMigrationCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.service = service + c.cancelmigrationrequest = cancelmigrationrequest return c } -// RequestId sets the optional parameter "requestId": A request ID. -// Specify a unique request ID to allow the server to ignore the request -// if it has completed. The server will ignore subsequent requests that -// provide a duplicate request ID for at least 60 minutes after the -// first request.For example, if an initial request times out, followed -// by another request with the same request ID, the server ignores the -// second request to prevent the creation of duplicate commitments.The -// request ID must be a valid UUID -// (https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) -// A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. -func (c *ProjectsLocationsServicesCreateCall) RequestId(requestId string) *ProjectsLocationsServicesCreateCall { - c.urlParams_.Set("requestId", requestId) +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsServicesCancelMigrationCall) Fields(s ...googleapi.Field) *ProjectsLocationsServicesCancelMigrationCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsServicesCancelMigrationCall) Context(ctx context.Context) *ProjectsLocationsServicesCancelMigrationCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsServicesCancelMigrationCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsServicesCancelMigrationCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.cancelmigrationrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+service}:cancelMigration") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "service": c.service, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "metastore.projects.locations.services.cancelMigration" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsServicesCancelMigrationCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Cancels the ongoing Managed Migration process.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/services/{servicesId}:cancelMigration", + // "httpMethod": "POST", + // "id": "metastore.projects.locations.services.cancelMigration", + // "parameterOrder": [ + // "service" + // ], + // "parameters": { + // "service": { + // "description": "Required. The relative resource name of the metastore service to cancel the ongoing migration to, in the following format:projects/{project_id}/locations/{location_id}/services/{service_id}.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/services/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1alpha/{+service}:cancelMigration", + // "request": { + // "$ref": "CancelMigrationRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "metastore.projects.locations.services.completeMigration": + +type ProjectsLocationsServicesCompleteMigrationCall struct { + s *APIService + service string + completemigrationrequest *CompleteMigrationRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// CompleteMigration: Completes the managed migration process. The +// Dataproc Metastore service will switch to using its own backend +// database after successful migration. +// +// - service: The relative resource name of the metastore service to +// complete the migration to, in the following +// format:projects/{project_id}/locations/{location_id}/services/{servi +// ce_id}. +func (r *ProjectsLocationsServicesService) CompleteMigration(service string, completemigrationrequest *CompleteMigrationRequest) *ProjectsLocationsServicesCompleteMigrationCall { + c := &ProjectsLocationsServicesCompleteMigrationCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.service = service + c.completemigrationrequest = completemigrationrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsServicesCompleteMigrationCall) Fields(s ...googleapi.Field) *ProjectsLocationsServicesCompleteMigrationCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsServicesCompleteMigrationCall) Context(ctx context.Context) *ProjectsLocationsServicesCompleteMigrationCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsServicesCompleteMigrationCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsServicesCompleteMigrationCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.completemigrationrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+service}:completeMigration") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "service": c.service, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "metastore.projects.locations.services.completeMigration" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsServicesCompleteMigrationCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Completes the managed migration process. The Dataproc Metastore service will switch to using its own backend database after successful migration.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/services/{servicesId}:completeMigration", + // "httpMethod": "POST", + // "id": "metastore.projects.locations.services.completeMigration", + // "parameterOrder": [ + // "service" + // ], + // "parameters": { + // "service": { + // "description": "Required. The relative resource name of the metastore service to complete the migration to, in the following format:projects/{project_id}/locations/{location_id}/services/{service_id}.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/services/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1alpha/{+service}:completeMigration", + // "request": { + // "$ref": "CompleteMigrationRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "metastore.projects.locations.services.create": + +type ProjectsLocationsServicesCreateCall struct { + s *APIService + parent string + service *Service + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates a metastore service in a project and location. +// +// - parent: The relative resource name of the location in which to +// create a metastore service, in the following +// form:projects/{project_number}/locations/{location_id}. +func (r *ProjectsLocationsServicesService) Create(parent string, service *Service) *ProjectsLocationsServicesCreateCall { + c := &ProjectsLocationsServicesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.service = service + return c +} + +// RequestId sets the optional parameter "requestId": A request ID. +// Specify a unique request ID to allow the server to ignore the request +// if it has completed. The server will ignore subsequent requests that +// provide a duplicate request ID for at least 60 minutes after the +// first request.For example, if an initial request times out, followed +// by another request with the same request ID, the server ignores the +// second request to prevent the creation of duplicate commitments.The +// request ID must be a valid UUID +// (https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) +// A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. +func (c *ProjectsLocationsServicesCreateCall) RequestId(requestId string) *ProjectsLocationsServicesCreateCall { + c.urlParams_.Set("requestId", requestId) return c } @@ -7566,6 +8293,151 @@ func (c *ProjectsLocationsServicesSetIamPolicyCall) Do(opts ...googleapi.CallOpt } +// method id "metastore.projects.locations.services.startMigration": + +type ProjectsLocationsServicesStartMigrationCall struct { + s *APIService + service string + startmigrationrequest *StartMigrationRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// StartMigration: Starts the Managed Migration process. +// +// - service: The relative resource name of the metastore service to +// start migrating to, in the following +// format:projects/{project_id}/locations/{location_id}/services/{servi +// ce_id}. +func (r *ProjectsLocationsServicesService) StartMigration(service string, startmigrationrequest *StartMigrationRequest) *ProjectsLocationsServicesStartMigrationCall { + c := &ProjectsLocationsServicesStartMigrationCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.service = service + c.startmigrationrequest = startmigrationrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsServicesStartMigrationCall) Fields(s ...googleapi.Field) *ProjectsLocationsServicesStartMigrationCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsServicesStartMigrationCall) Context(ctx context.Context) *ProjectsLocationsServicesStartMigrationCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsServicesStartMigrationCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsServicesStartMigrationCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.startmigrationrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+service}:startMigration") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "service": c.service, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "metastore.projects.locations.services.startMigration" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsServicesStartMigrationCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Starts the Managed Migration process.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/services/{servicesId}:startMigration", + // "httpMethod": "POST", + // "id": "metastore.projects.locations.services.startMigration", + // "parameterOrder": [ + // "service" + // ], + // "parameters": { + // "service": { + // "description": "Required. The relative resource name of the metastore service to start migrating to, in the following format:projects/{project_id}/locations/{location_id}/services/{service_id}.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/services/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1alpha/{+service}:startMigration", + // "request": { + // "$ref": "StartMigrationRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + // method id "metastore.projects.locations.services.testIamPermissions": type ProjectsLocationsServicesTestIamPermissionsCall struct { @@ -10580,3 +11452,535 @@ func (c *ProjectsLocationsServicesMetadataImportsPatchCall) Do(opts ...googleapi // } } + +// method id "metastore.projects.locations.services.migrationExecutions.delete": + +type ProjectsLocationsServicesMigrationExecutionsDeleteCall struct { + s *APIService + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes a single migration execution. +// +// - name: The relative resource name of the migrationExecution to +// delete, in the following +// form:projects/{project_number}/locations/{location_id}/services/{ser +// vice_id}/migrationExecutions/{migration_execution_id}. +func (r *ProjectsLocationsServicesMigrationExecutionsService) Delete(name string) *ProjectsLocationsServicesMigrationExecutionsDeleteCall { + c := &ProjectsLocationsServicesMigrationExecutionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// RequestId sets the optional parameter "requestId": A request ID. +// Specify a unique request ID to allow the server to ignore the request +// if it has completed. The server will ignore subsequent requests that +// provide a duplicate request ID for at least 60 minutes after the +// first request.For example, if an initial request times out, followed +// by another request with the same request ID, the server ignores the +// second request to prevent the creation of duplicate commitments.The +// request ID must be a valid UUID +// (https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) +// A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. +func (c *ProjectsLocationsServicesMigrationExecutionsDeleteCall) RequestId(requestId string) *ProjectsLocationsServicesMigrationExecutionsDeleteCall { + c.urlParams_.Set("requestId", requestId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsServicesMigrationExecutionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsServicesMigrationExecutionsDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsServicesMigrationExecutionsDeleteCall) Context(ctx context.Context) *ProjectsLocationsServicesMigrationExecutionsDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsServicesMigrationExecutionsDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsServicesMigrationExecutionsDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "metastore.projects.locations.services.migrationExecutions.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsServicesMigrationExecutionsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes a single migration execution.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/services/{servicesId}/migrationExecutions/{migrationExecutionsId}", + // "httpMethod": "DELETE", + // "id": "metastore.projects.locations.services.migrationExecutions.delete", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The relative resource name of the migrationExecution to delete, in the following form:projects/{project_number}/locations/{location_id}/services/{service_id}/migrationExecutions/{migration_execution_id}.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/services/[^/]+/migrationExecutions/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "requestId": { + // "description": "Optional. A request ID. Specify a unique request ID to allow the server to ignore the request if it has completed. The server will ignore subsequent requests that provide a duplicate request ID for at least 60 minutes after the first request.For example, if an initial request times out, followed by another request with the same request ID, the server ignores the second request to prevent the creation of duplicate commitments.The request ID must be a valid UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1alpha/{+name}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "metastore.projects.locations.services.migrationExecutions.get": + +type ProjectsLocationsServicesMigrationExecutionsGetCall struct { + s *APIService + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets details of a single migration execution. +// +// - name: The relative resource name of the migration execution to +// retrieve, in the following +// form:projects/{project_number}/locations/{location_id}/services/{ser +// vice_id}/migrationExecutions/{migration_execution_id}. +func (r *ProjectsLocationsServicesMigrationExecutionsService) Get(name string) *ProjectsLocationsServicesMigrationExecutionsGetCall { + c := &ProjectsLocationsServicesMigrationExecutionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsServicesMigrationExecutionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsServicesMigrationExecutionsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsServicesMigrationExecutionsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsServicesMigrationExecutionsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsServicesMigrationExecutionsGetCall) Context(ctx context.Context) *ProjectsLocationsServicesMigrationExecutionsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsServicesMigrationExecutionsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsServicesMigrationExecutionsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "metastore.projects.locations.services.migrationExecutions.get" call. +// Exactly one of *MigrationExecution or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *MigrationExecution.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsServicesMigrationExecutionsGetCall) Do(opts ...googleapi.CallOption) (*MigrationExecution, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &MigrationExecution{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets details of a single migration execution.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/services/{servicesId}/migrationExecutions/{migrationExecutionsId}", + // "httpMethod": "GET", + // "id": "metastore.projects.locations.services.migrationExecutions.get", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The relative resource name of the migration execution to retrieve, in the following form:projects/{project_number}/locations/{location_id}/services/{service_id}/migrationExecutions/{migration_execution_id}.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/services/[^/]+/migrationExecutions/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1alpha/{+name}", + // "response": { + // "$ref": "MigrationExecution" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "metastore.projects.locations.services.migrationExecutions.list": + +type ProjectsLocationsServicesMigrationExecutionsListCall struct { + s *APIService + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists migration executions on a service. +// +// - parent: The relative resource name of the service whose migration +// executions to list, in the following +// form:projects/{project_number}/locations/{location_id}/services/{ser +// vice_id}/migrationExecutions. +func (r *ProjectsLocationsServicesMigrationExecutionsService) List(parent string) *ProjectsLocationsServicesMigrationExecutionsListCall { + c := &ProjectsLocationsServicesMigrationExecutionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// Filter sets the optional parameter "filter": The filter to apply to +// list results. +func (c *ProjectsLocationsServicesMigrationExecutionsListCall) Filter(filter string) *ProjectsLocationsServicesMigrationExecutionsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// OrderBy sets the optional parameter "orderBy": Specify the ordering +// of results as described in Sorting Order +// (https://cloud.google.com/apis/design/design_patterns#sorting_order). +// If not specified, the results will be sorted in the default order. +func (c *ProjectsLocationsServicesMigrationExecutionsListCall) OrderBy(orderBy string) *ProjectsLocationsServicesMigrationExecutionsListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of migration executions to return. The response may contain less than +// the maximum number. If unspecified, no more than 500 migration +// executions are returned. The maximum value is 1000; values above 1000 +// are changed to 1000. +func (c *ProjectsLocationsServicesMigrationExecutionsListCall) PageSize(pageSize int64) *ProjectsLocationsServicesMigrationExecutionsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token, +// received from a previous DataprocMetastore.ListMigrationExecutions +// call. Provide this token to retrieve the subsequent page.To retrieve +// the first page, supply an empty page token.When paginating, other +// parameters provided to DataprocMetastore.ListMigrationExecutions must +// match the call that provided the page token. +func (c *ProjectsLocationsServicesMigrationExecutionsListCall) PageToken(pageToken string) *ProjectsLocationsServicesMigrationExecutionsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsServicesMigrationExecutionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsServicesMigrationExecutionsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsServicesMigrationExecutionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsServicesMigrationExecutionsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsServicesMigrationExecutionsListCall) Context(ctx context.Context) *ProjectsLocationsServicesMigrationExecutionsListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsServicesMigrationExecutionsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsServicesMigrationExecutionsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/migrationExecutions") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "metastore.projects.locations.services.migrationExecutions.list" call. +// Exactly one of *ListMigrationExecutionsResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ListMigrationExecutionsResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsServicesMigrationExecutionsListCall) Do(opts ...googleapi.CallOption) (*ListMigrationExecutionsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &ListMigrationExecutionsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists migration executions on a service.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/services/{servicesId}/migrationExecutions", + // "httpMethod": "GET", + // "id": "metastore.projects.locations.services.migrationExecutions.list", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. The filter to apply to list results.", + // "location": "query", + // "type": "string" + // }, + // "orderBy": { + // "description": "Optional. Specify the ordering of results as described in Sorting Order (https://cloud.google.com/apis/design/design_patterns#sorting_order). If not specified, the results will be sorted in the default order.", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "Optional. The maximum number of migration executions to return. The response may contain less than the maximum number. If unspecified, no more than 500 migration executions are returned. The maximum value is 1000; values above 1000 are changed to 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. A page token, received from a previous DataprocMetastore.ListMigrationExecutions call. Provide this token to retrieve the subsequent page.To retrieve the first page, supply an empty page token.When paginating, other parameters provided to DataprocMetastore.ListMigrationExecutions must match the call that provided the page token.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The relative resource name of the service whose migration executions to list, in the following form:projects/{project_number}/locations/{location_id}/services/{service_id}/migrationExecutions.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/services/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1alpha/{+parent}/migrationExecutions", + // "response": { + // "$ref": "ListMigrationExecutionsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsServicesMigrationExecutionsListCall) Pages(ctx context.Context, f func(*ListMigrationExecutionsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} diff --git a/metastore/v1beta/metastore-api.json b/metastore/v1beta/metastore-api.json index 6f22944b151..a3d43fba903 100644 --- a/metastore/v1beta/metastore-api.json +++ b/metastore/v1beta/metastore-api.json @@ -627,6 +627,62 @@ "https://www.googleapis.com/auth/cloud-platform" ] }, + "cancelMigration": { + "description": "Cancels the ongoing Managed Migration process.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/services/{servicesId}:cancelMigration", + "httpMethod": "POST", + "id": "metastore.projects.locations.services.cancelMigration", + "parameterOrder": [ + "service" + ], + "parameters": { + "service": { + "description": "Required. The relative resource name of the metastore service to cancel the ongoing migration to, in the following format:projects/{project_id}/locations/{location_id}/services/{service_id}.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/services/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta/{+service}:cancelMigration", + "request": { + "$ref": "CancelMigrationRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "completeMigration": { + "description": "Completes the managed migration process. The Dataproc Metastore service will switch to using its own backend database after successful migration.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/services/{servicesId}:completeMigration", + "httpMethod": "POST", + "id": "metastore.projects.locations.services.completeMigration", + "parameterOrder": [ + "service" + ], + "parameters": { + "service": { + "description": "Required. The relative resource name of the metastore service to complete the migration to, in the following format:projects/{project_id}/locations/{location_id}/services/{service_id}.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/services/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta/{+service}:completeMigration", + "request": { + "$ref": "CompleteMigrationRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "create": { "description": "Creates a metastore service in a project and location.", "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/services", @@ -1004,6 +1060,34 @@ "https://www.googleapis.com/auth/cloud-platform" ] }, + "startMigration": { + "description": "Starts the Managed Migration process.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/services/{servicesId}:startMigration", + "httpMethod": "POST", + "id": "metastore.projects.locations.services.startMigration", + "parameterOrder": [ + "service" + ], + "parameters": { + "service": { + "description": "Required. The relative resource name of the metastore service to start migrating to, in the following format:projects/{project_id}/locations/{location_id}/services/{service_id}.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/services/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta/{+service}:startMigration", + "request": { + "$ref": "StartMigrationRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "testIamPermissions": { "description": "Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may \"fail open\" without warning.", "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/services/{servicesId}:testIamPermissions", @@ -1599,6 +1683,111 @@ ] } } + }, + "migrationExecutions": { + "methods": { + "delete": { + "description": "Deletes a single migration execution.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/services/{servicesId}/migrationExecutions/{migrationExecutionsId}", + "httpMethod": "DELETE", + "id": "metastore.projects.locations.services.migrationExecutions.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The relative resource name of the migrationExecution to delete, in the following form:projects/{project_number}/locations/{location_id}/services/{service_id}/migrationExecutions/{migration_execution_id}.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/services/[^/]+/migrationExecutions/[^/]+$", + "required": true, + "type": "string" + }, + "requestId": { + "description": "Optional. A request ID. Specify a unique request ID to allow the server to ignore the request if it has completed. The server will ignore subsequent requests that provide a duplicate request ID for at least 60 minutes after the first request.For example, if an initial request times out, followed by another request with the same request ID, the server ignores the second request to prevent the creation of duplicate commitments.The request ID must be a valid UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.", + "location": "query", + "type": "string" + } + }, + "path": "v1beta/{+name}", + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "description": "Gets details of a single migration execution.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/services/{servicesId}/migrationExecutions/{migrationExecutionsId}", + "httpMethod": "GET", + "id": "metastore.projects.locations.services.migrationExecutions.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The relative resource name of the migration execution to retrieve, in the following form:projects/{project_number}/locations/{location_id}/services/{service_id}/migrationExecutions/{migration_execution_id}.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/services/[^/]+/migrationExecutions/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta/{+name}", + "response": { + "$ref": "MigrationExecution" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "description": "Lists migration executions on a service.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/services/{servicesId}/migrationExecutions", + "httpMethod": "GET", + "id": "metastore.projects.locations.services.migrationExecutions.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "filter": { + "description": "Optional. The filter to apply to list results.", + "location": "query", + "type": "string" + }, + "orderBy": { + "description": "Optional. Specify the ordering of results as described in Sorting Order (https://cloud.google.com/apis/design/design_patterns#sorting_order). If not specified, the results will be sorted in the default order.", + "location": "query", + "type": "string" + }, + "pageSize": { + "description": "Optional. The maximum number of migration executions to return. The response may contain less than the maximum number. If unspecified, no more than 500 migration executions are returned. The maximum value is 1000; values above 1000 are changed to 1000.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. A page token, received from a previous DataprocMetastore.ListMigrationExecutions call. Provide this token to retrieve the subsequent page.To retrieve the first page, supply an empty page token.When paginating, other parameters provided to DataprocMetastore.ListMigrationExecutions must match the call that provided the page token.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The relative resource name of the service whose migration executions to list, in the following form:projects/{project_number}/locations/{location_id}/services/{service_id}/migrationExecutions.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/services/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta/{+parent}/migrationExecutions", + "response": { + "$ref": "ListMigrationExecutionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } } } } @@ -1607,7 +1796,7 @@ } } }, - "revision": "20240312", + "revision": "20240325", "rootUrl": "https://metastore.googleapis.com/", "schemas": { "AlterMetadataResourceLocationRequest": { @@ -1835,12 +2024,136 @@ }, "type": "object" }, + "CancelMigrationRequest": { + "description": "Request message for DataprocMetastore.CancelMigration.", + "id": "CancelMigrationRequest", + "properties": {}, + "type": "object" + }, + "CancelMigrationResponse": { + "description": "Response message for DataprocMetastore.CancelMigration.", + "id": "CancelMigrationResponse", + "properties": { + "migrationExecution": { + "description": "The relative resource name of the migration execution, in the following form:projects/{project_number}/locations/{location_id}/services/{service_id}/migrationExecutions/{migration_execution_id}.", + "type": "string" + } + }, + "type": "object" + }, "CancelOperationRequest": { "description": "The request message for Operations.CancelOperation.", "id": "CancelOperationRequest", "properties": {}, "type": "object" }, + "CdcConfig": { + "description": "Configuration information to start the Change Data Capture (CDC) streams from customer database to backend database of Dataproc Metastore.", + "id": "CdcConfig", + "properties": { + "bucket": { + "description": "Optional. The bucket to write the intermediate stream event data in. The bucket name must be without any prefix like \"gs://\". See the bucket naming requirements (https://cloud.google.com/storage/docs/buckets#naming). This field is optional. If not set, the Artifacts Cloud Storage bucket will be used.", + "type": "string" + }, + "password": { + "description": "Required. Input only. The password for the user that Datastream service should use for the MySQL connection. This field is not returned on request.", + "type": "string" + }, + "reverseProxySubnet": { + "description": "Required. The URL of the subnetwork resource to create the VM instance hosting the reverse proxy in. More context in https://cloud.google.com/datastream/docs/private-connectivity#reverse-csql-proxy The subnetwork should reside in the network provided in the request that Datastream will peer to and should be in the same region as Datastream, in the following format. projects/{project_id}/regions/{region_id}/subnetworks/{subnetwork_id}", + "type": "string" + }, + "rootPath": { + "description": "Optional. The root path inside the Cloud Storage bucket. The stream event data will be written to this path. The default value is /migration.", + "type": "string" + }, + "subnetIpRange": { + "description": "Required. A /29 CIDR IP range for peering with datastream.", + "type": "string" + }, + "username": { + "description": "Required. The username that the Datastream service should use for the MySQL connection.", + "type": "string" + }, + "vpcNetwork": { + "description": "Required. Fully qualified name of the Cloud SQL instance's VPC network or the shared VPC network that Datastream will peer to, in the following format: projects/{project_id}/locations/global/networks/{network_id}. More context in https://cloud.google.com/datastream/docs/network-connectivity-options#privateconnectivity", + "type": "string" + } + }, + "type": "object" + }, + "CloudSQLConnectionConfig": { + "description": "Configuration information to establish customer database connection before the cutover phase of migration", + "id": "CloudSQLConnectionConfig", + "properties": { + "hiveDatabaseName": { + "description": "Required. The hive database name.", + "type": "string" + }, + "instanceConnectionName": { + "description": "Required. Cloud SQL database connection name (project_id:region:instance_name)", + "type": "string" + }, + "ipAddress": { + "description": "Required. The private IP address of the Cloud SQL instance.", + "type": "string" + }, + "natSubnet": { + "description": "Required. The relative resource name of the subnetwork to be used for Private Service Connect. Note that this cannot be a regular subnet and is used only for NAT. (https://cloud.google.com/vpc/docs/about-vpc-hosted-services#psc-subnets) This subnet is used to publish the SOCKS5 proxy service. The subnet size must be at least /29 and it should reside in a network through which the Cloud SQL instance is accessible. The resource name should be in the format, projects/{project_id}/regions/{region_id}/subnetworks/{subnetwork_id}", + "type": "string" + }, + "password": { + "description": "Required. Input only. The password for the user that Dataproc Metastore service will be using to connect to the database. This field is not returned on request.", + "type": "string" + }, + "port": { + "description": "Required. The network port of the database.", + "format": "int32", + "type": "integer" + }, + "proxySubnet": { + "description": "Required. The relative resource name of the subnetwork to deploy the SOCKS5 proxy service in. The subnetwork should reside in a network through which the Cloud SQL instance is accessible. The resource name should be in the format, projects/{project_id}/regions/{region_id}/subnetworks/{subnetwork_id}", + "type": "string" + }, + "username": { + "description": "Required. The username that Dataproc Metastore service will use to connect to the database.", + "type": "string" + } + }, + "type": "object" + }, + "CloudSQLMigrationConfig": { + "description": "Configuration information for migrating from self-managed hive metastore on GCP using Cloud SQL as the backend database to DPMS.", + "id": "CloudSQLMigrationConfig", + "properties": { + "cdcConfig": { + "$ref": "CdcConfig", + "description": "Required. Configuration information to start the Change Data Capture (CDC) streams from customer database to backend database of Dataproc Metastore. Dataproc Metastore switches to using its backend database after the cutover phase of migration." + }, + "cloudSqlConnectionConfig": { + "$ref": "CloudSQLConnectionConfig", + "description": "Required. Configuration information to establish customer database connection before the cutover phase of migration" + } + }, + "type": "object" + }, + "CompleteMigrationRequest": { + "description": "Request message for DataprocMetastore.CompleteMigration.", + "id": "CompleteMigrationRequest", + "properties": {}, + "type": "object" + }, + "CompleteMigrationResponse": { + "description": "Response message for DataprocMetastore.CompleteMigration.", + "id": "CompleteMigrationResponse", + "properties": { + "migrationExecution": { + "description": "The relative resource name of the migration execution, in the following form:projects/{project_number}/locations/{location_id}/services/{service_id}/migrationExecutions/{migration_execution_id}.", + "type": "string" + } + }, + "type": "object" + }, "Consumer": { "description": "Contains information of the customer's network configurations.", "id": "Consumer", @@ -1941,7 +2254,7 @@ "id": "EncryptionConfig", "properties": { "kmsKey": { - "description": "The fully qualified customer provided Cloud KMS key name to use for customer data encryption, in the following form:projects/{project_number}/locations/{location_id}/keyRings/{key_ring_id}/cryptoKeys/{crypto_key_id}.", + "description": "The fully qualified customer provided Cloud KMS key name to use for customer data encryption, in the following format:projects/{project_number}/locations/{location_id}/keyRings/{key_ring_id}/cryptoKeys/{crypto_key_id}.", "type": "string" } }, @@ -2312,6 +2625,31 @@ }, "type": "object" }, + "ListMigrationExecutionsResponse": { + "description": "Response message for DataprocMetastore.ListMigrationExecutions.", + "id": "ListMigrationExecutionsResponse", + "properties": { + "migrationExecutions": { + "description": "The migration executions on the specified service.", + "items": { + "$ref": "MigrationExecution" + }, + "type": "array" + }, + "nextPageToken": { + "description": "A token that can be sent as page_token to retrieve the next page. If this field is omitted, there are no subsequent pages.", + "type": "string" + }, + "unreachable": { + "description": "Locations that could not be reached.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, "ListOperationsResponse": { "description": "The response message for Operations.ListOperations.", "id": "ListOperationsResponse", @@ -2595,6 +2933,81 @@ }, "type": "object" }, + "MigrationExecution": { + "description": "The details of a migration execution resource.", + "id": "MigrationExecution", + "properties": { + "cloudSqlMigrationConfig": { + "$ref": "CloudSQLMigrationConfig", + "description": "Configuration information specific to migrating from self-managed hive metastore on GCP using Cloud SQL as the backend database to DPMS." + }, + "createTime": { + "description": "Output only. The time when the migration execution was started.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "endTime": { + "description": "Output only. The time when the migration execution finished.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "name": { + "description": "Output only. The relative resource name of the migration execution, in the following form: projects/{project_number}/locations/{location_id}/services/{service_id}/migrationExecutions/{migration_execution_id}", + "readOnly": true, + "type": "string" + }, + "phase": { + "description": "Output only. The current phase of the migration execution.", + "enum": [ + "PHASE_UNSPECIFIED", + "REPLICATION", + "CUTOVER" + ], + "enumDescriptions": [ + "The phase of the migration execution is unknown.", + "Replication phase refers to the migration phase when Dataproc Metastore is running a pipeline to replicate changes in the customer database to its backend database. During this phase, Dataproc Metastore uses the customer database as the hive metastore backend database.", + "Cutover phase refers to the migration phase when Dataproc Metastore switches to using its own backend database. Migration enters this phase when customer is done migrating all their clusters/workloads to DPMS and triggers CompleteMigration." + ], + "readOnly": true, + "type": "string" + }, + "state": { + "description": "Output only. The current state of the migration execution.", + "enum": [ + "STATE_UNSPECIFIED", + "STARTING", + "RUNNING", + "CANCELLING", + "AWAITING_USER_ACTION", + "SUCCEEDED", + "FAILED", + "CANCELLED", + "DELETING" + ], + "enumDescriptions": [ + "The state of the migration execution is unknown.", + "The migration execution is starting.", + "The migration execution is running.", + "The migration execution is in the process of being cancelled.", + "The migration execution is awaiting user action.", + "The migration execution has completed successfully.", + "The migration execution has failed.", + "The migration execution is cancelled.", + "The migration execution is being deleted." + ], + "readOnly": true, + "type": "string" + }, + "stateMessage": { + "description": "Output only. Additional information about the current state of the migration execution.", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, "MoveTableToDatabaseRequest": { "description": "Request message for DataprocMetastore.MoveTableToDatabase.", "id": "MoveTableToDatabaseRequest", @@ -3162,6 +3575,21 @@ }, "type": "object" }, + "StartMigrationRequest": { + "description": "Request message for DataprocMetastore.StartMigration.", + "id": "StartMigrationRequest", + "properties": { + "migrationExecution": { + "$ref": "MigrationExecution", + "description": "Required. The configuration details for the migration." + }, + "requestId": { + "description": "Optional. A request ID. Specify a unique request ID to allow the server to ignore the request if it has completed. The server will ignore subsequent requests that provide a duplicate request ID for at least 60 minutes after the first request.For example, if an initial request times out, followed by another request with the same request ID, the server ignores the second request to prevent the creation of duplicate commitments.The request ID must be a valid UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.", + "type": "string" + } + }, + "type": "object" + }, "Status": { "description": "The Status type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by gRPC (https://github.com/grpc). Each Status message contains three pieces of data: error code, error message, and error details.You can find out more about this error model and how to work with it in the API Design Guide (https://cloud.google.com/apis/design/errors).", "id": "Status", diff --git a/metastore/v1beta/metastore-gen.go b/metastore/v1beta/metastore-gen.go index 4c5ce29b252..14ff6c53fcb 100644 --- a/metastore/v1beta/metastore-gen.go +++ b/metastore/v1beta/metastore-gen.go @@ -208,6 +208,7 @@ func NewProjectsLocationsServicesService(s *APIService) *ProjectsLocationsServic rs.Backups = NewProjectsLocationsServicesBackupsService(s) rs.Databases = NewProjectsLocationsServicesDatabasesService(s) rs.MetadataImports = NewProjectsLocationsServicesMetadataImportsService(s) + rs.MigrationExecutions = NewProjectsLocationsServicesMigrationExecutionsService(s) return rs } @@ -219,6 +220,8 @@ type ProjectsLocationsServicesService struct { Databases *ProjectsLocationsServicesDatabasesService MetadataImports *ProjectsLocationsServicesMetadataImportsService + + MigrationExecutions *ProjectsLocationsServicesMigrationExecutionsService } func NewProjectsLocationsServicesBackupsService(s *APIService) *ProjectsLocationsServicesBackupsService { @@ -260,6 +263,15 @@ type ProjectsLocationsServicesMetadataImportsService struct { s *APIService } +func NewProjectsLocationsServicesMigrationExecutionsService(s *APIService) *ProjectsLocationsServicesMigrationExecutionsService { + rs := &ProjectsLocationsServicesMigrationExecutionsService{s: s} + return rs +} + +type ProjectsLocationsServicesMigrationExecutionsService struct { + s *APIService +} + // AlterMetadataResourceLocationRequest: Request message for // DataprocMetastore.AlterMetadataResourceLocation. type AlterMetadataResourceLocationRequest struct { @@ -701,11 +713,263 @@ func (s *Binding) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// CancelMigrationRequest: Request message for +// DataprocMetastore.CancelMigration. +type CancelMigrationRequest struct { +} + +// CancelMigrationResponse: Response message for +// DataprocMetastore.CancelMigration. +type CancelMigrationResponse struct { + // MigrationExecution: The relative resource name of the migration + // execution, in the following + // form:projects/{project_number}/locations/{location_id}/services/{servi + // ce_id}/migrationExecutions/{migration_execution_id}. + MigrationExecution string `json:"migrationExecution,omitempty"` + + // ForceSendFields is a list of field names (e.g. "MigrationExecution") + // to unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "MigrationExecution") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *CancelMigrationResponse) MarshalJSON() ([]byte, error) { + type NoMethod CancelMigrationResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // CancelOperationRequest: The request message for // Operations.CancelOperation. type CancelOperationRequest struct { } +// CdcConfig: Configuration information to start the Change Data Capture +// (CDC) streams from customer database to backend database of Dataproc +// Metastore. +type CdcConfig struct { + // Bucket: Optional. The bucket to write the intermediate stream event + // data in. The bucket name must be without any prefix like "gs://". See + // the bucket naming requirements + // (https://cloud.google.com/storage/docs/buckets#naming). This field is + // optional. If not set, the Artifacts Cloud Storage bucket will be + // used. + Bucket string `json:"bucket,omitempty"` + + // Password: Required. Input only. The password for the user that + // Datastream service should use for the MySQL connection. This field is + // not returned on request. + Password string `json:"password,omitempty"` + + // ReverseProxySubnet: Required. The URL of the subnetwork resource to + // create the VM instance hosting the reverse proxy in. More context in + // https://cloud.google.com/datastream/docs/private-connectivity#reverse-csql-proxy + // The subnetwork should reside in the network provided in the request + // that Datastream will peer to and should be in the same region as + // Datastream, in the following format. + // projects/{project_id}/regions/{region_id}/subnetworks/{subnetwork_id} + ReverseProxySubnet string `json:"reverseProxySubnet,omitempty"` + + // RootPath: Optional. The root path inside the Cloud Storage bucket. + // The stream event data will be written to this path. The default value + // is /migration. + RootPath string `json:"rootPath,omitempty"` + + // SubnetIpRange: Required. A /29 CIDR IP range for peering with + // datastream. + SubnetIpRange string `json:"subnetIpRange,omitempty"` + + // Username: Required. The username that the Datastream service should + // use for the MySQL connection. + Username string `json:"username,omitempty"` + + // VpcNetwork: Required. Fully qualified name of the Cloud SQL + // instance's VPC network or the shared VPC network that Datastream will + // peer to, in the following format: + // projects/{project_id}/locations/global/networks/{network_id}. More + // context in + // https://cloud.google.com/datastream/docs/network-connectivity-options#privateconnectivity + VpcNetwork string `json:"vpcNetwork,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Bucket") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Bucket") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *CdcConfig) MarshalJSON() ([]byte, error) { + type NoMethod CdcConfig + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// CloudSQLConnectionConfig: Configuration information to establish +// customer database connection before the cutover phase of migration +type CloudSQLConnectionConfig struct { + // HiveDatabaseName: Required. The hive database name. + HiveDatabaseName string `json:"hiveDatabaseName,omitempty"` + + // InstanceConnectionName: Required. Cloud SQL database connection name + // (project_id:region:instance_name) + InstanceConnectionName string `json:"instanceConnectionName,omitempty"` + + // IpAddress: Required. The private IP address of the Cloud SQL + // instance. + IpAddress string `json:"ipAddress,omitempty"` + + // NatSubnet: Required. The relative resource name of the subnetwork to + // be used for Private Service Connect. Note that this cannot be a + // regular subnet and is used only for NAT. + // (https://cloud.google.com/vpc/docs/about-vpc-hosted-services#psc-subnets) + // This subnet is used to publish the SOCKS5 proxy service. The subnet + // size must be at least /29 and it should reside in a network through + // which the Cloud SQL instance is accessible. The resource name should + // be in the format, + // projects/{project_id}/regions/{region_id}/subnetworks/{subnetwork_id} + NatSubnet string `json:"natSubnet,omitempty"` + + // Password: Required. Input only. The password for the user that + // Dataproc Metastore service will be using to connect to the database. + // This field is not returned on request. + Password string `json:"password,omitempty"` + + // Port: Required. The network port of the database. + Port int64 `json:"port,omitempty"` + + // ProxySubnet: Required. The relative resource name of the subnetwork + // to deploy the SOCKS5 proxy service in. The subnetwork should reside + // in a network through which the Cloud SQL instance is accessible. The + // resource name should be in the format, + // projects/{project_id}/regions/{region_id}/subnetworks/{subnetwork_id} + ProxySubnet string `json:"proxySubnet,omitempty"` + + // Username: Required. The username that Dataproc Metastore service will + // use to connect to the database. + Username string `json:"username,omitempty"` + + // ForceSendFields is a list of field names (e.g. "HiveDatabaseName") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "HiveDatabaseName") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *CloudSQLConnectionConfig) MarshalJSON() ([]byte, error) { + type NoMethod CloudSQLConnectionConfig + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// CloudSQLMigrationConfig: Configuration information for migrating from +// self-managed hive metastore on GCP using Cloud SQL as the backend +// database to DPMS. +type CloudSQLMigrationConfig struct { + // CdcConfig: Required. Configuration information to start the Change + // Data Capture (CDC) streams from customer database to backend database + // of Dataproc Metastore. Dataproc Metastore switches to using its + // backend database after the cutover phase of migration. + CdcConfig *CdcConfig `json:"cdcConfig,omitempty"` + + // CloudSqlConnectionConfig: Required. Configuration information to + // establish customer database connection before the cutover phase of + // migration + CloudSqlConnectionConfig *CloudSQLConnectionConfig `json:"cloudSqlConnectionConfig,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CdcConfig") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CdcConfig") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *CloudSQLMigrationConfig) MarshalJSON() ([]byte, error) { + type NoMethod CloudSQLMigrationConfig + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// CompleteMigrationRequest: Request message for +// DataprocMetastore.CompleteMigration. +type CompleteMigrationRequest struct { +} + +// CompleteMigrationResponse: Response message for +// DataprocMetastore.CompleteMigration. +type CompleteMigrationResponse struct { + // MigrationExecution: The relative resource name of the migration + // execution, in the following + // form:projects/{project_number}/locations/{location_id}/services/{servi + // ce_id}/migrationExecutions/{migration_execution_id}. + MigrationExecution string `json:"migrationExecution,omitempty"` + + // ForceSendFields is a list of field names (e.g. "MigrationExecution") + // to unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "MigrationExecution") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *CompleteMigrationResponse) MarshalJSON() ([]byte, error) { + type NoMethod CompleteMigrationResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // Consumer: Contains information of the customer's network // configurations. type Consumer struct { @@ -878,8 +1142,8 @@ type Empty struct { type EncryptionConfig struct { // KmsKey: The fully qualified customer provided Cloud KMS key name to // use for customer data encryption, in the following - // form:projects/{project_number}/locations/{location_id}/keyRings/{key_r - // ing_id}/cryptoKeys/{crypto_key_id}. + // format:projects/{project_number}/locations/{location_id}/keyRings/{key + // _ring_id}/cryptoKeys/{crypto_key_id}. KmsKey string `json:"kmsKey,omitempty"` // ForceSendFields is a list of field names (e.g. "KmsKey") to @@ -1510,6 +1774,48 @@ func (s *ListMetadataImportsResponse) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// ListMigrationExecutionsResponse: Response message for +// DataprocMetastore.ListMigrationExecutions. +type ListMigrationExecutionsResponse struct { + // MigrationExecutions: The migration executions on the specified + // service. + MigrationExecutions []*MigrationExecution `json:"migrationExecutions,omitempty"` + + // NextPageToken: A token that can be sent as page_token to retrieve the + // next page. If this field is omitted, there are no subsequent pages. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Unreachable: Locations that could not be reached. + Unreachable []string `json:"unreachable,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "MigrationExecutions") + // to unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "MigrationExecutions") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *ListMigrationExecutionsResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListMigrationExecutionsResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // ListOperationsResponse: The response message for // Operations.ListOperations. type ListOperationsResponse struct { @@ -1902,6 +2208,92 @@ func (s *MetadataManagementActivity) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// MigrationExecution: The details of a migration execution resource. +type MigrationExecution struct { + // CloudSqlMigrationConfig: Configuration information specific to + // migrating from self-managed hive metastore on GCP using Cloud SQL as + // the backend database to DPMS. + CloudSqlMigrationConfig *CloudSQLMigrationConfig `json:"cloudSqlMigrationConfig,omitempty"` + + // CreateTime: Output only. The time when the migration execution was + // started. + CreateTime string `json:"createTime,omitempty"` + + // EndTime: Output only. The time when the migration execution finished. + EndTime string `json:"endTime,omitempty"` + + // Name: Output only. The relative resource name of the migration + // execution, in the following form: + // projects/{project_number}/locations/{location_id}/services/{service_id + // }/migrationExecutions/{migration_execution_id} + Name string `json:"name,omitempty"` + + // Phase: Output only. The current phase of the migration execution. + // + // Possible values: + // "PHASE_UNSPECIFIED" - The phase of the migration execution is + // unknown. + // "REPLICATION" - Replication phase refers to the migration phase + // when Dataproc Metastore is running a pipeline to replicate changes in + // the customer database to its backend database. During this phase, + // Dataproc Metastore uses the customer database as the hive metastore + // backend database. + // "CUTOVER" - Cutover phase refers to the migration phase when + // Dataproc Metastore switches to using its own backend database. + // Migration enters this phase when customer is done migrating all their + // clusters/workloads to DPMS and triggers CompleteMigration. + Phase string `json:"phase,omitempty"` + + // State: Output only. The current state of the migration execution. + // + // Possible values: + // "STATE_UNSPECIFIED" - The state of the migration execution is + // unknown. + // "STARTING" - The migration execution is starting. + // "RUNNING" - The migration execution is running. + // "CANCELLING" - The migration execution is in the process of being + // cancelled. + // "AWAITING_USER_ACTION" - The migration execution is awaiting user + // action. + // "SUCCEEDED" - The migration execution has completed successfully. + // "FAILED" - The migration execution has failed. + // "CANCELLED" - The migration execution is cancelled. + // "DELETING" - The migration execution is being deleted. + State string `json:"state,omitempty"` + + // StateMessage: Output only. Additional information about the current + // state of the migration execution. + StateMessage string `json:"stateMessage,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "CloudSqlMigrationConfig") to unconditionally include in API + // requests. By default, fields with empty or default values are omitted + // from API requests. However, any non-pointer, non-interface field + // appearing in ForceSendFields will be sent to the server regardless of + // whether the field is empty or not. This may be used to include empty + // fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CloudSqlMigrationConfig") + // to include in API requests with the JSON null value. By default, + // fields with empty values are omitted from API requests. However, any + // field with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *MigrationExecution) MarshalJSON() ([]byte, error) { + type NoMethod MigrationExecution + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // MoveTableToDatabaseRequest: Request message for // DataprocMetastore.MoveTableToDatabase. type MoveTableToDatabaseRequest struct { @@ -2829,6 +3221,49 @@ func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// StartMigrationRequest: Request message for +// DataprocMetastore.StartMigration. +type StartMigrationRequest struct { + // MigrationExecution: Required. The configuration details for the + // migration. + MigrationExecution *MigrationExecution `json:"migrationExecution,omitempty"` + + // RequestId: Optional. A request ID. Specify a unique request ID to + // allow the server to ignore the request if it has completed. The + // server will ignore subsequent requests that provide a duplicate + // request ID for at least 60 minutes after the first request.For + // example, if an initial request times out, followed by another request + // with the same request ID, the server ignores the second request to + // prevent the creation of duplicate commitments.The request ID must be + // a valid UUID + // (https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) + // A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. + RequestId string `json:"requestId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "MigrationExecution") + // to unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "MigrationExecution") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *StartMigrationRequest) MarshalJSON() ([]byte, error) { + type NoMethod StartMigrationRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // Status: The Status type defines a logical error model that is // suitable for different programming environments, including REST APIs // and RPC APIs. It is used by gRPC (https://github.com/grpc). Each @@ -5627,41 +6062,333 @@ func (c *ProjectsLocationsServicesAlterTablePropertiesCall) Do(opts ...googleapi } -// method id "metastore.projects.locations.services.create": +// method id "metastore.projects.locations.services.cancelMigration": -type ProjectsLocationsServicesCreateCall struct { - s *APIService - parent string - service *Service - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsServicesCancelMigrationCall struct { + s *APIService + service string + cancelmigrationrequest *CancelMigrationRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Create: Creates a metastore service in a project and location. +// CancelMigration: Cancels the ongoing Managed Migration process. // -// - parent: The relative resource name of the location in which to -// create a metastore service, in the following -// form:projects/{project_number}/locations/{location_id}. -func (r *ProjectsLocationsServicesService) Create(parent string, service *Service) *ProjectsLocationsServicesCreateCall { - c := &ProjectsLocationsServicesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent +// - service: The relative resource name of the metastore service to +// cancel the ongoing migration to, in the following +// format:projects/{project_id}/locations/{location_id}/services/{servi +// ce_id}. +func (r *ProjectsLocationsServicesService) CancelMigration(service string, cancelmigrationrequest *CancelMigrationRequest) *ProjectsLocationsServicesCancelMigrationCall { + c := &ProjectsLocationsServicesCancelMigrationCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.service = service + c.cancelmigrationrequest = cancelmigrationrequest return c } -// RequestId sets the optional parameter "requestId": A request ID. -// Specify a unique request ID to allow the server to ignore the request -// if it has completed. The server will ignore subsequent requests that -// provide a duplicate request ID for at least 60 minutes after the -// first request.For example, if an initial request times out, followed -// by another request with the same request ID, the server ignores the -// second request to prevent the creation of duplicate commitments.The -// request ID must be a valid UUID -// (https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) -// A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. -func (c *ProjectsLocationsServicesCreateCall) RequestId(requestId string) *ProjectsLocationsServicesCreateCall { - c.urlParams_.Set("requestId", requestId) +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsServicesCancelMigrationCall) Fields(s ...googleapi.Field) *ProjectsLocationsServicesCancelMigrationCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsServicesCancelMigrationCall) Context(ctx context.Context) *ProjectsLocationsServicesCancelMigrationCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsServicesCancelMigrationCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsServicesCancelMigrationCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.cancelmigrationrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+service}:cancelMigration") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "service": c.service, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "metastore.projects.locations.services.cancelMigration" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsServicesCancelMigrationCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Cancels the ongoing Managed Migration process.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/services/{servicesId}:cancelMigration", + // "httpMethod": "POST", + // "id": "metastore.projects.locations.services.cancelMigration", + // "parameterOrder": [ + // "service" + // ], + // "parameters": { + // "service": { + // "description": "Required. The relative resource name of the metastore service to cancel the ongoing migration to, in the following format:projects/{project_id}/locations/{location_id}/services/{service_id}.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/services/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta/{+service}:cancelMigration", + // "request": { + // "$ref": "CancelMigrationRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "metastore.projects.locations.services.completeMigration": + +type ProjectsLocationsServicesCompleteMigrationCall struct { + s *APIService + service string + completemigrationrequest *CompleteMigrationRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// CompleteMigration: Completes the managed migration process. The +// Dataproc Metastore service will switch to using its own backend +// database after successful migration. +// +// - service: The relative resource name of the metastore service to +// complete the migration to, in the following +// format:projects/{project_id}/locations/{location_id}/services/{servi +// ce_id}. +func (r *ProjectsLocationsServicesService) CompleteMigration(service string, completemigrationrequest *CompleteMigrationRequest) *ProjectsLocationsServicesCompleteMigrationCall { + c := &ProjectsLocationsServicesCompleteMigrationCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.service = service + c.completemigrationrequest = completemigrationrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsServicesCompleteMigrationCall) Fields(s ...googleapi.Field) *ProjectsLocationsServicesCompleteMigrationCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsServicesCompleteMigrationCall) Context(ctx context.Context) *ProjectsLocationsServicesCompleteMigrationCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsServicesCompleteMigrationCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsServicesCompleteMigrationCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.completemigrationrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+service}:completeMigration") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "service": c.service, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "metastore.projects.locations.services.completeMigration" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsServicesCompleteMigrationCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Completes the managed migration process. The Dataproc Metastore service will switch to using its own backend database after successful migration.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/services/{servicesId}:completeMigration", + // "httpMethod": "POST", + // "id": "metastore.projects.locations.services.completeMigration", + // "parameterOrder": [ + // "service" + // ], + // "parameters": { + // "service": { + // "description": "Required. The relative resource name of the metastore service to complete the migration to, in the following format:projects/{project_id}/locations/{location_id}/services/{service_id}.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/services/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta/{+service}:completeMigration", + // "request": { + // "$ref": "CompleteMigrationRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "metastore.projects.locations.services.create": + +type ProjectsLocationsServicesCreateCall struct { + s *APIService + parent string + service *Service + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates a metastore service in a project and location. +// +// - parent: The relative resource name of the location in which to +// create a metastore service, in the following +// form:projects/{project_number}/locations/{location_id}. +func (r *ProjectsLocationsServicesService) Create(parent string, service *Service) *ProjectsLocationsServicesCreateCall { + c := &ProjectsLocationsServicesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.service = service + return c +} + +// RequestId sets the optional parameter "requestId": A request ID. +// Specify a unique request ID to allow the server to ignore the request +// if it has completed. The server will ignore subsequent requests that +// provide a duplicate request ID for at least 60 minutes after the +// first request.For example, if an initial request times out, followed +// by another request with the same request ID, the server ignores the +// second request to prevent the creation of duplicate commitments.The +// request ID must be a valid UUID +// (https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) +// A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. +func (c *ProjectsLocationsServicesCreateCall) RequestId(requestId string) *ProjectsLocationsServicesCreateCall { + c.urlParams_.Set("requestId", requestId) return c } @@ -7566,6 +8293,151 @@ func (c *ProjectsLocationsServicesSetIamPolicyCall) Do(opts ...googleapi.CallOpt } +// method id "metastore.projects.locations.services.startMigration": + +type ProjectsLocationsServicesStartMigrationCall struct { + s *APIService + service string + startmigrationrequest *StartMigrationRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// StartMigration: Starts the Managed Migration process. +// +// - service: The relative resource name of the metastore service to +// start migrating to, in the following +// format:projects/{project_id}/locations/{location_id}/services/{servi +// ce_id}. +func (r *ProjectsLocationsServicesService) StartMigration(service string, startmigrationrequest *StartMigrationRequest) *ProjectsLocationsServicesStartMigrationCall { + c := &ProjectsLocationsServicesStartMigrationCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.service = service + c.startmigrationrequest = startmigrationrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsServicesStartMigrationCall) Fields(s ...googleapi.Field) *ProjectsLocationsServicesStartMigrationCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsServicesStartMigrationCall) Context(ctx context.Context) *ProjectsLocationsServicesStartMigrationCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsServicesStartMigrationCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsServicesStartMigrationCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.startmigrationrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+service}:startMigration") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "service": c.service, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "metastore.projects.locations.services.startMigration" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsServicesStartMigrationCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Starts the Managed Migration process.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/services/{servicesId}:startMigration", + // "httpMethod": "POST", + // "id": "metastore.projects.locations.services.startMigration", + // "parameterOrder": [ + // "service" + // ], + // "parameters": { + // "service": { + // "description": "Required. The relative resource name of the metastore service to start migrating to, in the following format:projects/{project_id}/locations/{location_id}/services/{service_id}.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/services/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta/{+service}:startMigration", + // "request": { + // "$ref": "StartMigrationRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + // method id "metastore.projects.locations.services.testIamPermissions": type ProjectsLocationsServicesTestIamPermissionsCall struct { @@ -10580,3 +11452,535 @@ func (c *ProjectsLocationsServicesMetadataImportsPatchCall) Do(opts ...googleapi // } } + +// method id "metastore.projects.locations.services.migrationExecutions.delete": + +type ProjectsLocationsServicesMigrationExecutionsDeleteCall struct { + s *APIService + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes a single migration execution. +// +// - name: The relative resource name of the migrationExecution to +// delete, in the following +// form:projects/{project_number}/locations/{location_id}/services/{ser +// vice_id}/migrationExecutions/{migration_execution_id}. +func (r *ProjectsLocationsServicesMigrationExecutionsService) Delete(name string) *ProjectsLocationsServicesMigrationExecutionsDeleteCall { + c := &ProjectsLocationsServicesMigrationExecutionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// RequestId sets the optional parameter "requestId": A request ID. +// Specify a unique request ID to allow the server to ignore the request +// if it has completed. The server will ignore subsequent requests that +// provide a duplicate request ID for at least 60 minutes after the +// first request.For example, if an initial request times out, followed +// by another request with the same request ID, the server ignores the +// second request to prevent the creation of duplicate commitments.The +// request ID must be a valid UUID +// (https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) +// A zero UUID (00000000-0000-0000-0000-000000000000) is not supported. +func (c *ProjectsLocationsServicesMigrationExecutionsDeleteCall) RequestId(requestId string) *ProjectsLocationsServicesMigrationExecutionsDeleteCall { + c.urlParams_.Set("requestId", requestId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsServicesMigrationExecutionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsServicesMigrationExecutionsDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsServicesMigrationExecutionsDeleteCall) Context(ctx context.Context) *ProjectsLocationsServicesMigrationExecutionsDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsServicesMigrationExecutionsDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsServicesMigrationExecutionsDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "metastore.projects.locations.services.migrationExecutions.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsServicesMigrationExecutionsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes a single migration execution.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/services/{servicesId}/migrationExecutions/{migrationExecutionsId}", + // "httpMethod": "DELETE", + // "id": "metastore.projects.locations.services.migrationExecutions.delete", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The relative resource name of the migrationExecution to delete, in the following form:projects/{project_number}/locations/{location_id}/services/{service_id}/migrationExecutions/{migration_execution_id}.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/services/[^/]+/migrationExecutions/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "requestId": { + // "description": "Optional. A request ID. Specify a unique request ID to allow the server to ignore the request if it has completed. The server will ignore subsequent requests that provide a duplicate request ID for at least 60 minutes after the first request.For example, if an initial request times out, followed by another request with the same request ID, the server ignores the second request to prevent the creation of duplicate commitments.The request ID must be a valid UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1beta/{+name}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "metastore.projects.locations.services.migrationExecutions.get": + +type ProjectsLocationsServicesMigrationExecutionsGetCall struct { + s *APIService + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets details of a single migration execution. +// +// - name: The relative resource name of the migration execution to +// retrieve, in the following +// form:projects/{project_number}/locations/{location_id}/services/{ser +// vice_id}/migrationExecutions/{migration_execution_id}. +func (r *ProjectsLocationsServicesMigrationExecutionsService) Get(name string) *ProjectsLocationsServicesMigrationExecutionsGetCall { + c := &ProjectsLocationsServicesMigrationExecutionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsServicesMigrationExecutionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsServicesMigrationExecutionsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsServicesMigrationExecutionsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsServicesMigrationExecutionsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsServicesMigrationExecutionsGetCall) Context(ctx context.Context) *ProjectsLocationsServicesMigrationExecutionsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsServicesMigrationExecutionsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsServicesMigrationExecutionsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "metastore.projects.locations.services.migrationExecutions.get" call. +// Exactly one of *MigrationExecution or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *MigrationExecution.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsServicesMigrationExecutionsGetCall) Do(opts ...googleapi.CallOption) (*MigrationExecution, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &MigrationExecution{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets details of a single migration execution.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/services/{servicesId}/migrationExecutions/{migrationExecutionsId}", + // "httpMethod": "GET", + // "id": "metastore.projects.locations.services.migrationExecutions.get", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The relative resource name of the migration execution to retrieve, in the following form:projects/{project_number}/locations/{location_id}/services/{service_id}/migrationExecutions/{migration_execution_id}.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/services/[^/]+/migrationExecutions/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta/{+name}", + // "response": { + // "$ref": "MigrationExecution" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "metastore.projects.locations.services.migrationExecutions.list": + +type ProjectsLocationsServicesMigrationExecutionsListCall struct { + s *APIService + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists migration executions on a service. +// +// - parent: The relative resource name of the service whose migration +// executions to list, in the following +// form:projects/{project_number}/locations/{location_id}/services/{ser +// vice_id}/migrationExecutions. +func (r *ProjectsLocationsServicesMigrationExecutionsService) List(parent string) *ProjectsLocationsServicesMigrationExecutionsListCall { + c := &ProjectsLocationsServicesMigrationExecutionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// Filter sets the optional parameter "filter": The filter to apply to +// list results. +func (c *ProjectsLocationsServicesMigrationExecutionsListCall) Filter(filter string) *ProjectsLocationsServicesMigrationExecutionsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// OrderBy sets the optional parameter "orderBy": Specify the ordering +// of results as described in Sorting Order +// (https://cloud.google.com/apis/design/design_patterns#sorting_order). +// If not specified, the results will be sorted in the default order. +func (c *ProjectsLocationsServicesMigrationExecutionsListCall) OrderBy(orderBy string) *ProjectsLocationsServicesMigrationExecutionsListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of migration executions to return. The response may contain less than +// the maximum number. If unspecified, no more than 500 migration +// executions are returned. The maximum value is 1000; values above 1000 +// are changed to 1000. +func (c *ProjectsLocationsServicesMigrationExecutionsListCall) PageSize(pageSize int64) *ProjectsLocationsServicesMigrationExecutionsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token, +// received from a previous DataprocMetastore.ListMigrationExecutions +// call. Provide this token to retrieve the subsequent page.To retrieve +// the first page, supply an empty page token.When paginating, other +// parameters provided to DataprocMetastore.ListMigrationExecutions must +// match the call that provided the page token. +func (c *ProjectsLocationsServicesMigrationExecutionsListCall) PageToken(pageToken string) *ProjectsLocationsServicesMigrationExecutionsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsServicesMigrationExecutionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsServicesMigrationExecutionsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsServicesMigrationExecutionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsServicesMigrationExecutionsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsServicesMigrationExecutionsListCall) Context(ctx context.Context) *ProjectsLocationsServicesMigrationExecutionsListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsServicesMigrationExecutionsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsServicesMigrationExecutionsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/migrationExecutions") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "metastore.projects.locations.services.migrationExecutions.list" call. +// Exactly one of *ListMigrationExecutionsResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ListMigrationExecutionsResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsServicesMigrationExecutionsListCall) Do(opts ...googleapi.CallOption) (*ListMigrationExecutionsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &ListMigrationExecutionsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists migration executions on a service.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/services/{servicesId}/migrationExecutions", + // "httpMethod": "GET", + // "id": "metastore.projects.locations.services.migrationExecutions.list", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "filter": { + // "description": "Optional. The filter to apply to list results.", + // "location": "query", + // "type": "string" + // }, + // "orderBy": { + // "description": "Optional. Specify the ordering of results as described in Sorting Order (https://cloud.google.com/apis/design/design_patterns#sorting_order). If not specified, the results will be sorted in the default order.", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "Optional. The maximum number of migration executions to return. The response may contain less than the maximum number. If unspecified, no more than 500 migration executions are returned. The maximum value is 1000; values above 1000 are changed to 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. A page token, received from a previous DataprocMetastore.ListMigrationExecutions call. Provide this token to retrieve the subsequent page.To retrieve the first page, supply an empty page token.When paginating, other parameters provided to DataprocMetastore.ListMigrationExecutions must match the call that provided the page token.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The relative resource name of the service whose migration executions to list, in the following form:projects/{project_number}/locations/{location_id}/services/{service_id}/migrationExecutions.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/services/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta/{+parent}/migrationExecutions", + // "response": { + // "$ref": "ListMigrationExecutionsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsServicesMigrationExecutionsListCall) Pages(ctx context.Context, f func(*ListMigrationExecutionsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} diff --git a/redis/v1/redis-api.json b/redis/v1/redis-api.json index 3019dcf9ec2..ebe7fcd4c62 100644 --- a/redis/v1/redis-api.json +++ b/redis/v1/redis-api.json @@ -821,7 +821,7 @@ } } }, - "revision": "20240319", + "revision": "20240327", "rootUrl": "https://redis.googleapis.com/", "schemas": { "AOFConfig": { @@ -995,10 +995,34 @@ "description": "Required. Unique name of the resource in this scope including project and location using the form: `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`", "type": "string" }, + "nodeType": { + "description": "Optional. The type of a redis node in the cluster. NodeType determines the underlying machine-type of a redis node.", + "enum": [ + "NODE_TYPE_UNSPECIFIED", + "REDIS_SHARED_CORE_NANO", + "REDIS_HIGHMEM_MEDIUM", + "REDIS_HIGHMEM_XLARGE", + "REDIS_STANDARD_SMALL" + ], + "enumDescriptions": [ + "", + "Redis shared core nano node_type.", + "Redis highmem medium node_type.", + "Redis highmem xlarge node_type.", + "Redis standard small node_type." + ], + "type": "string" + }, "persistenceConfig": { "$ref": "ClusterPersistenceConfig", "description": "Optional. Persistence config (RDB, AOF) for the cluster." }, + "preciseSizeGb": { + "description": "Output only. Precise value of redis memory size in GB for the entire cluster.", + "format": "double", + "readOnly": true, + "type": "number" + }, "pscConfigs": { "description": "Required. Each PscConfig configures the consumer network where IPs will be designated to the cluster for client access through Private Service Connect Automation. Currently, only one PscConfig is supported.", "items": { diff --git a/redis/v1/redis-gen.go b/redis/v1/redis-gen.go index ab35feb8d50..a481dd649f5 100644 --- a/redis/v1/redis-gen.go +++ b/redis/v1/redis-gen.go @@ -469,10 +469,25 @@ type Cluster struct { // `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` Name string `json:"name,omitempty"` + // NodeType: Optional. The type of a redis node in the cluster. NodeType + // determines the underlying machine-type of a redis node. + // + // Possible values: + // "NODE_TYPE_UNSPECIFIED" + // "REDIS_SHARED_CORE_NANO" - Redis shared core nano node_type. + // "REDIS_HIGHMEM_MEDIUM" - Redis highmem medium node_type. + // "REDIS_HIGHMEM_XLARGE" - Redis highmem xlarge node_type. + // "REDIS_STANDARD_SMALL" - Redis standard small node_type. + NodeType string `json:"nodeType,omitempty"` + // PersistenceConfig: Optional. Persistence config (RDB, AOF) for the // cluster. PersistenceConfig *ClusterPersistenceConfig `json:"persistenceConfig,omitempty"` + // PreciseSizeGb: Output only. Precise value of redis memory size in GB + // for the entire cluster. + PreciseSizeGb float64 `json:"preciseSizeGb,omitempty"` + // PscConfigs: Required. Each PscConfig configures the consumer network // where IPs will be designated to the cluster for client access through // Private Service Connect Automation. Currently, only one PscConfig is @@ -556,6 +571,20 @@ func (s *Cluster) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +func (s *Cluster) UnmarshalJSON(data []byte) error { + type NoMethod Cluster + var s1 struct { + PreciseSizeGb gensupport.JSONFloat64 `json:"preciseSizeGb"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.PreciseSizeGb = float64(s1.PreciseSizeGb) + return nil +} + // ClusterPersistenceConfig: Configuration of the persistence // functionality. type ClusterPersistenceConfig struct { diff --git a/redis/v1beta1/redis-api.json b/redis/v1beta1/redis-api.json index 14c3d40bb03..47ee12fc763 100644 --- a/redis/v1beta1/redis-api.json +++ b/redis/v1beta1/redis-api.json @@ -821,7 +821,7 @@ } } }, - "revision": "20240319", + "revision": "20240327", "rootUrl": "https://redis.googleapis.com/", "schemas": { "AOFConfig": { @@ -995,10 +995,34 @@ "description": "Required. Unique name of the resource in this scope including project and location using the form: `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`", "type": "string" }, + "nodeType": { + "description": "Optional. The type of a redis node in the cluster. NodeType determines the underlying machine-type of a redis node.", + "enum": [ + "NODE_TYPE_UNSPECIFIED", + "REDIS_SHARED_CORE_NANO", + "REDIS_HIGHMEM_MEDIUM", + "REDIS_HIGHMEM_XLARGE", + "REDIS_STANDARD_SMALL" + ], + "enumDescriptions": [ + "", + "Redis shared core nano node_type.", + "Redis highmem medium node_type.", + "Redis highmem xlarge node_type.", + "Redis standard small node_type." + ], + "type": "string" + }, "persistenceConfig": { "$ref": "ClusterPersistenceConfig", "description": "Optional. Persistence config (RDB, AOF) for the cluster." }, + "preciseSizeGb": { + "description": "Output only. Precise value of redis memory size in GB for the entire cluster.", + "format": "double", + "readOnly": true, + "type": "number" + }, "pscConfigs": { "description": "Required. Each PscConfig configures the consumer network where IPs will be designated to the cluster for client access through Private Service Connect Automation. Currently, only one PscConfig is supported.", "items": { diff --git a/redis/v1beta1/redis-gen.go b/redis/v1beta1/redis-gen.go index 5387ba85155..5b5e7c52d28 100644 --- a/redis/v1beta1/redis-gen.go +++ b/redis/v1beta1/redis-gen.go @@ -469,10 +469,25 @@ type Cluster struct { // `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` Name string `json:"name,omitempty"` + // NodeType: Optional. The type of a redis node in the cluster. NodeType + // determines the underlying machine-type of a redis node. + // + // Possible values: + // "NODE_TYPE_UNSPECIFIED" + // "REDIS_SHARED_CORE_NANO" - Redis shared core nano node_type. + // "REDIS_HIGHMEM_MEDIUM" - Redis highmem medium node_type. + // "REDIS_HIGHMEM_XLARGE" - Redis highmem xlarge node_type. + // "REDIS_STANDARD_SMALL" - Redis standard small node_type. + NodeType string `json:"nodeType,omitempty"` + // PersistenceConfig: Optional. Persistence config (RDB, AOF) for the // cluster. PersistenceConfig *ClusterPersistenceConfig `json:"persistenceConfig,omitempty"` + // PreciseSizeGb: Output only. Precise value of redis memory size in GB + // for the entire cluster. + PreciseSizeGb float64 `json:"preciseSizeGb,omitempty"` + // PscConfigs: Required. Each PscConfig configures the consumer network // where IPs will be designated to the cluster for client access through // Private Service Connect Automation. Currently, only one PscConfig is @@ -556,6 +571,20 @@ func (s *Cluster) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +func (s *Cluster) UnmarshalJSON(data []byte) error { + type NoMethod Cluster + var s1 struct { + PreciseSizeGb gensupport.JSONFloat64 `json:"preciseSizeGb"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.PreciseSizeGb = float64(s1.PreciseSizeGb) + return nil +} + // ClusterPersistenceConfig: Configuration of the persistence // functionality. type ClusterPersistenceConfig struct { diff --git a/solar/v1/solar-api.json b/solar/v1/solar-api.json new file mode 100644 index 00000000000..345b9ef66e2 --- /dev/null +++ b/solar/v1/solar-api.json @@ -0,0 +1,926 @@ +{ + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-platform": { + "description": "See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account." + } + } + } + }, + "basePath": "", + "baseUrl": "https://solar.googleapis.com/", + "batchPath": "batch", + "canonicalName": "Solar", + "description": "Solar API.", + "discoveryVersion": "v1", + "documentationLink": "https://developers.google.com/maps/documentation/solar", + "fullyEncodeReservedExpansion": true, + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "id": "solar:v1", + "kind": "discovery#restDescription", + "mtlsRootUrl": "https://solar.mtls.googleapis.com/", + "name": "solar", + "ownerDomain": "google.com", + "ownerName": "Google", + "parameters": { + "$.xgafv": { + "description": "V1 error format.", + "enum": [ + "1", + "2" + ], + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "type": "string" + }, + "access_token": { + "description": "OAuth access token.", + "location": "query", + "type": "string" + }, + "alt": { + "default": "json", + "description": "Data format for response.", + "enum": [ + "json", + "media", + "proto" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ], + "location": "query", + "type": "string" + }, + "callback": { + "description": "JSONP", + "location": "query", + "type": "string" + }, + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "location": "query", + "type": "string" + }, + "key": { + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query", + "type": "string" + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "location": "query", + "type": "string" + }, + "prettyPrint": { + "default": "true", + "description": "Returns response with indentations and line breaks.", + "location": "query", + "type": "boolean" + }, + "quotaUser": { + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", + "location": "query", + "type": "string" + }, + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "location": "query", + "type": "string" + }, + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "location": "query", + "type": "string" + } + }, + "protocol": "rest", + "resources": { + "buildingInsights": { + "methods": { + "findClosest": { + "description": "Locates the closest building to a query point. Returns an error with code `NOT_FOUND` if there are no buildings within approximately 50m of the query point.", + "flatPath": "v1/buildingInsights:findClosest", + "httpMethod": "GET", + "id": "solar.buildingInsights.findClosest", + "parameterOrder": [], + "parameters": { + "location.latitude": { + "description": "The latitude in degrees. It must be in the range [-90.0, +90.0].", + "format": "double", + "location": "query", + "type": "number" + }, + "location.longitude": { + "description": "The longitude in degrees. It must be in the range [-180.0, +180.0].", + "format": "double", + "location": "query", + "type": "number" + }, + "requiredQuality": { + "description": "Optional. The minimum quality level allowed in the results. No result with lower quality than this will be returned. Not specifying this is equivalent to restricting to HIGH quality only.", + "enum": [ + "IMAGERY_QUALITY_UNSPECIFIED", + "HIGH", + "MEDIUM", + "LOW" + ], + "enumDescriptions": [ + "No quality is known.", + "The underlying imagery and DSM data were processed at 0.1 m/pixel.", + "The underlying imagery and DSM data were processed at 0.25 m/pixel.", + "The underlying imagery and DSM data were processed at 0.5 m/pixel." + ], + "location": "query", + "type": "string" + } + }, + "path": "v1/buildingInsights:findClosest", + "response": { + "$ref": "BuildingInsights" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, + "dataLayers": { + "methods": { + "get": { + "description": "Gets solar information for a region surrounding a location. Returns an error with code `NOT_FOUND` if the location is outside the coverage area.", + "flatPath": "v1/dataLayers:get", + "httpMethod": "GET", + "id": "solar.dataLayers.get", + "parameterOrder": [], + "parameters": { + "location.latitude": { + "description": "The latitude in degrees. It must be in the range [-90.0, +90.0].", + "format": "double", + "location": "query", + "type": "number" + }, + "location.longitude": { + "description": "The longitude in degrees. It must be in the range [-180.0, +180.0].", + "format": "double", + "location": "query", + "type": "number" + }, + "pixelSizeMeters": { + "description": "Optional. The minimum scale, in meters per pixel, of the data to return. Values of 0.1 (the default, if this field is not set explicitly), 0.25, 0.5, and 1.0 are supported. Imagery components whose normal resolution is less than `pixel_size_meters` will be returned at the resolution specified by `pixel_size_meters`; imagery components whose normal resolution is equal to or greater than `pixel_size_meters` will be returned at that normal resolution.", + "format": "float", + "location": "query", + "type": "number" + }, + "radiusMeters": { + "description": "Required. The radius, in meters, defining the region surrounding that centre point for which data should be returned. The limitations on this value are: * Any value up to 100m can always be specified. * Values over 100m can be specified, as long as `radius_meters` \u003c= `pixel_size_meters * 1000`. * However, for values over 175m, the `DataLayerView` in the request must not include monthly flux or hourly shade.", + "format": "float", + "location": "query", + "type": "number" + }, + "requiredQuality": { + "description": "Optional. The minimum quality level allowed in the results. No result with lower quality than this will be returned. Not specifying this is equivalent to restricting to HIGH quality only.", + "enum": [ + "IMAGERY_QUALITY_UNSPECIFIED", + "HIGH", + "MEDIUM", + "LOW" + ], + "enumDescriptions": [ + "No quality is known.", + "The underlying imagery and DSM data were processed at 0.1 m/pixel.", + "The underlying imagery and DSM data were processed at 0.25 m/pixel.", + "The underlying imagery and DSM data were processed at 0.5 m/pixel." + ], + "location": "query", + "type": "string" + }, + "view": { + "description": "Optional. The desired subset of the data to return.", + "enum": [ + "DATA_LAYER_VIEW_UNSPECIFIED", + "DSM_LAYER", + "IMAGERY_LAYERS", + "IMAGERY_AND_ANNUAL_FLUX_LAYERS", + "IMAGERY_AND_ALL_FLUX_LAYERS", + "FULL_LAYERS" + ], + "enumDescriptions": [ + "Equivalent to FULL.", + "Get the DSM only.", + "Get the DSM, RGB, and mask.", + "Get the DSM, RGB, mask, and annual flux.", + "Get the DSM, RGB, mask, annual flux, and monthly flux.", + "Get all data." + ], + "location": "query", + "type": "string" + } + }, + "path": "v1/dataLayers:get", + "response": { + "$ref": "DataLayers" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, + "geoTiff": { + "methods": { + "get": { + "description": "Returns an image by its ID.", + "flatPath": "v1/geoTiff:get", + "httpMethod": "GET", + "id": "solar.geoTiff.get", + "parameterOrder": [], + "parameters": { + "id": { + "description": "Required. The ID of the asset being requested.", + "location": "query", + "type": "string" + } + }, + "path": "v1/geoTiff:get", + "response": { + "$ref": "HttpBody" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } + }, + "revision": "20240327", + "rootUrl": "https://solar.googleapis.com/", + "schemas": { + "BuildingInsights": { + "description": "Response message for `Solar.FindClosestBuildingInsights`. Information about the location, dimensions, and solar potential of a building.", + "id": "BuildingInsights", + "properties": { + "administrativeArea": { + "description": "Administrative area 1 (e.g., in the US, the state) that contains this building. For example, in the US, the abbreviation might be \"MA\" or \"CA.\"", + "type": "string" + }, + "boundingBox": { + "$ref": "LatLngBox", + "description": "The bounding box of the building." + }, + "center": { + "$ref": "LatLng", + "description": "A point near the center of the building." + }, + "imageryDate": { + "$ref": "Date", + "description": "Date that the underlying imagery was acquired. This is approximate." + }, + "imageryProcessedDate": { + "$ref": "Date", + "description": "When processing was completed on this imagery." + }, + "imageryQuality": { + "description": "The quality of the imagery used to compute the data for this building.", + "enum": [ + "IMAGERY_QUALITY_UNSPECIFIED", + "HIGH", + "MEDIUM", + "LOW" + ], + "enumDescriptions": [ + "No quality is known.", + "The underlying imagery and DSM data were processed at 0.1 m/pixel.", + "The underlying imagery and DSM data were processed at 0.25 m/pixel.", + "The underlying imagery and DSM data were processed at 0.5 m/pixel." + ], + "type": "string" + }, + "name": { + "description": "The resource name for the building, of the format `building/`.", + "type": "string" + }, + "postalCode": { + "description": "Postal code (e.g., US zip code) this building is contained by.", + "type": "string" + }, + "regionCode": { + "description": "Region code for the country (or region) this building is in.", + "type": "string" + }, + "solarPotential": { + "$ref": "SolarPotential", + "description": "Solar potential of the building." + }, + "statisticalArea": { + "description": "Statistical area (e.g., US census tract) this building is in.", + "type": "string" + } + }, + "type": "object" + }, + "CashPurchaseSavings": { + "description": "Cost and benefit of an outright purchase of a particular configuration of solar panels with a particular electricity usage.", + "id": "CashPurchaseSavings", + "properties": { + "outOfPocketCost": { + "$ref": "Money", + "description": "Initial cost before tax incentives: the amount that must be paid out-of-pocket. Contrast with `upfront_cost`, which is after tax incentives." + }, + "paybackYears": { + "description": "Number of years until payback occurs. A negative value means payback never occurs within the lifetime period.", + "format": "float", + "type": "number" + }, + "rebateValue": { + "$ref": "Money", + "description": "The value of all tax rebates." + }, + "savings": { + "$ref": "SavingsOverTime", + "description": "How much is saved (or not) over the lifetime period." + }, + "upfrontCost": { + "$ref": "Money", + "description": "Initial cost after tax incentives: it's the amount that must be paid during first year. Contrast with `out_of_pocket_cost`, which is before tax incentives." + } + }, + "type": "object" + }, + "DataLayers": { + "description": "Information about the solar potential of a region. The actual data are contained in a number of GeoTIFF files covering the requested region, for which this message contains URLs: Each string in the `DataLayers` message contains a URL from which the corresponding GeoTIFF can be fetched. These URLs are valid for a few hours after they've been generated. Most of the GeoTIFF files are at a resolution of 0.1m/pixel, but the monthly flux file is at 0.5m/pixel, and the hourly shade files are at 1m/pixel. If a `pixel_size_meters` value was specified in the `GetDataLayersRequest`, then the minimum resolution in the GeoTIFF files will be that value.", + "id": "DataLayers", + "properties": { + "annualFluxUrl": { + "description": "The URL for the annual flux map (annual sunlight on roofs) of the region. Values are kWh/kW/year. This is *unmasked flux*: flux is computed for every location, not just building rooftops. Invalid locations are stored as -9999: locations outside our coverage area will be invalid, and a few locations inside the coverage area, where we were unable to calculate flux, will also be invalid.", + "type": "string" + }, + "dsmUrl": { + "description": "The URL for an image of the DSM (Digital Surface Model) of the region. Values are in meters above EGM96 geoid (i.e., sea level). Invalid locations (where we don't have data) are stored as -9999.", + "type": "string" + }, + "hourlyShadeUrls": { + "description": "Twelve URLs for hourly shade, corresponding to January...December, in order. Each GeoTIFF will contain 24 bands, corresponding to the 24 hours of the day. Each pixel is a 32 bit integer, corresponding to the (up to) 31 days of that month; a 1 bit means that the corresponding location is able to see the sun at that day, of that hour, of that month. Invalid locations are stored as -9999 (since this is negative, it has bit 31 set, and no valid value could have bit 31 set as that would correspond to the 32nd day of the month). An example may be useful. If you want to know whether a point (at pixel location (x, y)) saw sun at 4pm on the 22nd of June you would: 1. fetch the sixth URL in this list (corresponding to June). 1. look up the 17th channel (corresponding to 4pm). 1. read the 32-bit value at (x, y). 1. read bit 21 of the value (corresponding to the 22nd of the month). 1. if that bit is a 1, then that spot saw the sun at 4pm 22 June. More formally: Given `month` (1-12), `day` (1...month max; February has 28 days) and `hour` (0-23), the shade/sun for that month/day/hour at a position `(x, y)` is the bit ``` (hourly_shade[month - 1])(x, y)[hour] \u0026 (1 \u003c\u003c (day - 1)) ``` where `(x, y)` is spatial indexing, `[month - 1]` refers to fetching the `month - 1`st URL (indexing from zero), `[hour]` is indexing into the channels, and a final non-zero result means \"sunny\". There are no leap days, and DST doesn't exist (all days are 24 hours long; noon is always \"standard time\" noon).", + "items": { + "type": "string" + }, + "type": "array" + }, + "imageryDate": { + "$ref": "Date", + "description": "When the source imagery (from which all the other data are derived) in this region was taken. It is necessarily somewhat approximate, as the images may have been taken over more than one day." + }, + "imageryProcessedDate": { + "$ref": "Date", + "description": "When processing was completed on this imagery." + }, + "imageryQuality": { + "description": "The quality of the result's imagery.", + "enum": [ + "IMAGERY_QUALITY_UNSPECIFIED", + "HIGH", + "MEDIUM", + "LOW" + ], + "enumDescriptions": [ + "No quality is known.", + "The underlying imagery and DSM data were processed at 0.1 m/pixel.", + "The underlying imagery and DSM data were processed at 0.25 m/pixel.", + "The underlying imagery and DSM data were processed at 0.5 m/pixel." + ], + "type": "string" + }, + "maskUrl": { + "description": "The URL for the building mask image: one bit per pixel saying whether that pixel is considered to be part of a rooftop or not.", + "type": "string" + }, + "monthlyFluxUrl": { + "description": "The URL for the monthly flux map (sunlight on roofs, broken down by month) of the region. Values are kWh/kW/year. The GeoTIFF pointed to by this URL will contain twelve bands, corresponding to January...December, in order.", + "type": "string" + }, + "rgbUrl": { + "description": "The URL for an image of RGB data (aerial photo) of the region.", + "type": "string" + } + }, + "type": "object" + }, + "Date": { + "description": "Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * A full date, with non-zero year, month, and day values. * A month and day, with a zero year (for example, an anniversary). * A year on its own, with a zero month and a zero day. * A year and month, with a zero day (for example, a credit card expiration date). Related types: * google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp", + "id": "Date", + "properties": { + "day": { + "description": "Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.", + "format": "int32", + "type": "integer" + }, + "month": { + "description": "Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.", + "format": "int32", + "type": "integer" + }, + "year": { + "description": "Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.", + "format": "int32", + "type": "integer" + } + }, + "type": "object" + }, + "FinancedPurchaseSavings": { + "description": "Cost and benefit of using a loan to buy a particular configuration of solar panels with a particular electricity usage.", + "id": "FinancedPurchaseSavings", + "properties": { + "annualLoanPayment": { + "$ref": "Money", + "description": "Annual loan payments." + }, + "loanInterestRate": { + "description": "The interest rate on loans assumed in this set of calculations.", + "format": "float", + "type": "number" + }, + "rebateValue": { + "$ref": "Money", + "description": "The value of all tax rebates (including Federal Investment Tax Credit (ITC))." + }, + "savings": { + "$ref": "SavingsOverTime", + "description": "How much is saved (or not) over the lifetime period." + } + }, + "type": "object" + }, + "FinancialAnalysis": { + "description": "Analysis of the cost and benefits of the optimum solar layout for a particular electric bill size.", + "id": "FinancialAnalysis", + "properties": { + "averageKwhPerMonth": { + "description": "How much electricity the house uses in an average month, based on the bill size and the local electricity rates.", + "format": "float", + "type": "number" + }, + "cashPurchaseSavings": { + "$ref": "CashPurchaseSavings", + "description": "Cost and benefit of buying the solar panels with cash." + }, + "defaultBill": { + "description": "Whether this is the bill size selected to be the default bill for the area this building is in. Exactly one `FinancialAnalysis` in `BuildingSolarPotential` should have `default_bill` set.", + "type": "boolean" + }, + "financedPurchaseSavings": { + "$ref": "FinancedPurchaseSavings", + "description": "Cost and benefit of buying the solar panels by financing the purchase." + }, + "financialDetails": { + "$ref": "FinancialDetails", + "description": "Financial information that applies regardless of the financing method used." + }, + "leasingSavings": { + "$ref": "LeasingSavings", + "description": "Cost and benefit of leasing the solar panels." + }, + "monthlyBill": { + "$ref": "Money", + "description": "The monthly electric bill this analysis assumes." + }, + "panelConfigIndex": { + "description": "Index in solar_panel_configs of the optimum solar layout for this bill size. This can be -1 indicating that there is no layout. In this case, the remaining submessages will be omitted.", + "format": "int32", + "type": "integer" + } + }, + "type": "object" + }, + "FinancialDetails": { + "description": "Details of a financial analysis. Some of these details are already stored at higher levels (e.g., out of pocket cost). Total money amounts are over a lifetime period defined by the panel_lifetime_years field in SolarPotential. Note: The out of pocket cost of purchasing the panels is given in the out_of_pocket_cost field in CashPurchaseSavings.", + "id": "FinancialDetails", + "properties": { + "costOfElectricityWithoutSolar": { + "$ref": "Money", + "description": "Total cost of electricity the user would have paid over the lifetime period if they didn't install solar." + }, + "federalIncentive": { + "$ref": "Money", + "description": "Amount of money available from federal incentives; this applies if the user buys (with or without a loan) the panels." + }, + "initialAcKwhPerYear": { + "description": "How many AC kWh we think the solar panels will generate in their first year.", + "format": "float", + "type": "number" + }, + "lifetimeSrecTotal": { + "$ref": "Money", + "description": "Amount of money the user will receive from Solar Renewable Energy Credits over the panel lifetime; this applies if the user buys (with or without a loan) the panels." + }, + "netMeteringAllowed": { + "description": "Whether net metering is allowed.", + "type": "boolean" + }, + "percentageExportedToGrid": { + "description": "The percentage (0-100) of solar electricity production we assumed was exported to the grid, based on the first quarter of production. This affects the calculations if net metering is not allowed.", + "format": "float", + "type": "number" + }, + "remainingLifetimeUtilityBill": { + "$ref": "Money", + "description": "Utility bill for electricity not produced by solar, for the lifetime of the panels." + }, + "solarPercentage": { + "description": "Percentage (0-100) of the user's power supplied by solar. Valid for the first year but approximately correct for future years.", + "format": "float", + "type": "number" + }, + "stateIncentive": { + "$ref": "Money", + "description": "Amount of money available from state incentives; this applies if the user buys (with or without a loan) the panels." + }, + "utilityIncentive": { + "$ref": "Money", + "description": "Amount of money available from utility incentives; this applies if the user buys (with or without a loan) the panels." + } + }, + "type": "object" + }, + "HttpBody": { + "description": "Message that represents an arbitrary HTTP body. It should only be used for payload formats that can't be represented as JSON, such as raw binary or an HTML page. This message can be used both in streaming and non-streaming API methods in the request as well as the response. It can be used as a top-level request field, which is convenient if one wants to extract parameters from either the URL or HTTP template into the request fields and also want access to the raw HTTP body. Example: message GetResourceRequest { // A unique request id. string request_id = 1; // The raw HTTP body is bound to this field. google.api.HttpBody http_body = 2; } service ResourceService { rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); rpc UpdateResource(google.api.HttpBody) returns (google.protobuf.Empty); } Example with streaming methods: service CaldavService { rpc GetCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); rpc UpdateCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); } Use of this type only changes how the request and response bodies are handled, all other features will continue to work unchanged.", + "id": "HttpBody", + "properties": { + "contentType": { + "description": "The HTTP Content-Type header value specifying the content type of the body.", + "type": "string" + }, + "data": { + "description": "The HTTP request/response body as raw binary.", + "format": "byte", + "type": "string" + }, + "extensions": { + "description": "Application specific response metadata. Must be set in the first response for streaming APIs.", + "items": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "LatLng": { + "description": "An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges.", + "id": "LatLng", + "properties": { + "latitude": { + "description": "The latitude in degrees. It must be in the range [-90.0, +90.0].", + "format": "double", + "type": "number" + }, + "longitude": { + "description": "The longitude in degrees. It must be in the range [-180.0, +180.0].", + "format": "double", + "type": "number" + } + }, + "type": "object" + }, + "LatLngBox": { + "description": "A bounding box in lat/lng coordinates.", + "id": "LatLngBox", + "properties": { + "ne": { + "$ref": "LatLng", + "description": "The northeast corner of the box." + }, + "sw": { + "$ref": "LatLng", + "description": "The southwest corner of the box." + } + }, + "type": "object" + }, + "LeasingSavings": { + "description": "Cost and benefit of leasing a particular configuration of solar panels with a particular electricity usage.", + "id": "LeasingSavings", + "properties": { + "annualLeasingCost": { + "$ref": "Money", + "description": "Estimated annual leasing cost." + }, + "leasesAllowed": { + "description": "Whether leases are allowed in this juristiction (leases are not allowed in some states). If this field is false, then the values in this message should probably be ignored.", + "type": "boolean" + }, + "leasesSupported": { + "description": "Whether leases are supported in this juristiction by the financial calculation engine. If this field is false, then the values in this message should probably be ignored. This is independent of `leases_allowed`: in some areas leases are allowed, but under conditions that aren't handled by the financial models.", + "type": "boolean" + }, + "savings": { + "$ref": "SavingsOverTime", + "description": "How much is saved (or not) over the lifetime period." + } + }, + "type": "object" + }, + "Money": { + "description": "Represents an amount of money with its currency type.", + "id": "Money", + "properties": { + "currencyCode": { + "description": "The three-letter currency code defined in ISO 4217.", + "type": "string" + }, + "nanos": { + "description": "Number of nano (10^-9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If `units` is positive, `nanos` must be positive or zero. If `units` is zero, `nanos` can be positive, zero, or negative. If `units` is negative, `nanos` must be negative or zero. For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.", + "format": "int32", + "type": "integer" + }, + "units": { + "description": "The whole units of the amount. For example if `currencyCode` is `\"USD\"`, then 1 unit is one US dollar.", + "format": "int64", + "type": "string" + } + }, + "type": "object" + }, + "RoofSegmentSizeAndSunshineStats": { + "description": "Information about the size and sunniness quantiles of a roof segment.", + "id": "RoofSegmentSizeAndSunshineStats", + "properties": { + "azimuthDegrees": { + "description": "Compass direction the roof segment is pointing in. 0 = North, 90 = East, 180 = South. For a \"flat\" roof segment (`pitch_degrees` very near 0), azimuth is not well defined, so for consistency, we define it arbitrarily to be 0 (North).", + "format": "float", + "type": "number" + }, + "boundingBox": { + "$ref": "LatLngBox", + "description": "The bounding box of the roof segment." + }, + "center": { + "$ref": "LatLng", + "description": "A point near the center of the roof segment." + }, + "pitchDegrees": { + "description": "Angle of the roof segment relative to the theoretical ground plane. 0 = parallel to the ground, 90 = perpendicular to the ground.", + "format": "float", + "type": "number" + }, + "planeHeightAtCenterMeters": { + "description": "The height of the roof segment plane, in meters above sea level, at the point designated by `center`. Together with the pitch, azimuth, and center location, this fully defines the roof segment plane.", + "format": "float", + "type": "number" + }, + "stats": { + "$ref": "SizeAndSunshineStats", + "description": "Total size and sunlight quantiles for the roof segment." + } + }, + "type": "object" + }, + "RoofSegmentSummary": { + "description": "Information about a roof segment on the building, with some number of panels placed on it.", + "id": "RoofSegmentSummary", + "properties": { + "azimuthDegrees": { + "description": "Compass direction the roof segment is pointing in. 0 = North, 90 = East, 180 = South. For a \"flat\" roof segment (`pitch_degrees` very near 0), azimuth is not well defined, so for consistency, we define it arbitrarily to be 0 (North).", + "format": "float", + "type": "number" + }, + "panelsCount": { + "description": "The total number of panels on this segment.", + "format": "int32", + "type": "integer" + }, + "pitchDegrees": { + "description": "Angle of the roof segment relative to the theoretical ground plane. 0 = parallel to the ground, 90 = perpendicular to the ground.", + "format": "float", + "type": "number" + }, + "segmentIndex": { + "description": "Index in roof_segment_stats of the corresponding `RoofSegmentSizeAndSunshineStats`.", + "format": "int32", + "type": "integer" + }, + "yearlyEnergyDcKwh": { + "description": "How much sunlight energy this part of the layout captures over the course of a year, in DC kWh, assuming the panels described above.", + "format": "float", + "type": "number" + } + }, + "type": "object" + }, + "SavingsOverTime": { + "description": "Financial information that's shared between different financing methods.", + "id": "SavingsOverTime", + "properties": { + "financiallyViable": { + "description": "Indicates whether this scenario is financially viable. Will be false for scenarios with poor financial viability (e.g., money-losing).", + "type": "boolean" + }, + "presentValueOfSavingsLifetime": { + "$ref": "Money", + "description": "Using the assumed discount rate, what is the present value of the cumulative lifetime savings?" + }, + "presentValueOfSavingsYear20": { + "$ref": "Money", + "description": "Using the assumed discount rate, what is the present value of the cumulative 20-year savings?" + }, + "savingsLifetime": { + "$ref": "Money", + "description": "Savings in the entire panel lifetime." + }, + "savingsYear1": { + "$ref": "Money", + "description": "Savings in the first year after panel installation." + }, + "savingsYear20": { + "$ref": "Money", + "description": "Savings in the first twenty years after panel installation." + } + }, + "type": "object" + }, + "SizeAndSunshineStats": { + "description": "Size and sunniness quantiles of a roof, or part of a roof.", + "id": "SizeAndSunshineStats", + "properties": { + "areaMeters2": { + "description": "The area of the roof or roof segment, in m^2. This is the roof area (accounting for tilt), not the ground footprint area.", + "format": "float", + "type": "number" + }, + "groundAreaMeters2": { + "description": "The ground footprint area covered by the roof or roof segment, in m^2.", + "format": "float", + "type": "number" + }, + "sunshineQuantiles": { + "description": "Quantiles of the pointwise sunniness across the area. If there are N values here, this represents the (N-1)-iles. For example, if there are 5 values, then they would be the quartiles (min, 25%, 50%, 75%, max). Values are in annual kWh/kW like max_sunshine_hours_per_year.", + "items": { + "format": "float", + "type": "number" + }, + "type": "array" + } + }, + "type": "object" + }, + "SolarPanel": { + "description": "SolarPanel describes the position, orientation, and production of a single solar panel. See the panel_height_meters, panel_width_meters, and panel_capacity_watts fields in SolarPotential for information on the parameters of the panel.", + "id": "SolarPanel", + "properties": { + "center": { + "$ref": "LatLng", + "description": "The centre of the panel." + }, + "orientation": { + "description": "The orientation of the panel.", + "enum": [ + "SOLAR_PANEL_ORIENTATION_UNSPECIFIED", + "LANDSCAPE", + "PORTRAIT" + ], + "enumDescriptions": [ + "No panel orientation is known.", + "A `LANDSCAPE` panel has its long edge perpendicular to the azimuth direction of the roof segment that it is placed on.", + "A `PORTRAIT` panel has its long edge parallel to the azimuth direction of the roof segment that it is placed on." + ], + "type": "string" + }, + "segmentIndex": { + "description": "Index in roof_segment_stats of the `RoofSegmentSizeAndSunshineStats` which corresponds to the roof segment that this panel is placed on.", + "format": "int32", + "type": "integer" + }, + "yearlyEnergyDcKwh": { + "description": "How much sunlight energy this layout captures over the course of a year, in DC kWh.", + "format": "float", + "type": "number" + } + }, + "type": "object" + }, + "SolarPanelConfig": { + "description": "SolarPanelConfig describes a particular placement of solar panels on the roof.", + "id": "SolarPanelConfig", + "properties": { + "panelsCount": { + "description": "Total number of panels. Note that this is redundant to (the sum of) the corresponding fields in roof_segment_summaries.", + "format": "int32", + "type": "integer" + }, + "roofSegmentSummaries": { + "description": "Information about the production of each roof segment that is carrying at least one panel in this layout. `roof_segment_summaries[i]` describes the i-th roof segment, including its size, expected production and orientation.", + "items": { + "$ref": "RoofSegmentSummary" + }, + "type": "array" + }, + "yearlyEnergyDcKwh": { + "description": "How much sunlight energy this layout captures over the course of a year, in DC kWh, assuming the panels described above.", + "format": "float", + "type": "number" + } + }, + "type": "object" + }, + "SolarPotential": { + "description": "Information about the solar potential of a building. A number of fields in this are defined in terms of \"panels\". The fields panel_capacity_watts, panel_height_meters, and panel_width_meters describe the parameters of the model of panel used in these calculations.", + "id": "SolarPotential", + "properties": { + "buildingStats": { + "$ref": "SizeAndSunshineStats", + "description": "Size and sunlight quantiles for the entire building, including parts of the roof that were not assigned to some roof segment. Because the orientations of these parts are not well characterised, the roof area estimate is unreliable, but the ground area estimate is reliable. It may be that a more reliable whole building roof area can be obtained by scaling the roof area from whole_roof_stats by the ratio of the ground areas of `building_stats` and `whole_roof_stats`." + }, + "carbonOffsetFactorKgPerMwh": { + "description": "Equivalent amount of CO2 produced per MWh of grid electricity. This is a measure of the carbon intensity of grid electricity displaced by solar electricity.", + "format": "float", + "type": "number" + }, + "financialAnalyses": { + "description": "A FinancialAnalysis gives the savings from going solar assuming a given monthly bill and a given electricity provider. They are in order of increasing order of monthly bill amount. This field will be empty for buildings in areas for which the Solar API does not have enough information to perform financial computations.", + "items": { + "$ref": "FinancialAnalysis" + }, + "type": "array" + }, + "maxArrayAreaMeters2": { + "description": "Size, in square meters, of the maximum array.", + "format": "float", + "type": "number" + }, + "maxArrayPanelsCount": { + "description": "Size of the maximum array - that is, the maximum number of panels that can fit on the roof.", + "format": "int32", + "type": "integer" + }, + "maxSunshineHoursPerYear": { + "description": "Maximum number of sunshine hours received per year, by any point on the roof. Sunshine hours are a measure of the total amount of insolation (energy) received per year. 1 sunshine hour = 1 kWh per kW (where kW refers to kW of capacity under Standard Testing Conditions).", + "format": "float", + "type": "number" + }, + "panelCapacityWatts": { + "description": "Capacity, in watts, of the panel used in the calculations.", + "format": "float", + "type": "number" + }, + "panelHeightMeters": { + "description": "Height, in meters in portrait orientation, of the panel used in the calculations.", + "format": "float", + "type": "number" + }, + "panelLifetimeYears": { + "description": "The expected lifetime, in years, of the solar panels. This is used in the financial calculations.", + "format": "int32", + "type": "integer" + }, + "panelWidthMeters": { + "description": "Width, in meters in portrait orientation, of the panel used in the calculations.", + "format": "float", + "type": "number" + }, + "roofSegmentStats": { + "description": "Size and sunlight quantiles for each roof segment.", + "items": { + "$ref": "RoofSegmentSizeAndSunshineStats" + }, + "type": "array" + }, + "solarPanelConfigs": { + "description": "Each SolarPanelConfig describes a different arrangement of solar panels on the roof. They are in order of increasing number of panels. The `SolarPanelConfig` with panels_count=N is based on the first N panels in the `solar_panels` list. This field is only populated if at least 4 panels can fit on a roof.", + "items": { + "$ref": "SolarPanelConfig" + }, + "type": "array" + }, + "solarPanels": { + "description": "Each SolarPanel describes a single solar panel. They are listed in the order that the panel layout algorithm placed this. This is usually, though not always, in decreasing order of annual energy production.", + "items": { + "$ref": "SolarPanel" + }, + "type": "array" + }, + "wholeRoofStats": { + "$ref": "SizeAndSunshineStats", + "description": "Total size and sunlight quantiles for the part of the roof that was assigned to some roof segment. Despite the name, this may not include the entire building. See building_stats." + } + }, + "type": "object" + } + }, + "servicePath": "", + "title": "Solar API", + "version": "v1", + "version_module": true +} \ No newline at end of file diff --git a/solar/v1/solar-gen.go b/solar/v1/solar-gen.go new file mode 100644 index 00000000000..ae11e2c40d1 --- /dev/null +++ b/solar/v1/solar-gen.go @@ -0,0 +1,2061 @@ +// Copyright 2024 Google LLC. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Code generated file. DO NOT EDIT. + +// Package solar provides access to the Solar API. +// +// For product documentation, see: https://developers.google.com/maps/documentation/solar +// +// # Library status +// +// These client libraries are officially supported by Google. However, this +// library is considered complete and is in maintenance mode. This means +// that we will address critical bugs and security issues but will not add +// any new features. +// +// When possible, we recommend using our newer +// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) +// that are still actively being worked and iterated on. +// +// # Creating a client +// +// Usage example: +// +// import "google.golang.org/api/solar/v1" +// ... +// ctx := context.Background() +// solarService, err := solar.NewService(ctx) +// +// In this example, Google Application Default Credentials are used for +// authentication. For information on how to create and obtain Application +// Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. +// +// # Other authentication options +// +// To use an API key for authentication (note: some APIs do not support API +// keys), use [google.golang.org/api/option.WithAPIKey]: +// +// solarService, err := solar.NewService(ctx, option.WithAPIKey("AIza...")) +// +// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth +// flow, use [google.golang.org/api/option.WithTokenSource]: +// +// config := &oauth2.Config{...} +// // ... +// token, err := config.Exchange(ctx, ...) +// solarService, err := solar.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) +// +// See [google.golang.org/api/option.ClientOption] for details on options. +package solar // import "google.golang.org/api/solar/v1" + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "net/url" + "strconv" + "strings" + + googleapi "google.golang.org/api/googleapi" + internal "google.golang.org/api/internal" + gensupport "google.golang.org/api/internal/gensupport" + option "google.golang.org/api/option" + internaloption "google.golang.org/api/option/internaloption" + htransport "google.golang.org/api/transport/http" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = gensupport.MarshalJSON +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = context.Canceled +var _ = internaloption.WithDefaultEndpoint +var _ = internal.Version + +const apiId = "solar:v1" +const apiName = "solar" +const apiVersion = "v1" +const basePath = "https://solar.googleapis.com/" +const basePathTemplate = "https://solar.UNIVERSE_DOMAIN/" +const mtlsBasePath = "https://solar.mtls.googleapis.com/" +const defaultUniverseDomain = "googleapis.com" + +// OAuth2 scopes used by this API. +const ( + // See, edit, configure, and delete your Google Cloud data and see the + // email address for your Google Account. + CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" +) + +// NewService creates a new Service. +func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { + scopesOption := internaloption.WithDefaultScopes( + "https://www.googleapis.com/auth/cloud-platform", + ) + // NOTE: prepend, so we don't override user-specified scopes. + opts = append([]option.ClientOption{scopesOption}, opts...) + opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) + opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate)) + opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) + opts = append(opts, internaloption.WithDefaultUniverseDomain(defaultUniverseDomain)) + client, endpoint, err := htransport.NewClient(ctx, opts...) + if err != nil { + return nil, err + } + s, err := New(client) + if err != nil { + return nil, err + } + if endpoint != "" { + s.BasePath = endpoint + } + return s, nil +} + +// New creates a new Service. It uses the provided http.Client for requests. +// +// Deprecated: please use NewService instead. +// To provide a custom HTTP client, use option.WithHTTPClient. +// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.BuildingInsights = NewBuildingInsightsService(s) + s.DataLayers = NewDataLayersService(s) + s.GeoTiff = NewGeoTiffService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + BuildingInsights *BuildingInsightsService + + DataLayers *DataLayersService + + GeoTiff *GeoTiffService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewBuildingInsightsService(s *Service) *BuildingInsightsService { + rs := &BuildingInsightsService{s: s} + return rs +} + +type BuildingInsightsService struct { + s *Service +} + +func NewDataLayersService(s *Service) *DataLayersService { + rs := &DataLayersService{s: s} + return rs +} + +type DataLayersService struct { + s *Service +} + +func NewGeoTiffService(s *Service) *GeoTiffService { + rs := &GeoTiffService{s: s} + return rs +} + +type GeoTiffService struct { + s *Service +} + +// BuildingInsights: Response message for +// `Solar.FindClosestBuildingInsights`. Information about the location, +// dimensions, and solar potential of a building. +type BuildingInsights struct { + // AdministrativeArea: Administrative area 1 (e.g., in the US, the + // state) that contains this building. For example, in the US, the + // abbreviation might be "MA" or "CA." + AdministrativeArea string `json:"administrativeArea,omitempty"` + + // BoundingBox: The bounding box of the building. + BoundingBox *LatLngBox `json:"boundingBox,omitempty"` + + // Center: A point near the center of the building. + Center *LatLng `json:"center,omitempty"` + + // ImageryDate: Date that the underlying imagery was acquired. This is + // approximate. + ImageryDate *Date `json:"imageryDate,omitempty"` + + // ImageryProcessedDate: When processing was completed on this imagery. + ImageryProcessedDate *Date `json:"imageryProcessedDate,omitempty"` + + // ImageryQuality: The quality of the imagery used to compute the data + // for this building. + // + // Possible values: + // "IMAGERY_QUALITY_UNSPECIFIED" - No quality is known. + // "HIGH" - The underlying imagery and DSM data were processed at 0.1 + // m/pixel. + // "MEDIUM" - The underlying imagery and DSM data were processed at + // 0.25 m/pixel. + // "LOW" - The underlying imagery and DSM data were processed at 0.5 + // m/pixel. + ImageryQuality string `json:"imageryQuality,omitempty"` + + // Name: The resource name for the building, of the format `building/`. + Name string `json:"name,omitempty"` + + // PostalCode: Postal code (e.g., US zip code) this building is + // contained by. + PostalCode string `json:"postalCode,omitempty"` + + // RegionCode: Region code for the country (or region) this building is + // in. + RegionCode string `json:"regionCode,omitempty"` + + // SolarPotential: Solar potential of the building. + SolarPotential *SolarPotential `json:"solarPotential,omitempty"` + + // StatisticalArea: Statistical area (e.g., US census tract) this + // building is in. + StatisticalArea string `json:"statisticalArea,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AdministrativeArea") + // to unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "AdministrativeArea") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *BuildingInsights) MarshalJSON() ([]byte, error) { + type NoMethod BuildingInsights + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// CashPurchaseSavings: Cost and benefit of an outright purchase of a +// particular configuration of solar panels with a particular +// electricity usage. +type CashPurchaseSavings struct { + // OutOfPocketCost: Initial cost before tax incentives: the amount that + // must be paid out-of-pocket. Contrast with `upfront_cost`, which is + // after tax incentives. + OutOfPocketCost *Money `json:"outOfPocketCost,omitempty"` + + // PaybackYears: Number of years until payback occurs. A negative value + // means payback never occurs within the lifetime period. + PaybackYears float64 `json:"paybackYears,omitempty"` + + // RebateValue: The value of all tax rebates. + RebateValue *Money `json:"rebateValue,omitempty"` + + // Savings: How much is saved (or not) over the lifetime period. + Savings *SavingsOverTime `json:"savings,omitempty"` + + // UpfrontCost: Initial cost after tax incentives: it's the amount that + // must be paid during first year. Contrast with `out_of_pocket_cost`, + // which is before tax incentives. + UpfrontCost *Money `json:"upfrontCost,omitempty"` + + // ForceSendFields is a list of field names (e.g. "OutOfPocketCost") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "OutOfPocketCost") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *CashPurchaseSavings) MarshalJSON() ([]byte, error) { + type NoMethod CashPurchaseSavings + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +func (s *CashPurchaseSavings) UnmarshalJSON(data []byte) error { + type NoMethod CashPurchaseSavings + var s1 struct { + PaybackYears gensupport.JSONFloat64 `json:"paybackYears"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.PaybackYears = float64(s1.PaybackYears) + return nil +} + +// DataLayers: Information about the solar potential of a region. The +// actual data are contained in a number of GeoTIFF files covering the +// requested region, for which this message contains URLs: Each string +// in the `DataLayers` message contains a URL from which the +// corresponding GeoTIFF can be fetched. These URLs are valid for a few +// hours after they've been generated. Most of the GeoTIFF files are at +// a resolution of 0.1m/pixel, but the monthly flux file is at +// 0.5m/pixel, and the hourly shade files are at 1m/pixel. If a +// `pixel_size_meters` value was specified in the +// `GetDataLayersRequest`, then the minimum resolution in the GeoTIFF +// files will be that value. +type DataLayers struct { + // AnnualFluxUrl: The URL for the annual flux map (annual sunlight on + // roofs) of the region. Values are kWh/kW/year. This is *unmasked + // flux*: flux is computed for every location, not just building + // rooftops. Invalid locations are stored as -9999: locations outside + // our coverage area will be invalid, and a few locations inside the + // coverage area, where we were unable to calculate flux, will also be + // invalid. + AnnualFluxUrl string `json:"annualFluxUrl,omitempty"` + + // DsmUrl: The URL for an image of the DSM (Digital Surface Model) of + // the region. Values are in meters above EGM96 geoid (i.e., sea level). + // Invalid locations (where we don't have data) are stored as -9999. + DsmUrl string `json:"dsmUrl,omitempty"` + + // HourlyShadeUrls: Twelve URLs for hourly shade, corresponding to + // January...December, in order. Each GeoTIFF will contain 24 bands, + // corresponding to the 24 hours of the day. Each pixel is a 32 bit + // integer, corresponding to the (up to) 31 days of that month; a 1 bit + // means that the corresponding location is able to see the sun at that + // day, of that hour, of that month. Invalid locations are stored as + // -9999 (since this is negative, it has bit 31 set, and no valid value + // could have bit 31 set as that would correspond to the 32nd day of the + // month). An example may be useful. If you want to know whether a point + // (at pixel location (x, y)) saw sun at 4pm on the 22nd of June you + // would: 1. fetch the sixth URL in this list (corresponding to June). + // 1. look up the 17th channel (corresponding to 4pm). 1. read the + // 32-bit value at (x, y). 1. read bit 21 of the value (corresponding to + // the 22nd of the month). 1. if that bit is a 1, then that spot saw the + // sun at 4pm 22 June. More formally: Given `month` (1-12), `day` + // (1...month max; February has 28 days) and `hour` (0-23), the + // shade/sun for that month/day/hour at a position `(x, y)` is the bit + // ``` (hourly_shade[month - 1])(x, y)[hour] & (1 << (day - 1)) ``` + // where `(x, y)` is spatial indexing, `[month - 1]` refers to fetching + // the `month - 1`st URL (indexing from zero), `[hour]` is indexing into + // the channels, and a final non-zero result means "sunny". There are no + // leap days, and DST doesn't exist (all days are 24 hours long; noon is + // always "standard time" noon). + HourlyShadeUrls []string `json:"hourlyShadeUrls,omitempty"` + + // ImageryDate: When the source imagery (from which all the other data + // are derived) in this region was taken. It is necessarily somewhat + // approximate, as the images may have been taken over more than one + // day. + ImageryDate *Date `json:"imageryDate,omitempty"` + + // ImageryProcessedDate: When processing was completed on this imagery. + ImageryProcessedDate *Date `json:"imageryProcessedDate,omitempty"` + + // ImageryQuality: The quality of the result's imagery. + // + // Possible values: + // "IMAGERY_QUALITY_UNSPECIFIED" - No quality is known. + // "HIGH" - The underlying imagery and DSM data were processed at 0.1 + // m/pixel. + // "MEDIUM" - The underlying imagery and DSM data were processed at + // 0.25 m/pixel. + // "LOW" - The underlying imagery and DSM data were processed at 0.5 + // m/pixel. + ImageryQuality string `json:"imageryQuality,omitempty"` + + // MaskUrl: The URL for the building mask image: one bit per pixel + // saying whether that pixel is considered to be part of a rooftop or + // not. + MaskUrl string `json:"maskUrl,omitempty"` + + // MonthlyFluxUrl: The URL for the monthly flux map (sunlight on roofs, + // broken down by month) of the region. Values are kWh/kW/year. The + // GeoTIFF pointed to by this URL will contain twelve bands, + // corresponding to January...December, in order. + MonthlyFluxUrl string `json:"monthlyFluxUrl,omitempty"` + + // RgbUrl: The URL for an image of RGB data (aerial photo) of the + // region. + RgbUrl string `json:"rgbUrl,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AnnualFluxUrl") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "AnnualFluxUrl") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *DataLayers) MarshalJSON() ([]byte, error) { + type NoMethod DataLayers + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// Date: Represents a whole or partial calendar date, such as a +// birthday. The time of day and time zone are either specified +// elsewhere or are insignificant. The date is relative to the Gregorian +// Calendar. This can represent one of the following: * A full date, +// with non-zero year, month, and day values. * A month and day, with a +// zero year (for example, an anniversary). * A year on its own, with a +// zero month and a zero day. * A year and month, with a zero day (for +// example, a credit card expiration date). Related types: * +// google.type.TimeOfDay * google.type.DateTime * +// google.protobuf.Timestamp +type Date struct { + // Day: Day of a month. Must be from 1 to 31 and valid for the year and + // month, or 0 to specify a year by itself or a year and month where the + // day isn't significant. + Day int64 `json:"day,omitempty"` + + // Month: Month of a year. Must be from 1 to 12, or 0 to specify a year + // without a month and day. + Month int64 `json:"month,omitempty"` + + // Year: Year of the date. Must be from 1 to 9999, or 0 to specify a + // date without a year. + Year int64 `json:"year,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Day") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Day") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *Date) MarshalJSON() ([]byte, error) { + type NoMethod Date + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// FinancedPurchaseSavings: Cost and benefit of using a loan to buy a +// particular configuration of solar panels with a particular +// electricity usage. +type FinancedPurchaseSavings struct { + // AnnualLoanPayment: Annual loan payments. + AnnualLoanPayment *Money `json:"annualLoanPayment,omitempty"` + + // LoanInterestRate: The interest rate on loans assumed in this set of + // calculations. + LoanInterestRate float64 `json:"loanInterestRate,omitempty"` + + // RebateValue: The value of all tax rebates (including Federal + // Investment Tax Credit (ITC)). + RebateValue *Money `json:"rebateValue,omitempty"` + + // Savings: How much is saved (or not) over the lifetime period. + Savings *SavingsOverTime `json:"savings,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AnnualLoanPayment") + // to unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "AnnualLoanPayment") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *FinancedPurchaseSavings) MarshalJSON() ([]byte, error) { + type NoMethod FinancedPurchaseSavings + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +func (s *FinancedPurchaseSavings) UnmarshalJSON(data []byte) error { + type NoMethod FinancedPurchaseSavings + var s1 struct { + LoanInterestRate gensupport.JSONFloat64 `json:"loanInterestRate"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.LoanInterestRate = float64(s1.LoanInterestRate) + return nil +} + +// FinancialAnalysis: Analysis of the cost and benefits of the optimum +// solar layout for a particular electric bill size. +type FinancialAnalysis struct { + // AverageKwhPerMonth: How much electricity the house uses in an average + // month, based on the bill size and the local electricity rates. + AverageKwhPerMonth float64 `json:"averageKwhPerMonth,omitempty"` + + // CashPurchaseSavings: Cost and benefit of buying the solar panels with + // cash. + CashPurchaseSavings *CashPurchaseSavings `json:"cashPurchaseSavings,omitempty"` + + // DefaultBill: Whether this is the bill size selected to be the default + // bill for the area this building is in. Exactly one + // `FinancialAnalysis` in `BuildingSolarPotential` should have + // `default_bill` set. + DefaultBill bool `json:"defaultBill,omitempty"` + + // FinancedPurchaseSavings: Cost and benefit of buying the solar panels + // by financing the purchase. + FinancedPurchaseSavings *FinancedPurchaseSavings `json:"financedPurchaseSavings,omitempty"` + + // FinancialDetails: Financial information that applies regardless of + // the financing method used. + FinancialDetails *FinancialDetails `json:"financialDetails,omitempty"` + + // LeasingSavings: Cost and benefit of leasing the solar panels. + LeasingSavings *LeasingSavings `json:"leasingSavings,omitempty"` + + // MonthlyBill: The monthly electric bill this analysis assumes. + MonthlyBill *Money `json:"monthlyBill,omitempty"` + + // PanelConfigIndex: Index in solar_panel_configs of the optimum solar + // layout for this bill size. This can be -1 indicating that there is no + // layout. In this case, the remaining submessages will be omitted. + PanelConfigIndex int64 `json:"panelConfigIndex,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AverageKwhPerMonth") + // to unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "AverageKwhPerMonth") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *FinancialAnalysis) MarshalJSON() ([]byte, error) { + type NoMethod FinancialAnalysis + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +func (s *FinancialAnalysis) UnmarshalJSON(data []byte) error { + type NoMethod FinancialAnalysis + var s1 struct { + AverageKwhPerMonth gensupport.JSONFloat64 `json:"averageKwhPerMonth"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.AverageKwhPerMonth = float64(s1.AverageKwhPerMonth) + return nil +} + +// FinancialDetails: Details of a financial analysis. Some of these +// details are already stored at higher levels (e.g., out of pocket +// cost). Total money amounts are over a lifetime period defined by the +// panel_lifetime_years field in SolarPotential. Note: The out of pocket +// cost of purchasing the panels is given in the out_of_pocket_cost +// field in CashPurchaseSavings. +type FinancialDetails struct { + // CostOfElectricityWithoutSolar: Total cost of electricity the user + // would have paid over the lifetime period if they didn't install + // solar. + CostOfElectricityWithoutSolar *Money `json:"costOfElectricityWithoutSolar,omitempty"` + + // FederalIncentive: Amount of money available from federal incentives; + // this applies if the user buys (with or without a loan) the panels. + FederalIncentive *Money `json:"federalIncentive,omitempty"` + + // InitialAcKwhPerYear: How many AC kWh we think the solar panels will + // generate in their first year. + InitialAcKwhPerYear float64 `json:"initialAcKwhPerYear,omitempty"` + + // LifetimeSrecTotal: Amount of money the user will receive from Solar + // Renewable Energy Credits over the panel lifetime; this applies if the + // user buys (with or without a loan) the panels. + LifetimeSrecTotal *Money `json:"lifetimeSrecTotal,omitempty"` + + // NetMeteringAllowed: Whether net metering is allowed. + NetMeteringAllowed bool `json:"netMeteringAllowed,omitempty"` + + // PercentageExportedToGrid: The percentage (0-100) of solar electricity + // production we assumed was exported to the grid, based on the first + // quarter of production. This affects the calculations if net metering + // is not allowed. + PercentageExportedToGrid float64 `json:"percentageExportedToGrid,omitempty"` + + // RemainingLifetimeUtilityBill: Utility bill for electricity not + // produced by solar, for the lifetime of the panels. + RemainingLifetimeUtilityBill *Money `json:"remainingLifetimeUtilityBill,omitempty"` + + // SolarPercentage: Percentage (0-100) of the user's power supplied by + // solar. Valid for the first year but approximately correct for future + // years. + SolarPercentage float64 `json:"solarPercentage,omitempty"` + + // StateIncentive: Amount of money available from state incentives; this + // applies if the user buys (with or without a loan) the panels. + StateIncentive *Money `json:"stateIncentive,omitempty"` + + // UtilityIncentive: Amount of money available from utility incentives; + // this applies if the user buys (with or without a loan) the panels. + UtilityIncentive *Money `json:"utilityIncentive,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "CostOfElectricityWithoutSolar") to unconditionally include in API + // requests. By default, fields with empty or default values are omitted + // from API requests. However, any non-pointer, non-interface field + // appearing in ForceSendFields will be sent to the server regardless of + // whether the field is empty or not. This may be used to include empty + // fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. + // "CostOfElectricityWithoutSolar") to include in API requests with the + // JSON null value. By default, fields with empty values are omitted + // from API requests. However, any field with an empty value appearing + // in NullFields will be sent to the server as null. It is an error if a + // field in this list has a non-empty value. This may be used to include + // null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *FinancialDetails) MarshalJSON() ([]byte, error) { + type NoMethod FinancialDetails + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +func (s *FinancialDetails) UnmarshalJSON(data []byte) error { + type NoMethod FinancialDetails + var s1 struct { + InitialAcKwhPerYear gensupport.JSONFloat64 `json:"initialAcKwhPerYear"` + PercentageExportedToGrid gensupport.JSONFloat64 `json:"percentageExportedToGrid"` + SolarPercentage gensupport.JSONFloat64 `json:"solarPercentage"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.InitialAcKwhPerYear = float64(s1.InitialAcKwhPerYear) + s.PercentageExportedToGrid = float64(s1.PercentageExportedToGrid) + s.SolarPercentage = float64(s1.SolarPercentage) + return nil +} + +// HttpBody: Message that represents an arbitrary HTTP body. It should +// only be used for payload formats that can't be represented as JSON, +// such as raw binary or an HTML page. This message can be used both in +// streaming and non-streaming API methods in the request as well as the +// response. It can be used as a top-level request field, which is +// convenient if one wants to extract parameters from either the URL or +// HTTP template into the request fields and also want access to the raw +// HTTP body. Example: message GetResourceRequest { // A unique request +// id. string request_id = 1; // The raw HTTP body is bound to this +// field. google.api.HttpBody http_body = 2; } service ResourceService { +// rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); +// rpc UpdateResource(google.api.HttpBody) returns +// (google.protobuf.Empty); } Example with streaming methods: service +// CaldavService { rpc GetCalendar(stream google.api.HttpBody) returns +// (stream google.api.HttpBody); rpc UpdateCalendar(stream +// google.api.HttpBody) returns (stream google.api.HttpBody); } Use of +// this type only changes how the request and response bodies are +// handled, all other features will continue to work unchanged. +type HttpBody struct { + // ContentType: The HTTP Content-Type header value specifying the + // content type of the body. + ContentType string `json:"contentType,omitempty"` + + // Data: The HTTP request/response body as raw binary. + Data string `json:"data,omitempty"` + + // Extensions: Application specific response metadata. Must be set in + // the first response for streaming APIs. + Extensions []googleapi.RawMessage `json:"extensions,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ContentType") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ContentType") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *HttpBody) MarshalJSON() ([]byte, error) { + type NoMethod HttpBody + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// LatLng: An object that represents a latitude/longitude pair. This is +// expressed as a pair of doubles to represent degrees latitude and +// degrees longitude. Unless specified otherwise, this object must +// conform to the WGS84 standard. Values must be within normalized +// ranges. +type LatLng struct { + // Latitude: The latitude in degrees. It must be in the range [-90.0, + // +90.0]. + Latitude float64 `json:"latitude,omitempty"` + + // Longitude: The longitude in degrees. It must be in the range [-180.0, + // +180.0]. + Longitude float64 `json:"longitude,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Latitude") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Latitude") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *LatLng) MarshalJSON() ([]byte, error) { + type NoMethod LatLng + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +func (s *LatLng) UnmarshalJSON(data []byte) error { + type NoMethod LatLng + var s1 struct { + Latitude gensupport.JSONFloat64 `json:"latitude"` + Longitude gensupport.JSONFloat64 `json:"longitude"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.Latitude = float64(s1.Latitude) + s.Longitude = float64(s1.Longitude) + return nil +} + +// LatLngBox: A bounding box in lat/lng coordinates. +type LatLngBox struct { + // Ne: The northeast corner of the box. + Ne *LatLng `json:"ne,omitempty"` + + // Sw: The southwest corner of the box. + Sw *LatLng `json:"sw,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Ne") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Ne") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *LatLngBox) MarshalJSON() ([]byte, error) { + type NoMethod LatLngBox + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// LeasingSavings: Cost and benefit of leasing a particular +// configuration of solar panels with a particular electricity usage. +type LeasingSavings struct { + // AnnualLeasingCost: Estimated annual leasing cost. + AnnualLeasingCost *Money `json:"annualLeasingCost,omitempty"` + + // LeasesAllowed: Whether leases are allowed in this juristiction + // (leases are not allowed in some states). If this field is false, then + // the values in this message should probably be ignored. + LeasesAllowed bool `json:"leasesAllowed,omitempty"` + + // LeasesSupported: Whether leases are supported in this juristiction by + // the financial calculation engine. If this field is false, then the + // values in this message should probably be ignored. This is + // independent of `leases_allowed`: in some areas leases are allowed, + // but under conditions that aren't handled by the financial models. + LeasesSupported bool `json:"leasesSupported,omitempty"` + + // Savings: How much is saved (or not) over the lifetime period. + Savings *SavingsOverTime `json:"savings,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AnnualLeasingCost") + // to unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "AnnualLeasingCost") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *LeasingSavings) MarshalJSON() ([]byte, error) { + type NoMethod LeasingSavings + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// Money: Represents an amount of money with its currency type. +type Money struct { + // CurrencyCode: The three-letter currency code defined in ISO 4217. + CurrencyCode string `json:"currencyCode,omitempty"` + + // Nanos: Number of nano (10^-9) units of the amount. The value must be + // between -999,999,999 and +999,999,999 inclusive. If `units` is + // positive, `nanos` must be positive or zero. If `units` is zero, + // `nanos` can be positive, zero, or negative. If `units` is negative, + // `nanos` must be negative or zero. For example $-1.75 is represented + // as `units`=-1 and `nanos`=-750,000,000. + Nanos int64 `json:"nanos,omitempty"` + + // Units: The whole units of the amount. For example if `currencyCode` + // is "USD", then 1 unit is one US dollar. + Units int64 `json:"units,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "CurrencyCode") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CurrencyCode") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *Money) MarshalJSON() ([]byte, error) { + type NoMethod Money + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// RoofSegmentSizeAndSunshineStats: Information about the size and +// sunniness quantiles of a roof segment. +type RoofSegmentSizeAndSunshineStats struct { + // AzimuthDegrees: Compass direction the roof segment is pointing in. 0 + // = North, 90 = East, 180 = South. For a "flat" roof segment + // (`pitch_degrees` very near 0), azimuth is not well defined, so for + // consistency, we define it arbitrarily to be 0 (North). + AzimuthDegrees float64 `json:"azimuthDegrees,omitempty"` + + // BoundingBox: The bounding box of the roof segment. + BoundingBox *LatLngBox `json:"boundingBox,omitempty"` + + // Center: A point near the center of the roof segment. + Center *LatLng `json:"center,omitempty"` + + // PitchDegrees: Angle of the roof segment relative to the theoretical + // ground plane. 0 = parallel to the ground, 90 = perpendicular to the + // ground. + PitchDegrees float64 `json:"pitchDegrees,omitempty"` + + // PlaneHeightAtCenterMeters: The height of the roof segment plane, in + // meters above sea level, at the point designated by `center`. Together + // with the pitch, azimuth, and center location, this fully defines the + // roof segment plane. + PlaneHeightAtCenterMeters float64 `json:"planeHeightAtCenterMeters,omitempty"` + + // Stats: Total size and sunlight quantiles for the roof segment. + Stats *SizeAndSunshineStats `json:"stats,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AzimuthDegrees") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "AzimuthDegrees") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *RoofSegmentSizeAndSunshineStats) MarshalJSON() ([]byte, error) { + type NoMethod RoofSegmentSizeAndSunshineStats + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +func (s *RoofSegmentSizeAndSunshineStats) UnmarshalJSON(data []byte) error { + type NoMethod RoofSegmentSizeAndSunshineStats + var s1 struct { + AzimuthDegrees gensupport.JSONFloat64 `json:"azimuthDegrees"` + PitchDegrees gensupport.JSONFloat64 `json:"pitchDegrees"` + PlaneHeightAtCenterMeters gensupport.JSONFloat64 `json:"planeHeightAtCenterMeters"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.AzimuthDegrees = float64(s1.AzimuthDegrees) + s.PitchDegrees = float64(s1.PitchDegrees) + s.PlaneHeightAtCenterMeters = float64(s1.PlaneHeightAtCenterMeters) + return nil +} + +// RoofSegmentSummary: Information about a roof segment on the building, +// with some number of panels placed on it. +type RoofSegmentSummary struct { + // AzimuthDegrees: Compass direction the roof segment is pointing in. 0 + // = North, 90 = East, 180 = South. For a "flat" roof segment + // (`pitch_degrees` very near 0), azimuth is not well defined, so for + // consistency, we define it arbitrarily to be 0 (North). + AzimuthDegrees float64 `json:"azimuthDegrees,omitempty"` + + // PanelsCount: The total number of panels on this segment. + PanelsCount int64 `json:"panelsCount,omitempty"` + + // PitchDegrees: Angle of the roof segment relative to the theoretical + // ground plane. 0 = parallel to the ground, 90 = perpendicular to the + // ground. + PitchDegrees float64 `json:"pitchDegrees,omitempty"` + + // SegmentIndex: Index in roof_segment_stats of the corresponding + // `RoofSegmentSizeAndSunshineStats`. + SegmentIndex int64 `json:"segmentIndex,omitempty"` + + // YearlyEnergyDcKwh: How much sunlight energy this part of the layout + // captures over the course of a year, in DC kWh, assuming the panels + // described above. + YearlyEnergyDcKwh float64 `json:"yearlyEnergyDcKwh,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AzimuthDegrees") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "AzimuthDegrees") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *RoofSegmentSummary) MarshalJSON() ([]byte, error) { + type NoMethod RoofSegmentSummary + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +func (s *RoofSegmentSummary) UnmarshalJSON(data []byte) error { + type NoMethod RoofSegmentSummary + var s1 struct { + AzimuthDegrees gensupport.JSONFloat64 `json:"azimuthDegrees"` + PitchDegrees gensupport.JSONFloat64 `json:"pitchDegrees"` + YearlyEnergyDcKwh gensupport.JSONFloat64 `json:"yearlyEnergyDcKwh"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.AzimuthDegrees = float64(s1.AzimuthDegrees) + s.PitchDegrees = float64(s1.PitchDegrees) + s.YearlyEnergyDcKwh = float64(s1.YearlyEnergyDcKwh) + return nil +} + +// SavingsOverTime: Financial information that's shared between +// different financing methods. +type SavingsOverTime struct { + // FinanciallyViable: Indicates whether this scenario is financially + // viable. Will be false for scenarios with poor financial viability + // (e.g., money-losing). + FinanciallyViable bool `json:"financiallyViable,omitempty"` + + // PresentValueOfSavingsLifetime: Using the assumed discount rate, what + // is the present value of the cumulative lifetime savings? + PresentValueOfSavingsLifetime *Money `json:"presentValueOfSavingsLifetime,omitempty"` + + // PresentValueOfSavingsYear20: Using the assumed discount rate, what is + // the present value of the cumulative 20-year savings? + PresentValueOfSavingsYear20 *Money `json:"presentValueOfSavingsYear20,omitempty"` + + // SavingsLifetime: Savings in the entire panel lifetime. + SavingsLifetime *Money `json:"savingsLifetime,omitempty"` + + // SavingsYear1: Savings in the first year after panel installation. + SavingsYear1 *Money `json:"savingsYear1,omitempty"` + + // SavingsYear20: Savings in the first twenty years after panel + // installation. + SavingsYear20 *Money `json:"savingsYear20,omitempty"` + + // ForceSendFields is a list of field names (e.g. "FinanciallyViable") + // to unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "FinanciallyViable") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *SavingsOverTime) MarshalJSON() ([]byte, error) { + type NoMethod SavingsOverTime + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// SizeAndSunshineStats: Size and sunniness quantiles of a roof, or part +// of a roof. +type SizeAndSunshineStats struct { + // AreaMeters2: The area of the roof or roof segment, in m^2. This is + // the roof area (accounting for tilt), not the ground footprint area. + AreaMeters2 float64 `json:"areaMeters2,omitempty"` + + // GroundAreaMeters2: The ground footprint area covered by the roof or + // roof segment, in m^2. + GroundAreaMeters2 float64 `json:"groundAreaMeters2,omitempty"` + + // SunshineQuantiles: Quantiles of the pointwise sunniness across the + // area. If there are N values here, this represents the (N-1)-iles. For + // example, if there are 5 values, then they would be the quartiles + // (min, 25%, 50%, 75%, max). Values are in annual kWh/kW like + // max_sunshine_hours_per_year. + SunshineQuantiles []float64 `json:"sunshineQuantiles,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AreaMeters2") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "AreaMeters2") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *SizeAndSunshineStats) MarshalJSON() ([]byte, error) { + type NoMethod SizeAndSunshineStats + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +func (s *SizeAndSunshineStats) UnmarshalJSON(data []byte) error { + type NoMethod SizeAndSunshineStats + var s1 struct { + AreaMeters2 gensupport.JSONFloat64 `json:"areaMeters2"` + GroundAreaMeters2 gensupport.JSONFloat64 `json:"groundAreaMeters2"` + SunshineQuantiles []gensupport.JSONFloat64 `json:"sunshineQuantiles"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.AreaMeters2 = float64(s1.AreaMeters2) + s.GroundAreaMeters2 = float64(s1.GroundAreaMeters2) + s.SunshineQuantiles = make([]float64, len(s1.SunshineQuantiles)) + for i := range s1.SunshineQuantiles { + s.SunshineQuantiles[i] = float64(s1.SunshineQuantiles[i]) + } + return nil +} + +// SolarPanel: SolarPanel describes the position, orientation, and +// production of a single solar panel. See the panel_height_meters, +// panel_width_meters, and panel_capacity_watts fields in SolarPotential +// for information on the parameters of the panel. +type SolarPanel struct { + // Center: The centre of the panel. + Center *LatLng `json:"center,omitempty"` + + // Orientation: The orientation of the panel. + // + // Possible values: + // "SOLAR_PANEL_ORIENTATION_UNSPECIFIED" - No panel orientation is + // known. + // "LANDSCAPE" - A `LANDSCAPE` panel has its long edge perpendicular + // to the azimuth direction of the roof segment that it is placed on. + // "PORTRAIT" - A `PORTRAIT` panel has its long edge parallel to the + // azimuth direction of the roof segment that it is placed on. + Orientation string `json:"orientation,omitempty"` + + // SegmentIndex: Index in roof_segment_stats of the + // `RoofSegmentSizeAndSunshineStats` which corresponds to the roof + // segment that this panel is placed on. + SegmentIndex int64 `json:"segmentIndex,omitempty"` + + // YearlyEnergyDcKwh: How much sunlight energy this layout captures over + // the course of a year, in DC kWh. + YearlyEnergyDcKwh float64 `json:"yearlyEnergyDcKwh,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Center") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Center") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *SolarPanel) MarshalJSON() ([]byte, error) { + type NoMethod SolarPanel + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +func (s *SolarPanel) UnmarshalJSON(data []byte) error { + type NoMethod SolarPanel + var s1 struct { + YearlyEnergyDcKwh gensupport.JSONFloat64 `json:"yearlyEnergyDcKwh"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.YearlyEnergyDcKwh = float64(s1.YearlyEnergyDcKwh) + return nil +} + +// SolarPanelConfig: SolarPanelConfig describes a particular placement +// of solar panels on the roof. +type SolarPanelConfig struct { + // PanelsCount: Total number of panels. Note that this is redundant to + // (the sum of) the corresponding fields in roof_segment_summaries. + PanelsCount int64 `json:"panelsCount,omitempty"` + + // RoofSegmentSummaries: Information about the production of each roof + // segment that is carrying at least one panel in this layout. + // `roof_segment_summaries[i]` describes the i-th roof segment, + // including its size, expected production and orientation. + RoofSegmentSummaries []*RoofSegmentSummary `json:"roofSegmentSummaries,omitempty"` + + // YearlyEnergyDcKwh: How much sunlight energy this layout captures over + // the course of a year, in DC kWh, assuming the panels described above. + YearlyEnergyDcKwh float64 `json:"yearlyEnergyDcKwh,omitempty"` + + // ForceSendFields is a list of field names (e.g. "PanelsCount") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "PanelsCount") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *SolarPanelConfig) MarshalJSON() ([]byte, error) { + type NoMethod SolarPanelConfig + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +func (s *SolarPanelConfig) UnmarshalJSON(data []byte) error { + type NoMethod SolarPanelConfig + var s1 struct { + YearlyEnergyDcKwh gensupport.JSONFloat64 `json:"yearlyEnergyDcKwh"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.YearlyEnergyDcKwh = float64(s1.YearlyEnergyDcKwh) + return nil +} + +// SolarPotential: Information about the solar potential of a building. +// A number of fields in this are defined in terms of "panels". The +// fields panel_capacity_watts, panel_height_meters, and +// panel_width_meters describe the parameters of the model of panel used +// in these calculations. +type SolarPotential struct { + // BuildingStats: Size and sunlight quantiles for the entire building, + // including parts of the roof that were not assigned to some roof + // segment. Because the orientations of these parts are not well + // characterised, the roof area estimate is unreliable, but the ground + // area estimate is reliable. It may be that a more reliable whole + // building roof area can be obtained by scaling the roof area from + // whole_roof_stats by the ratio of the ground areas of `building_stats` + // and `whole_roof_stats`. + BuildingStats *SizeAndSunshineStats `json:"buildingStats,omitempty"` + + // CarbonOffsetFactorKgPerMwh: Equivalent amount of CO2 produced per MWh + // of grid electricity. This is a measure of the carbon intensity of + // grid electricity displaced by solar electricity. + CarbonOffsetFactorKgPerMwh float64 `json:"carbonOffsetFactorKgPerMwh,omitempty"` + + // FinancialAnalyses: A FinancialAnalysis gives the savings from going + // solar assuming a given monthly bill and a given electricity provider. + // They are in order of increasing order of monthly bill amount. This + // field will be empty for buildings in areas for which the Solar API + // does not have enough information to perform financial computations. + FinancialAnalyses []*FinancialAnalysis `json:"financialAnalyses,omitempty"` + + // MaxArrayAreaMeters2: Size, in square meters, of the maximum array. + MaxArrayAreaMeters2 float64 `json:"maxArrayAreaMeters2,omitempty"` + + // MaxArrayPanelsCount: Size of the maximum array - that is, the maximum + // number of panels that can fit on the roof. + MaxArrayPanelsCount int64 `json:"maxArrayPanelsCount,omitempty"` + + // MaxSunshineHoursPerYear: Maximum number of sunshine hours received + // per year, by any point on the roof. Sunshine hours are a measure of + // the total amount of insolation (energy) received per year. 1 sunshine + // hour = 1 kWh per kW (where kW refers to kW of capacity under Standard + // Testing Conditions). + MaxSunshineHoursPerYear float64 `json:"maxSunshineHoursPerYear,omitempty"` + + // PanelCapacityWatts: Capacity, in watts, of the panel used in the + // calculations. + PanelCapacityWatts float64 `json:"panelCapacityWatts,omitempty"` + + // PanelHeightMeters: Height, in meters in portrait orientation, of the + // panel used in the calculations. + PanelHeightMeters float64 `json:"panelHeightMeters,omitempty"` + + // PanelLifetimeYears: The expected lifetime, in years, of the solar + // panels. This is used in the financial calculations. + PanelLifetimeYears int64 `json:"panelLifetimeYears,omitempty"` + + // PanelWidthMeters: Width, in meters in portrait orientation, of the + // panel used in the calculations. + PanelWidthMeters float64 `json:"panelWidthMeters,omitempty"` + + // RoofSegmentStats: Size and sunlight quantiles for each roof segment. + RoofSegmentStats []*RoofSegmentSizeAndSunshineStats `json:"roofSegmentStats,omitempty"` + + // SolarPanelConfigs: Each SolarPanelConfig describes a different + // arrangement of solar panels on the roof. They are in order of + // increasing number of panels. The `SolarPanelConfig` with + // panels_count=N is based on the first N panels in the `solar_panels` + // list. This field is only populated if at least 4 panels can fit on a + // roof. + SolarPanelConfigs []*SolarPanelConfig `json:"solarPanelConfigs,omitempty"` + + // SolarPanels: Each SolarPanel describes a single solar panel. They are + // listed in the order that the panel layout algorithm placed this. This + // is usually, though not always, in decreasing order of annual energy + // production. + SolarPanels []*SolarPanel `json:"solarPanels,omitempty"` + + // WholeRoofStats: Total size and sunlight quantiles for the part of the + // roof that was assigned to some roof segment. Despite the name, this + // may not include the entire building. See building_stats. + WholeRoofStats *SizeAndSunshineStats `json:"wholeRoofStats,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BuildingStats") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "BuildingStats") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *SolarPotential) MarshalJSON() ([]byte, error) { + type NoMethod SolarPotential + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +func (s *SolarPotential) UnmarshalJSON(data []byte) error { + type NoMethod SolarPotential + var s1 struct { + CarbonOffsetFactorKgPerMwh gensupport.JSONFloat64 `json:"carbonOffsetFactorKgPerMwh"` + MaxArrayAreaMeters2 gensupport.JSONFloat64 `json:"maxArrayAreaMeters2"` + MaxSunshineHoursPerYear gensupport.JSONFloat64 `json:"maxSunshineHoursPerYear"` + PanelCapacityWatts gensupport.JSONFloat64 `json:"panelCapacityWatts"` + PanelHeightMeters gensupport.JSONFloat64 `json:"panelHeightMeters"` + PanelWidthMeters gensupport.JSONFloat64 `json:"panelWidthMeters"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.CarbonOffsetFactorKgPerMwh = float64(s1.CarbonOffsetFactorKgPerMwh) + s.MaxArrayAreaMeters2 = float64(s1.MaxArrayAreaMeters2) + s.MaxSunshineHoursPerYear = float64(s1.MaxSunshineHoursPerYear) + s.PanelCapacityWatts = float64(s1.PanelCapacityWatts) + s.PanelHeightMeters = float64(s1.PanelHeightMeters) + s.PanelWidthMeters = float64(s1.PanelWidthMeters) + return nil +} + +// method id "solar.buildingInsights.findClosest": + +type BuildingInsightsFindClosestCall struct { + s *Service + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// FindClosest: Locates the closest building to a query point. Returns +// an error with code `NOT_FOUND` if there are no buildings within +// approximately 50m of the query point. +func (r *BuildingInsightsService) FindClosest() *BuildingInsightsFindClosestCall { + c := &BuildingInsightsFindClosestCall{s: r.s, urlParams_: make(gensupport.URLParams)} + return c +} + +// LocationLatitude sets the optional parameter "location.latitude": The +// latitude in degrees. It must be in the range [-90.0, +90.0]. +func (c *BuildingInsightsFindClosestCall) LocationLatitude(locationLatitude float64) *BuildingInsightsFindClosestCall { + c.urlParams_.Set("location.latitude", fmt.Sprint(locationLatitude)) + return c +} + +// LocationLongitude sets the optional parameter "location.longitude": +// The longitude in degrees. It must be in the range [-180.0, +180.0]. +func (c *BuildingInsightsFindClosestCall) LocationLongitude(locationLongitude float64) *BuildingInsightsFindClosestCall { + c.urlParams_.Set("location.longitude", fmt.Sprint(locationLongitude)) + return c +} + +// RequiredQuality sets the optional parameter "requiredQuality": The +// minimum quality level allowed in the results. No result with lower +// quality than this will be returned. Not specifying this is equivalent +// to restricting to HIGH quality only. +// +// Possible values: +// +// "IMAGERY_QUALITY_UNSPECIFIED" - No quality is known. +// "HIGH" - The underlying imagery and DSM data were processed at 0.1 +// +// m/pixel. +// +// "MEDIUM" - The underlying imagery and DSM data were processed at +// +// 0.25 m/pixel. +// +// "LOW" - The underlying imagery and DSM data were processed at 0.5 +// +// m/pixel. +func (c *BuildingInsightsFindClosestCall) RequiredQuality(requiredQuality string) *BuildingInsightsFindClosestCall { + c.urlParams_.Set("requiredQuality", requiredQuality) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BuildingInsightsFindClosestCall) Fields(s ...googleapi.Field) *BuildingInsightsFindClosestCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BuildingInsightsFindClosestCall) IfNoneMatch(entityTag string) *BuildingInsightsFindClosestCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *BuildingInsightsFindClosestCall) Context(ctx context.Context) *BuildingInsightsFindClosestCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *BuildingInsightsFindClosestCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *BuildingInsightsFindClosestCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/buildingInsights:findClosest") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "solar.buildingInsights.findClosest" call. +// Exactly one of *BuildingInsights or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *BuildingInsights.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *BuildingInsightsFindClosestCall) Do(opts ...googleapi.CallOption) (*BuildingInsights, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &BuildingInsights{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Locates the closest building to a query point. Returns an error with code `NOT_FOUND` if there are no buildings within approximately 50m of the query point.", + // "flatPath": "v1/buildingInsights:findClosest", + // "httpMethod": "GET", + // "id": "solar.buildingInsights.findClosest", + // "parameterOrder": [], + // "parameters": { + // "location.latitude": { + // "description": "The latitude in degrees. It must be in the range [-90.0, +90.0].", + // "format": "double", + // "location": "query", + // "type": "number" + // }, + // "location.longitude": { + // "description": "The longitude in degrees. It must be in the range [-180.0, +180.0].", + // "format": "double", + // "location": "query", + // "type": "number" + // }, + // "requiredQuality": { + // "description": "Optional. The minimum quality level allowed in the results. No result with lower quality than this will be returned. Not specifying this is equivalent to restricting to HIGH quality only.", + // "enum": [ + // "IMAGERY_QUALITY_UNSPECIFIED", + // "HIGH", + // "MEDIUM", + // "LOW" + // ], + // "enumDescriptions": [ + // "No quality is known.", + // "The underlying imagery and DSM data were processed at 0.1 m/pixel.", + // "The underlying imagery and DSM data were processed at 0.25 m/pixel.", + // "The underlying imagery and DSM data were processed at 0.5 m/pixel." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1/buildingInsights:findClosest", + // "response": { + // "$ref": "BuildingInsights" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "solar.dataLayers.get": + +type DataLayersGetCall struct { + s *Service + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets solar information for a region surrounding a location. +// Returns an error with code `NOT_FOUND` if the location is outside the +// coverage area. +func (r *DataLayersService) Get() *DataLayersGetCall { + c := &DataLayersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + return c +} + +// LocationLatitude sets the optional parameter "location.latitude": The +// latitude in degrees. It must be in the range [-90.0, +90.0]. +func (c *DataLayersGetCall) LocationLatitude(locationLatitude float64) *DataLayersGetCall { + c.urlParams_.Set("location.latitude", fmt.Sprint(locationLatitude)) + return c +} + +// LocationLongitude sets the optional parameter "location.longitude": +// The longitude in degrees. It must be in the range [-180.0, +180.0]. +func (c *DataLayersGetCall) LocationLongitude(locationLongitude float64) *DataLayersGetCall { + c.urlParams_.Set("location.longitude", fmt.Sprint(locationLongitude)) + return c +} + +// PixelSizeMeters sets the optional parameter "pixelSizeMeters": The +// minimum scale, in meters per pixel, of the data to return. Values of +// 0.1 (the default, if this field is not set explicitly), 0.25, 0.5, +// and 1.0 are supported. Imagery components whose normal resolution is +// less than `pixel_size_meters` will be returned at the resolution +// specified by `pixel_size_meters`; imagery components whose normal +// resolution is equal to or greater than `pixel_size_meters` will be +// returned at that normal resolution. +func (c *DataLayersGetCall) PixelSizeMeters(pixelSizeMeters float64) *DataLayersGetCall { + c.urlParams_.Set("pixelSizeMeters", fmt.Sprint(pixelSizeMeters)) + return c +} + +// RadiusMeters sets the optional parameter "radiusMeters": Required. +// The radius, in meters, defining the region surrounding that centre +// point for which data should be returned. The limitations on this +// value are: * Any value up to 100m can always be specified. * Values +// over 100m can be specified, as long as `radius_meters` <= +// `pixel_size_meters * 1000`. * However, for values over 175m, the +// `DataLayerView` in the request must not include monthly flux or +// hourly shade. +func (c *DataLayersGetCall) RadiusMeters(radiusMeters float64) *DataLayersGetCall { + c.urlParams_.Set("radiusMeters", fmt.Sprint(radiusMeters)) + return c +} + +// RequiredQuality sets the optional parameter "requiredQuality": The +// minimum quality level allowed in the results. No result with lower +// quality than this will be returned. Not specifying this is equivalent +// to restricting to HIGH quality only. +// +// Possible values: +// +// "IMAGERY_QUALITY_UNSPECIFIED" - No quality is known. +// "HIGH" - The underlying imagery and DSM data were processed at 0.1 +// +// m/pixel. +// +// "MEDIUM" - The underlying imagery and DSM data were processed at +// +// 0.25 m/pixel. +// +// "LOW" - The underlying imagery and DSM data were processed at 0.5 +// +// m/pixel. +func (c *DataLayersGetCall) RequiredQuality(requiredQuality string) *DataLayersGetCall { + c.urlParams_.Set("requiredQuality", requiredQuality) + return c +} + +// View sets the optional parameter "view": The desired subset of the +// data to return. +// +// Possible values: +// +// "DATA_LAYER_VIEW_UNSPECIFIED" - Equivalent to FULL. +// "DSM_LAYER" - Get the DSM only. +// "IMAGERY_LAYERS" - Get the DSM, RGB, and mask. +// "IMAGERY_AND_ANNUAL_FLUX_LAYERS" - Get the DSM, RGB, mask, and +// +// annual flux. +// +// "IMAGERY_AND_ALL_FLUX_LAYERS" - Get the DSM, RGB, mask, annual +// +// flux, and monthly flux. +// +// "FULL_LAYERS" - Get all data. +func (c *DataLayersGetCall) View(view string) *DataLayersGetCall { + c.urlParams_.Set("view", view) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DataLayersGetCall) Fields(s ...googleapi.Field) *DataLayersGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DataLayersGetCall) IfNoneMatch(entityTag string) *DataLayersGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *DataLayersGetCall) Context(ctx context.Context) *DataLayersGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *DataLayersGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *DataLayersGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/dataLayers:get") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "solar.dataLayers.get" call. +// Exactly one of *DataLayers or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *DataLayers.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DataLayersGetCall) Do(opts ...googleapi.CallOption) (*DataLayers, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &DataLayers{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets solar information for a region surrounding a location. Returns an error with code `NOT_FOUND` if the location is outside the coverage area.", + // "flatPath": "v1/dataLayers:get", + // "httpMethod": "GET", + // "id": "solar.dataLayers.get", + // "parameterOrder": [], + // "parameters": { + // "location.latitude": { + // "description": "The latitude in degrees. It must be in the range [-90.0, +90.0].", + // "format": "double", + // "location": "query", + // "type": "number" + // }, + // "location.longitude": { + // "description": "The longitude in degrees. It must be in the range [-180.0, +180.0].", + // "format": "double", + // "location": "query", + // "type": "number" + // }, + // "pixelSizeMeters": { + // "description": "Optional. The minimum scale, in meters per pixel, of the data to return. Values of 0.1 (the default, if this field is not set explicitly), 0.25, 0.5, and 1.0 are supported. Imagery components whose normal resolution is less than `pixel_size_meters` will be returned at the resolution specified by `pixel_size_meters`; imagery components whose normal resolution is equal to or greater than `pixel_size_meters` will be returned at that normal resolution.", + // "format": "float", + // "location": "query", + // "type": "number" + // }, + // "radiusMeters": { + // "description": "Required. The radius, in meters, defining the region surrounding that centre point for which data should be returned. The limitations on this value are: * Any value up to 100m can always be specified. * Values over 100m can be specified, as long as `radius_meters` \u003c= `pixel_size_meters * 1000`. * However, for values over 175m, the `DataLayerView` in the request must not include monthly flux or hourly shade.", + // "format": "float", + // "location": "query", + // "type": "number" + // }, + // "requiredQuality": { + // "description": "Optional. The minimum quality level allowed in the results. No result with lower quality than this will be returned. Not specifying this is equivalent to restricting to HIGH quality only.", + // "enum": [ + // "IMAGERY_QUALITY_UNSPECIFIED", + // "HIGH", + // "MEDIUM", + // "LOW" + // ], + // "enumDescriptions": [ + // "No quality is known.", + // "The underlying imagery and DSM data were processed at 0.1 m/pixel.", + // "The underlying imagery and DSM data were processed at 0.25 m/pixel.", + // "The underlying imagery and DSM data were processed at 0.5 m/pixel." + // ], + // "location": "query", + // "type": "string" + // }, + // "view": { + // "description": "Optional. The desired subset of the data to return.", + // "enum": [ + // "DATA_LAYER_VIEW_UNSPECIFIED", + // "DSM_LAYER", + // "IMAGERY_LAYERS", + // "IMAGERY_AND_ANNUAL_FLUX_LAYERS", + // "IMAGERY_AND_ALL_FLUX_LAYERS", + // "FULL_LAYERS" + // ], + // "enumDescriptions": [ + // "Equivalent to FULL.", + // "Get the DSM only.", + // "Get the DSM, RGB, and mask.", + // "Get the DSM, RGB, mask, and annual flux.", + // "Get the DSM, RGB, mask, annual flux, and monthly flux.", + // "Get all data." + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1/dataLayers:get", + // "response": { + // "$ref": "DataLayers" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "solar.geoTiff.get": + +type GeoTiffGetCall struct { + s *Service + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Returns an image by its ID. +func (r *GeoTiffService) Get() *GeoTiffGetCall { + c := &GeoTiffGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + return c +} + +// Id sets the optional parameter "id": Required. The ID of the asset +// being requested. +func (c *GeoTiffGetCall) Id(id string) *GeoTiffGetCall { + c.urlParams_.Set("id", id) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GeoTiffGetCall) Fields(s ...googleapi.Field) *GeoTiffGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GeoTiffGetCall) IfNoneMatch(entityTag string) *GeoTiffGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *GeoTiffGetCall) Context(ctx context.Context) *GeoTiffGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *GeoTiffGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *GeoTiffGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/geoTiff:get") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "solar.geoTiff.get" call. +// Exactly one of *HttpBody or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *HttpBody.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *GeoTiffGetCall) Do(opts ...googleapi.CallOption) (*HttpBody, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &HttpBody{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns an image by its ID.", + // "flatPath": "v1/geoTiff:get", + // "httpMethod": "GET", + // "id": "solar.geoTiff.get", + // "parameterOrder": [], + // "parameters": { + // "id": { + // "description": "Required. The ID of the asset being requested.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1/geoTiff:get", + // "response": { + // "$ref": "HttpBody" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +}