From c053dae6f67273bafa2c281f7699a0d0e9a2a138 Mon Sep 17 00:00:00 2001 From: Cameron Thornton Date: Mon, 3 Jun 2024 06:10:43 -0500 Subject: [PATCH 1/5] diffs --- mmv1/api/resource.go | 24 +- mmv1/api/type.go | 14 - .../{go_instance.yaml => go_Instance.yaml} | 75 ++-- mmv1/products/pubsub/go_Schema.yaml | 6 +- mmv1/products/pubsub/go_Subscription.yaml | 320 ++++++++++-------- mmv1/products/pubsub/go_Topic.yaml | 119 +++++-- .../base_configs/iam_test_file.go.tmpl | 1 - ...sub_subscription_push_cloudstorage.tf.tmpl | 5 +- ...ubscription_push_cloudstorage_avro.tf.tmpl | 7 +- ..._property_documentation.html.markdown.tmpl | 10 +- .../terraform/resource.html.markdown.tmpl | 6 +- mmv1/templates/terraform/update_mask.go.tmpl | 10 +- mmv1/third_party/terraform/go.mod | 2 +- 13 files changed, 363 insertions(+), 236 deletions(-) rename mmv1/products/datafusion/{go_instance.yaml => go_Instance.yaml} (79%) diff --git a/mmv1/api/resource.go b/mmv1/api/resource.go index 6d9ad9bdf4c7..772a3ad85a84 100644 --- a/mmv1/api/resource.go +++ b/mmv1/api/resource.go @@ -14,6 +14,7 @@ package api import ( "fmt" + "maps" "regexp" "strings" @@ -1279,15 +1280,30 @@ func CompareByName(a, b *Type) int { return strings.Compare(a.Name, b.Name) } -func (r Resource) GetPropertyUpdateMasksGroups() map[string][]string { +func (r Resource) GetPropertyUpdateMasksGroupKeys(properties []*Type) []string { + keys := []string{} + for _, prop := range properties { + if prop.FlattenObject { + k := r.GetPropertyUpdateMasksGroupKeys(prop.Properties) + keys = append(keys, k...) + } else if len(prop.UpdateMaskFields) > 0 { + keys = append(keys, google.Underscore(prop.Name)) + } else { + keys = append(keys, google.Underscore(prop.Name)) + } + } + return keys +} + +func (r Resource) GetPropertyUpdateMasksGroups(properties []*Type, maskPrefix string) map[string][]string { maskGroups := map[string][]string{} - for _, prop := range r.AllUserProperties() { + for _, prop := range properties { if prop.FlattenObject { - prop.GetNestedPropertyUpdateMasksGroups(maskGroups, prop.ApiName) + maps.Copy(maskGroups, r.GetPropertyUpdateMasksGroups(prop.Properties, prop.ApiName)) } else if len(prop.UpdateMaskFields) > 0 { maskGroups[google.Underscore(prop.Name)] = prop.UpdateMaskFields } else { - maskGroups[google.Underscore(prop.Name)] = []string{prop.ApiName} + maskGroups[google.Underscore(prop.Name)] = []string{maskPrefix + prop.ApiName} } } return maskGroups diff --git a/mmv1/api/type.go b/mmv1/api/type.go index 7cd9cccc74b1..67b110c936c4 100644 --- a/mmv1/api/type.go +++ b/mmv1/api/type.go @@ -1292,20 +1292,6 @@ func (t Type) NamespaceProperty() string { // // end -// new utility function for recursive calls to GetPropertyUpdateMasksGroups - -func (t Type) GetNestedPropertyUpdateMasksGroups(maskGroups map[string][]string, maskPrefix string) { - for _, prop := range t.AllProperties() { - if prop.FlattenObject { - prop.GetNestedPropertyUpdateMasksGroups(maskGroups, prop.ApiName) - } else if len(prop.UpdateMaskFields) > 0 { - maskGroups[google.Underscore(prop.Name)] = prop.UpdateMaskFields - } else { - maskGroups[google.Underscore(prop.Name)] = []string{maskPrefix + prop.ApiName} - } - } -} - func (t Type) CustomTemplate(templatePath string, appendNewline bool) string { return resource.ExecuteTemplate(&t, templatePath, appendNewline) } diff --git a/mmv1/products/datafusion/go_instance.yaml b/mmv1/products/datafusion/go_Instance.yaml similarity index 79% rename from mmv1/products/datafusion/go_instance.yaml rename to mmv1/products/datafusion/go_Instance.yaml index fecffa4352c2..fd14261d37be 100644 --- a/mmv1/products/datafusion/go_instance.yaml +++ b/mmv1/products/datafusion/go_Instance.yaml @@ -90,7 +90,8 @@ examples: parameters: - name: 'region' type: String - description: "The region of the Data Fusion instance." + description: | + The region of the Data Fusion instance. url_param_only: true required: false immutable: true @@ -99,14 +100,16 @@ parameters: properties: - name: 'name' type: String - description: "The ID of the instance or a fully qualified identifier for the instance." + description: | + The ID of the instance or a fully qualified identifier for the instance. required: true immutable: true custom_flatten: 'templates/terraform/custom_flatten/go/name_from_self_link.tmpl' custom_expand: 'templates/terraform/custom_expand/go/shortname_to_url.go.tmpl' - name: 'description' type: String - description: "An optional description of the instance." + description: | + An optional description of the instance. immutable: true - name: 'type' type: Enum @@ -129,13 +132,16 @@ properties: - 'DEVELOPER' - name: 'enableStackdriverLogging' type: Boolean - description: "Option to enable Stackdriver Logging." + description: | + Option to enable Stackdriver Logging. - name: 'enableStackdriverMonitoring' type: Boolean - description: "Option to enable Stackdriver Monitoring." + description: | + Option to enable Stackdriver Monitoring. - name: 'enableRbac' type: Boolean - description: "Option to enable granular role-based access control." + description: | + Option to enable granular role-based access control. - name: 'labels' type: KeyValueLabels description: | @@ -144,7 +150,8 @@ properties: immutable: false - name: 'options' type: KeyValuePairs - description: "Map of additional options used to configure the behavior of Data Fusion instance." + description: | + Map of additional options used to configure the behavior of Data Fusion instance. immutable: true default_from_api: true diff_suppress_func: 'instanceOptionsDiffSuppress' @@ -178,19 +185,23 @@ properties: - 'RESTARTING' - name: 'stateMessage' type: String - description: "Additional information about the current state of this Data Fusion instance if available." + description: | + Additional information about the current state of this Data Fusion instance if available. output: true - name: 'serviceEndpoint' type: String - description: "Endpoint on which the Data Fusion UI and REST APIs are accessible." + description: | + Endpoint on which the Data Fusion UI and REST APIs are accessible. output: true - name: 'version' type: String - description: "Current version of the Data Fusion." + description: | + Current version of the Data Fusion. default_from_api: true - name: 'serviceAccount' type: String - description: "Service account which will be used to access resources in the customer project." + description: | + Service account which will be used to access resources in the customer project. min_version: 'beta' output: true deprecation_message: '`service_account` is deprecated and will be removed in a future major release. Instead, use `tenant_project_id` to extract the tenant project ID.' @@ -203,19 +214,23 @@ properties: immutable: true - name: 'dataprocServiceAccount' type: String - description: "User-managed service account to set on Dataproc when Cloud Data Fusion creates Dataproc to run data processing pipelines." + description: | + User-managed service account to set on Dataproc when Cloud Data Fusion creates Dataproc to run data processing pipelines. immutable: true - name: 'tenantProjectId' type: String - description: "The name of the tenant project." + description: | + The name of the tenant project. output: true - name: 'gcsBucket' type: String - description: "Cloud Storage bucket generated by Data Fusion in the customer project." + description: | + Cloud Storage bucket generated by Data Fusion in the customer project. output: true - name: 'networkConfig' type: NestedObject - description: "Network configuration options. These are required when a private Data Fusion instance is to be created." + description: | + Network configuration options. These are required when a private Data Fusion instance is to be created. immutable: true properties: - name: 'ipAllocation' @@ -235,42 +250,51 @@ properties: immutable: true - name: 'zone' type: String - description: "Name of the zone in which the Data Fusion instance will be created. Only DEVELOPER instances use this field." + description: | + Name of the zone in which the Data Fusion instance will be created. Only DEVELOPER instances use this field. immutable: true default_from_api: true - name: 'displayName' type: String - description: "Display name for an instance." + description: | + Display name for an instance. immutable: true - name: 'apiEndpoint' type: String - description: "Endpoint on which the REST APIs is accessible." + description: | + Endpoint on which the REST APIs is accessible. output: true - name: 'p4ServiceAccount' type: String - description: "P4 service account for the customer project." + description: | + P4 service account for the customer project. output: true - name: 'cryptoKeyConfig' type: NestedObject - description: "The crypto key configuration. This field is used by the Customer-Managed Encryption Keys (CMEK) feature." + description: | + The crypto key configuration. This field is used by the Customer-Managed Encryption Keys (CMEK) feature. immutable: true properties: - name: 'keyReference' type: String - description: "The name of the key which is used to encrypt/decrypt customer data. For key in Cloud KMS, the key should be in the format of projects/*/locations/*/keyRings/*/cryptoKeys/*." + description: | + The name of the key which is used to encrypt/decrypt customer data. For key in Cloud KMS, the key should be in the format of projects/*/locations/*/keyRings/*/cryptoKeys/*. required: true immutable: true - name: 'eventPublishConfig' type: NestedObject - description: "Option to enable and pass metadata for event publishing." + description: | + Option to enable and pass metadata for event publishing. properties: - name: 'enabled' type: Boolean - description: "Option to enable Event Publishing." + description: | + Option to enable Event Publishing. required: true - name: 'topic' type: String - description: "The resource name of the Pub/Sub topic. Format: projects/{projectId}/topics/{topic_id}" + description: | + The resource name of the Pub/Sub topic. Format: projects/{projectId}/topics/{topic_id} required: true immutable: true - name: 'accelerators' @@ -284,7 +308,8 @@ properties: properties: - name: 'acceleratorType' type: Enum - description: "The type of an accelator for a CDF instance." + description: | + The type of an accelator for a CDF instance. required: true enum_values: - 'CDC' diff --git a/mmv1/products/pubsub/go_Schema.yaml b/mmv1/products/pubsub/go_Schema.yaml index c8642d31b3bc..46ee0533179b 100644 --- a/mmv1/products/pubsub/go_Schema.yaml +++ b/mmv1/products/pubsub/go_Schema.yaml @@ -58,7 +58,9 @@ examples: parameters: - name: 'name' type: String - description: "The ID to use for the schema, which will become the final component of the schema's resource name." + description: + The ID to use for the schema, which will become the final component of the + schema's resource name. required: true immutable: true diff_suppress_func: 'tpgresource.CompareSelfLinkOrResourceName' @@ -67,7 +69,7 @@ parameters: properties: - name: 'type' type: Enum - description: "The type of the schema definition" + description: The type of the schema definition default_value: TYPE_UNSPECIFIED enum_values: - 'TYPE_UNSPECIFIED' diff --git a/mmv1/products/pubsub/go_Subscription.yaml b/mmv1/products/pubsub/go_Subscription.yaml index e21927fbab71..d5c03dddf7d2 100644 --- a/mmv1/products/pubsub/go_Subscription.yaml +++ b/mmv1/products/pubsub/go_Subscription.yaml @@ -37,7 +37,9 @@ timeouts: async: type: 'PollAsync' check_response_func_existence: 'transport_tpg.PollCheckForExistence' + check_response_func_absence: 'transport_tpg.PollCheckForAbsence' suppress_error: true + target_occurrences: 1 actions: ['create'] custom_code: constants: 'templates/terraform/constants/go/subscription.go.tmpl' @@ -89,7 +91,7 @@ parameters: properties: - name: 'name' type: String - description: "Name of the subscription." + description: 'Name of the subscription.' required: true immutable: true custom_flatten: 'templates/terraform/custom_flatten/go/name_from_self_link.tmpl' @@ -108,75 +110,92 @@ properties: imports: 'name' - name: 'labels' type: KeyValueLabels - description: "A set of key/value label pairs to assign to this Subscription. -" + description: | + A set of key/value label pairs to assign to this Subscription. immutable: false - name: 'bigqueryConfig' type: NestedObject - description: "If delivery to BigQuery is used with this subscription, this field is used to configure it. -Either pushConfig, bigQueryConfig or cloudStorageConfig can be set, but not combined. -If all three are empty, then the subscriber will pull and ack messages using API methods." + description: | + If delivery to BigQuery is used with this subscription, this field is used to configure it. + Either pushConfig, bigQueryConfig or cloudStorageConfig can be set, but not combined. + If all three are empty, then the subscriber will pull and ack messages using API methods. conflicts: - push_config - cloud_storage_config properties: - name: 'table' type: String - description: "The name of the table to which to write data, of the form {projectId}:{datasetId}.{tableId}" + description: | + The name of the table to which to write data, of the form {projectId}:{datasetId}.{tableId} required: true - name: 'useTopicSchema' type: Boolean - description: "When true, use the topic's schema as the columns to write to in BigQuery, if it exists. - Only one of use_topic_schema and use_table_schema can be set." + description: | + When true, use the topic's schema as the columns to write to in BigQuery, if it exists. + Only one of use_topic_schema and use_table_schema can be set. conflicts: - use_table_schema - name: 'useTableSchema' type: Boolean - description: "When true, use the BigQuery table's schema as the columns to write to in BigQuery. Messages - must be published in JSON format. Only one of use_topic_schema and use_table_schema can be set." + description: | + When true, use the BigQuery table's schema as the columns to write to in BigQuery. Messages + must be published in JSON format. Only one of use_topic_schema and use_table_schema can be set. conflicts: - use_topic_schema - name: 'writeMetadata' type: Boolean - description: "When true, write the subscription name, messageId, publishTime, attributes, and orderingKey to additional columns in the table. - The subscription name, messageId, and publishTime fields are put in their own columns while all other message properties (other than data) are written to a JSON object in the attributes column." + description: | + When true, write the subscription name, messageId, publishTime, attributes, and orderingKey to additional columns in the table. + The subscription name, messageId, and publishTime fields are put in their own columns while all other message properties (other than data) are written to a JSON object in the attributes column. - name: 'dropUnknownFields' type: Boolean - description: "When true and use_topic_schema or use_table_schema is true, any fields that are a part of the topic schema or message schema that - are not part of the BigQuery table schema are dropped when writing to BigQuery. Otherwise, the schemas must be kept in sync - and any messages with extra fields are not written and remain in the subscription's backlog." + description: | + When true and use_topic_schema or use_table_schema is true, any fields that are a part of the topic schema or message schema that + are not part of the BigQuery table schema are dropped when writing to BigQuery. Otherwise, the schemas must be kept in sync + and any messages with extra fields are not written and remain in the subscription's backlog. - name: 'cloudStorageConfig' type: NestedObject - description: "If delivery to Cloud Storage is used with this subscription, this field is used to configure it. -Either pushConfig, bigQueryConfig or cloudStorageConfig can be set, but not combined. -If all three are empty, then the subscriber will pull and ack messages using API methods." + description: | + If delivery to Cloud Storage is used with this subscription, this field is used to configure it. + Either pushConfig, bigQueryConfig or cloudStorageConfig can be set, but not combined. + If all three are empty, then the subscriber will pull and ack messages using API methods. conflicts: - push_config - bigquery_config properties: - name: 'bucket' type: String - description: "User-provided name for the Cloud Storage bucket. The bucket must be created by the user. The bucket name must be without any prefix like 'gs://'." + description: | + User-provided name for the Cloud Storage bucket. The bucket must be created by the user. The bucket name must be without any prefix like "gs://". required: true - name: 'filenamePrefix' type: String - description: "User-provided prefix for Cloud Storage filename." + description: | + User-provided prefix for Cloud Storage filename. - name: 'filenameSuffix' type: String - description: "User-provided suffix for Cloud Storage filename. Must not end in '/'." + description: | + User-provided suffix for Cloud Storage filename. Must not end in "/". + - name: 'filenameDatetimeFormat' + type: String + description: | + User-provided format string specifying how to represent datetimes in Cloud Storage filenames. - name: 'maxDuration' type: String - description: "The maximum duration that can elapse before a new Cloud Storage file is created. Min 1 minute, max 10 minutes, default 5 minutes. - May not exceed the subscription's acknowledgement deadline. - A duration in seconds with up to nine fractional digits, ending with 's'. Example: '3.5s'." + description: | + The maximum duration that can elapse before a new Cloud Storage file is created. Min 1 minute, max 10 minutes, default 5 minutes. + May not exceed the subscription's acknowledgement deadline. + A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s". default_value: 300s - name: 'maxBytes' type: Integer - description: "The maximum bytes that can be written to a Cloud Storage file before a new file is created. Min 1 KB, max 10 GiB. - The maxBytes limit may be exceeded in cases where messages are larger than the limit." + description: | + The maximum bytes that can be written to a Cloud Storage file before a new file is created. Min 1 KB, max 10 GiB. + The maxBytes limit may be exceeded in cases where messages are larger than the limit. - name: 'state' type: Enum - description: "An output-only field that indicates whether or not the subscription can receive messages." + description: | + An output-only field that indicates whether or not the subscription can receive messages. output: true enum_values: - 'ACTIVE' @@ -184,83 +203,93 @@ If all three are empty, then the subscriber will pull and ack messages using API - 'NOT_FOUND' - name: 'avroConfig' type: NestedObject - description: "If set, message data will be written to Cloud Storage in Avro format." + description: | + If set, message data will be written to Cloud Storage in Avro format. properties: - name: 'writeMetadata' type: Boolean - description: "When true, write the subscription name, messageId, publishTime, attributes, and orderingKey as additional fields in the output." + description: | + When true, write the subscription name, messageId, publishTime, attributes, and orderingKey as additional fields in the output. - name: 'pushConfig' type: NestedObject - description: "If push delivery is used with this subscription, this field is used to -configure it. An empty pushConfig signifies that the subscriber will -pull and ack messages using API methods." + description: | + If push delivery is used with this subscription, this field is used to + configure it. An empty pushConfig signifies that the subscriber will + pull and ack messages using API methods. conflicts: - bigquery_config - cloud_storage_config properties: - name: 'oidcToken' type: NestedObject - description: "If specified, Pub/Sub will generate and attach an OIDC JWT token as - an Authorization header in the HTTP request for every pushed message." + description: | + If specified, Pub/Sub will generate and attach an OIDC JWT token as + an Authorization header in the HTTP request for every pushed message. properties: - name: 'serviceAccountEmail' type: String - description: "Service account email to be used for generating the OIDC token. - The caller (for subscriptions.create, subscriptions.patch, and - subscriptions.modifyPushConfig RPCs) must have the - iam.serviceAccounts.actAs permission for the service account." + description: | + Service account email to be used for generating the OIDC token. + The caller (for subscriptions.create, subscriptions.patch, and + subscriptions.modifyPushConfig RPCs) must have the + iam.serviceAccounts.actAs permission for the service account. required: true - name: 'audience' type: String - description: "Audience to be used when generating OIDC token. The audience claim - identifies the recipients that the JWT is intended for. The audience - value is a single case-sensitive string. Having multiple values (array) - for the audience field is not supported. More info about the OIDC JWT - token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3 - Note: if not specified, the Push endpoint URL will be used." + description: | + Audience to be used when generating OIDC token. The audience claim + identifies the recipients that the JWT is intended for. The audience + value is a single case-sensitive string. Having multiple values (array) + for the audience field is not supported. More info about the OIDC JWT + token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3 + Note: if not specified, the Push endpoint URL will be used. - name: 'pushEndpoint' type: String - description: "A URL locating the endpoint to which messages should be pushed. - For example, a Webhook endpoint might use - 'https://example.com/push'." + description: | + A URL locating the endpoint to which messages should be pushed. + For example, a Webhook endpoint might use + "https://example.com/push". required: true - name: 'attributes' type: KeyValuePairs - description: "Endpoint configuration attributes. + description: | + Endpoint configuration attributes. - Every endpoint has a set of API supported attributes that can - be used to control different aspects of the message delivery. + Every endpoint has a set of API supported attributes that can + be used to control different aspects of the message delivery. - The currently supported attribute is x-goog-version, which you - can use to change the format of the pushed message. This - attribute indicates the version of the data expected by - the endpoint. This controls the shape of the pushed message - (i.e., its fields and metadata). The endpoint version is - based on the version of the Pub/Sub API. + The currently supported attribute is x-goog-version, which you + can use to change the format of the pushed message. This + attribute indicates the version of the data expected by + the endpoint. This controls the shape of the pushed message + (i.e., its fields and metadata). The endpoint version is + based on the version of the Pub/Sub API. - If not present during the subscriptions.create call, - it will default to the version of the API used to make - such call. If not present during a subscriptions.modifyPushConfig - call, its value will not be changed. subscriptions.get - calls will always return a valid version, even if the - subscription was created without this attribute. + If not present during the subscriptions.create call, + it will default to the version of the API used to make + such call. If not present during a subscriptions.modifyPushConfig + call, its value will not be changed. subscriptions.get + calls will always return a valid version, even if the + subscription was created without this attribute. - The possible values for this attribute are: + The possible values for this attribute are: - - v1beta1: uses the push format defined in the v1beta1 Pub/Sub API. - - v1 or v1beta2: uses the push format defined in the v1 Pub/Sub API." + - v1beta1: uses the push format defined in the v1beta1 Pub/Sub API. + - v1 or v1beta2: uses the push format defined in the v1 Pub/Sub API. diff_suppress_func: 'tpgresource.IgnoreMissingKeyInMap("x-goog-version")' - name: 'noWrapper' type: NestedObject - description: "When set, the payload to the push endpoint is not wrapped.Sets the - `data` field as the HTTP body for delivery." + description: | + When set, the payload to the push endpoint is not wrapped.Sets the + `data` field as the HTTP body for delivery. custom_flatten: 'templates/terraform/custom_flatten/go/pubsub_no_wrapper_write_metadata_flatten.go.tmpl' properties: - name: 'writeMetadata' type: Boolean - description: "When true, writes the Pub/Sub message metadata to - `x-goog-pubsub-:` headers of the HTTP request. Writes the - Pub/Sub message attributes to `:` headers of the HTTP request." + description: | + When true, writes the Pub/Sub message metadata to + `x-goog-pubsub-:` headers of the HTTP request. Writes the + Pub/Sub message attributes to `:` headers of the HTTP request. required: true send_empty_value: true - name: 'ackDeadlineSeconds' @@ -287,124 +316,137 @@ pull and ack messages using API methods." default_from_api: true - name: 'messageRetentionDuration' type: String - description: "How long to retain unacknowledged messages in the subscription's -backlog, from the moment a message is published. If -retain_acked_messages is true, then this also configures the retention -of acknowledged messages, and thus configures how far back in time a -subscriptions.seek can be done. Defaults to 7 days. Cannot be more -than 7 days (`'604800s'`) or less than 10 minutes (`'600s'`). + description: | + How long to retain unacknowledged messages in the subscription's + backlog, from the moment a message is published. If + retain_acked_messages is true, then this also configures the retention + of acknowledged messages, and thus configures how far back in time a + subscriptions.seek can be done. Defaults to 7 days. Cannot be more + than 7 days (`"604800s"`) or less than 10 minutes (`"600s"`). -A duration in seconds with up to nine fractional digits, terminated -by 's'. Example: `'600.5s'`." + A duration in seconds with up to nine fractional digits, terminated + by 's'. Example: `"600.5s"`. default_value: 604800s - name: 'retainAckedMessages' type: Boolean - description: "Indicates whether to retain acknowledged messages. If `true`, then -messages are not expunged from the subscription's backlog, even if -they are acknowledged, until they fall out of the -messageRetentionDuration window." + description: | + Indicates whether to retain acknowledged messages. If `true`, then + messages are not expunged from the subscription's backlog, even if + they are acknowledged, until they fall out of the + messageRetentionDuration window. - name: 'expirationPolicy' type: NestedObject - description: "A policy that specifies the conditions for this subscription's expiration. -A subscription is considered active as long as any connected subscriber -is successfully consuming messages from the subscription or is issuing -operations on the subscription. If expirationPolicy is not set, a default -policy with ttl of 31 days will be used. If it is set but ttl is '', the -resource never expires. The minimum allowed value for expirationPolicy.ttl -is 1 day." + description: | + A policy that specifies the conditions for this subscription's expiration. + A subscription is considered active as long as any connected subscriber + is successfully consuming messages from the subscription or is issuing + operations on the subscription. If expirationPolicy is not set, a default + policy with ttl of 31 days will be used. If it is set but ttl is "", the + resource never expires. The minimum allowed value for expirationPolicy.ttl + is 1 day. default_from_api: true send_empty_value: true allow_empty_object: true properties: - name: 'ttl' type: String - description: "Specifies the 'time-to-live' duration for an associated resource. The - resource expires if it is not active for a period of ttl. - If ttl is set to '', the associated resource never expires. - A duration in seconds with up to nine fractional digits, terminated by 's'. - Example - '3.5s'." + description: | + Specifies the "time-to-live" duration for an associated resource. The + resource expires if it is not active for a period of ttl. + If ttl is set to "", the associated resource never expires. + A duration in seconds with up to nine fractional digits, terminated by 's'. + Example - "3.5s". required: true diff_suppress_func: 'comparePubsubSubscriptionExpirationPolicy' - name: 'filter' type: String - description: "The subscription only delivers the messages that match the filter. -Pub/Sub automatically acknowledges the messages that don't match the filter. You can filter messages -by their attributes. The maximum length of a filter is 256 bytes. After creating the subscription, -you can't modify the filter." + description: | + The subscription only delivers the messages that match the filter. + Pub/Sub automatically acknowledges the messages that don't match the filter. You can filter messages + by their attributes. The maximum length of a filter is 256 bytes. After creating the subscription, + you can't modify the filter. required: false immutable: true - name: 'deadLetterPolicy' type: NestedObject - description: "A policy that specifies the conditions for dead lettering messages in -this subscription. If dead_letter_policy is not set, dead lettering -is disabled. + description: | + A policy that specifies the conditions for dead lettering messages in + this subscription. If dead_letter_policy is not set, dead lettering + is disabled. -The Cloud Pub/Sub service account associated with this subscription's -parent project (i.e., -service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have -permission to Acknowledge() messages on this subscription." + The Cloud Pub/Sub service account associated with this subscription's + parent project (i.e., + service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have + permission to Acknowledge() messages on this subscription. send_empty_value: true properties: - name: 'deadLetterTopic' type: String - description: "The name of the topic to which dead letter messages should be published. - Format is `projects/{project}/topics/{topic}`. + description: | + The name of the topic to which dead letter messages should be published. + Format is `projects/{project}/topics/{topic}`. - The Cloud Pub/Sub service account associated with the enclosing subscription's - parent project (i.e., - service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have - permission to Publish() to this topic. + The Cloud Pub/Sub service account associated with the enclosing subscription's + parent project (i.e., + service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have + permission to Publish() to this topic. - The operation will fail if the topic does not exist. - Users should ensure that there is a subscription attached to this topic - since messages published to a topic with no subscriptions are lost." + The operation will fail if the topic does not exist. + Users should ensure that there is a subscription attached to this topic + since messages published to a topic with no subscriptions are lost. - name: 'maxDeliveryAttempts' type: Integer - description: "The maximum number of delivery attempts for any message. The value must be - between 5 and 100. + description: | + The maximum number of delivery attempts for any message. The value must be + between 5 and 100. - The number of delivery attempts is defined as 1 + (the sum of number of - NACKs and number of times the acknowledgement deadline has been exceeded for the message). + The number of delivery attempts is defined as 1 + (the sum of number of + NACKs and number of times the acknowledgement deadline has been exceeded for the message). - A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that - client libraries may automatically extend ack_deadlines. + A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that + client libraries may automatically extend ack_deadlines. - This field will be honored on a best effort basis. + This field will be honored on a best effort basis. - If this parameter is 0, a default value of 5 is used." + If this parameter is 0, a default value of 5 is used. - name: 'retryPolicy' type: NestedObject - description: "A policy that specifies how Pub/Sub retries message delivery for this subscription. + description: | + A policy that specifies how Pub/Sub retries message delivery for this subscription. -If not set, the default retry policy is applied. This generally implies that messages will be retried as soon as possible for healthy subscribers. -RetryPolicy will be triggered on NACKs or acknowledgement deadline exceeded events for a given message" + If not set, the default retry policy is applied. This generally implies that messages will be retried as soon as possible for healthy subscribers. + RetryPolicy will be triggered on NACKs or acknowledgement deadline exceeded events for a given message properties: - name: 'minimumBackoff' type: String - description: "The minimum delay between consecutive deliveries of a given message. Value should be between 0 and 600 seconds. Defaults to 10 seconds. - A duration in seconds with up to nine fractional digits, terminated by 's'. Example: '3.5s'." + description: | + The minimum delay between consecutive deliveries of a given message. Value should be between 0 and 600 seconds. Defaults to 10 seconds. + A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s". default_from_api: true diff_suppress_func: 'tpgresource.DurationDiffSuppress' - name: 'maximumBackoff' type: String - description: "The maximum delay between consecutive deliveries of a given message. Value should be between 0 and 600 seconds. Defaults to 600 seconds. - A duration in seconds with up to nine fractional digits, terminated by 's'. Example: '3.5s'." + description: | + The maximum delay between consecutive deliveries of a given message. Value should be between 0 and 600 seconds. Defaults to 600 seconds. + A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s". default_from_api: true diff_suppress_func: 'tpgresource.DurationDiffSuppress' - name: 'enableMessageOrdering' type: Boolean - description: "If `true`, messages published with the same orderingKey in PubsubMessage will be delivered to -the subscribers in the order in which they are received by the Pub/Sub system. Otherwise, they -may be delivered in any order." + description: | + If `true`, messages published with the same orderingKey in PubsubMessage will be delivered to + the subscribers in the order in which they are received by the Pub/Sub system. Otherwise, they + may be delivered in any order. immutable: true - name: 'enableExactlyOnceDelivery' type: Boolean - description: "If `true`, Pub/Sub provides the following guarantees for the delivery -of a message with a given value of messageId on this Subscriptions': + description: | + If `true`, Pub/Sub provides the following guarantees for the delivery + of a message with a given value of messageId on this Subscriptions': -- The message sent to a subscriber is guaranteed not to be resent before the message's acknowledgement deadline expires. + - The message sent to a subscriber is guaranteed not to be resent before the message's acknowledgement deadline expires. -- An acknowledged message will not be resent to a subscriber. + - An acknowledged message will not be resent to a subscriber. -Note that subscribers may still receive multiple copies of a message when `enable_exactly_once_delivery` -is true if the message was published multiple times by a publisher client. These copies are considered distinct by Pub/Sub and have distinct messageId values" + Note that subscribers may still receive multiple copies of a message when `enable_exactly_once_delivery` + is true if the message was published multiple times by a publisher client. These copies are considered distinct by Pub/Sub and have distinct messageId values diff --git a/mmv1/products/pubsub/go_Topic.yaml b/mmv1/products/pubsub/go_Topic.yaml index 8bf902dd89c2..3ea5c47c4fd3 100644 --- a/mmv1/products/pubsub/go_Topic.yaml +++ b/mmv1/products/pubsub/go_Topic.yaml @@ -24,6 +24,12 @@ docs: note: | You can retrieve the email of the Google Managed Pub/Sub Service Account used for forwarding by using the `google_project_service_identity` resource. + # PubSub resources don't have operations but are negatively cached + # and eventually consistent. + # Because some users check whether the PubSub resource exists prior + # to applying a new resource, we need to add this PollAsync to GET the + # resource until it exists and the negative cached result goes away. + # Context: hashicorp/terraform-provider-google#4993 base_url: 'projects/{{project}}/topics' create_verb: 'PUT' update_url: 'projects/{{project}}/topics/{{name}}' @@ -39,6 +45,7 @@ async: check_response_func_absence: 'transport_tpg.PollCheckForAbsence' suppress_error: true target_occurrences: 1 + actions: ['create'] iam_policy: method_name_separator: ':' parent_resource_attribute: 'topic' @@ -72,11 +79,15 @@ examples: schema_name: 'example' test_env_vars: project_name: 'PROJECT_NAME' + - name: 'pubsub_topic_ingestion_kinesis' + primary_resource_id: 'example' + vars: + topic_name: 'example-topic' parameters: properties: - name: 'name' type: String - description: "Name of the topic." + description: 'Name of the topic.' required: true immutable: true diff_suppress_func: 'tpgresource.CompareSelfLinkOrResourceName' @@ -84,62 +95,104 @@ properties: custom_expand: 'templates/terraform/custom_expand/go/resource_from_self_link.go.tmpl' - name: 'kmsKeyName' type: String - description: "The resource name of the Cloud KMS CryptoKey to be used to protect access -to messages published on this topic. Your project's PubSub service account -(`service-{{PROJECT_NUMBER}}@gcp-sa-pubsub.iam.gserviceaccount.com`) must have -`roles/cloudkms.cryptoKeyEncrypterDecrypter` to use this feature. -The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`" + description: | + The resource name of the Cloud KMS CryptoKey to be used to protect access + to messages published on this topic. Your project's PubSub service account + (`service-{{PROJECT_NUMBER}}@gcp-sa-pubsub.iam.gserviceaccount.com`) must have + `roles/cloudkms.cryptoKeyEncrypterDecrypter` to use this feature. + The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*` - name: 'labels' type: KeyValueLabels - description: "A set of key/value label pairs to assign to this Topic. -" + description: | + A set of key/value label pairs to assign to this Topic. immutable: false - name: 'messageStoragePolicy' type: NestedObject - description: "Policy constraining the set of Google Cloud Platform regions where -messages published to the topic may be stored. If not present, then no -constraints are in effect." + description: | + Policy constraining the set of Google Cloud Platform regions where + messages published to the topic may be stored. If not present, then no + constraints are in effect. default_from_api: true properties: - name: 'allowedPersistenceRegions' type: Array - description: "A list of IDs of GCP regions where messages that are published to - the topic may be persisted in storage. Messages published by - publishers running in non-allowed GCP regions (or running outside - of GCP altogether) will be routed for storage in one of the - allowed regions. An empty list means that no regions are allowed, - and is not a valid configuration." + description: | + A list of IDs of GCP regions where messages that are published to + the topic may be persisted in storage. Messages published by + publishers running in non-allowed GCP regions (or running outside + of GCP altogether) will be routed for storage in one of the + allowed regions. An empty list means that no regions are allowed, + and is not a valid configuration. required: true - item_type: + item_type: type: String - name: 'schemaSettings' type: NestedObject - description: "Settings for validating messages published against a schema." + description: | + Settings for validating messages published against a schema. default_from_api: true properties: - name: 'schema' type: String - description: "The name of the schema that messages published should be - validated against. Format is projects/{project}/schemas/{schema}. - The value of this field will be _deleted-schema_ - if the schema has been deleted." + description: | + The name of the schema that messages published should be + validated against. Format is projects/{project}/schemas/{schema}. + The value of this field will be _deleted-schema_ + if the schema has been deleted. required: true - name: 'encoding' type: Enum - description: "The encoding of messages validated against schema." + description: The encoding of messages validated against schema. default_value: ENCODING_UNSPECIFIED enum_values: - 'ENCODING_UNSPECIFIED' - 'JSON' - 'BINARY' - - '' - name: 'messageRetentionDuration' type: String - description: "Indicates the minimum duration to retain a message after it is published -to the topic. If this field is set, messages published to the topic in -the last messageRetentionDuration are always available to subscribers. -For instance, it allows any attached subscription to seek to a timestamp -that is up to messageRetentionDuration in the past. If this field is not -set, message retention is controlled by settings on individual subscriptions. -The rotation period has the format of a decimal number, followed by the -letter `s` (seconds). Cannot be more than 31 days or less than 10 minutes." + description: | + Indicates the minimum duration to retain a message after it is published + to the topic. If this field is set, messages published to the topic in + the last messageRetentionDuration are always available to subscribers. + For instance, it allows any attached subscription to seek to a timestamp + that is up to messageRetentionDuration in the past. If this field is not + set, message retention is controlled by settings on individual subscriptions. + The rotation period has the format of a decimal number, followed by the + letter `s` (seconds). Cannot be more than 31 days or less than 10 minutes. + - name: 'ingestionDataSourceSettings' + type: NestedObject + description: | + Settings for ingestion from a data source into this topic. + properties: + - name: 'awsKinesis' + type: NestedObject + description: | + Settings for ingestion from Amazon Kinesis Data Streams. + properties: + - name: 'streamArn' + type: String + description: | + The Kinesis stream ARN to ingest data from. + required: true + - name: 'consumerArn' + type: String + description: | + The Kinesis consumer ARN to used for ingestion in + Enhanced Fan-Out mode. The consumer must be already + created and ready to be used. + required: true + - name: 'awsRoleArn' + type: String + description: | + AWS role ARN to be used for Federated Identity authentication with + Kinesis. Check the Pub/Sub docs for how to set up this role and the + required permissions that need to be attached to it. + required: true + - name: 'gcpServiceAccount' + type: String + description: | + The GCP service account to be used for Federated Identity authentication + with Kinesis (via a `AssumeRoleWithWebIdentity` call for the provided + role). The `awsRoleArn` must be set up with `accounts.google.com:sub` + equals to this service account number. + required: true diff --git a/mmv1/templates/terraform/examples/base_configs/iam_test_file.go.tmpl b/mmv1/templates/terraform/examples/base_configs/iam_test_file.go.tmpl index 748e9d1ddcd5..80e05c9afce9 100644 --- a/mmv1/templates/terraform/examples/base_configs/iam_test_file.go.tmpl +++ b/mmv1/templates/terraform/examples/base_configs/iam_test_file.go.tmpl @@ -1,4 +1,3 @@ -{{/* <% if hc_downstream */ -}} // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 diff --git a/mmv1/templates/terraform/examples/go/pubsub_subscription_push_cloudstorage.tf.tmpl b/mmv1/templates/terraform/examples/go/pubsub_subscription_push_cloudstorage.tf.tmpl index e86725487dc4..07543bc458d0 100644 --- a/mmv1/templates/terraform/examples/go/pubsub_subscription_push_cloudstorage.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/pubsub_subscription_push_cloudstorage.tf.tmpl @@ -17,11 +17,12 @@ resource "google_pubsub_subscription" "{{$.PrimaryResourceId}}" { filename_prefix = "pre-" filename_suffix = "-%{random_suffix}" - + filename_datetime_format = "YYYY-MM-DD/hh_mm_ssZ" + max_bytes = 1000 max_duration = "300s" } - depends_on = [ + depends_on = [ google_storage_bucket.{{$.PrimaryResourceId}}, google_storage_bucket_iam_member.admin, ] diff --git a/mmv1/templates/terraform/examples/go/pubsub_subscription_push_cloudstorage_avro.tf.tmpl b/mmv1/templates/terraform/examples/go/pubsub_subscription_push_cloudstorage_avro.tf.tmpl index 273081424975..4d78207e4c9f 100644 --- a/mmv1/templates/terraform/examples/go/pubsub_subscription_push_cloudstorage_avro.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/pubsub_subscription_push_cloudstorage_avro.tf.tmpl @@ -17,15 +17,16 @@ resource "google_pubsub_subscription" "{{$.PrimaryResourceId}}" { filename_prefix = "pre-" filename_suffix = "-%{random_suffix}" - + filename_datetime_format = "YYYY-MM-DD/hh_mm_ssZ" + max_bytes = 1000 max_duration = "300s" - + avro_config { write_metadata = true } } - depends_on = [ + depends_on = [ google_storage_bucket.{{$.PrimaryResourceId}}, google_storage_bucket_iam_member.admin, ] diff --git a/mmv1/templates/terraform/nested_property_documentation.html.markdown.tmpl b/mmv1/templates/terraform/nested_property_documentation.html.markdown.tmpl index 05c013f0a221..f451327fe851 100644 --- a/mmv1/templates/terraform/nested_property_documentation.html.markdown.tmpl +++ b/mmv1/templates/terraform/nested_property_documentation.html.markdown.tmpl @@ -8,11 +8,11 @@ {{ if $.IsA "Map" }} * `{{ underscore $.KeyName }}` - (Required) The identifier for this object. Format specified above. {{- end}} - {{- end}} - {{- range $np := $.NestedProperties }} -{{- template "propertyDocumentation" $np -}} - {{- end}} - {{- range $np := $.NestedProperties }} + {{- range $np := $.NestedProperties }} +{{- template "propertyDocumentation" $np }} + {{- end }} + {{- range $np := $.NestedProperties }} {{- template "nestedPropertyDocumentation" $np -}} + {{- end}} {{- end}} {{- end}} \ No newline at end of file diff --git a/mmv1/templates/terraform/resource.html.markdown.tmpl b/mmv1/templates/terraform/resource.html.markdown.tmpl index a9bb6ee8ab17..ab8c9a1fe58b 100644 --- a/mmv1/templates/terraform/resource.html.markdown.tmpl +++ b/mmv1/templates/terraform/resource.html.markdown.tmpl @@ -97,7 +97,7 @@ The following arguments are supported: {{- end }} {{- end }} -{{- range $p := $.AllNestedProperties $.RootProperties }} +{{- range $p := $.AllUserProperties }} {{- if $p.Required }} {{- template "nestedPropertyDocumentation" $p}} {{- end}} @@ -120,7 +120,7 @@ The following arguments are supported: {{ if $.Docs.OptionalProperties }} {{ $.Docs.OptionalProperties }} {{- end }} -{{- range $p := $.AllNestedProperties $.RootProperties }} +{{- range $p := $.AllUserProperties }} {{- if and (not $p.Required) (not $p.Output) }} {{- template "nestedPropertyDocumentation" $p -}} {{ end}} @@ -138,7 +138,7 @@ In addition to the arguments listed above, the following computed attributes are {{- if $.HasSelfLink }} * `self_link` - The URI of the created resource. {{- end }} -{{ range $p := $.AllNestedProperties $.RootProperties }} +{{ range $p := $.AllUserProperties }} {{- if $p.Output }} {{- template "nestedPropertyDocumentation" $p -}} {{- end }} diff --git a/mmv1/templates/terraform/update_mask.go.tmpl b/mmv1/templates/terraform/update_mask.go.tmpl index 98a47f4f2194..b4bca9377c55 100644 --- a/mmv1/templates/terraform/update_mask.go.tmpl +++ b/mmv1/templates/terraform/update_mask.go.tmpl @@ -12,11 +12,13 @@ */}} {{- define "UpdateMask" }} updateMask := []string{} -{{- range $field, $masks := $.GetPropertyUpdateMasksGroups }} -if d.HasChange("{{ $field }}") { - updateMask = append(updateMask, {{ join $masks ","}}) +{{- $maskGroups := $.GetPropertyUpdateMasksGroups $.UpdateBodyProperties "" }} +{{- range $key := $.GetPropertyUpdateMasksGroupKeys $.UpdateBodyProperties }} + +if d.HasChange("{{ $key }}") { + updateMask = append(updateMask, "{{ join (index $maskGroups $key) "\",\""}}") } -{{ end }} +{{- end }} // updateMask is a URL parameter but not present in the schema, so ReplaceVars // won't set it url, err = transport_tpg.AddQueryParams(url, map[string]string{"updateMask": strings.Join(updateMask, ",")}) diff --git a/mmv1/third_party/terraform/go.mod b/mmv1/third_party/terraform/go.mod index 26e6f46d5d43..8fa4bcaf42e6 100644 --- a/mmv1/third_party/terraform/go.mod +++ b/mmv1/third_party/terraform/go.mod @@ -97,7 +97,7 @@ require ( go.opentelemetry.io/otel v1.24.0 // indirect go.opentelemetry.io/otel/metric v1.24.0 // indirect go.opentelemetry.io/otel/trace v1.24.0 // indirect - go4.org/netipx v0.0.0-20231129151722-fdeea329fbba + go4.org/netipx v0.0.0-20231129151722-fdeea329fbba // indirect golang.org/x/crypto v0.22.0 // indirect golang.org/x/mod v0.17.0 // indirect golang.org/x/sync v0.7.0 // indirect From 166a845fe8d9b11348b9091a25b24360aa40e6f2 Mon Sep 17 00:00:00 2001 From: Cameron Thornton Date: Mon, 3 Jun 2024 10:03:13 -0500 Subject: [PATCH 2/5] whitespace --- mmv1/products/pubsub/go_Topic.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmv1/products/pubsub/go_Topic.yaml b/mmv1/products/pubsub/go_Topic.yaml index 3ea5c47c4fd3..32c9ce54bce2 100644 --- a/mmv1/products/pubsub/go_Topic.yaml +++ b/mmv1/products/pubsub/go_Topic.yaml @@ -124,7 +124,7 @@ properties: allowed regions. An empty list means that no regions are allowed, and is not a valid configuration. required: true - item_type: + item_type: type: String - name: 'schemaSettings' type: NestedObject From 2bf24df4eceb5e3456be10114a44d5cdb716a9d9 Mon Sep 17 00:00:00 2001 From: Cameron Thornton Date: Mon, 3 Jun 2024 11:12:32 -0500 Subject: [PATCH 3/5] couple more --- mmv1/products/pubsub/go_Subscription.yaml | 10 ++++++---- mmv1/provider/terraform.go | 17 +---------------- 2 files changed, 7 insertions(+), 20 deletions(-) diff --git a/mmv1/products/pubsub/go_Subscription.yaml b/mmv1/products/pubsub/go_Subscription.yaml index d5c03dddf7d2..3ee6f3eb70fa 100644 --- a/mmv1/products/pubsub/go_Subscription.yaml +++ b/mmv1/products/pubsub/go_Subscription.yaml @@ -133,15 +133,17 @@ properties: description: | When true, use the topic's schema as the columns to write to in BigQuery, if it exists. Only one of use_topic_schema and use_table_schema can be set. - conflicts: - - use_table_schema + # Not present in Ruby version + # conflicts: + # - use_table_schema - name: 'useTableSchema' type: Boolean description: | When true, use the BigQuery table's schema as the columns to write to in BigQuery. Messages must be published in JSON format. Only one of use_topic_schema and use_table_schema can be set. - conflicts: - - use_topic_schema + # Not present in Ruby version + # conflicts: + # - use_topic_schema - name: 'writeMetadata' type: Boolean description: | diff --git a/mmv1/provider/terraform.go b/mmv1/provider/terraform.go index e610c44769d8..04d71840afff 100644 --- a/mmv1/provider/terraform.go +++ b/mmv1/provider/terraform.go @@ -90,22 +90,7 @@ func (t *Terraform) Generate(outputFolder, productPath string, generateCode, gen func (t *Terraform) GenerateObjects(outputFolder string, generateCode, generateDocs bool) { for _, object := range t.Product.Objects { - // TODO Q2: Exclude objects - // if !types.empty? && !types.include?(object.name) - // Google::LOGGER.info "Excluding #{object.name} per user request" - // elsif types.empty? && object.exclude - // Google::LOGGER.info "Excluding #{object.name} per API catalog" - // elsif types.empty? && object.not_in_version?(@version) - // Google::LOGGER.info "Excluding #{object.name} per API version" - // else - // Google::LOGGER.info "Generating #{object.name}" - // # exclude_if_not_in_version must be called in order to filter out - // # beta properties that are nested within GA resources - // object.exclude_if_not_in_version!(@version) - // - // # Make object immutable. - // object.freeze - // object.all_user_properties.each(&:freeze) + object.ExcludeIfNotInVersion(&t.Version) t.GenerateObject(*object, outputFolder, t.TargetVersionName, generateCode, generateDocs) } From 3c47d694de8896c2e30652a199491611e603007a Mon Sep 17 00:00:00 2001 From: Cameron Thornton Date: Mon, 3 Jun 2024 11:13:14 -0500 Subject: [PATCH 4/5] Switchover command --- GNUmakefile | 1 + mmv1/products/datafusion/Instance.yaml | 3 +++ mmv1/products/datafusion/product.yaml | 3 +++ mmv1/products/pubsub/Schema.yaml | 3 +++ mmv1/products/pubsub/Subscription.yaml | 3 +++ mmv1/products/pubsub/Topic.yaml | 3 +++ mmv1/products/pubsub/go_Topic.yaml | 1 - mmv1/products/pubsub/go_product.yaml | 1 - mmv1/products/pubsub/product.yaml | 3 +++ 9 files changed, 19 insertions(+), 2 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 905ed552009c..55e94786f576 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -68,6 +68,7 @@ mmv1: bundle exec compiler.rb -e terraform -o $(OUTPUT_PATH) -v beta --no-code $(mmv1_compile); \ else \ bundle exec compiler.rb -e terraform -o $(OUTPUT_PATH) -v $(VERSION) $(mmv1_compile); \ + go run . --version $(VERSION) --output $(OUTPUT_PATH); \ fi tpgtools: diff --git a/mmv1/products/datafusion/Instance.yaml b/mmv1/products/datafusion/Instance.yaml index ccd0efd1c762..2d45a9d400ff 100644 --- a/mmv1/products/datafusion/Instance.yaml +++ b/mmv1/products/datafusion/Instance.yaml @@ -11,6 +11,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +# Warning: This is a deprecated file, please edit the go_ version in the same +# directory + --- !ruby/object:Api::Resource name: 'Instance' base_url: 'projects/{{project}}/locations/{{region}}/instances' diff --git a/mmv1/products/datafusion/product.yaml b/mmv1/products/datafusion/product.yaml index b358c9be12ae..d4a7867e78ad 100644 --- a/mmv1/products/datafusion/product.yaml +++ b/mmv1/products/datafusion/product.yaml @@ -11,6 +11,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +# Warning: This is a deprecated file, please edit the go_ version in the same +# directory + --- !ruby/object:Api::Product name: DataFusion display_name: Cloud Data Fusion diff --git a/mmv1/products/pubsub/Schema.yaml b/mmv1/products/pubsub/Schema.yaml index b5faf6addc98..6ac4e0a4c6f0 100644 --- a/mmv1/products/pubsub/Schema.yaml +++ b/mmv1/products/pubsub/Schema.yaml @@ -11,6 +11,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +# Warning: This is a deprecated file, please edit the go_ version in the same +# directory + --- !ruby/object:Api::Resource name: 'Schema' description: | diff --git a/mmv1/products/pubsub/Subscription.yaml b/mmv1/products/pubsub/Subscription.yaml index 97a17de701cd..c08d2c9de948 100644 --- a/mmv1/products/pubsub/Subscription.yaml +++ b/mmv1/products/pubsub/Subscription.yaml @@ -11,6 +11,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +# Warning: This is a deprecated file, please edit the go_ version in the same +# directory + --- !ruby/object:Api::Resource name: 'Subscription' description: | diff --git a/mmv1/products/pubsub/Topic.yaml b/mmv1/products/pubsub/Topic.yaml index 5fff52cff69f..015401732a8d 100644 --- a/mmv1/products/pubsub/Topic.yaml +++ b/mmv1/products/pubsub/Topic.yaml @@ -11,6 +11,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +# Warning: This is a deprecated file, please edit the go_ version in the same +# directory + --- !ruby/object:Api::Resource name: 'Topic' description: | diff --git a/mmv1/products/pubsub/go_Topic.yaml b/mmv1/products/pubsub/go_Topic.yaml index 32c9ce54bce2..dd0bde3d488f 100644 --- a/mmv1/products/pubsub/go_Topic.yaml +++ b/mmv1/products/pubsub/go_Topic.yaml @@ -11,7 +11,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Warning: This is a temporary file, and should not be edited directly --- name: 'Topic' description: | diff --git a/mmv1/products/pubsub/go_product.yaml b/mmv1/products/pubsub/go_product.yaml index f3f63389edd2..60178155da8e 100644 --- a/mmv1/products/pubsub/go_product.yaml +++ b/mmv1/products/pubsub/go_product.yaml @@ -11,7 +11,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Warning: This is a temporary file, and should not be edited directly --- name: 'Pubsub' display_name: 'Cloud Pub/Sub' diff --git a/mmv1/products/pubsub/product.yaml b/mmv1/products/pubsub/product.yaml index fee2f465bb07..39b64b01e7fd 100644 --- a/mmv1/products/pubsub/product.yaml +++ b/mmv1/products/pubsub/product.yaml @@ -11,6 +11,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +# Warning: This is a deprecated file, please edit the go_ version in the same +# directory + --- !ruby/object:Api::Product name: Pubsub display_name: Cloud Pub/Sub From 001d5f3f3bda25149f3ca5084844fc654e9b9dfa Mon Sep 17 00:00:00 2001 From: Cameron Thornton Date: Mon, 3 Jun 2024 11:21:59 -0500 Subject: [PATCH 5/5] remove warning lines --- mmv1/products/datafusion/go_Instance.yaml | 1 - mmv1/products/datafusion/go_product.yaml | 1 - mmv1/products/pubsub/go_Schema.yaml | 1 - mmv1/products/pubsub/go_Subscription.yaml | 1 - 4 files changed, 4 deletions(-) diff --git a/mmv1/products/datafusion/go_Instance.yaml b/mmv1/products/datafusion/go_Instance.yaml index fd14261d37be..ea834d3eaf56 100644 --- a/mmv1/products/datafusion/go_Instance.yaml +++ b/mmv1/products/datafusion/go_Instance.yaml @@ -11,7 +11,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Warning: This is a temporary file, and should not be edited directly --- name: 'Instance' description: | diff --git a/mmv1/products/datafusion/go_product.yaml b/mmv1/products/datafusion/go_product.yaml index 25150a0626c8..a09292369f4c 100644 --- a/mmv1/products/datafusion/go_product.yaml +++ b/mmv1/products/datafusion/go_product.yaml @@ -11,7 +11,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Warning: This is a temporary file, and should not be edited directly --- name: 'DataFusion' display_name: 'Cloud Data Fusion' diff --git a/mmv1/products/pubsub/go_Schema.yaml b/mmv1/products/pubsub/go_Schema.yaml index 46ee0533179b..005faa1d495e 100644 --- a/mmv1/products/pubsub/go_Schema.yaml +++ b/mmv1/products/pubsub/go_Schema.yaml @@ -11,7 +11,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Warning: This is a temporary file, and should not be edited directly --- name: 'Schema' description: | diff --git a/mmv1/products/pubsub/go_Subscription.yaml b/mmv1/products/pubsub/go_Subscription.yaml index 3ee6f3eb70fa..00252ef37bf4 100644 --- a/mmv1/products/pubsub/go_Subscription.yaml +++ b/mmv1/products/pubsub/go_Subscription.yaml @@ -11,7 +11,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Warning: This is a temporary file, and should not be edited directly --- name: 'Subscription' description: |