From ccc1c0d3233f33df2734641b09d4afbef0ef1c26 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 2 Oct 2024 07:10:18 +0000 Subject: [PATCH] feat(all): auto-regenerate discovery clients --- aiplatform/v1/aiplatform-api.json | 8 +- aiplatform/v1/aiplatform-gen.go | 18 +- aiplatform/v1beta1/aiplatform-api.json | 10 +- aiplatform/v1beta1/aiplatform-gen.go | 24 +- .../v1alpha/analyticsadmin-api.json | 4 +- analyticsadmin/v1alpha/analyticsadmin-gen.go | 8 +- apigee/v1/apigee-api.json | 239 ++++++- apigee/v1/apigee-gen.go | 676 ++++++++++++++++++ bigquery/v2/bigquery-api.json | 79 +- bigquery/v2/bigquery-gen.go | 18 + .../v1alpha1/factchecktools-api.json | 20 +- factchecktools/v1alpha1/factchecktools-gen.go | 9 - go.work.sum | 1 + .../accounts_v1beta/merchantapi-api.json | 11 +- .../accounts_v1beta/merchantapi-gen.go | 16 +- .../notifications_v1beta/merchantapi-api.json | 4 +- .../notifications_v1beta/merchantapi-gen.go | 20 +- .../products_v1beta/merchantapi-api.json | 6 +- .../products_v1beta/merchantapi-gen.go | 8 +- realtimebidding/v1/realtimebidding-api.json | 6 +- realtimebidding/v1/realtimebidding-gen.go | 5 +- .../v1/serviceconsumermanagement-api.json | 4 +- .../v1/serviceconsumermanagement-gen.go | 2 +- serviceusage/v1beta1/serviceusage-api.json | 4 +- serviceusage/v1beta1/serviceusage-gen.go | 2 +- texttospeech/v1/texttospeech-api.json | 179 ++++- texttospeech/v1/texttospeech-gen.go | 369 +++++++++- texttospeech/v1beta1/texttospeech-api.json | 181 ++++- texttospeech/v1beta1/texttospeech-gen.go | 370 +++++++++- 29 files changed, 2187 insertions(+), 114 deletions(-) diff --git a/aiplatform/v1/aiplatform-api.json b/aiplatform/v1/aiplatform-api.json index 4bbc9bdf737..45545519e19 100644 --- a/aiplatform/v1/aiplatform-api.json +++ b/aiplatform/v1/aiplatform-api.json @@ -6590,7 +6590,7 @@ ], "parameters": { "parent": { - "description": "Required. The resource name of the EntityType to create the batch of Features under. Format: `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}`", + "description": "Required. The resource name of the EntityType/FeatureGroup to create the batch of Features under. Format: `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` `projects/{project}/locations/{location}/featureGroups/{feature_group}`", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+$", "required": true, @@ -17813,7 +17813,7 @@ } } }, - "revision": "20240923", + "revision": "20240925", "rootUrl": "https://aiplatform.googleapis.com/", "schemas": { "CloudAiLargeModelsVisionGenerateVideoResponse": { @@ -18607,11 +18607,11 @@ "type": "object" }, "GoogleCloudAiplatformV1BatchCreateFeaturesRequest": { - "description": "Request message for FeaturestoreService.BatchCreateFeatures.", + "description": "Request message for FeaturestoreService.BatchCreateFeatures. Request message for FeatureRegistryService.BatchCreateFeatures.", "id": "GoogleCloudAiplatformV1BatchCreateFeaturesRequest", "properties": { "requests": { - "description": "Required. The request message specifying the Features to create. All Features must be created under the same parent EntityType. The `parent` field in each child request message can be omitted. If `parent` is set in a child request, then the value must match the `parent` value in this request message.", + "description": "Required. The request message specifying the Features to create. All Features must be created under the same parent EntityType / FeatureGroup. The `parent` field in each child request message can be omitted. If `parent` is set in a child request, then the value must match the `parent` value in this request message.", "items": { "$ref": "GoogleCloudAiplatformV1CreateFeatureRequest" }, diff --git a/aiplatform/v1/aiplatform-gen.go b/aiplatform/v1/aiplatform-gen.go index f8d409dc734..f255eb1c35b 100644 --- a/aiplatform/v1/aiplatform-gen.go +++ b/aiplatform/v1/aiplatform-gen.go @@ -2471,13 +2471,14 @@ func (s GoogleCloudAiplatformV1BatchCreateFeaturesOperationMetadata) MarshalJSON } // GoogleCloudAiplatformV1BatchCreateFeaturesRequest: Request message for -// FeaturestoreService.BatchCreateFeatures. +// FeaturestoreService.BatchCreateFeatures. Request message for +// FeatureRegistryService.BatchCreateFeatures. type GoogleCloudAiplatformV1BatchCreateFeaturesRequest struct { // Requests: Required. The request message specifying the Features to create. - // All Features must be created under the same parent EntityType. The `parent` - // field in each child request message can be omitted. If `parent` is set in a - // child request, then the value must match the `parent` value in this request - // message. + // All Features must be created under the same parent EntityType / + // FeatureGroup. The `parent` field in each child request message can be + // omitted. If `parent` is set in a child request, then the value must match + // the `parent` value in this request message. Requests []*GoogleCloudAiplatformV1CreateFeatureRequest `json:"requests,omitempty"` // ForceSendFields is a list of field names (e.g. "Requests") to // unconditionally include in API requests. By default, fields with empty or @@ -57508,10 +57509,11 @@ type ProjectsLocationsFeaturestoresEntityTypesFeaturesBatchCreateCall struct { // BatchCreate: Creates a batch of Features in a given EntityType. // -// - parent: The resource name of the EntityType to create the batch of -// Features under. Format: +// - parent: The resource name of the EntityType/FeatureGroup to create the +// batch of Features under. Format: // `projects/{project}/locations/{location}/featurestores/{featurestore}/entit -// yTypes/{entity_type}`. +// yTypes/{entity_type}` +// `projects/{project}/locations/{location}/featureGroups/{feature_group}`. func (r *ProjectsLocationsFeaturestoresEntityTypesFeaturesService) BatchCreate(parent string, googlecloudaiplatformv1batchcreatefeaturesrequest *GoogleCloudAiplatformV1BatchCreateFeaturesRequest) *ProjectsLocationsFeaturestoresEntityTypesFeaturesBatchCreateCall { c := &ProjectsLocationsFeaturestoresEntityTypesFeaturesBatchCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent diff --git a/aiplatform/v1beta1/aiplatform-api.json b/aiplatform/v1beta1/aiplatform-api.json index 726c16a0c64..0cec8a21aa0 100644 --- a/aiplatform/v1beta1/aiplatform-api.json +++ b/aiplatform/v1beta1/aiplatform-api.json @@ -8344,7 +8344,7 @@ ], "parameters": { "parent": { - "description": "Required. The resource name of the EntityType to create the batch of Features under. Format: `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}`", + "description": "Required. The resource name of the EntityType/FeatureGroup to create the batch of Features under. Format: `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` `projects/{project}/locations/{location}/featureGroups/{feature_group}`", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+$", "required": true, @@ -21202,7 +21202,7 @@ } } }, - "revision": "20240916", + "revision": "20240925", "rootUrl": "https://aiplatform.googleapis.com/", "schemas": { "CloudAiLargeModelsVisionGenerateVideoResponse": { @@ -22250,11 +22250,11 @@ "type": "object" }, "GoogleCloudAiplatformV1beta1BatchCreateFeaturesRequest": { - "description": "Request message for FeaturestoreService.BatchCreateFeatures.", + "description": "Request message for FeaturestoreService.BatchCreateFeatures. Request message for FeatureRegistryService.BatchCreateFeatures.", "id": "GoogleCloudAiplatformV1beta1BatchCreateFeaturesRequest", "properties": { "requests": { - "description": "Required. The request message specifying the Features to create. All Features must be created under the same parent EntityType. The `parent` field in each child request message can be omitted. If `parent` is set in a child request, then the value must match the `parent` value in this request message.", + "description": "Required. The request message specifying the Features to create. All Features must be created under the same parent EntityType / FeatureGroup. The `parent` field in each child request message can be omitted. If `parent` is set in a child request, then the value must match the `parent` value in this request message.", "items": { "$ref": "GoogleCloudAiplatformV1beta1CreateFeatureRequest" }, @@ -37743,7 +37743,7 @@ "type": "number" }, "sourceUri": { - "description": "For vertex RagStore, if the file is imported from Cloud Storage or Google Drive, source_uri will be original file URI in Cloud Storage or Google Drive; if file is uploaded, source_uri will be file display name.", + "description": "If the file is imported from Cloud Storage or Google Drive, source_uri will be original file URI in Cloud Storage or Google Drive; if file is uploaded, source_uri will be file display name.", "type": "string" }, "sparseDistance": { diff --git a/aiplatform/v1beta1/aiplatform-gen.go b/aiplatform/v1beta1/aiplatform-gen.go index 4870edc2a0a..5ad68326aad 100644 --- a/aiplatform/v1beta1/aiplatform-gen.go +++ b/aiplatform/v1beta1/aiplatform-gen.go @@ -3201,13 +3201,14 @@ func (s GoogleCloudAiplatformV1beta1BatchCreateFeaturesOperationMetadata) Marsha } // GoogleCloudAiplatformV1beta1BatchCreateFeaturesRequest: Request message for -// FeaturestoreService.BatchCreateFeatures. +// FeaturestoreService.BatchCreateFeatures. Request message for +// FeatureRegistryService.BatchCreateFeatures. type GoogleCloudAiplatformV1beta1BatchCreateFeaturesRequest struct { // Requests: Required. The request message specifying the Features to create. - // All Features must be created under the same parent EntityType. The `parent` - // field in each child request message can be omitted. If `parent` is set in a - // child request, then the value must match the `parent` value in this request - // message. + // All Features must be created under the same parent EntityType / + // FeatureGroup. The `parent` field in each child request message can be + // omitted. If `parent` is set in a child request, then the value must match + // the `parent` value in this request message. Requests []*GoogleCloudAiplatformV1beta1CreateFeatureRequest `json:"requests,omitempty"` // ForceSendFields is a list of field names (e.g. "Requests") to // unconditionally include in API requests. By default, fields with empty or @@ -24976,9 +24977,9 @@ type GoogleCloudAiplatformV1beta1RagContextsContext struct { // Distance: The distance between the query dense embedding vector and the // context text vector. Distance float64 `json:"distance,omitempty"` - // SourceUri: For vertex RagStore, if the file is imported from Cloud Storage - // or Google Drive, source_uri will be original file URI in Cloud Storage or - // Google Drive; if file is uploaded, source_uri will be file display name. + // SourceUri: If the file is imported from Cloud Storage or Google Drive, + // source_uri will be original file URI in Cloud Storage or Google Drive; if + // file is uploaded, source_uri will be file display name. SourceUri string `json:"sourceUri,omitempty"` // SparseDistance: The distance between the query sparse embedding vector and // the context text vector. @@ -69685,10 +69686,11 @@ type ProjectsLocationsFeaturestoresEntityTypesFeaturesBatchCreateCall struct { // BatchCreate: Creates a batch of Features in a given EntityType. // -// - parent: The resource name of the EntityType to create the batch of -// Features under. Format: +// - parent: The resource name of the EntityType/FeatureGroup to create the +// batch of Features under. Format: // `projects/{project}/locations/{location}/featurestores/{featurestore}/entit -// yTypes/{entity_type}`. +// yTypes/{entity_type}` +// `projects/{project}/locations/{location}/featureGroups/{feature_group}`. func (r *ProjectsLocationsFeaturestoresEntityTypesFeaturesService) BatchCreate(parent string, googlecloudaiplatformv1beta1batchcreatefeaturesrequest *GoogleCloudAiplatformV1beta1BatchCreateFeaturesRequest) *ProjectsLocationsFeaturestoresEntityTypesFeaturesBatchCreateCall { c := &ProjectsLocationsFeaturestoresEntityTypesFeaturesBatchCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent diff --git a/analyticsadmin/v1alpha/analyticsadmin-api.json b/analyticsadmin/v1alpha/analyticsadmin-api.json index 8ae9dce29a8..d09a559b1c5 100644 --- a/analyticsadmin/v1alpha/analyticsadmin-api.json +++ b/analyticsadmin/v1alpha/analyticsadmin-api.json @@ -4886,7 +4886,7 @@ } } }, - "revision": "20240916", + "revision": "20240929", "rootUrl": "https://analyticsadmin.googleapis.com/", "schemas": { "GoogleAnalyticsAdminV1alphaAccessBetweenFilter": { @@ -6037,7 +6037,7 @@ "type": "string" }, "project": { - "description": "Immutable. The linked Google Cloud project resource name. Currently, this API always uses a project number, but may use project IDs in the future. Format: 'projects/{project number}' Example: 'projects/1234'", + "description": "Immutable. The linked Google Cloud project. When creating a BigQueryLink, you may provide this resource name using either a project number or project ID. Once this resource has been created, the returned project will always have a project that contains a project number. Format: 'projects/{project number}' Example: 'projects/1234'", "type": "string" }, "streamingExportEnabled": { diff --git a/analyticsadmin/v1alpha/analyticsadmin-gen.go b/analyticsadmin/v1alpha/analyticsadmin-gen.go index f05cfbdd85f..dc13355afc2 100644 --- a/analyticsadmin/v1alpha/analyticsadmin-gen.go +++ b/analyticsadmin/v1alpha/analyticsadmin-gen.go @@ -2113,9 +2113,11 @@ type GoogleAnalyticsAdminV1alphaBigQueryLink struct { // 'properties/{property_id}/bigQueryLinks/{bigquery_link_id}' Format: // 'properties/1234/bigQueryLinks/abc567' Name string `json:"name,omitempty"` - // Project: Immutable. The linked Google Cloud project resource name. - // Currently, this API always uses a project number, but may use project IDs in - // the future. Format: 'projects/{project number}' Example: 'projects/1234' + // Project: Immutable. The linked Google Cloud project. When creating a + // BigQueryLink, you may provide this resource name using either a project + // number or project ID. Once this resource has been created, the returned + // project will always have a project that contains a project number. Format: + // 'projects/{project number}' Example: 'projects/1234' Project string `json:"project,omitempty"` // StreamingExportEnabled: If set true, enables streaming export to the linked // Google Cloud project. diff --git a/apigee/v1/apigee-api.json b/apigee/v1/apigee-api.json index 5e204819667..cee60c35492 100644 --- a/apigee/v1/apigee-api.json +++ b/apigee/v1/apigee-api.json @@ -9503,6 +9503,163 @@ } } }, + "securityProfilesV2": { + "methods": { + "create": { + "description": "Create a security profile v2.", + "flatPath": "v1/organizations/{organizationsId}/securityProfilesV2", + "httpMethod": "POST", + "id": "apigee.organizations.securityProfilesV2.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The parent resource name.", + "location": "path", + "pattern": "^organizations/[^/]+$", + "required": true, + "type": "string" + }, + "securityProfileV2Id": { + "description": "Required. The security profile id.", + "location": "query", + "type": "string" + } + }, + "path": "v1/{+parent}/securityProfilesV2", + "request": { + "$ref": "GoogleCloudApigeeV1SecurityProfileV2" + }, + "response": { + "$ref": "GoogleCloudApigeeV1SecurityProfileV2" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "delete": { + "description": "Delete a security profile v2.", + "flatPath": "v1/organizations/{organizationsId}/securityProfilesV2/{securityProfilesV2Id}", + "httpMethod": "DELETE", + "id": "apigee.organizations.securityProfilesV2.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the security profile v2 to delete.", + "location": "path", + "pattern": "^organizations/[^/]+/securityProfilesV2/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "GoogleProtobufEmpty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "description": "Get a security profile v2.", + "flatPath": "v1/organizations/{organizationsId}/securityProfilesV2/{securityProfilesV2Id}", + "httpMethod": "GET", + "id": "apigee.organizations.securityProfilesV2.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The security profile id.", + "location": "path", + "pattern": "^organizations/[^/]+/securityProfilesV2/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "GoogleCloudApigeeV1SecurityProfileV2" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "description": "List security profiles v2.", + "flatPath": "v1/organizations/{organizationsId}/securityProfilesV2", + "httpMethod": "GET", + "id": "apigee.organizations.securityProfilesV2.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "Optional. The maximum number of profiles to return", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. A page token, received from a previous `ListSecurityProfilesV2` call. Provide this to retrieve the subsequent page.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. For a specific organization, list of all the security profiles. Format: `organizations/{org}`", + "location": "path", + "pattern": "^organizations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}/securityProfilesV2", + "response": { + "$ref": "GoogleCloudApigeeV1ListSecurityProfilesV2Response" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "patch": { + "description": "Update a security profile V2.", + "flatPath": "v1/organizations/{organizationsId}/securityProfilesV2/{securityProfilesV2Id}", + "httpMethod": "PATCH", + "id": "apigee.organizations.securityProfilesV2.patch", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Identifier. Name of the security profile v2 resource. Format: organizations/{org}/securityProfilesV2/{profile}", + "location": "path", + "pattern": "^organizations/[^/]+/securityProfilesV2/[^/]+$", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "Required. The list of fields to update.", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "v1/{+name}", + "request": { + "$ref": "GoogleCloudApigeeV1SecurityProfileV2" + }, + "response": { + "$ref": "GoogleCloudApigeeV1SecurityProfileV2" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, "sharedflows": { "methods": { "create": { @@ -10157,7 +10314,7 @@ } } }, - "revision": "20240919", + "revision": "20240927", "rootUrl": "https://apigee.googleapis.com/", "schemas": { "EdgeConfigstoreBundleBadBundle": { @@ -14703,6 +14860,24 @@ }, "type": "object" }, + "GoogleCloudApigeeV1ListSecurityProfilesV2Response": { + "description": "Response for ListSecurityProfilesV2.", + "id": "GoogleCloudApigeeV1ListSecurityProfilesV2Response", + "properties": { + "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" + }, + "securityProfilesV2": { + "description": "List of security profiles in the organization.", + "items": { + "$ref": "GoogleCloudApigeeV1SecurityProfileV2" + }, + "type": "array" + } + }, + "type": "object" + }, "GoogleCloudApigeeV1ListSecurityReportsResponse": { "description": "The response for SecurityReports.", "id": "GoogleCloudApigeeV1ListSecurityReportsResponse", @@ -17344,6 +17519,68 @@ }, "type": "object" }, + "GoogleCloudApigeeV1SecurityProfileV2": { + "description": "Security profile for risk assessment version 2.", + "id": "GoogleCloudApigeeV1SecurityProfileV2", + "properties": { + "createTime": { + "description": "Output only. The time of the security profile creation.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "description": { + "description": "Optional. The description of the security profile.", + "type": "string" + }, + "googleDefined": { + "description": "Output only. Whether the security profile is google defined.", + "readOnly": true, + "type": "boolean" + }, + "name": { + "description": "Identifier. Name of the security profile v2 resource. Format: organizations/{org}/securityProfilesV2/{profile}", + "type": "string" + }, + "profileAssessmentConfigs": { + "additionalProperties": { + "$ref": "GoogleCloudApigeeV1SecurityProfileV2ProfileAssessmentConfig" + }, + "description": "Required. The configuration for each assessment in this profile. Key is the name/id of the assessment.", + "type": "object" + }, + "updateTime": { + "description": "Output only. The time of the security profile update.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudApigeeV1SecurityProfileV2ProfileAssessmentConfig": { + "description": "The configuration definition for a specific assessment.", + "id": "GoogleCloudApigeeV1SecurityProfileV2ProfileAssessmentConfig", + "properties": { + "weight": { + "description": "The weight of the assessment.", + "enum": [ + "WEIGHT_UNSPECIFIED", + "MINOR", + "MODERATE", + "MAJOR" + ], + "enumDescriptions": [ + "The weight is unspecified.", + "The weight is minor.", + "The weight is moderate.", + "The weight is major." + ], + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudApigeeV1SecurityReport": { "description": "SecurityReport saves all the information about the created security report.", "id": "GoogleCloudApigeeV1SecurityReport", diff --git a/apigee/v1/apigee-gen.go b/apigee/v1/apigee-gen.go index 0c21f60bd46..7accb98d120 100644 --- a/apigee/v1/apigee-gen.go +++ b/apigee/v1/apigee-gen.go @@ -204,6 +204,7 @@ func NewOrganizationsService(s *Service) *OrganizationsService { rs.Reports = NewOrganizationsReportsService(s) rs.SecurityAssessmentResults = NewOrganizationsSecurityAssessmentResultsService(s) rs.SecurityProfiles = NewOrganizationsSecurityProfilesService(s) + rs.SecurityProfilesV2 = NewOrganizationsSecurityProfilesV2Service(s) rs.Sharedflows = NewOrganizationsSharedflowsService(s) rs.Sites = NewOrganizationsSitesService(s) return rs @@ -254,6 +255,8 @@ type OrganizationsService struct { SecurityProfiles *OrganizationsSecurityProfilesService + SecurityProfilesV2 *OrganizationsSecurityProfilesV2Service + Sharedflows *OrganizationsSharedflowsService Sites *OrganizationsSitesService @@ -1144,6 +1147,15 @@ type OrganizationsSecurityProfilesEnvironmentsService struct { s *Service } +func NewOrganizationsSecurityProfilesV2Service(s *Service) *OrganizationsSecurityProfilesV2Service { + rs := &OrganizationsSecurityProfilesV2Service{s: s} + return rs +} + +type OrganizationsSecurityProfilesV2Service struct { + s *Service +} + func NewOrganizationsSharedflowsService(s *Service) *OrganizationsSharedflowsService { rs := &OrganizationsSharedflowsService{s: s} rs.Deployments = NewOrganizationsSharedflowsDeploymentsService(s) @@ -6675,6 +6687,35 @@ func (s GoogleCloudApigeeV1ListSecurityProfilesResponse) MarshalJSON() ([]byte, return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) } +// GoogleCloudApigeeV1ListSecurityProfilesV2Response: Response for +// ListSecurityProfilesV2. +type GoogleCloudApigeeV1ListSecurityProfilesV2Response struct { + // 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"` + // SecurityProfilesV2: List of security profiles in the organization. + SecurityProfilesV2 []*GoogleCloudApigeeV1SecurityProfileV2 `json:"securityProfilesV2,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "NextPageToken") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s GoogleCloudApigeeV1ListSecurityProfilesV2Response) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudApigeeV1ListSecurityProfilesV2Response + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + // GoogleCloudApigeeV1ListSecurityReportsResponse: The response for // SecurityReports. type GoogleCloudApigeeV1ListSecurityReportsResponse struct { @@ -9767,6 +9808,73 @@ func (s GoogleCloudApigeeV1SecurityProfileScoringConfig) MarshalJSON() ([]byte, return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) } +// GoogleCloudApigeeV1SecurityProfileV2: Security profile for risk assessment +// version 2. +type GoogleCloudApigeeV1SecurityProfileV2 struct { + // CreateTime: Output only. The time of the security profile creation. + CreateTime string `json:"createTime,omitempty"` + // Description: Optional. The description of the security profile. + Description string `json:"description,omitempty"` + // GoogleDefined: Output only. Whether the security profile is google defined. + GoogleDefined bool `json:"googleDefined,omitempty"` + // Name: Identifier. Name of the security profile v2 resource. Format: + // organizations/{org}/securityProfilesV2/{profile} + Name string `json:"name,omitempty"` + // ProfileAssessmentConfigs: Required. The configuration for each assessment in + // this profile. Key is the name/id of the assessment. + ProfileAssessmentConfigs map[string]GoogleCloudApigeeV1SecurityProfileV2ProfileAssessmentConfig `json:"profileAssessmentConfigs,omitempty"` + // UpdateTime: Output only. The time of the security profile update. + UpdateTime string `json:"updateTime,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "CreateTime") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s GoogleCloudApigeeV1SecurityProfileV2) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudApigeeV1SecurityProfileV2 + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// GoogleCloudApigeeV1SecurityProfileV2ProfileAssessmentConfig: The +// configuration definition for a specific assessment. +type GoogleCloudApigeeV1SecurityProfileV2ProfileAssessmentConfig struct { + // Weight: The weight of the assessment. + // + // Possible values: + // "WEIGHT_UNSPECIFIED" - The weight is unspecified. + // "MINOR" - The weight is minor. + // "MODERATE" - The weight is moderate. + // "MAJOR" - The weight is major. + Weight string `json:"weight,omitempty"` + // ForceSendFields is a list of field names (e.g. "Weight") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Weight") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s GoogleCloudApigeeV1SecurityProfileV2ProfileAssessmentConfig) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudApigeeV1SecurityProfileV2ProfileAssessmentConfig + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + // GoogleCloudApigeeV1SecurityReport: SecurityReport saves all the information // about the created security report. type GoogleCloudApigeeV1SecurityReport struct { @@ -45843,6 +45951,574 @@ func (c *OrganizationsSecurityProfilesEnvironmentsDeleteCall) Do(opts ...googlea return ret, nil } +type OrganizationsSecurityProfilesV2CreateCall struct { + s *Service + parent string + googlecloudapigeev1securityprofilev2 *GoogleCloudApigeeV1SecurityProfileV2 + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Create a security profile v2. +// +// - parent: The parent resource name. +func (r *OrganizationsSecurityProfilesV2Service) Create(parent string, googlecloudapigeev1securityprofilev2 *GoogleCloudApigeeV1SecurityProfileV2) *OrganizationsSecurityProfilesV2CreateCall { + c := &OrganizationsSecurityProfilesV2CreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googlecloudapigeev1securityprofilev2 = googlecloudapigeev1securityprofilev2 + return c +} + +// SecurityProfileV2Id sets the optional parameter "securityProfileV2Id": +// Required. The security profile id. +func (c *OrganizationsSecurityProfilesV2CreateCall) SecurityProfileV2Id(securityProfileV2Id string) *OrganizationsSecurityProfilesV2CreateCall { + c.urlParams_.Set("securityProfileV2Id", securityProfileV2Id) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *OrganizationsSecurityProfilesV2CreateCall) Fields(s ...googleapi.Field) *OrganizationsSecurityProfilesV2CreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *OrganizationsSecurityProfilesV2CreateCall) Context(ctx context.Context) *OrganizationsSecurityProfilesV2CreateCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *OrganizationsSecurityProfilesV2CreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsSecurityProfilesV2CreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1securityprofilev2) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/securityProfilesV2") + 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{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "apigee.organizations.securityProfilesV2.create" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleCloudApigeeV1SecurityProfileV2.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 *OrganizationsSecurityProfilesV2CreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudApigeeV1SecurityProfileV2, 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 := &GoogleCloudApigeeV1SecurityProfileV2{ + 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 +} + +type OrganizationsSecurityProfilesV2DeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Delete a security profile v2. +// +// - name: The name of the security profile v2 to delete. +func (r *OrganizationsSecurityProfilesV2Service) Delete(name string) *OrganizationsSecurityProfilesV2DeleteCall { + c := &OrganizationsSecurityProfilesV2DeleteCall{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 +// details. +func (c *OrganizationsSecurityProfilesV2DeleteCall) Fields(s ...googleapi.Field) *OrganizationsSecurityProfilesV2DeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *OrganizationsSecurityProfilesV2DeleteCall) Context(ctx context.Context) *OrganizationsSecurityProfilesV2DeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *OrganizationsSecurityProfilesV2DeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsSecurityProfilesV2DeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+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 "apigee.organizations.securityProfilesV2.delete" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleProtobufEmpty.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 *OrganizationsSecurityProfilesV2DeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, 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 := &GoogleProtobufEmpty{ + 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 +} + +type OrganizationsSecurityProfilesV2GetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Get a security profile v2. +// +// - name: The security profile id. +func (r *OrganizationsSecurityProfilesV2Service) Get(name string) *OrganizationsSecurityProfilesV2GetCall { + c := &OrganizationsSecurityProfilesV2GetCall{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 +// details. +func (c *OrganizationsSecurityProfilesV2GetCall) Fields(s ...googleapi.Field) *OrganizationsSecurityProfilesV2GetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *OrganizationsSecurityProfilesV2GetCall) IfNoneMatch(entityTag string) *OrganizationsSecurityProfilesV2GetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *OrganizationsSecurityProfilesV2GetCall) Context(ctx context.Context) *OrganizationsSecurityProfilesV2GetCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *OrganizationsSecurityProfilesV2GetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsSecurityProfilesV2GetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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/{+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 "apigee.organizations.securityProfilesV2.get" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleCloudApigeeV1SecurityProfileV2.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 *OrganizationsSecurityProfilesV2GetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudApigeeV1SecurityProfileV2, 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 := &GoogleCloudApigeeV1SecurityProfileV2{ + 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 +} + +type OrganizationsSecurityProfilesV2ListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: List security profiles v2. +// +// - parent: For a specific organization, list of all the security profiles. +// Format: `organizations/{org}`. +func (r *OrganizationsSecurityProfilesV2Service) List(parent string) *OrganizationsSecurityProfilesV2ListCall { + c := &OrganizationsSecurityProfilesV2ListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number of +// profiles to return +func (c *OrganizationsSecurityProfilesV2ListCall) PageSize(pageSize int64) *OrganizationsSecurityProfilesV2ListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token, received +// from a previous `ListSecurityProfilesV2` call. Provide this to retrieve the +// subsequent page. +func (c *OrganizationsSecurityProfilesV2ListCall) PageToken(pageToken string) *OrganizationsSecurityProfilesV2ListCall { + 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 +// details. +func (c *OrganizationsSecurityProfilesV2ListCall) Fields(s ...googleapi.Field) *OrganizationsSecurityProfilesV2ListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *OrganizationsSecurityProfilesV2ListCall) IfNoneMatch(entityTag string) *OrganizationsSecurityProfilesV2ListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *OrganizationsSecurityProfilesV2ListCall) Context(ctx context.Context) *OrganizationsSecurityProfilesV2ListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *OrganizationsSecurityProfilesV2ListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsSecurityProfilesV2ListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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/{+parent}/securityProfilesV2") + 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 "apigee.organizations.securityProfilesV2.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleCloudApigeeV1ListSecurityProfilesV2Response.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 *OrganizationsSecurityProfilesV2ListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudApigeeV1ListSecurityProfilesV2Response, 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 := &GoogleCloudApigeeV1ListSecurityProfilesV2Response{ + 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 +} + +// 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 *OrganizationsSecurityProfilesV2ListCall) Pages(ctx context.Context, f func(*GoogleCloudApigeeV1ListSecurityProfilesV2Response) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + 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) + } +} + +type OrganizationsSecurityProfilesV2PatchCall struct { + s *Service + name string + googlecloudapigeev1securityprofilev2 *GoogleCloudApigeeV1SecurityProfileV2 + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Update a security profile V2. +// +// - name: Identifier. Name of the security profile v2 resource. Format: +// organizations/{org}/securityProfilesV2/{profile}. +func (r *OrganizationsSecurityProfilesV2Service) Patch(name string, googlecloudapigeev1securityprofilev2 *GoogleCloudApigeeV1SecurityProfileV2) *OrganizationsSecurityProfilesV2PatchCall { + c := &OrganizationsSecurityProfilesV2PatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googlecloudapigeev1securityprofilev2 = googlecloudapigeev1securityprofilev2 + return c +} + +// UpdateMask sets the optional parameter "updateMask": Required. The list of +// fields to update. +func (c *OrganizationsSecurityProfilesV2PatchCall) UpdateMask(updateMask string) *OrganizationsSecurityProfilesV2PatchCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *OrganizationsSecurityProfilesV2PatchCall) Fields(s ...googleapi.Field) *OrganizationsSecurityProfilesV2PatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *OrganizationsSecurityProfilesV2PatchCall) Context(ctx context.Context) *OrganizationsSecurityProfilesV2PatchCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *OrganizationsSecurityProfilesV2PatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsSecurityProfilesV2PatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudapigeev1securityprofilev2) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("PATCH", 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 "apigee.organizations.securityProfilesV2.patch" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleCloudApigeeV1SecurityProfileV2.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 *OrganizationsSecurityProfilesV2PatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudApigeeV1SecurityProfileV2, 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 := &GoogleCloudApigeeV1SecurityProfileV2{ + 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 +} + type OrganizationsSharedflowsCreateCall struct { s *Service parent string diff --git a/bigquery/v2/bigquery-api.json b/bigquery/v2/bigquery-api.json index 37efa8dcdbf..ec4ff938239 100644 --- a/bigquery/v2/bigquery-api.json +++ b/bigquery/v2/bigquery-api.json @@ -54,20 +54,65 @@ "endpointUrl": "https://bigquery.me-central2.rep.googleapis.com/", "location": "me-central2" }, + { + "description": "Regional Endpoint", + "endpointUrl": "https://bigquery.us-central1.rep.googleapis.com/", + "location": "us-central1" + }, + { + "description": "Regional Endpoint", + "endpointUrl": "https://bigquery.us-central2.rep.googleapis.com/", + "location": "us-central2" + }, + { + "description": "Regional Endpoint", + "endpointUrl": "https://bigquery.us-east1.rep.googleapis.com/", + "location": "us-east1" + }, { "description": "Regional Endpoint", "endpointUrl": "https://bigquery.us-east4.rep.googleapis.com/", "location": "us-east4" }, + { + "description": "Regional Endpoint", + "endpointUrl": "https://bigquery.us-east5.rep.googleapis.com/", + "location": "us-east5" + }, { "description": "Regional Endpoint", "endpointUrl": "https://bigquery.us-east7.rep.googleapis.com/", "location": "us-east7" }, + { + "description": "Regional Endpoint", + "endpointUrl": "https://bigquery.us-south1.rep.googleapis.com/", + "location": "us-south1" + }, { "description": "Regional Endpoint", "endpointUrl": "https://bigquery.us-west1.rep.googleapis.com/", "location": "us-west1" + }, + { + "description": "Regional Endpoint", + "endpointUrl": "https://bigquery.us-west2.rep.googleapis.com/", + "location": "us-west2" + }, + { + "description": "Regional Endpoint", + "endpointUrl": "https://bigquery.us-west3.rep.googleapis.com/", + "location": "us-west3" + }, + { + "description": "Regional Endpoint", + "endpointUrl": "https://bigquery.us-west4.rep.googleapis.com/", + "location": "us-west4" + }, + { + "description": "Regional Endpoint", + "endpointUrl": "https://bigquery.us-west8.rep.googleapis.com/", + "location": "us-west8" } ], "fullyEncodeReservedExpansion": true, @@ -1940,7 +1985,7 @@ } } }, - "revision": "20240905", + "revision": "20240919", "rootUrl": "https://bigquery.googleapis.com/", "schemas": { "AggregateClassificationMetrics": { @@ -6424,7 +6469,8 @@ "RANDOM_FOREST_CLASSIFIER", "TENSORFLOW_LITE", "ONNX", - "TRANSFORM_ONLY" + "TRANSFORM_ONLY", + "CONTRIBUTION_ANALYSIS" ], "enumDescriptions": [ "Default value.", @@ -6451,7 +6497,8 @@ "Random forest classifier model.", "An imported TensorFlow Lite model.", "An imported ONNX model.", - "Model to capture the columns and logic in the TRANSFORM clause along with statistics useful for ML analytic functions." + "Model to capture the columns and logic in the TRANSFORM clause along with statistics useful for ML analytic functions.", + "The contribution analysis model." ], "readOnly": true, "type": "string" @@ -6595,7 +6642,8 @@ "RANDOM_FOREST_CLASSIFIER", "TENSORFLOW_LITE", "ONNX", - "TRANSFORM_ONLY" + "TRANSFORM_ONLY", + "CONTRIBUTION_ANALYSIS" ], "enumDescriptions": [ "Default value.", @@ -6622,7 +6670,8 @@ "Random forest classifier model.", "An imported TensorFlow Lite model.", "An imported ONNX model.", - "Model to capture the columns and logic in the TRANSFORM clause along with statistics useful for ML analytic functions." + "Model to capture the columns and logic in the TRANSFORM clause along with statistics useful for ML analytic functions.", + "The contribution analysis model." ], "readOnly": true, "type": "string" @@ -9329,6 +9378,10 @@ "format": "double", "type": "number" }, + "contributionMetric": { + "description": "The contribution metric. Applies to contribution analysis models. Allowed formats supported are for summable and summable ratio contribution metrics. These include expressions such as \"SUM(x)\" or \"SUM(x)/SUM(y)\", where x and y are column names from the base table.", + "type": "string" + }, "dartNormalizeType": { "description": "Type of normalization algorithm for boosted tree models using dart booster.", "enum": [ @@ -9402,6 +9455,13 @@ "description": "If true, perform decompose time series and save the results.", "type": "boolean" }, + "dimensionIdColumns": { + "description": "Optional. Names of the columns to slice on. Applies to contribution analysis models.", + "items": { + "type": "string" + }, + "type": "array" + }, "distanceType": { "description": "Distance type for clustering models.", "enum": [ @@ -9825,6 +9885,10 @@ "format": "int64", "type": "string" }, + "isTestColumn": { + "description": "Name of the column used to determine the rows corresponding to control and test. Applies to contribution analysis models.", + "type": "string" + }, "itemColumn": { "description": "Item column specified for matrix factorization models.", "type": "string" @@ -9925,6 +9989,11 @@ "format": "int64", "type": "string" }, + "minAprioriSupport": { + "description": "The apriori support minimum. Applies to contribution analysis models.", + "format": "double", + "type": "number" + }, "minRelativeProgress": { "description": "When early_stop is true, stops training when accuracy improvement is less than 'min_relative_progress'. Used only for iterative training algorithms.", "format": "double", diff --git a/bigquery/v2/bigquery-gen.go b/bigquery/v2/bigquery-gen.go index d4bd7e23e40..2772173d314 100644 --- a/bigquery/v2/bigquery-gen.go +++ b/bigquery/v2/bigquery-gen.go @@ -6051,6 +6051,7 @@ type MlStatistics struct { // "ONNX" - An imported ONNX model. // "TRANSFORM_ONLY" - Model to capture the columns and logic in the TRANSFORM // clause along with statistics useful for ML analytic functions. + // "CONTRIBUTION_ANALYSIS" - The contribution analysis model. ModelType string `json:"modelType,omitempty"` // TrainingType: Output only. Training type of the job. // @@ -6167,6 +6168,7 @@ type Model struct { // "ONNX" - An imported ONNX model. // "TRANSFORM_ONLY" - Model to capture the columns and logic in the TRANSFORM // clause along with statistics useful for ML analytic functions. + // "CONTRIBUTION_ANALYSIS" - The contribution analysis model. ModelType string `json:"modelType,omitempty"` // OptimalTrialIds: Output only. For single-objective hyperparameter tuning // (https://cloud.google.com/bigquery-ml/docs/reference/standard-sql/bigqueryml-syntax-hp-tuning-overview) @@ -9576,6 +9578,11 @@ type TrainingOptions struct { // ColsampleBytree: Subsample ratio of columns when constructing each tree for // boosted tree models. ColsampleBytree float64 `json:"colsampleBytree,omitempty"` + // ContributionMetric: The contribution metric. Applies to contribution + // analysis models. Allowed formats supported are for summable and summable + // ratio contribution metrics. These include expressions such as "SUM(x)" or + // "SUM(x)/SUM(y)", where x and y are column names from the base table. + ContributionMetric string `json:"contributionMetric,omitempty"` // DartNormalizeType: Type of normalization algorithm for boosted tree models // using dart booster. // @@ -9625,6 +9632,9 @@ type TrainingOptions struct { // DecomposeTimeSeries: If true, perform decompose time series and save the // results. DecomposeTimeSeries bool `json:"decomposeTimeSeries,omitempty"` + // DimensionIdColumns: Optional. Names of the columns to slice on. Applies to + // contribution analysis models. + DimensionIdColumns []string `json:"dimensionIdColumns,omitempty"` // DistanceType: Distance type for clustering models. // // Possible values: @@ -9855,6 +9865,9 @@ type TrainingOptions struct { // IntegratedGradientsNumSteps: Number of integral steps for the integrated // gradients explain method. IntegratedGradientsNumSteps int64 `json:"integratedGradientsNumSteps,omitempty,string"` + // IsTestColumn: Name of the column used to determine the rows corresponding to + // control and test. Applies to contribution analysis models. + IsTestColumn string `json:"isTestColumn,omitempty"` // ItemColumn: Item column specified for matrix factorization models. ItemColumn string `json:"itemColumn,omitempty"` // KmeansInitializationColumn: The column used to provide the initial centroids @@ -9910,6 +9923,9 @@ type TrainingOptions struct { MaxTimeSeriesLength int64 `json:"maxTimeSeriesLength,omitempty,string"` // MaxTreeDepth: Maximum depth of a tree for boosted tree models. MaxTreeDepth int64 `json:"maxTreeDepth,omitempty,string"` + // MinAprioriSupport: The apriori support minimum. Applies to contribution + // analysis models. + MinAprioriSupport float64 `json:"minAprioriSupport,omitempty"` // MinRelativeProgress: When early_stop is true, stops training when accuracy // improvement is less than 'min_relative_progress'. Used only for iterative // training algorithms. @@ -10073,6 +10089,7 @@ func (s *TrainingOptions) UnmarshalJSON(data []byte) error { L1Regularization gensupport.JSONFloat64 `json:"l1Regularization"` L2Regularization gensupport.JSONFloat64 `json:"l2Regularization"` LearnRate gensupport.JSONFloat64 `json:"learnRate"` + MinAprioriSupport gensupport.JSONFloat64 `json:"minAprioriSupport"` MinRelativeProgress gensupport.JSONFloat64 `json:"minRelativeProgress"` MinSplitLoss gensupport.JSONFloat64 `json:"minSplitLoss"` PcaExplainedVarianceRatio gensupport.JSONFloat64 `json:"pcaExplainedVarianceRatio"` @@ -10096,6 +10113,7 @@ func (s *TrainingOptions) UnmarshalJSON(data []byte) error { s.L1Regularization = float64(s1.L1Regularization) s.L2Regularization = float64(s1.L2Regularization) s.LearnRate = float64(s1.LearnRate) + s.MinAprioriSupport = float64(s1.MinAprioriSupport) s.MinRelativeProgress = float64(s1.MinRelativeProgress) s.MinSplitLoss = float64(s1.MinSplitLoss) s.PcaExplainedVarianceRatio = float64(s1.PcaExplainedVarianceRatio) diff --git a/factchecktools/v1alpha1/factchecktools-api.json b/factchecktools/v1alpha1/factchecktools-api.json index 9f14c9b8f2b..81f3a1c6f6b 100644 --- a/factchecktools/v1alpha1/factchecktools-api.json +++ b/factchecktools/v1alpha1/factchecktools-api.json @@ -4,9 +4,6 @@ "scopes": { "https://www.googleapis.com/auth/factchecktools": { "description": "Read, create, update, and delete your ClaimReview data." - }, - "https://www.googleapis.com/auth/userinfo.email": { - "description": "See your primary Google Account email address" } } } @@ -220,8 +217,7 @@ "$ref": "GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage" }, "scopes": [ - "https://www.googleapis.com/auth/factchecktools", - "https://www.googleapis.com/auth/userinfo.email" + "https://www.googleapis.com/auth/factchecktools" ] }, "delete": { @@ -246,8 +242,7 @@ "$ref": "GoogleProtobufEmpty" }, "scopes": [ - "https://www.googleapis.com/auth/factchecktools", - "https://www.googleapis.com/auth/userinfo.email" + "https://www.googleapis.com/auth/factchecktools" ] }, "get": { @@ -272,8 +267,7 @@ "$ref": "GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage" }, "scopes": [ - "https://www.googleapis.com/auth/factchecktools", - "https://www.googleapis.com/auth/userinfo.email" + "https://www.googleapis.com/auth/factchecktools" ] }, "list": { @@ -316,8 +310,7 @@ "$ref": "GoogleFactcheckingFactchecktoolsV1alpha1ListClaimReviewMarkupPagesResponse" }, "scopes": [ - "https://www.googleapis.com/auth/factchecktools", - "https://www.googleapis.com/auth/userinfo.email" + "https://www.googleapis.com/auth/factchecktools" ] }, "update": { @@ -345,14 +338,13 @@ "$ref": "GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage" }, "scopes": [ - "https://www.googleapis.com/auth/factchecktools", - "https://www.googleapis.com/auth/userinfo.email" + "https://www.googleapis.com/auth/factchecktools" ] } } } }, - "revision": "20240626", + "revision": "20240929", "rootUrl": "https://factchecktools.googleapis.com/", "schemas": { "GoogleFactcheckingFactchecktoolsV1alpha1Claim": { diff --git a/factchecktools/v1alpha1/factchecktools-gen.go b/factchecktools/v1alpha1/factchecktools-gen.go index ac1193fca55..226fde4d532 100644 --- a/factchecktools/v1alpha1/factchecktools-gen.go +++ b/factchecktools/v1alpha1/factchecktools-gen.go @@ -34,11 +34,6 @@ // // # Other authentication options // -// By default, all available scopes (see "Constants") are used to authenticate. -// To restrict scopes, use [google.golang.org/api/option.WithScopes]: -// -// factchecktoolsService, err := factchecktools.NewService(ctx, option.WithScopes(factchecktools.UserinfoEmailScope)) -// // To use an API key for authentication (note: some APIs do not support API // keys), use [google.golang.org/api/option.WithAPIKey]: // @@ -102,16 +97,12 @@ const mtlsBasePath = "https://factchecktools.mtls.googleapis.com/" const ( // Read, create, update, and delete your ClaimReview data. FactchecktoolsScope = "https://www.googleapis.com/auth/factchecktools" - - // See your primary Google Account email address - UserinfoEmailScope = "https://www.googleapis.com/auth/userinfo.email" ) // NewService creates a new Service. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { scopesOption := internaloption.WithDefaultScopes( "https://www.googleapis.com/auth/factchecktools", - "https://www.googleapis.com/auth/userinfo.email", ) // NOTE: prepend, so we don't override user-specified scopes. opts = append([]option.ClientOption{scopesOption}, opts...) diff --git a/go.work.sum b/go.work.sum index 10e67cd0ef8..0c5a675cc55 100644 --- a/go.work.sum +++ b/go.work.sum @@ -91,6 +91,7 @@ cloud.google.com/go/compute v1.27.4/go.mod h1:7JZS+h21ERAGHOy5qb7+EPyXlQwzshzrx1 cloud.google.com/go/compute v1.27.5 h1:iii9Z+FhEeZ5cUkGOEqU+GM7MJSyxMgbE7H7j+JndYY= cloud.google.com/go/compute v1.28.0 h1:OPtBxMcheSS+DWfci803qvPly3d4w7Eu5ztKBcFfzwk= cloud.google.com/go/compute v1.28.0/go.mod h1:DEqZBtYrDnD5PvjsKwb3onnhX+qjdCVM7eshj1XdjV4= +cloud.google.com/go/compute v1.28.1 h1:XwPcZjgMCnU2tkwY10VleUjSAfpTj9RDn+kGrbYsi8o= cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= cloud.google.com/go/contactcenterinsights v1.13.0/go.mod h1:ieq5d5EtHsu8vhe2y3amtZ+BE+AQwX5qAy7cpo0POsI= cloud.google.com/go/contactcenterinsights v1.13.6/go.mod h1:mL+DbN3pMQGaAbDC4wZhryLciwSwHf5Tfk4Itr72Zyk= diff --git a/merchantapi/accounts_v1beta/merchantapi-api.json b/merchantapi/accounts_v1beta/merchantapi-api.json index a9a9fe5180a..b1d5ec29158 100644 --- a/merchantapi/accounts_v1beta/merchantapi-api.json +++ b/merchantapi/accounts_v1beta/merchantapi-api.json @@ -126,7 +126,7 @@ ] }, "delete": { - "description": "Deletes the specified account regardless of its type: standalone, MCA or sub-account. Deleting an MCA leads to the deletion of all of its sub-accounts. Executing this method requires admin access.", + "description": "Deletes the specified account regardless of its type: standalone, MCA or sub-account. Deleting an MCA leads to the deletion of all of its sub-accounts. Executing this method requires admin access. The deletion succeeds only if the account does not provide services to any other account and has no processed offers. You can use the `force` parameter to override this.", "flatPath": "accounts/v1beta/accounts/{accountsId}", "httpMethod": "DELETE", "id": "merchantapi.accounts.delete", @@ -134,6 +134,11 @@ "name" ], "parameters": { + "force": { + "description": "Optional. If set to `true`, the account is deleted even if it provides services to other accounts or has processed offers.", + "location": "query", + "type": "boolean" + }, "name": { "description": "Required. The name of the account to delete. Format: `accounts/{account}`", "location": "path", @@ -176,7 +181,7 @@ ] }, "list": { - "description": "Lists accounts accessible to the calling user and matching the constraints of the request such as page size or filters. This is not just listing the sub-accounts of an MCA, but all accounts the calling user has access to including other MCAs, linked accounts, standalone accounts and so on.", + "description": "Lists accounts accessible to the calling user and matching the constraints of the request such as page size or filters. This is not just listing the sub-accounts of an MCA, but all accounts the calling user has access to including other MCAs, linked accounts, standalone accounts and so on. If no filter is provided, then it returns accounts the user is directly added to.", "flatPath": "accounts/v1beta/accounts", "httpMethod": "GET", "id": "merchantapi.accounts.list", @@ -1412,7 +1417,7 @@ } } }, - "revision": "20240924", + "revision": "20240930", "rootUrl": "https://merchantapi.googleapis.com/", "schemas": { "AcceptTermsOfService": { diff --git a/merchantapi/accounts_v1beta/merchantapi-gen.go b/merchantapi/accounts_v1beta/merchantapi-gen.go index e133403bd65..88c9be7451e 100644 --- a/merchantapi/accounts_v1beta/merchantapi-gen.go +++ b/merchantapi/accounts_v1beta/merchantapi-gen.go @@ -3182,7 +3182,10 @@ type AccountsDeleteCall struct { // Delete: Deletes the specified account regardless of its type: standalone, // MCA or sub-account. Deleting an MCA leads to the deletion of all of its -// sub-accounts. Executing this method requires admin access. +// sub-accounts. Executing this method requires admin access. The deletion +// succeeds only if the account does not provide services to any other account +// and has no processed offers. You can use the `force` parameter to override +// this. // // - name: The name of the account to delete. Format: `accounts/{account}`. func (r *AccountsService) Delete(name string) *AccountsDeleteCall { @@ -3191,6 +3194,14 @@ func (r *AccountsService) Delete(name string) *AccountsDeleteCall { return c } +// Force sets the optional parameter "force": If set to `true`, the account is +// deleted even if it provides services to other accounts or has processed +// offers. +func (c *AccountsDeleteCall) Force(force bool) *AccountsDeleteCall { + c.urlParams_.Set("force", fmt.Sprint(force)) + return c +} + // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. @@ -3390,7 +3401,8 @@ type AccountsListCall struct { // constraints of the request such as page size or filters. This is not just // listing the sub-accounts of an MCA, but all accounts the calling user has // access to including other MCAs, linked accounts, standalone accounts and so -// on. +// on. If no filter is provided, then it returns accounts the user is directly +// added to. func (r *AccountsService) List() *AccountsListCall { c := &AccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} return c diff --git a/merchantapi/notifications_v1beta/merchantapi-api.json b/merchantapi/notifications_v1beta/merchantapi-api.json index 88587706ead..05b3e76e3b3 100644 --- a/merchantapi/notifications_v1beta/merchantapi-api.json +++ b/merchantapi/notifications_v1beta/merchantapi-api.json @@ -110,7 +110,7 @@ "notificationsubscriptions": { "methods": { "create": { - "description": "Creates a notification subscription for a merchant. We will allow the following types of notification subscriptions to exist together (per merchant as a subscriber per event type): 1. Subscription for all managed accounts + subscription for self 2. Multiple \"partial\" subscriptions for managed accounts + subscription for self we will not allow (per merchant as a subscriber per event type): 1. multiple self subscriptions. 2. multiple \"all managed accounts\" subscriptions. 3. all and partial subscriptions at the same time. 4. multiple partial subscriptions for the same target account", + "description": "Creates a notification subscription for a business. For standalone or subaccounts accounts, the business can create a subscription for self. For MCAs, the business can create a subscription for all managed accounts or for a specific subaccount. We will allow the following types of notification subscriptions to exist together (per business as a subscriber per event type): 1. Subscription for all managed accounts + subscription for self. 2. Multiple \"partial\" subscriptions for managed accounts + subscription for self. we will not allow (per business as a subscriber per event type): 1. Multiple self subscriptions. 2. Multiple \"all managed accounts\" subscriptions. 3. \"All managed accounts\" subscription and partial subscriptions at the same time. 4. Multiple partial subscriptions for the same target account.", "flatPath": "notifications/v1beta/accounts/{accountsId}/notificationsubscriptions", "httpMethod": "POST", "id": "merchantapi.accounts.notificationsubscriptions.create", @@ -262,7 +262,7 @@ } } }, - "revision": "20240827", + "revision": "20240930", "rootUrl": "https://merchantapi.googleapis.com/", "schemas": { "Empty": { diff --git a/merchantapi/notifications_v1beta/merchantapi-gen.go b/merchantapi/notifications_v1beta/merchantapi-gen.go index 57a60240890..3c65ec1bf1e 100644 --- a/merchantapi/notifications_v1beta/merchantapi-gen.go +++ b/merchantapi/notifications_v1beta/merchantapi-gen.go @@ -382,14 +382,18 @@ type AccountsNotificationsubscriptionsCreateCall struct { header_ http.Header } -// Create: Creates a notification subscription for a merchant. We will allow -// the following types of notification subscriptions to exist together (per -// merchant as a subscriber per event type): 1. Subscription for all managed -// accounts + subscription for self 2. Multiple "partial" subscriptions for -// managed accounts + subscription for self we will not allow (per merchant as -// a subscriber per event type): 1. multiple self subscriptions. 2. multiple -// "all managed accounts" subscriptions. 3. all and partial subscriptions at -// the same time. 4. multiple partial subscriptions for the same target account +// Create: Creates a notification subscription for a business. For standalone +// or subaccounts accounts, the business can create a subscription for self. +// For MCAs, the business can create a subscription for all managed accounts or +// for a specific subaccount. We will allow the following types of notification +// subscriptions to exist together (per business as a subscriber per event +// type): 1. Subscription for all managed accounts + subscription for self. 2. +// Multiple "partial" subscriptions for managed accounts + subscription for +// self. we will not allow (per business as a subscriber per event type): 1. +// Multiple self subscriptions. 2. Multiple "all managed accounts" +// subscriptions. 3. "All managed accounts" subscription and partial +// subscriptions at the same time. 4. Multiple partial subscriptions for the +// same target account. // // - parent: The merchant account that owns the new notification subscription. // Format: `accounts/{account}`. diff --git a/merchantapi/products_v1beta/merchantapi-api.json b/merchantapi/products_v1beta/merchantapi-api.json index ddde2611e17..cf74306290c 100644 --- a/merchantapi/products_v1beta/merchantapi-api.json +++ b/merchantapi/products_v1beta/merchantapi-api.json @@ -242,7 +242,7 @@ } } }, - "revision": "20240916", + "revision": "20240930", "rootUrl": "https://merchantapi.googleapis.com/", "schemas": { "Attributes": { @@ -1183,7 +1183,7 @@ "type": "string" }, "name": { - "description": "The name of the product. Format: `\"{product.name=accounts/{account}/products/{product}}\"`", + "description": "The name of the product. Format: `\"{product.name=accounts/{account}/products/{product}}\"` where the last section `product` consists of 4 parts: channel~content_language~feed_label~offer_id example for product name is \"accounts/123/products/online~en~US~sku123\"", "type": "string" }, "offerId": { @@ -1358,7 +1358,7 @@ "type": "string" }, "name": { - "description": "Identifier. The name of the product input. Format: `\"{productinput.name=accounts/{account}/productInputs/{productinput}}\"`", + "description": "Identifier. The name of the product input. Format: `\"{productinput.name=accounts/{account}/productInputs/{productinput}}\"` where the last section `productinput` consists of 4 parts: channel~content_language~feed_label~offer_id example for product input name is \"accounts/123/productInputs/online~en~US~sku123\"", "type": "string" }, "offerId": { diff --git a/merchantapi/products_v1beta/merchantapi-gen.go b/merchantapi/products_v1beta/merchantapi-gen.go index 5bae822e858..1eecc1dfc8f 100644 --- a/merchantapi/products_v1beta/merchantapi-gen.go +++ b/merchantapi/products_v1beta/merchantapi-gen.go @@ -1040,7 +1040,10 @@ type Product struct { // FeedLabel: Output only. The feed label for the product. FeedLabel string `json:"feedLabel,omitempty"` // Name: The name of the product. Format: - // "{product.name=accounts/{account}/products/{product}}" + // "{product.name=accounts/{account}/products/{product}}" where the last + // section `product` consists of 4 parts: + // channel~content_language~feed_label~offer_id example for product name is + // "accounts/123/products/online~en~US~sku123" Name string `json:"name,omitempty"` // OfferId: Output only. Your unique identifier for the product. This is the // same for the product input and processed product. Leading and trailing @@ -1254,6 +1257,9 @@ type ProductInput struct { FeedLabel string `json:"feedLabel,omitempty"` // Name: Identifier. The name of the product input. Format: // "{productinput.name=accounts/{account}/productInputs/{productinput}}" + // where the last section `productinput` consists of 4 parts: + // channel~content_language~feed_label~offer_id example for product input name + // is "accounts/123/productInputs/online~en~US~sku123" Name string `json:"name,omitempty"` // OfferId: Required. Immutable. Your unique identifier for the product. This // is the same for the product input and processed product. Leading and diff --git a/realtimebidding/v1/realtimebidding-api.json b/realtimebidding/v1/realtimebidding-api.json index a7a7b824ac6..c3d30684f6b 100644 --- a/realtimebidding/v1/realtimebidding-api.json +++ b/realtimebidding/v1/realtimebidding-api.json @@ -1305,7 +1305,7 @@ } } }, - "revision": "20240806", + "revision": "20240930", "rootUrl": "https://realtimebidding.googleapis.com/", "schemas": { "ActivatePretargetingConfigRequest": { @@ -3251,11 +3251,11 @@ "readOnly": true }, "videoUrl": { - "description": "The URL to fetch a video ad.", + "description": "The URL to fetch a video ad. The URL should return an XML response that conforms to the VAST 2.0, 3.0 or 4.x standard.", "type": "string" }, "videoVastXml": { - "description": "The contents of a VAST document for a video ad. This document should conform to the VAST 2.0 or 3.0 standard.", + "description": "The contents of a VAST document for a video ad. This document should conform to the VAST 2.0, 3.0, or 4.x standard.", "type": "string" } }, diff --git a/realtimebidding/v1/realtimebidding-gen.go b/realtimebidding/v1/realtimebidding-gen.go index d583d9dd456..a8eca61a469 100644 --- a/realtimebidding/v1/realtimebidding-gen.go +++ b/realtimebidding/v1/realtimebidding-gen.go @@ -2468,10 +2468,11 @@ func (s UserList) MarshalJSON() ([]byte, error) { type VideoContent struct { // VideoMetadata: Output only. Video metadata. VideoMetadata *VideoMetadata `json:"videoMetadata,omitempty"` - // VideoUrl: The URL to fetch a video ad. + // VideoUrl: The URL to fetch a video ad. The URL should return an XML response + // that conforms to the VAST 2.0, 3.0 or 4.x standard. VideoUrl string `json:"videoUrl,omitempty"` // VideoVastXml: The contents of a VAST document for a video ad. This document - // should conform to the VAST 2.0 or 3.0 standard. + // should conform to the VAST 2.0, 3.0, or 4.x standard. VideoVastXml string `json:"videoVastXml,omitempty"` // ForceSendFields is a list of field names (e.g. "VideoMetadata") to // unconditionally include in API requests. By default, fields with empty or diff --git a/serviceconsumermanagement/v1/serviceconsumermanagement-api.json b/serviceconsumermanagement/v1/serviceconsumermanagement-api.json index 5f8553e505e..bce68870a0b 100644 --- a/serviceconsumermanagement/v1/serviceconsumermanagement-api.json +++ b/serviceconsumermanagement/v1/serviceconsumermanagement-api.json @@ -542,7 +542,7 @@ } } }, - "revision": "20240919", + "revision": "20240929", "rootUrl": "https://serviceconsumermanagement.googleapis.com/", "schemas": { "AddTenantProjectRequest": { @@ -2037,7 +2037,7 @@ "type": "object" }, "Mixin": { - "description": "Declares an API Interface to be included in this interface. The including interface must redeclare all the methods from the included interface, but documentation and options are inherited as follows: - If after comment and whitespace stripping, the documentation string of the redeclared method is empty, it will be inherited from the original method. - Each annotation belonging to the service config (http, visibility) which is not set in the redeclared method will be inherited. - If an http annotation is inherited, the path pattern will be modified as follows. Any version prefix will be replaced by the version of the including interface plus the root path if specified. Example of a simple mixin: package google.acl.v1; service AccessControl { // Get the underlying ACL object. rpc GetAcl(GetAclRequest) returns (Acl) { option (google.api.http).get = \"/v1/{resource=**}:getAcl\"; } } package google.storage.v2; service Storage { // rpc GetAcl(GetAclRequest) returns (Acl); // Get a data record. rpc GetData(GetDataRequest) returns (Data) { option (google.api.http).get = \"/v2/{resource=**}\"; } } Example of a mixin configuration: apis: - name: google.storage.v2.Storage mixins: - name: google.acl.v1.AccessControl The mixin construct implies that all methods in `AccessControl` are also declared with same name and request/response types in `Storage`. A documentation generator or annotation processor will see the effective `Storage.GetAcl` method after inherting documentation and annotations as follows: service Storage { // Get the underlying ACL object. rpc GetAcl(GetAclRequest) returns (Acl) { option (google.api.http).get = \"/v2/{resource=**}:getAcl\"; } ... } Note how the version in the path pattern changed from `v1` to `v2`. If the `root` field in the mixin is specified, it should be a relative path under which inherited HTTP paths are placed. Example: apis: - name: google.storage.v2.Storage mixins: - name: google.acl.v1.AccessControl root: acls This implies the following inherited HTTP annotation: service Storage { // Get the underlying ACL object. rpc GetAcl(GetAclRequest) returns (Acl) { option (google.api.http).get = \"/v2/acls/{resource=**}:getAcl\"; } ... }", + "description": "Declares an API Interface to be included in this interface. The including interface must redeclare all the methods from the included interface, but documentation and options are inherited as follows: - If after comment and whitespace stripping, the documentation string of the redeclared method is empty, it will be inherited from the original method. - Each annotation belonging to the service config (http, visibility) which is not set in the redeclared method will be inherited. - If an http annotation is inherited, the path pattern will be modified as follows. Any version prefix will be replaced by the version of the including interface plus the root path if specified. Example of a simple mixin: package google.acl.v1; service AccessControl { // Get the underlying ACL object. rpc GetAcl(GetAclRequest) returns (Acl) { option (google.api.http).get = \"/v1/{resource=**}:getAcl\"; } } package google.storage.v2; service Storage { // rpc GetAcl(GetAclRequest) returns (Acl); // Get a data record. rpc GetData(GetDataRequest) returns (Data) { option (google.api.http).get = \"/v2/{resource=**}\"; } } Example of a mixin configuration: apis: - name: google.storage.v2.Storage mixins: - name: google.acl.v1.AccessControl The mixin construct implies that all methods in `AccessControl` are also declared with same name and request/response types in `Storage`. A documentation generator or annotation processor will see the effective `Storage.GetAcl` method after inheriting documentation and annotations as follows: service Storage { // Get the underlying ACL object. rpc GetAcl(GetAclRequest) returns (Acl) { option (google.api.http).get = \"/v2/{resource=**}:getAcl\"; } ... } Note how the version in the path pattern changed from `v1` to `v2`. If the `root` field in the mixin is specified, it should be a relative path under which inherited HTTP paths are placed. Example: apis: - name: google.storage.v2.Storage mixins: - name: google.acl.v1.AccessControl root: acls This implies the following inherited HTTP annotation: service Storage { // Get the underlying ACL object. rpc GetAcl(GetAclRequest) returns (Acl) { option (google.api.http).get = \"/v2/acls/{resource=**}:getAcl\"; } ... }", "id": "Mixin", "properties": { "name": { diff --git a/serviceconsumermanagement/v1/serviceconsumermanagement-gen.go b/serviceconsumermanagement/v1/serviceconsumermanagement-gen.go index f3051ebbeeb..a9b331788e8 100644 --- a/serviceconsumermanagement/v1/serviceconsumermanagement-gen.go +++ b/serviceconsumermanagement/v1/serviceconsumermanagement-gen.go @@ -2467,7 +2467,7 @@ func (s MetricRule) MarshalJSON() ([]byte, error) { // mixin construct implies that all methods in `AccessControl` are also // declared with same name and request/response types in `Storage`. A // documentation generator or annotation processor will see the effective -// `Storage.GetAcl` method after inherting documentation and annotations as +// `Storage.GetAcl` method after inheriting documentation and annotations as // follows: service Storage { // Get the underlying ACL object. rpc // GetAcl(GetAclRequest) returns (Acl) { option (google.api.http).get = // "/v2/{resource=**}:getAcl"; } ... } Note how the version in the path pattern diff --git a/serviceusage/v1beta1/serviceusage-api.json b/serviceusage/v1beta1/serviceusage-api.json index 268c01da8c3..5cdee347420 100644 --- a/serviceusage/v1beta1/serviceusage-api.json +++ b/serviceusage/v1beta1/serviceusage-api.json @@ -964,7 +964,7 @@ } } }, - "revision": "20240919", + "revision": "20240929", "rootUrl": "https://serviceusage.googleapis.com/", "schemas": { "AddEnableRulesMetadata": { @@ -3370,7 +3370,7 @@ "type": "object" }, "Mixin": { - "description": "Declares an API Interface to be included in this interface. The including interface must redeclare all the methods from the included interface, but documentation and options are inherited as follows: - If after comment and whitespace stripping, the documentation string of the redeclared method is empty, it will be inherited from the original method. - Each annotation belonging to the service config (http, visibility) which is not set in the redeclared method will be inherited. - If an http annotation is inherited, the path pattern will be modified as follows. Any version prefix will be replaced by the version of the including interface plus the root path if specified. Example of a simple mixin: package google.acl.v1; service AccessControl { // Get the underlying ACL object. rpc GetAcl(GetAclRequest) returns (Acl) { option (google.api.http).get = \"/v1/{resource=**}:getAcl\"; } } package google.storage.v2; service Storage { // rpc GetAcl(GetAclRequest) returns (Acl); // Get a data record. rpc GetData(GetDataRequest) returns (Data) { option (google.api.http).get = \"/v2/{resource=**}\"; } } Example of a mixin configuration: apis: - name: google.storage.v2.Storage mixins: - name: google.acl.v1.AccessControl The mixin construct implies that all methods in `AccessControl` are also declared with same name and request/response types in `Storage`. A documentation generator or annotation processor will see the effective `Storage.GetAcl` method after inherting documentation and annotations as follows: service Storage { // Get the underlying ACL object. rpc GetAcl(GetAclRequest) returns (Acl) { option (google.api.http).get = \"/v2/{resource=**}:getAcl\"; } ... } Note how the version in the path pattern changed from `v1` to `v2`. If the `root` field in the mixin is specified, it should be a relative path under which inherited HTTP paths are placed. Example: apis: - name: google.storage.v2.Storage mixins: - name: google.acl.v1.AccessControl root: acls This implies the following inherited HTTP annotation: service Storage { // Get the underlying ACL object. rpc GetAcl(GetAclRequest) returns (Acl) { option (google.api.http).get = \"/v2/acls/{resource=**}:getAcl\"; } ... }", + "description": "Declares an API Interface to be included in this interface. The including interface must redeclare all the methods from the included interface, but documentation and options are inherited as follows: - If after comment and whitespace stripping, the documentation string of the redeclared method is empty, it will be inherited from the original method. - Each annotation belonging to the service config (http, visibility) which is not set in the redeclared method will be inherited. - If an http annotation is inherited, the path pattern will be modified as follows. Any version prefix will be replaced by the version of the including interface plus the root path if specified. Example of a simple mixin: package google.acl.v1; service AccessControl { // Get the underlying ACL object. rpc GetAcl(GetAclRequest) returns (Acl) { option (google.api.http).get = \"/v1/{resource=**}:getAcl\"; } } package google.storage.v2; service Storage { // rpc GetAcl(GetAclRequest) returns (Acl); // Get a data record. rpc GetData(GetDataRequest) returns (Data) { option (google.api.http).get = \"/v2/{resource=**}\"; } } Example of a mixin configuration: apis: - name: google.storage.v2.Storage mixins: - name: google.acl.v1.AccessControl The mixin construct implies that all methods in `AccessControl` are also declared with same name and request/response types in `Storage`. A documentation generator or annotation processor will see the effective `Storage.GetAcl` method after inheriting documentation and annotations as follows: service Storage { // Get the underlying ACL object. rpc GetAcl(GetAclRequest) returns (Acl) { option (google.api.http).get = \"/v2/{resource=**}:getAcl\"; } ... } Note how the version in the path pattern changed from `v1` to `v2`. If the `root` field in the mixin is specified, it should be a relative path under which inherited HTTP paths are placed. Example: apis: - name: google.storage.v2.Storage mixins: - name: google.acl.v1.AccessControl root: acls This implies the following inherited HTTP annotation: service Storage { // Get the underlying ACL object. rpc GetAcl(GetAclRequest) returns (Acl) { option (google.api.http).get = \"/v2/acls/{resource=**}:getAcl\"; } ... }", "id": "Mixin", "properties": { "name": { diff --git a/serviceusage/v1beta1/serviceusage-gen.go b/serviceusage/v1beta1/serviceusage-gen.go index 0ec2e4502db..355f05727eb 100644 --- a/serviceusage/v1beta1/serviceusage-gen.go +++ b/serviceusage/v1beta1/serviceusage-gen.go @@ -3593,7 +3593,7 @@ func (s MetricRule) MarshalJSON() ([]byte, error) { // mixin construct implies that all methods in `AccessControl` are also // declared with same name and request/response types in `Storage`. A // documentation generator or annotation processor will see the effective -// `Storage.GetAcl` method after inherting documentation and annotations as +// `Storage.GetAcl` method after inheriting documentation and annotations as // follows: service Storage { // Get the underlying ACL object. rpc // GetAcl(GetAclRequest) returns (Acl) { option (google.api.http).get = // "/v2/{resource=**}:getAcl"; } ... } Note how the version in the path pattern diff --git a/texttospeech/v1/texttospeech-api.json b/texttospeech/v1/texttospeech-api.json index 3cb22a33b26..0669aba88f6 100644 --- a/texttospeech/v1/texttospeech-api.json +++ b/texttospeech/v1/texttospeech-api.json @@ -294,6 +294,24 @@ }, "voices": { "methods": { + "generateVoiceCloningKey": { + "description": "Generates voice clone key given a short voice prompt. This method validates the voice prompts with a series of checks against the voice talent statement to verify the voice clone is safe to generate.", + "flatPath": "v1/voices:generateVoiceCloningKey", + "httpMethod": "POST", + "id": "texttospeech.voices.generateVoiceCloningKey", + "parameterOrder": [], + "parameters": {}, + "path": "v1/voices:generateVoiceCloningKey", + "request": { + "$ref": "GenerateVoiceCloningKeyRequest" + }, + "response": { + "$ref": "GenerateVoiceCloningKeyResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "list": { "description": "Returns a list of Voice supported for synthesis.", "flatPath": "v1/voices", @@ -318,9 +336,20 @@ } } }, - "revision": "20240815", + "revision": "20241001", "rootUrl": "https://texttospeech.googleapis.com/", "schemas": { + "AdvancedVoiceOptions": { + "description": "Used for advanced voice options.", + "id": "AdvancedVoiceOptions", + "properties": { + "lowLatencyJourneySynthesis": { + "description": "Only for Jounrney voices. If false, the synthesis will be context aware and have higher latency.", + "type": "boolean" + } + }, + "type": "object" + }, "AudioConfig": { "description": "Description of audio data to be synthesized.", "id": "AudioConfig", @@ -381,6 +410,49 @@ "properties": {}, "type": "object" }, + "CustomPronunciationParams": { + "description": "Pronunciation customization for a phrase.", + "id": "CustomPronunciationParams", + "properties": { + "phoneticEncoding": { + "description": "The phonetic encoding of the phrase.", + "enum": [ + "PHONETIC_ENCODING_UNSPECIFIED", + "PHONETIC_ENCODING_IPA", + "PHONETIC_ENCODING_X_SAMPA" + ], + "enumDescriptions": [ + "Not specified.", + "IPA. (e.g. apple -\u003e ˈæpəl ) https://en.wikipedia.org/wiki/International_Phonetic_Alphabet", + "X-SAMPA (e.g. apple -\u003e \"{p@l\" ) https://en.wikipedia.org/wiki/X-SAMPA" + ], + "type": "string" + }, + "phrase": { + "description": "The phrase to which the customization will be applied. The phrase can be multiple words (in the case of proper nouns etc), but should not span to a whole sentence.", + "type": "string" + }, + "pronunciation": { + "description": "The pronunciation of the phrase. This must be in the phonetic encoding specified above.", + "type": "string" + } + }, + "type": "object" + }, + "CustomPronunciations": { + "description": "A collection of pronunciation customizations.", + "id": "CustomPronunciations", + "properties": { + "pronunciations": { + "description": "The pronunciation customizations to be applied.", + "items": { + "$ref": "CustomPronunciationParams" + }, + "type": "array" + } + }, + "type": "object" + }, "CustomVoiceParams": { "description": "Description of the custom voice to be synthesized.", "id": "CustomVoiceParams", @@ -413,6 +485,40 @@ "properties": {}, "type": "object" }, + "GenerateVoiceCloningKeyRequest": { + "description": "Request message for the `GenerateVoiceCloningKey` method.", + "id": "GenerateVoiceCloningKeyRequest", + "properties": { + "consentScript": { + "description": "Required. The script used for the voice talent statement. The script will be provided to the caller through other channels. It must be returned unchanged in this field.", + "type": "string" + }, + "languageCode": { + "description": "Required. The language of the supplied audio as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. Example: \"en-US\". See [Language Support](https://cloud.google.com/speech-to-text/docs/languages) for a list of the currently supported language codes.", + "type": "string" + }, + "referenceAudio": { + "$ref": "InputAudio", + "description": "Required. The training audio used to create voice clone. This is currently limited to LINEAR16 PCM WAV files mono audio with 24khz sample rate. This needs to be specified in [InputAudio.audio_config], other values will be explicitly rejected." + }, + "voiceTalentConsent": { + "$ref": "InputAudio", + "description": "Required. The voice talent audio used to verify consent to voice clone." + } + }, + "type": "object" + }, + "GenerateVoiceCloningKeyResponse": { + "description": "Response message for the `GenerateVoiceCloningKey` method.", + "id": "GenerateVoiceCloningKeyResponse", + "properties": { + "voiceCloningKey": { + "description": "The voice clone key. Use it in the SynthesizeSpeechRequest by setting [voice.voice_clone.voice_cloning_key].", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudTexttospeechV1SynthesizeLongAudioMetadata": { "description": "Metadata for response returned by the `SynthesizeLongAudio` method.", "id": "GoogleCloudTexttospeechV1SynthesizeLongAudioMetadata", @@ -436,6 +542,54 @@ }, "type": "object" }, + "InputAudio": { + "description": "Holds audio content and config.", + "id": "InputAudio", + "properties": { + "audioConfig": { + "$ref": "InputAudioConfig", + "description": "Required. Provides information that specifies how to process content." + }, + "content": { + "description": "Required. The audio data bytes encoded as specified in `InputAudioConfig`. Note: as with all bytes fields, proto buffers use a pure binary representation, whereas JSON representations use base64. Audio samples should be between 5-25 seconds in length.", + "format": "byte", + "type": "string" + } + }, + "type": "object" + }, + "InputAudioConfig": { + "description": "Description of inputted audio data.", + "id": "InputAudioConfig", + "properties": { + "audioEncoding": { + "description": "Required. The format of the audio byte stream.", + "enum": [ + "AUDIO_ENCODING_UNSPECIFIED", + "LINEAR16", + "MP3", + "OGG_OPUS", + "MULAW", + "ALAW" + ], + "enumDescriptions": [ + "Not specified. Will return result google.rpc.Code.INVALID_ARGUMENT.", + "Uncompressed 16-bit signed little-endian samples (Linear PCM). Audio content returned as LINEAR16 also contains a WAV header.", + "MP3 audio at 32kbps.", + "Opus encoded audio wrapped in an ogg container. The result will be a file which can be played natively on Android, and in browsers (at least Chrome and Firefox). The quality of the encoding is considerably higher than MP3 while using approximately the same bitrate.", + "8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. Audio content returned as MULAW also contains a WAV header.", + "8-bit samples that compand 14-bit audio samples using G.711 PCMU/A-law. Audio content returned as ALAW also contains a WAV header." + ], + "type": "string" + }, + "sampleRateHertz": { + "description": "Required. The sample rate (in hertz) for this audio.", + "format": "int32", + "type": "integer" + } + }, + "type": "object" + }, "ListOperationsResponse": { "description": "The response message for Operations.ListOperations.", "id": "ListOperationsResponse", @@ -534,6 +688,10 @@ "description": "Contains text input to be synthesized. Either `text` or `ssml` must be supplied. Supplying both or neither returns google.rpc.Code.INVALID_ARGUMENT. The input size is limited to 5000 bytes.", "id": "SynthesisInput", "properties": { + "customPronunciations": { + "$ref": "CustomPronunciations", + "description": "Optional. The pronunciation customizations to be applied to the input. If this is set, the input will be synthesized using the given pronunciation customizations. The initial support will be for EFIGS (English, French, Italian, German, Spanish) languages, as provided in VoiceSelectionParams. Journey and Instant Clone voices are not supported yet. In order to customize the pronunciation of a phrase, there must be an exact match of the phrase in the input types. If using SSML, the phrase must not be inside a phoneme tag (entirely or partially)." + }, "ssml": { "description": "The SSML document to be synthesized. The SSML document must be valid and well-formed. Otherwise the RPC will fail and return google.rpc.Code.INVALID_ARGUMENT. For more information, see [SSML](https://cloud.google.com/text-to-speech/docs/ssml).", "type": "string" @@ -595,6 +753,10 @@ "description": "The top-level message sent by the client for the `SynthesizeSpeech` method.", "id": "SynthesizeSpeechRequest", "properties": { + "advancedVoiceOptions": { + "$ref": "AdvancedVoiceOptions", + "description": "Adnanced voice options." + }, "audioConfig": { "$ref": "AudioConfig", "description": "Required. The configuration of the synthesized audio." @@ -661,6 +823,17 @@ }, "type": "object" }, + "VoiceCloneParams": { + "description": "The configuration of Voice Clone feature.", + "id": "VoiceCloneParams", + "properties": { + "voiceCloningKey": { + "description": "Required. Created by GenerateVoiceCloningKey.", + "type": "string" + } + }, + "type": "object" + }, "VoiceSelectionParams": { "description": "Description of which voice to use for a synthesis request.", "id": "VoiceSelectionParams", @@ -692,6 +865,10 @@ "A gender-neutral voice. This voice is not yet supported." ], "type": "string" + }, + "voiceClone": { + "$ref": "VoiceCloneParams", + "description": "Optional. The configuration for a voice clone. If [VoiceCloneParams.voice_clone_key] is set, the service will choose the voice clone matching the specified configuration." } }, "type": "object" diff --git a/texttospeech/v1/texttospeech-gen.go b/texttospeech/v1/texttospeech-gen.go index ce92a981701..d6740d4b7e5 100644 --- a/texttospeech/v1/texttospeech-gen.go +++ b/texttospeech/v1/texttospeech-gen.go @@ -225,6 +225,29 @@ type VoicesService struct { s *Service } +// AdvancedVoiceOptions: Used for advanced voice options. +type AdvancedVoiceOptions struct { + // LowLatencyJourneySynthesis: Only for Jounrney voices. If false, the + // synthesis will be context aware and have higher latency. + LowLatencyJourneySynthesis bool `json:"lowLatencyJourneySynthesis,omitempty"` + // ForceSendFields is a list of field names (e.g. "LowLatencyJourneySynthesis") + // to unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "LowLatencyJourneySynthesis") to + // include in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s AdvancedVoiceOptions) MarshalJSON() ([]byte, error) { + type NoMethod AdvancedVoiceOptions + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + // AudioConfig: Description of audio data to be synthesized. type AudioConfig struct { // AudioEncoding: Required. The format of the audio byte stream. @@ -316,6 +339,64 @@ func (s *AudioConfig) UnmarshalJSON(data []byte) error { type CancelOperationRequest struct { } +// CustomPronunciationParams: Pronunciation customization for a phrase. +type CustomPronunciationParams struct { + // PhoneticEncoding: The phonetic encoding of the phrase. + // + // Possible values: + // "PHONETIC_ENCODING_UNSPECIFIED" - Not specified. + // "PHONETIC_ENCODING_IPA" - IPA. (e.g. apple -> ˈæpəl ) + // https://en.wikipedia.org/wiki/International_Phonetic_Alphabet + // "PHONETIC_ENCODING_X_SAMPA" - X-SAMPA (e.g. apple -> "{p@l" ) + // https://en.wikipedia.org/wiki/X-SAMPA + PhoneticEncoding string `json:"phoneticEncoding,omitempty"` + // Phrase: The phrase to which the customization will be applied. The phrase + // can be multiple words (in the case of proper nouns etc), but should not span + // to a whole sentence. + Phrase string `json:"phrase,omitempty"` + // Pronunciation: The pronunciation of the phrase. This must be in the phonetic + // encoding specified above. + Pronunciation string `json:"pronunciation,omitempty"` + // ForceSendFields is a list of field names (e.g. "PhoneticEncoding") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "PhoneticEncoding") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s CustomPronunciationParams) MarshalJSON() ([]byte, error) { + type NoMethod CustomPronunciationParams + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// CustomPronunciations: A collection of pronunciation customizations. +type CustomPronunciations struct { + // Pronunciations: The pronunciation customizations to be applied. + Pronunciations []*CustomPronunciationParams `json:"pronunciations,omitempty"` + // ForceSendFields is a list of field names (e.g. "Pronunciations") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Pronunciations") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s CustomPronunciations) MarshalJSON() ([]byte, error) { + type NoMethod CustomPronunciations + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + // CustomVoiceParams: Description of the custom voice to be synthesized. type CustomVoiceParams struct { // Model: Required. The name of the AutoML model that synthesizes the custom @@ -360,6 +441,72 @@ type Empty struct { googleapi.ServerResponse `json:"-"` } +// GenerateVoiceCloningKeyRequest: Request message for the +// `GenerateVoiceCloningKey` method. +type GenerateVoiceCloningKeyRequest struct { + // ConsentScript: Required. The script used for the voice talent statement. The + // script will be provided to the caller through other channels. It must be + // returned unchanged in this field. + ConsentScript string `json:"consentScript,omitempty"` + // LanguageCode: Required. The language of the supplied audio as a BCP-47 + // (https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. Example: + // "en-US". See Language Support + // (https://cloud.google.com/speech-to-text/docs/languages) for a list of the + // currently supported language codes. + LanguageCode string `json:"languageCode,omitempty"` + // ReferenceAudio: Required. The training audio used to create voice clone. + // This is currently limited to LINEAR16 PCM WAV files mono audio with 24khz + // sample rate. This needs to be specified in [InputAudio.audio_config], other + // values will be explicitly rejected. + ReferenceAudio *InputAudio `json:"referenceAudio,omitempty"` + // VoiceTalentConsent: Required. The voice talent audio used to verify consent + // to voice clone. + VoiceTalentConsent *InputAudio `json:"voiceTalentConsent,omitempty"` + // ForceSendFields is a list of field names (e.g. "ConsentScript") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ConsentScript") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s GenerateVoiceCloningKeyRequest) MarshalJSON() ([]byte, error) { + type NoMethod GenerateVoiceCloningKeyRequest + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// GenerateVoiceCloningKeyResponse: Response message for the +// `GenerateVoiceCloningKey` method. +type GenerateVoiceCloningKeyResponse struct { + // VoiceCloningKey: The voice clone key. Use it in the SynthesizeSpeechRequest + // by setting [voice.voice_clone.voice_cloning_key]. + VoiceCloningKey string `json:"voiceCloningKey,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "VoiceCloningKey") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "VoiceCloningKey") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s GenerateVoiceCloningKeyResponse) MarshalJSON() ([]byte, error) { + type NoMethod GenerateVoiceCloningKeyResponse + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + // GoogleCloudTexttospeechV1SynthesizeLongAudioMetadata: Metadata for response // returned by the `SynthesizeLongAudio` method. type GoogleCloudTexttospeechV1SynthesizeLongAudioMetadata struct { @@ -402,6 +549,73 @@ func (s *GoogleCloudTexttospeechV1SynthesizeLongAudioMetadata) UnmarshalJSON(dat return nil } +// InputAudio: Holds audio content and config. +type InputAudio struct { + // AudioConfig: Required. Provides information that specifies how to process + // content. + AudioConfig *InputAudioConfig `json:"audioConfig,omitempty"` + // Content: Required. The audio data bytes encoded as specified in + // `InputAudioConfig`. Note: as with all bytes fields, proto buffers use a pure + // binary representation, whereas JSON representations use base64. Audio + // samples should be between 5-25 seconds in length. + Content string `json:"content,omitempty"` + // ForceSendFields is a list of field names (e.g. "AudioConfig") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "AudioConfig") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s InputAudio) MarshalJSON() ([]byte, error) { + type NoMethod InputAudio + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// InputAudioConfig: Description of inputted audio data. +type InputAudioConfig struct { + // AudioEncoding: Required. The format of the audio byte stream. + // + // Possible values: + // "AUDIO_ENCODING_UNSPECIFIED" - Not specified. Will return result + // google.rpc.Code.INVALID_ARGUMENT. + // "LINEAR16" - Uncompressed 16-bit signed little-endian samples (Linear + // PCM). Audio content returned as LINEAR16 also contains a WAV header. + // "MP3" - MP3 audio at 32kbps. + // "OGG_OPUS" - Opus encoded audio wrapped in an ogg container. The result + // will be a file which can be played natively on Android, and in browsers (at + // least Chrome and Firefox). The quality of the encoding is considerably + // higher than MP3 while using approximately the same bitrate. + // "MULAW" - 8-bit samples that compand 14-bit audio samples using G.711 + // PCMU/mu-law. Audio content returned as MULAW also contains a WAV header. + // "ALAW" - 8-bit samples that compand 14-bit audio samples using G.711 + // PCMU/A-law. Audio content returned as ALAW also contains a WAV header. + AudioEncoding string `json:"audioEncoding,omitempty"` + // SampleRateHertz: Required. The sample rate (in hertz) for this audio. + SampleRateHertz int64 `json:"sampleRateHertz,omitempty"` + // ForceSendFields is a list of field names (e.g. "AudioEncoding") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "AudioEncoding") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s InputAudioConfig) MarshalJSON() ([]byte, error) { + type NoMethod InputAudioConfig + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + // ListOperationsResponse: The response message for Operations.ListOperations. type ListOperationsResponse struct { // NextPageToken: The standard List next-page token. @@ -541,6 +755,15 @@ func (s Status) MarshalJSON() ([]byte, error) { // `ssml` must be supplied. Supplying both or neither returns // google.rpc.Code.INVALID_ARGUMENT. The input size is limited to 5000 bytes. type SynthesisInput struct { + // CustomPronunciations: Optional. The pronunciation customizations to be + // applied to the input. If this is set, the input will be synthesized using + // the given pronunciation customizations. The initial support will be for + // EFIGS (English, French, Italian, German, Spanish) languages, as provided in + // VoiceSelectionParams. Journey and Instant Clone voices are not supported + // yet. In order to customize the pronunciation of a phrase, there must be an + // exact match of the phrase in the input types. If using SSML, the phrase must + // not be inside a phoneme tag (entirely or partially). + CustomPronunciations *CustomPronunciations `json:"customPronunciations,omitempty"` // Ssml: The SSML document to be synthesized. The SSML document must be valid // and well-formed. Otherwise the RPC will fail and return // google.rpc.Code.INVALID_ARGUMENT. For more information, see SSML @@ -548,15 +771,15 @@ type SynthesisInput struct { Ssml string `json:"ssml,omitempty"` // Text: The raw text to be synthesized. Text string `json:"text,omitempty"` - // ForceSendFields is a list of field names (e.g. "Ssml") to unconditionally - // include in API requests. By default, fields with empty or default values are - // omitted from API requests. See + // ForceSendFields is a list of field names (e.g. "CustomPronunciations") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Ssml") to include in API requests - // with the JSON null value. By default, fields with empty values are omitted - // from API requests. See + // NullFields is a list of field names (e.g. "CustomPronunciations") to include + // in API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` } @@ -643,6 +866,8 @@ func (s SynthesizeLongAudioRequest) MarshalJSON() ([]byte, error) { // SynthesizeSpeechRequest: The top-level message sent by the client for the // `SynthesizeSpeech` method. type SynthesizeSpeechRequest struct { + // AdvancedVoiceOptions: Adnanced voice options. + AdvancedVoiceOptions *AdvancedVoiceOptions `json:"advancedVoiceOptions,omitempty"` // AudioConfig: Required. The configuration of the synthesized audio. AudioConfig *AudioConfig `json:"audioConfig,omitempty"` // Input: Required. The Synthesizer requires either plain text or SSML as @@ -650,15 +875,15 @@ type SynthesizeSpeechRequest struct { Input *SynthesisInput `json:"input,omitempty"` // Voice: Required. The desired voice of the synthesized audio. Voice *VoiceSelectionParams `json:"voice,omitempty"` - // ForceSendFields is a list of field names (e.g. "AudioConfig") to + // ForceSendFields is a list of field names (e.g. "AdvancedVoiceOptions") to // unconditionally include in API requests. By default, fields with empty or // default values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "AudioConfig") to include in API - // requests with the JSON null value. By default, fields with empty values are - // omitted from API requests. See + // NullFields is a list of field names (e.g. "AdvancedVoiceOptions") to include + // in API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` } @@ -738,6 +963,28 @@ func (s Voice) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) } +// VoiceCloneParams: The configuration of Voice Clone feature. +type VoiceCloneParams struct { + // VoiceCloningKey: Required. Created by GenerateVoiceCloningKey. + VoiceCloningKey string `json:"voiceCloningKey,omitempty"` + // ForceSendFields is a list of field names (e.g. "VoiceCloningKey") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "VoiceCloningKey") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s VoiceCloneParams) MarshalJSON() ([]byte, error) { + type NoMethod VoiceCloneParams + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + // VoiceSelectionParams: Description of which voice to use for a synthesis // request. type VoiceSelectionParams struct { @@ -777,6 +1024,10 @@ type VoiceSelectionParams struct { // "FEMALE" - A female voice. // "NEUTRAL" - A gender-neutral voice. This voice is not yet supported. SsmlGender string `json:"ssmlGender,omitempty"` + // VoiceClone: Optional. The configuration for a voice clone. If + // [VoiceCloneParams.voice_clone_key] is set, the service will choose the voice + // clone matching the specified configuration. + VoiceClone *VoiceCloneParams `json:"voiceClone,omitempty"` // ForceSendFields is a list of field names (e.g. "CustomVoice") to // unconditionally include in API requests. By default, fields with empty or // default values are omitted from API requests. See @@ -1459,6 +1710,104 @@ func (c *TextSynthesizeCall) Do(opts ...googleapi.CallOption) (*SynthesizeSpeech return ret, nil } +type VoicesGenerateVoiceCloningKeyCall struct { + s *Service + generatevoicecloningkeyrequest *GenerateVoiceCloningKeyRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// GenerateVoiceCloningKey: Generates voice clone key given a short voice +// prompt. This method validates the voice prompts with a series of checks +// against the voice talent statement to verify the voice clone is safe to +// generate. +func (r *VoicesService) GenerateVoiceCloningKey(generatevoicecloningkeyrequest *GenerateVoiceCloningKeyRequest) *VoicesGenerateVoiceCloningKeyCall { + c := &VoicesGenerateVoiceCloningKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.generatevoicecloningkeyrequest = generatevoicecloningkeyrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *VoicesGenerateVoiceCloningKeyCall) Fields(s ...googleapi.Field) *VoicesGenerateVoiceCloningKeyCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *VoicesGenerateVoiceCloningKeyCall) Context(ctx context.Context) *VoicesGenerateVoiceCloningKeyCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *VoicesGenerateVoiceCloningKeyCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *VoicesGenerateVoiceCloningKeyCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.generatevoicecloningkeyrequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/voices:generateVoiceCloningKey") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "texttospeech.voices.generateVoiceCloningKey" call. +// Any non-2xx status code is an error. Response headers are in either +// *GenerateVoiceCloningKeyResponse.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 *VoicesGenerateVoiceCloningKeyCall) Do(opts ...googleapi.CallOption) (*GenerateVoiceCloningKeyResponse, 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 := &GenerateVoiceCloningKeyResponse{ + 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 +} + type VoicesListCall struct { s *Service urlParams_ gensupport.URLParams diff --git a/texttospeech/v1beta1/texttospeech-api.json b/texttospeech/v1beta1/texttospeech-api.json index 27e3af57b4a..a44438f330c 100644 --- a/texttospeech/v1beta1/texttospeech-api.json +++ b/texttospeech/v1beta1/texttospeech-api.json @@ -237,6 +237,24 @@ }, "voices": { "methods": { + "generateVoiceCloningKey": { + "description": "Generates voice clone key given a short voice prompt. This method validates the voice prompts with a series of checks against the voice talent statement to verify the voice clone is safe to generate.", + "flatPath": "v1beta1/voices:generateVoiceCloningKey", + "httpMethod": "POST", + "id": "texttospeech.voices.generateVoiceCloningKey", + "parameterOrder": [], + "parameters": {}, + "path": "v1beta1/voices:generateVoiceCloningKey", + "request": { + "$ref": "GenerateVoiceCloningKeyRequest" + }, + "response": { + "$ref": "GenerateVoiceCloningKeyResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "list": { "description": "Returns a list of Voice supported for synthesis.", "flatPath": "v1beta1/voices", @@ -261,9 +279,20 @@ } } }, - "revision": "20240815", + "revision": "20241001", "rootUrl": "https://texttospeech.googleapis.com/", "schemas": { + "AdvancedVoiceOptions": { + "description": "Used for advanced voice options.", + "id": "AdvancedVoiceOptions", + "properties": { + "lowLatencyJourneySynthesis": { + "description": "Only for Jounrney voices. If false, the synthesis will be context aware and have higher latency.", + "type": "boolean" + } + }, + "type": "object" + }, "AudioConfig": { "description": "Description of audio data to be synthesized.", "id": "AudioConfig", @@ -320,6 +349,49 @@ }, "type": "object" }, + "CustomPronunciationParams": { + "description": "Pronunciation customization for a phrase.", + "id": "CustomPronunciationParams", + "properties": { + "phoneticEncoding": { + "description": "The phonetic encoding of the phrase.", + "enum": [ + "PHONETIC_ENCODING_UNSPECIFIED", + "PHONETIC_ENCODING_IPA", + "PHONETIC_ENCODING_X_SAMPA" + ], + "enumDescriptions": [ + "Not specified.", + "IPA. (e.g. apple -\u003e ˈæpəl ) https://en.wikipedia.org/wiki/International_Phonetic_Alphabet", + "X-SAMPA (e.g. apple -\u003e \"{p@l\" ) https://en.wikipedia.org/wiki/X-SAMPA" + ], + "type": "string" + }, + "phrase": { + "description": "The phrase to which the customization will be applied. The phrase can be multiple words (in the case of proper nouns etc), but should not span to a whole sentence.", + "type": "string" + }, + "pronunciation": { + "description": "The pronunciation of the phrase. This must be in the phonetic encoding specified above.", + "type": "string" + } + }, + "type": "object" + }, + "CustomPronunciations": { + "description": "A collection of pronunciation customizations.", + "id": "CustomPronunciations", + "properties": { + "pronunciations": { + "description": "The pronunciation customizations to be applied.", + "items": { + "$ref": "CustomPronunciationParams" + }, + "type": "array" + } + }, + "type": "object" + }, "CustomVoiceParams": { "description": "Description of the custom voice to be synthesized.", "id": "CustomVoiceParams", @@ -346,6 +418,40 @@ }, "type": "object" }, + "GenerateVoiceCloningKeyRequest": { + "description": "Request message for the `GenerateVoiceCloningKey` method.", + "id": "GenerateVoiceCloningKeyRequest", + "properties": { + "consentScript": { + "description": "Required. The script used for the voice talent statement. The script will be provided to the caller through other channels. It must be returned unchanged in this field.", + "type": "string" + }, + "languageCode": { + "description": "Required. The language of the supplied audio as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. Example: \"en-US\". See [Language Support](https://cloud.google.com/speech-to-text/docs/languages) for a list of the currently supported language codes.", + "type": "string" + }, + "referenceAudio": { + "$ref": "InputAudio", + "description": "Required. The training audio used to create voice clone. This is currently limited to LINEAR16 PCM WAV files mono audio with 24khz sample rate. This needs to be specified in [InputAudio.audio_config], other values will be explicitly rejected." + }, + "voiceTalentConsent": { + "$ref": "InputAudio", + "description": "Required. The voice talent audio used to verify consent to voice clone." + } + }, + "type": "object" + }, + "GenerateVoiceCloningKeyResponse": { + "description": "Response message for the `GenerateVoiceCloningKey` method.", + "id": "GenerateVoiceCloningKeyResponse", + "properties": { + "voiceCloningKey": { + "description": "The voice clone key. Use it in the SynthesizeSpeechRequest by setting [voice.voice_clone.voice_cloning_key].", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudTexttospeechV1beta1SynthesizeLongAudioMetadata": { "description": "Metadata for response returned by the `SynthesizeLongAudio` method.", "id": "GoogleCloudTexttospeechV1beta1SynthesizeLongAudioMetadata", @@ -369,6 +475,56 @@ }, "type": "object" }, + "InputAudio": { + "description": "Holds audio content and config.", + "id": "InputAudio", + "properties": { + "audioConfig": { + "$ref": "InputAudioConfig", + "description": "Required. Provides information that specifies how to process content." + }, + "content": { + "description": "Required. The audio data bytes encoded as specified in `InputAudioConfig`. Note: as with all bytes fields, proto buffers use a pure binary representation, whereas JSON representations use base64. Audio samples should be between 5-25 seconds in length.", + "format": "byte", + "type": "string" + } + }, + "type": "object" + }, + "InputAudioConfig": { + "description": "Description of inputted audio data.", + "id": "InputAudioConfig", + "properties": { + "audioEncoding": { + "description": "Required. The format of the audio byte stream.", + "enum": [ + "AUDIO_ENCODING_UNSPECIFIED", + "LINEAR16", + "MP3", + "MP3_64_KBPS", + "OGG_OPUS", + "MULAW", + "ALAW" + ], + "enumDescriptions": [ + "Not specified. Will return result google.rpc.Code.INVALID_ARGUMENT.", + "Uncompressed 16-bit signed little-endian samples (Linear PCM). Audio content returned as LINEAR16 also contains a WAV header.", + "MP3 audio at 32kbps.", + "MP3 at 64kbps.", + "Opus encoded audio wrapped in an ogg container. The result will be a file which can be played natively on Android, and in browsers (at least Chrome and Firefox). The quality of the encoding is considerably higher than MP3 while using approximately the same bitrate.", + "8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. Audio content returned as MULAW also contains a WAV header.", + "8-bit samples that compand 14-bit audio samples using G.711 PCMU/A-law. Audio content returned as ALAW also contains a WAV header." + ], + "type": "string" + }, + "sampleRateHertz": { + "description": "Required. The sample rate (in hertz) for this audio.", + "format": "int32", + "type": "integer" + } + }, + "type": "object" + }, "ListOperationsResponse": { "description": "The response message for Operations.ListOperations.", "id": "ListOperationsResponse", @@ -467,6 +623,10 @@ "description": "Contains text input to be synthesized. Either `text` or `ssml` must be supplied. Supplying both or neither returns google.rpc.Code.INVALID_ARGUMENT. The input size is limited to 5000 bytes.", "id": "SynthesisInput", "properties": { + "customPronunciations": { + "$ref": "CustomPronunciations", + "description": "Optional. The pronunciation customizations to be applied to the input. If this is set, the input will be synthesized using the given pronunciation customizations. The initial support will be for EFIGS (English, French, Italian, German, Spanish) languages, as provided in VoiceSelectionParams. Journey and Instant Clone voices are not supported yet. In order to customize the pronunciation of a phrase, there must be an exact match of the phrase in the input types. If using SSML, the phrase must not be inside a phoneme tag (entirely or partially)." + }, "ssml": { "description": "The SSML document to be synthesized. The SSML document must be valid and well-formed. Otherwise the RPC will fail and return google.rpc.Code.INVALID_ARGUMENT. For more information, see [SSML](https://cloud.google.com/text-to-speech/docs/ssml).", "type": "string" @@ -528,6 +688,10 @@ "description": "The top-level message sent by the client for the `SynthesizeSpeech` method.", "id": "SynthesizeSpeechRequest", "properties": { + "advancedVoiceOptions": { + "$ref": "AdvancedVoiceOptions", + "description": "Adnanced voice options." + }, "audioConfig": { "$ref": "AudioConfig", "description": "Required. The configuration of the synthesized audio." @@ -636,6 +800,17 @@ }, "type": "object" }, + "VoiceCloneParams": { + "description": "The configuration of Voice Clone feature.", + "id": "VoiceCloneParams", + "properties": { + "voiceCloningKey": { + "description": "Required. Created by GenerateVoiceCloningKey.", + "type": "string" + } + }, + "type": "object" + }, "VoiceSelectionParams": { "description": "Description of which voice to use for a synthesis request.", "id": "VoiceSelectionParams", @@ -667,6 +842,10 @@ "A gender-neutral voice. This voice is not yet supported." ], "type": "string" + }, + "voiceClone": { + "$ref": "VoiceCloneParams", + "description": "Optional. The configuration for a voice clone. If [VoiceCloneParams.voice_clone_key] is set, the service will choose the voice clone matching the specified configuration." } }, "type": "object" diff --git a/texttospeech/v1beta1/texttospeech-gen.go b/texttospeech/v1beta1/texttospeech-gen.go index bb7b44eaa8f..bee5adca955 100644 --- a/texttospeech/v1beta1/texttospeech-gen.go +++ b/texttospeech/v1beta1/texttospeech-gen.go @@ -213,6 +213,29 @@ type VoicesService struct { s *Service } +// AdvancedVoiceOptions: Used for advanced voice options. +type AdvancedVoiceOptions struct { + // LowLatencyJourneySynthesis: Only for Jounrney voices. If false, the + // synthesis will be context aware and have higher latency. + LowLatencyJourneySynthesis bool `json:"lowLatencyJourneySynthesis,omitempty"` + // ForceSendFields is a list of field names (e.g. "LowLatencyJourneySynthesis") + // to unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "LowLatencyJourneySynthesis") to + // include in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s AdvancedVoiceOptions) MarshalJSON() ([]byte, error) { + type NoMethod AdvancedVoiceOptions + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + // AudioConfig: Description of audio data to be synthesized. type AudioConfig struct { // AudioEncoding: Required. The format of the audio byte stream. @@ -301,6 +324,64 @@ func (s *AudioConfig) UnmarshalJSON(data []byte) error { return nil } +// CustomPronunciationParams: Pronunciation customization for a phrase. +type CustomPronunciationParams struct { + // PhoneticEncoding: The phonetic encoding of the phrase. + // + // Possible values: + // "PHONETIC_ENCODING_UNSPECIFIED" - Not specified. + // "PHONETIC_ENCODING_IPA" - IPA. (e.g. apple -> ˈæpəl ) + // https://en.wikipedia.org/wiki/International_Phonetic_Alphabet + // "PHONETIC_ENCODING_X_SAMPA" - X-SAMPA (e.g. apple -> "{p@l" ) + // https://en.wikipedia.org/wiki/X-SAMPA + PhoneticEncoding string `json:"phoneticEncoding,omitempty"` + // Phrase: The phrase to which the customization will be applied. The phrase + // can be multiple words (in the case of proper nouns etc), but should not span + // to a whole sentence. + Phrase string `json:"phrase,omitempty"` + // Pronunciation: The pronunciation of the phrase. This must be in the phonetic + // encoding specified above. + Pronunciation string `json:"pronunciation,omitempty"` + // ForceSendFields is a list of field names (e.g. "PhoneticEncoding") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "PhoneticEncoding") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s CustomPronunciationParams) MarshalJSON() ([]byte, error) { + type NoMethod CustomPronunciationParams + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// CustomPronunciations: A collection of pronunciation customizations. +type CustomPronunciations struct { + // Pronunciations: The pronunciation customizations to be applied. + Pronunciations []*CustomPronunciationParams `json:"pronunciations,omitempty"` + // ForceSendFields is a list of field names (e.g. "Pronunciations") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Pronunciations") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s CustomPronunciations) MarshalJSON() ([]byte, error) { + type NoMethod CustomPronunciations + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + // CustomVoiceParams: Description of the custom voice to be synthesized. type CustomVoiceParams struct { // Model: Required. The name of the AutoML model that synthesizes the custom @@ -336,6 +417,72 @@ func (s CustomVoiceParams) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) } +// GenerateVoiceCloningKeyRequest: Request message for the +// `GenerateVoiceCloningKey` method. +type GenerateVoiceCloningKeyRequest struct { + // ConsentScript: Required. The script used for the voice talent statement. The + // script will be provided to the caller through other channels. It must be + // returned unchanged in this field. + ConsentScript string `json:"consentScript,omitempty"` + // LanguageCode: Required. The language of the supplied audio as a BCP-47 + // (https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. Example: + // "en-US". See Language Support + // (https://cloud.google.com/speech-to-text/docs/languages) for a list of the + // currently supported language codes. + LanguageCode string `json:"languageCode,omitempty"` + // ReferenceAudio: Required. The training audio used to create voice clone. + // This is currently limited to LINEAR16 PCM WAV files mono audio with 24khz + // sample rate. This needs to be specified in [InputAudio.audio_config], other + // values will be explicitly rejected. + ReferenceAudio *InputAudio `json:"referenceAudio,omitempty"` + // VoiceTalentConsent: Required. The voice talent audio used to verify consent + // to voice clone. + VoiceTalentConsent *InputAudio `json:"voiceTalentConsent,omitempty"` + // ForceSendFields is a list of field names (e.g. "ConsentScript") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ConsentScript") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s GenerateVoiceCloningKeyRequest) MarshalJSON() ([]byte, error) { + type NoMethod GenerateVoiceCloningKeyRequest + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// GenerateVoiceCloningKeyResponse: Response message for the +// `GenerateVoiceCloningKey` method. +type GenerateVoiceCloningKeyResponse struct { + // VoiceCloningKey: The voice clone key. Use it in the SynthesizeSpeechRequest + // by setting [voice.voice_clone.voice_cloning_key]. + VoiceCloningKey string `json:"voiceCloningKey,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "VoiceCloningKey") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "VoiceCloningKey") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s GenerateVoiceCloningKeyResponse) MarshalJSON() ([]byte, error) { + type NoMethod GenerateVoiceCloningKeyResponse + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + // GoogleCloudTexttospeechV1beta1SynthesizeLongAudioMetadata: Metadata for // response returned by the `SynthesizeLongAudio` method. type GoogleCloudTexttospeechV1beta1SynthesizeLongAudioMetadata struct { @@ -378,6 +525,74 @@ func (s *GoogleCloudTexttospeechV1beta1SynthesizeLongAudioMetadata) UnmarshalJSO return nil } +// InputAudio: Holds audio content and config. +type InputAudio struct { + // AudioConfig: Required. Provides information that specifies how to process + // content. + AudioConfig *InputAudioConfig `json:"audioConfig,omitempty"` + // Content: Required. The audio data bytes encoded as specified in + // `InputAudioConfig`. Note: as with all bytes fields, proto buffers use a pure + // binary representation, whereas JSON representations use base64. Audio + // samples should be between 5-25 seconds in length. + Content string `json:"content,omitempty"` + // ForceSendFields is a list of field names (e.g. "AudioConfig") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "AudioConfig") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s InputAudio) MarshalJSON() ([]byte, error) { + type NoMethod InputAudio + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// InputAudioConfig: Description of inputted audio data. +type InputAudioConfig struct { + // AudioEncoding: Required. The format of the audio byte stream. + // + // Possible values: + // "AUDIO_ENCODING_UNSPECIFIED" - Not specified. Will return result + // google.rpc.Code.INVALID_ARGUMENT. + // "LINEAR16" - Uncompressed 16-bit signed little-endian samples (Linear + // PCM). Audio content returned as LINEAR16 also contains a WAV header. + // "MP3" - MP3 audio at 32kbps. + // "MP3_64_KBPS" - MP3 at 64kbps. + // "OGG_OPUS" - Opus encoded audio wrapped in an ogg container. The result + // will be a file which can be played natively on Android, and in browsers (at + // least Chrome and Firefox). The quality of the encoding is considerably + // higher than MP3 while using approximately the same bitrate. + // "MULAW" - 8-bit samples that compand 14-bit audio samples using G.711 + // PCMU/mu-law. Audio content returned as MULAW also contains a WAV header. + // "ALAW" - 8-bit samples that compand 14-bit audio samples using G.711 + // PCMU/A-law. Audio content returned as ALAW also contains a WAV header. + AudioEncoding string `json:"audioEncoding,omitempty"` + // SampleRateHertz: Required. The sample rate (in hertz) for this audio. + SampleRateHertz int64 `json:"sampleRateHertz,omitempty"` + // ForceSendFields is a list of field names (e.g. "AudioEncoding") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "AudioEncoding") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s InputAudioConfig) MarshalJSON() ([]byte, error) { + type NoMethod InputAudioConfig + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + // ListOperationsResponse: The response message for Operations.ListOperations. type ListOperationsResponse struct { // NextPageToken: The standard List next-page token. @@ -517,6 +732,15 @@ func (s Status) MarshalJSON() ([]byte, error) { // `ssml` must be supplied. Supplying both or neither returns // google.rpc.Code.INVALID_ARGUMENT. The input size is limited to 5000 bytes. type SynthesisInput struct { + // CustomPronunciations: Optional. The pronunciation customizations to be + // applied to the input. If this is set, the input will be synthesized using + // the given pronunciation customizations. The initial support will be for + // EFIGS (English, French, Italian, German, Spanish) languages, as provided in + // VoiceSelectionParams. Journey and Instant Clone voices are not supported + // yet. In order to customize the pronunciation of a phrase, there must be an + // exact match of the phrase in the input types. If using SSML, the phrase must + // not be inside a phoneme tag (entirely or partially). + CustomPronunciations *CustomPronunciations `json:"customPronunciations,omitempty"` // Ssml: The SSML document to be synthesized. The SSML document must be valid // and well-formed. Otherwise the RPC will fail and return // google.rpc.Code.INVALID_ARGUMENT. For more information, see SSML @@ -524,15 +748,15 @@ type SynthesisInput struct { Ssml string `json:"ssml,omitempty"` // Text: The raw text to be synthesized. Text string `json:"text,omitempty"` - // ForceSendFields is a list of field names (e.g. "Ssml") to unconditionally - // include in API requests. By default, fields with empty or default values are - // omitted from API requests. See + // ForceSendFields is a list of field names (e.g. "CustomPronunciations") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Ssml") to include in API requests - // with the JSON null value. By default, fields with empty values are omitted - // from API requests. See + // NullFields is a list of field names (e.g. "CustomPronunciations") to include + // in API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` } @@ -619,6 +843,8 @@ func (s SynthesizeLongAudioRequest) MarshalJSON() ([]byte, error) { // SynthesizeSpeechRequest: The top-level message sent by the client for the // `SynthesizeSpeech` method. type SynthesizeSpeechRequest struct { + // AdvancedVoiceOptions: Adnanced voice options. + AdvancedVoiceOptions *AdvancedVoiceOptions `json:"advancedVoiceOptions,omitempty"` // AudioConfig: Required. The configuration of the synthesized audio. AudioConfig *AudioConfig `json:"audioConfig,omitempty"` // EnableTimePointing: Whether and what timepoints are returned in the @@ -635,15 +861,15 @@ type SynthesizeSpeechRequest struct { Input *SynthesisInput `json:"input,omitempty"` // Voice: Required. The desired voice of the synthesized audio. Voice *VoiceSelectionParams `json:"voice,omitempty"` - // ForceSendFields is a list of field names (e.g. "AudioConfig") to + // ForceSendFields is a list of field names (e.g. "AdvancedVoiceOptions") to // unconditionally include in API requests. By default, fields with empty or // default values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "AudioConfig") to include in API - // requests with the JSON null value. By default, fields with empty values are - // omitted from API requests. See + // NullFields is a list of field names (e.g. "AdvancedVoiceOptions") to include + // in API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` } @@ -768,6 +994,28 @@ func (s Voice) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) } +// VoiceCloneParams: The configuration of Voice Clone feature. +type VoiceCloneParams struct { + // VoiceCloningKey: Required. Created by GenerateVoiceCloningKey. + VoiceCloningKey string `json:"voiceCloningKey,omitempty"` + // ForceSendFields is a list of field names (e.g. "VoiceCloningKey") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "VoiceCloningKey") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s VoiceCloneParams) MarshalJSON() ([]byte, error) { + type NoMethod VoiceCloneParams + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + // VoiceSelectionParams: Description of which voice to use for a synthesis // request. type VoiceSelectionParams struct { @@ -807,6 +1055,10 @@ type VoiceSelectionParams struct { // "FEMALE" - A female voice. // "NEUTRAL" - A gender-neutral voice. This voice is not yet supported. SsmlGender string `json:"ssmlGender,omitempty"` + // VoiceClone: Optional. The configuration for a voice clone. If + // [VoiceCloneParams.voice_clone_key] is set, the service will choose the voice + // clone matching the specified configuration. + VoiceClone *VoiceCloneParams `json:"voiceClone,omitempty"` // ForceSendFields is a list of field names (e.g. "CustomVoice") to // unconditionally include in API requests. By default, fields with empty or // default values are omitted from API requests. See @@ -1282,6 +1534,104 @@ func (c *TextSynthesizeCall) Do(opts ...googleapi.CallOption) (*SynthesizeSpeech return ret, nil } +type VoicesGenerateVoiceCloningKeyCall struct { + s *Service + generatevoicecloningkeyrequest *GenerateVoiceCloningKeyRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// GenerateVoiceCloningKey: Generates voice clone key given a short voice +// prompt. This method validates the voice prompts with a series of checks +// against the voice talent statement to verify the voice clone is safe to +// generate. +func (r *VoicesService) GenerateVoiceCloningKey(generatevoicecloningkeyrequest *GenerateVoiceCloningKeyRequest) *VoicesGenerateVoiceCloningKeyCall { + c := &VoicesGenerateVoiceCloningKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.generatevoicecloningkeyrequest = generatevoicecloningkeyrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *VoicesGenerateVoiceCloningKeyCall) Fields(s ...googleapi.Field) *VoicesGenerateVoiceCloningKeyCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *VoicesGenerateVoiceCloningKeyCall) Context(ctx context.Context) *VoicesGenerateVoiceCloningKeyCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *VoicesGenerateVoiceCloningKeyCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *VoicesGenerateVoiceCloningKeyCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.generatevoicecloningkeyrequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/voices:generateVoiceCloningKey") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "texttospeech.voices.generateVoiceCloningKey" call. +// Any non-2xx status code is an error. Response headers are in either +// *GenerateVoiceCloningKeyResponse.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 *VoicesGenerateVoiceCloningKeyCall) Do(opts ...googleapi.CallOption) (*GenerateVoiceCloningKeyResponse, 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 := &GenerateVoiceCloningKeyResponse{ + 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 +} + type VoicesListCall struct { s *Service urlParams_ gensupport.URLParams