Skip to content

Commit

Permalink
Update serializer to remove unused async fields (#12517)
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottSuarez authored Jan 24, 2025
1 parent fc8e41c commit 22c37cf
Show file tree
Hide file tree
Showing 9 changed files with 1 addition and 67 deletions.
32 changes: 0 additions & 32 deletions mmv1/api/async.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
"log"
"strings"

"github.com/GoogleCloudPlatform/magic-modules/mmv1/google"
"golang.org/x/exp/slices"
)

Expand Down Expand Up @@ -72,52 +71,21 @@ func NewAsync() *Async {
type OpAsync struct {
Result OpAsyncResult

Status OpAsyncStatus `yaml:"status,omitempty"`

Error OpAsyncError

// If true, include project as an argument to OperationWaitTime.
// It is intended for resources that calculate project/region from a selflink field
IncludeProject bool `yaml:"include_project"`
}

type OpAsyncOperation struct {
Kind string `yaml:"kind,omitempty"`

Path string `yaml:"path,omitempty"`

BaseUrl string `yaml:"base_url,omitempty"`

WaitMs int `yaml:"wait_ms,omitempty"`

// Use this if the resource includes the full operation url.
FullUrl string `yaml:"full_url,omitempty"`
}

// Represents the results of an Operation request
type OpAsyncResult struct {
ResourceInsideResponse bool `yaml:"resource_inside_response,omitempty"`

Path string `yaml:"path,omitempty"`
}

// Provides information to parse the result response to check operation
// status
type OpAsyncStatus struct {
Path string `yaml:"path,omitempty"`

Complete bool `yaml:"complete,omitempty"`

Allowed []bool `yaml:"allowed,omitempty"`
}

// Provides information on how to retrieve errors of the executed operations
type OpAsyncError struct {
google.YamlValidator `yaml:"-"`

Path string `yaml:"path,omitempty"`

Message string `yaml:"message,omitempty"`
}

// Async implementation for polling in Terraform
Expand Down
1 change: 0 additions & 1 deletion mmv1/products/apihub/ApiHubInstance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ async:
type: OpAsync
result:
resource_inside_response: true
error: {}
include_project: false
autogen_status: QXBpSHViSW5zdGFuY2U=
parameters:
Expand Down
1 change: 0 additions & 1 deletion mmv1/products/beyondcorp/SecurityGateway.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ async:
type: OpAsync
result:
resource_inside_response: true
error: {}
include_project: false
autogen_status: U2VjdXJpdHlHYXRld2F5
parameters:
Expand Down
1 change: 0 additions & 1 deletion mmv1/products/developerconnect/Connection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ async:
type: OpAsync
result:
resource_inside_response: true
error: {}
include_project: false
autogen_status: Q29ubmVjdGlvbg==
parameters:
Expand Down
6 changes: 0 additions & 6 deletions mmv1/products/edgenetwork/InterconnectAttachment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,8 @@ async:
type: 'OpAsync'
operation:
base_url: '{{op_id}}'
path: 'name'
wait_ms: 1000
result:
path: 'response'
resource_inside_response: false
error:
path: 'error'
message: 'message'
examples:
- name: 'edgenetwork_interconnect_attachment'
primary_resource_id: 'example_interconnect_attachment'
Expand Down
9 changes: 1 addition & 8 deletions mmv1/products/gkeonprem/VmwareAdminCluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ description: "A Google VMware Admin Cluster."
exclude_delete: true
id_format: "projects/{{project}}/locations/{{location}}/vmwareAdminClusters/{{name}}"
import_format: ["projects/{{project}}/locations/{{location}}/vmwareAdminClusters/{{name}}"]
timeouts: !ruby/object:Api::Timeouts
timeouts:
insert_minutes: 60
delete_minutes: 60
update_minutes: 60
Expand All @@ -33,15 +33,8 @@ async:
type: 'OpAsync'
operation:
base_url: '{{op_id}}'
kind: 'gkeonprem#operation'
path: 'name'
wait_ms: 1000
result:
path: 'response'
resource_inside_response: true
error:
path: 'error'
message: 'message'
custom_code:
taint_resource_on_failed_create: true
examples:
Expand Down
6 changes: 0 additions & 6 deletions mmv1/products/networksecurity/InterceptDeployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,8 @@ async:
type: 'OpAsync'
operation:
base_url: '{{op_id}}'
path: 'name'
wait_ms: 1000
result:
path: 'response'
resource_inside_response: true
error:
path: 'error'
message: 'message'
custom_code:
examples:
- name: 'network_security_intercept_deployment_basic'
Expand Down
6 changes: 0 additions & 6 deletions mmv1/products/networksecurity/InterceptEndpointGroup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,8 @@ async:
type: 'OpAsync'
operation:
base_url: '{{op_id}}'
path: 'name'
wait_ms: 1000
result:
path: 'response'
resource_inside_response: true
error:
path: 'error'
message: 'message'
custom_code:
examples:
- name: 'network_security_intercept_endpoint_group_basic'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,8 @@ async:
type: 'OpAsync'
operation:
base_url: '{{op_id}}'
path: 'name'
wait_ms: 1000
result:
path: 'response'
resource_inside_response: true
error:
path: 'error'
message: 'message'
custom_code:
examples:
- name: 'network_security_intercept_endpoint_group_association_basic'
Expand Down

0 comments on commit 22c37cf

Please sign in to comment.