From 190bcadd8bd6477adbc3f3eb5afe9219ca1309ac Mon Sep 17 00:00:00 2001 From: Evan Phoenix Date: Wed, 1 Nov 2023 12:49:19 -0700 Subject: [PATCH] Remove mis-pathed and duplicated models for cloud-shared --- .../v1/models/google_protobuf_any.go | 160 -------- .../v1/models/google_protobuf_field_mask.go | 248 ------------ .../v1/models/google_rpc_status.go | 184 --------- .../v1/models/grpc_gateway_runtime_error.go | 130 ------- .../grpc_gateway_runtime_stream_error.go | 133 ------- ...shicorp_cloud_common_pagination_request.go | 63 --- ...hicorp_cloud_common_pagination_response.go | 61 --- .../hashicorp_cloud_common_sorting_request.go | 59 --- .../models/hashicorp_cloud_location_link.go | 126 ------ .../hashicorp_cloud_location_location.go | 116 ------ .../models/hashicorp_cloud_location_region.go | 53 --- .../hashicorp_cloud_operation_operation.go | 363 ------------------ ...shicorp_cloud_operation_operation_state.go | 89 ----- 13 files changed, 1785 deletions(-) delete mode 100644 clients/cloud-shared/cloud-shared/v1/models/google_protobuf_any.go delete mode 100644 clients/cloud-shared/cloud-shared/v1/models/google_protobuf_field_mask.go delete mode 100644 clients/cloud-shared/cloud-shared/v1/models/google_rpc_status.go delete mode 100644 clients/cloud-shared/cloud-shared/v1/models/grpc_gateway_runtime_error.go delete mode 100644 clients/cloud-shared/cloud-shared/v1/models/grpc_gateway_runtime_stream_error.go delete mode 100644 clients/cloud-shared/cloud-shared/v1/models/hashicorp_cloud_common_pagination_request.go delete mode 100644 clients/cloud-shared/cloud-shared/v1/models/hashicorp_cloud_common_pagination_response.go delete mode 100644 clients/cloud-shared/cloud-shared/v1/models/hashicorp_cloud_common_sorting_request.go delete mode 100644 clients/cloud-shared/cloud-shared/v1/models/hashicorp_cloud_location_link.go delete mode 100644 clients/cloud-shared/cloud-shared/v1/models/hashicorp_cloud_location_location.go delete mode 100644 clients/cloud-shared/cloud-shared/v1/models/hashicorp_cloud_location_region.go delete mode 100644 clients/cloud-shared/cloud-shared/v1/models/hashicorp_cloud_operation_operation.go delete mode 100644 clients/cloud-shared/cloud-shared/v1/models/hashicorp_cloud_operation_operation_state.go diff --git a/clients/cloud-shared/cloud-shared/v1/models/google_protobuf_any.go b/clients/cloud-shared/cloud-shared/v1/models/google_protobuf_any.go deleted file mode 100644 index ac8f429b..00000000 --- a/clients/cloud-shared/cloud-shared/v1/models/google_protobuf_any.go +++ /dev/null @@ -1,160 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// GoogleProtobufAny `Any` contains an arbitrary serialized protocol buffer message along with a -// URL that describes the type of the serialized message. -// -// Protobuf library provides support to pack/unpack Any values in the form -// of utility functions or additional generated methods of the Any type. -// -// Example 1: Pack and unpack a message in C++. -// -// Foo foo = ...; -// Any any; -// any.PackFrom(foo); -// ... -// if (any.UnpackTo(&foo)) { -// ... -// } -// -// Example 2: Pack and unpack a message in Java. -// -// Foo foo = ...; -// Any any = Any.pack(foo); -// ... -// if (any.is(Foo.class)) { -// foo = any.unpack(Foo.class); -// } -// -// Example 3: Pack and unpack a message in Python. -// -// foo = Foo(...) -// any = Any() -// any.Pack(foo) -// ... -// if any.Is(Foo.DESCRIPTOR): -// any.Unpack(foo) -// ... -// -// Example 4: Pack and unpack a message in Go -// -// foo := &pb.Foo{...} -// any, err := anypb.New(foo) -// if err != nil { -// ... -// } -// ... -// foo := &pb.Foo{} -// if err := any.UnmarshalTo(foo); err != nil { -// ... -// } -// -// The pack methods provided by protobuf library will by default use -// 'type.googleapis.com/full.type.name' as the type URL and the unpack -// methods only use the fully qualified type name after the last '/' -// in the type URL, for example "foo.bar.com/x/y.z" will yield type -// name "y.z". -// -// JSON -// ==== -// The JSON representation of an `Any` value uses the regular -// representation of the deserialized, embedded message, with an -// additional field `@type` which contains the type URL. Example: -// -// package google.profile; -// message Person { -// string first_name = 1; -// string last_name = 2; -// } -// -// { -// "@type": "type.googleapis.com/google.profile.Person", -// "firstName": , -// "lastName": -// } -// -// If the embedded message type is well-known and has a custom JSON -// representation, that representation will be embedded adding a field -// `value` which holds the custom JSON in addition to the `@type` -// field. Example (for message [google.protobuf.Duration][]): -// -// { -// "@type": "type.googleapis.com/google.protobuf.Duration", -// "value": "1.212s" -// } -// -// swagger:model google.protobuf.Any -type GoogleProtobufAny struct { - - // A URL/resource name that uniquely identifies the type of the serialized - // protocol buffer message. This string must contain at least - // one "/" character. The last segment of the URL's path must represent - // the fully qualified name of the type (as in - // `path/google.protobuf.Duration`). The name should be in a canonical form - // (e.g., leading "." is not accepted). - // - // In practice, teams usually precompile into the binary all types that they - // expect it to use in the context of Any. However, for URLs which use the - // scheme `http`, `https`, or no scheme, one can optionally set up a type - // server that maps type URLs to message definitions as follows: - // - // * If no scheme is provided, `https` is assumed. - // * An HTTP GET on the URL must yield a [google.protobuf.Type][] - // value in binary format, or produce an error. - // * Applications are allowed to cache lookup results based on the - // URL, or have them precompiled into a binary to avoid any - // lookup. Therefore, binary compatibility needs to be preserved - // on changes to types. (Use versioned type names to manage - // breaking changes.) - // - // Note: this functionality is not currently available in the official - // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. - // - // Schemes other than `http`, `https` (or the empty scheme) might be - // used with implementation specific semantics. - TypeURL string `json:"type_url,omitempty"` - - // Must be a valid serialized protocol buffer of the above specified type. - // Format: byte - Value strfmt.Base64 `json:"value,omitempty"` -} - -// Validate validates this google protobuf any -func (m *GoogleProtobufAny) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this google protobuf any based on context it is used -func (m *GoogleProtobufAny) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *GoogleProtobufAny) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *GoogleProtobufAny) UnmarshalBinary(b []byte) error { - var res GoogleProtobufAny - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/clients/cloud-shared/cloud-shared/v1/models/google_protobuf_field_mask.go b/clients/cloud-shared/cloud-shared/v1/models/google_protobuf_field_mask.go deleted file mode 100644 index b92c61a3..00000000 --- a/clients/cloud-shared/cloud-shared/v1/models/google_protobuf_field_mask.go +++ /dev/null @@ -1,248 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// GoogleProtobufFieldMask `FieldMask` represents a set of symbolic field paths, for example: -// -// paths: "f.a" -// -// paths: "f.b.d" -// -// Here `f` represents a field in some root message, `a` and `b` -// fields in the message found in `f`, and `d` a field found in the -// message in `f.b`. -// -// Field masks are used to specify a subset of fields that should be -// returned by a get operation or modified by an update operation. -// Field masks also have a custom JSON encoding (see below). -// -// # Field Masks in Projections -// -// When used in the context of a projection, a response message or -// sub-message is filtered by the API to only contain those fields as -// specified in the mask. For example, if the mask in the previous -// example is applied to a response message as follows: -// -// f { -// a : 22 -// b { -// d : 1 -// x : 2 -// } -// y : 13 -// } -// z: 8 -// -// The result will not contain specific values for fields x,y and z -// (their value will be set to the default, and omitted in proto text -// output): -// -// f { -// a : 22 -// b { -// d : 1 -// } -// } -// -// A repeated field is not allowed except at the last position of a -// paths string. -// -// If a FieldMask object is not present in a get operation, the -// operation applies to all fields (as if a FieldMask of all fields -// had been specified). -// -// Note that a field mask does not necessarily apply to the -// top-level response message. In case of a REST get operation, the -// field mask applies directly to the response, but in case of a REST -// list operation, the mask instead applies to each individual message -// in the returned resource list. In case of a REST custom method, -// other definitions may be used. Where the mask applies will be -// clearly documented together with its declaration in the API. In -// any case, the effect on the returned resource/resources is required -// behavior for APIs. -// -// # Field Masks in Update Operations -// -// A field mask in update operations specifies which fields of the -// targeted resource are going to be updated. The API is required -// to only change the values of the fields as specified in the mask -// and leave the others untouched. If a resource is passed in to -// describe the updated values, the API ignores the values of all -// fields not covered by the mask. -// -// If a repeated field is specified for an update operation, new values will -// be appended to the existing repeated field in the target resource. Note that -// a repeated field is only allowed in the last position of a `paths` string. -// -// If a sub-message is specified in the last position of the field mask for an -// update operation, then new value will be merged into the existing sub-message -// in the target resource. -// -// For example, given the target message: -// -// f { -// b { -// d: 1 -// x: 2 -// } -// c: [1] -// } -// -// And an update message: -// -// f { -// b { -// d: 10 -// } -// c: [2] -// } -// -// then if the field mask is: -// -// paths: ["f.b", "f.c"] -// -// then the result will be: -// -// f { -// b { -// d: 10 -// x: 2 -// } -// c: [1, 2] -// } -// -// An implementation may provide options to override this default behavior for -// repeated and message fields. -// -// In order to reset a field's value to the default, the field must -// be in the mask and set to the default value in the provided resource. -// Hence, in order to reset all fields of a resource, provide a default -// instance of the resource and set all fields in the mask, or do -// not provide a mask as described below. -// -// If a field mask is not present on update, the operation applies to -// all fields (as if a field mask of all fields has been specified). -// Note that in the presence of schema evolution, this may mean that -// fields the client does not know and has therefore not filled into -// the request will be reset to their default. If this is unwanted -// behavior, a specific service may require a client to always specify -// a field mask, producing an error if not. -// -// As with get operations, the location of the resource which -// describes the updated values in the request message depends on the -// operation kind. In any case, the effect of the field mask is -// required to be honored by the API. -// -// ## Considerations for HTTP REST -// -// The HTTP kind of an update operation which uses a field mask must -// be set to PATCH instead of PUT in order to satisfy HTTP semantics -// (PUT must only be used for full updates). -// -// # JSON Encoding of Field Masks -// -// In JSON, a field mask is encoded as a single string where paths are -// separated by a comma. Fields name in each path are converted -// to/from lower-camel naming conventions. -// -// As an example, consider the following message declarations: -// -// message Profile { -// User user = 1; -// Photo photo = 2; -// } -// message User { -// string display_name = 1; -// string address = 2; -// } -// -// In proto a field mask for `Profile` may look as such: -// -// mask { -// paths: "user.display_name" -// paths: "photo" -// } -// -// In JSON, the same mask is represented as below: -// -// { -// mask: "user.displayName,photo" -// } -// -// # Field Masks and Oneof Fields -// -// Field masks treat fields in oneofs just as regular fields. Consider the -// following message: -// -// message SampleMessage { -// oneof test_oneof { -// string name = 4; -// SubMessage sub_message = 9; -// } -// } -// -// The field mask can be: -// -// mask { -// paths: "name" -// } -// -// Or: -// -// mask { -// paths: "sub_message" -// } -// -// Note that oneof type names ("test_oneof" in this case) cannot be used in -// paths. -// -// ## Field Mask Verification -// -// The implementation of any API method which has a FieldMask type field in the -// request should verify the included field paths, and return an -// `INVALID_ARGUMENT` error if any path is duplicated or unmappable. -// -// swagger:model google.protobuf.FieldMask -type GoogleProtobufFieldMask struct { - - // The set of field mask paths. - Paths []string `json:"paths"` -} - -// Validate validates this google protobuf field mask -func (m *GoogleProtobufFieldMask) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this google protobuf field mask based on context it is used -func (m *GoogleProtobufFieldMask) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *GoogleProtobufFieldMask) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *GoogleProtobufFieldMask) UnmarshalBinary(b []byte) error { - var res GoogleProtobufFieldMask - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/clients/cloud-shared/cloud-shared/v1/models/google_rpc_status.go b/clients/cloud-shared/cloud-shared/v1/models/google_rpc_status.go deleted file mode 100644 index a5be1ca6..00000000 --- a/clients/cloud-shared/cloud-shared/v1/models/google_rpc_status.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// GoogleRPCStatus The `Status` type defines a logical error model that is suitable for -// different programming environments, including REST APIs and RPC APIs. It is -// used by [gRPC](https://github.com/grpc). The error model is designed to be: -// -// - Simple to use and understand for most users -// - Flexible enough to meet unexpected needs -// -// # Overview -// -// The `Status` message contains three pieces of data: error code, error -// message, and error details. The error code should be an enum value of -// [google.rpc.Code][google.rpc.Code], but it may accept additional error codes -// if needed. The error message should be a developer-facing English message -// that helps developers *understand* and *resolve* the error. If a localized -// user-facing error message is needed, put the localized message in the error -// details or localize it in the client. The optional error details may contain -// arbitrary information about the error. There is a predefined set of error -// detail types in the package `google.rpc` that can be used for common error -// conditions. -// -// # Language mapping -// -// The `Status` message is the logical representation of the error model, but it -// is not necessarily the actual wire format. When the `Status` message is -// exposed in different client libraries and different wire protocols, it can be -// mapped differently. For example, it will likely be mapped to some exceptions -// in Java, but more likely mapped to some error codes in C. -// -// # Other uses -// -// The error model and the `Status` message can be used in a variety of -// environments, either with or without APIs, to provide a -// consistent developer experience across different environments. -// -// Example uses of this error model include: -// -// - Partial errors. If a service needs to return partial errors to the client, -// it may embed the `Status` in the normal response to indicate the partial -// errors. -// -// - Workflow errors. A typical workflow has multiple steps. Each step may -// have a `Status` message for error reporting. -// -// - Batch operations. If a client uses batch request and batch response, the -// `Status` message should be used directly inside batch response, one for -// each error sub-response. -// -// - Asynchronous operations. If an API call embeds asynchronous operation -// results in its response, the status of those operations should be -// represented directly using the `Status` message. -// -// - Logging. If some API errors are stored in logs, the message `Status` could -// be used directly after any stripping needed for security/privacy reasons. -// -// swagger:model google.rpc.Status -type GoogleRPCStatus struct { - - // The status code, which should be an enum value of - // [google.rpc.Code][google.rpc.Code]. - Code int32 `json:"code,omitempty"` - - // A list of messages that carry the error details. There is a common set of - // message types for APIs to use. - Details []*GoogleProtobufAny `json:"details"` - - // A developer-facing error message, which should be in English. Any - // user-facing error message should be localized and sent in the - // [google.rpc.Status.details][google.rpc.Status.details] field, or localized - // by the client. - Message string `json:"message,omitempty"` -} - -// Validate validates this google rpc status -func (m *GoogleRPCStatus) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDetails(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *GoogleRPCStatus) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(m.Details) { // not required - return nil - } - - for i := 0; i < len(m.Details); i++ { - if swag.IsZero(m.Details[i]) { // not required - continue - } - - if m.Details[i] != nil { - if err := m.Details[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("details" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this google rpc status based on the context it is used -func (m *GoogleRPCStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDetails(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *GoogleRPCStatus) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Details); i++ { - - if m.Details[i] != nil { - - if swag.IsZero(m.Details[i]) { // not required - return nil - } - - if err := m.Details[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("details" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *GoogleRPCStatus) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *GoogleRPCStatus) UnmarshalBinary(b []byte) error { - var res GoogleRPCStatus - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/clients/cloud-shared/cloud-shared/v1/models/grpc_gateway_runtime_error.go b/clients/cloud-shared/cloud-shared/v1/models/grpc_gateway_runtime_error.go deleted file mode 100644 index 8dfe453e..00000000 --- a/clients/cloud-shared/cloud-shared/v1/models/grpc_gateway_runtime_error.go +++ /dev/null @@ -1,130 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// GrpcGatewayRuntimeError grpc gateway runtime error -// -// swagger:model grpc.gateway.runtime.Error -type GrpcGatewayRuntimeError struct { - - // code - Code int32 `json:"code,omitempty"` - - // details - Details []*GoogleProtobufAny `json:"details"` - - // error - Error string `json:"error,omitempty"` - - // message - Message string `json:"message,omitempty"` -} - -// Validate validates this grpc gateway runtime error -func (m *GrpcGatewayRuntimeError) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDetails(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *GrpcGatewayRuntimeError) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(m.Details) { // not required - return nil - } - - for i := 0; i < len(m.Details); i++ { - if swag.IsZero(m.Details[i]) { // not required - continue - } - - if m.Details[i] != nil { - if err := m.Details[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("details" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this grpc gateway runtime error based on the context it is used -func (m *GrpcGatewayRuntimeError) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDetails(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *GrpcGatewayRuntimeError) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Details); i++ { - - if m.Details[i] != nil { - - if swag.IsZero(m.Details[i]) { // not required - return nil - } - - if err := m.Details[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("details" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *GrpcGatewayRuntimeError) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *GrpcGatewayRuntimeError) UnmarshalBinary(b []byte) error { - var res GrpcGatewayRuntimeError - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/clients/cloud-shared/cloud-shared/v1/models/grpc_gateway_runtime_stream_error.go b/clients/cloud-shared/cloud-shared/v1/models/grpc_gateway_runtime_stream_error.go deleted file mode 100644 index 9754bf73..00000000 --- a/clients/cloud-shared/cloud-shared/v1/models/grpc_gateway_runtime_stream_error.go +++ /dev/null @@ -1,133 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// GrpcGatewayRuntimeStreamError grpc gateway runtime stream error -// -// swagger:model grpc.gateway.runtime.StreamError -type GrpcGatewayRuntimeStreamError struct { - - // details - Details []*GoogleProtobufAny `json:"details"` - - // grpc code - GrpcCode int32 `json:"grpc_code,omitempty"` - - // http code - HTTPCode int32 `json:"http_code,omitempty"` - - // http status - HTTPStatus string `json:"http_status,omitempty"` - - // message - Message string `json:"message,omitempty"` -} - -// Validate validates this grpc gateway runtime stream error -func (m *GrpcGatewayRuntimeStreamError) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDetails(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *GrpcGatewayRuntimeStreamError) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(m.Details) { // not required - return nil - } - - for i := 0; i < len(m.Details); i++ { - if swag.IsZero(m.Details[i]) { // not required - continue - } - - if m.Details[i] != nil { - if err := m.Details[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("details" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this grpc gateway runtime stream error based on the context it is used -func (m *GrpcGatewayRuntimeStreamError) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDetails(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *GrpcGatewayRuntimeStreamError) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Details); i++ { - - if m.Details[i] != nil { - - if swag.IsZero(m.Details[i]) { // not required - return nil - } - - if err := m.Details[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("details" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *GrpcGatewayRuntimeStreamError) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *GrpcGatewayRuntimeStreamError) UnmarshalBinary(b []byte) error { - var res GrpcGatewayRuntimeStreamError - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/clients/cloud-shared/cloud-shared/v1/models/hashicorp_cloud_common_pagination_request.go b/clients/cloud-shared/cloud-shared/v1/models/hashicorp_cloud_common_pagination_request.go deleted file mode 100644 index 26af5a0e..00000000 --- a/clients/cloud-shared/cloud-shared/v1/models/hashicorp_cloud_common_pagination_request.go +++ /dev/null @@ -1,63 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// HashicorpCloudCommonPaginationRequest PaginationRequest are the parameters for a paginated list request. -// -// swagger:model hashicorp.cloud.common.PaginationRequest -type HashicorpCloudCommonPaginationRequest struct { - - // Specifies a page token to use to retrieve the next page. Set this to the - // `next_page_token` returned by previous list requests to get the next page of - // results. If set, `previous_page_token` must not be set. - NextPageToken string `json:"next_page_token,omitempty"` - - // The max number of results per page that should be returned. If the number - // of available results is larger than `page_size`, a `next_page_token` is - // returned which can be used to get the next page of results in subsequent - // requests. A value of zero will cause `page_size` to be defaulted. - PageSize int64 `json:"page_size,omitempty"` - - // Specifies a page token to use to retrieve the previous page. Set this to - // the `previous_page_token` returned by previous list requests to get the - // previous page of results. If set, `next_page_token` must not be set. - PreviousPageToken string `json:"previous_page_token,omitempty"` -} - -// Validate validates this hashicorp cloud common pagination request -func (m *HashicorpCloudCommonPaginationRequest) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this hashicorp cloud common pagination request based on context it is used -func (m *HashicorpCloudCommonPaginationRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *HashicorpCloudCommonPaginationRequest) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *HashicorpCloudCommonPaginationRequest) UnmarshalBinary(b []byte) error { - var res HashicorpCloudCommonPaginationRequest - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/clients/cloud-shared/cloud-shared/v1/models/hashicorp_cloud_common_pagination_response.go b/clients/cloud-shared/cloud-shared/v1/models/hashicorp_cloud_common_pagination_response.go deleted file mode 100644 index 873d04d5..00000000 --- a/clients/cloud-shared/cloud-shared/v1/models/hashicorp_cloud_common_pagination_response.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// HashicorpCloudCommonPaginationResponse PaginationResponse is the response holding the page tokens for a paginated -// list response. -// -// swagger:model hashicorp.cloud.common.PaginationResponse -type HashicorpCloudCommonPaginationResponse struct { - - // This token allows you to get the next page of results for list requests. - // If the number of results is larger than `page_size`, use the - // `next_page_token` as a value for the query parameter `next_page_token` in - // the next request. The value will become empty when there are no more pages. - NextPageToken string `json:"next_page_token,omitempty"` - - // This token allows you to get the previous page of results for list - // requests. If the number of results is larger than `page_size`, use the - // `previous_page_token` as a value for the query parameter - // `previous_page_token` in the next request. The value will become empty when - // there are no more pages. - PreviousPageToken string `json:"previous_page_token,omitempty"` -} - -// Validate validates this hashicorp cloud common pagination response -func (m *HashicorpCloudCommonPaginationResponse) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this hashicorp cloud common pagination response based on context it is used -func (m *HashicorpCloudCommonPaginationResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *HashicorpCloudCommonPaginationResponse) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *HashicorpCloudCommonPaginationResponse) UnmarshalBinary(b []byte) error { - var res HashicorpCloudCommonPaginationResponse - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/clients/cloud-shared/cloud-shared/v1/models/hashicorp_cloud_common_sorting_request.go b/clients/cloud-shared/cloud-shared/v1/models/hashicorp_cloud_common_sorting_request.go deleted file mode 100644 index 9bfb5709..00000000 --- a/clients/cloud-shared/cloud-shared/v1/models/hashicorp_cloud_common_sorting_request.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// HashicorpCloudCommonSortingRequest SortingRequest are the parameters for a sorted list request. -// -// swagger:model hashicorp.cloud.common.SortingRequest -type HashicorpCloudCommonSortingRequest struct { - - // Specifies the list of per field ordering that should be used for sorting. - // The order matters as rows are sorted in order by fields and when the field - // matches, the next field is used to tie break the ordering. - // The per field default ordering is ascending. - // - // The fields should be immutabile, unique, and orderable. If the field is - // not unique, more than one sort fields should be passed. - // - // Example: oder_by=name,age desc,created_at asc - // In that case, 'name' will get the default 'ascending' order. - OrderBy []string `json:"order_by"` -} - -// Validate validates this hashicorp cloud common sorting request -func (m *HashicorpCloudCommonSortingRequest) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this hashicorp cloud common sorting request based on context it is used -func (m *HashicorpCloudCommonSortingRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *HashicorpCloudCommonSortingRequest) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *HashicorpCloudCommonSortingRequest) UnmarshalBinary(b []byte) error { - var res HashicorpCloudCommonSortingRequest - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/clients/cloud-shared/cloud-shared/v1/models/hashicorp_cloud_location_link.go b/clients/cloud-shared/cloud-shared/v1/models/hashicorp_cloud_location_link.go deleted file mode 100644 index ecd9e730..00000000 --- a/clients/cloud-shared/cloud-shared/v1/models/hashicorp_cloud_location_link.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// HashicorpCloudLocationLink Link is used to uniquely reference any resource within HashiCorp Cloud. -// This can be conceptually considered a "foreign key". -// -// swagger:model hashicorp.cloud.location.Link -type HashicorpCloudLocationLink struct { - - // description is a human-friendly description for this link. This is - // used primarily for informational purposes such as error messages. - Description string `json:"description,omitempty"` - - // id is the identifier for this resource. - ID string `json:"id,omitempty"` - - // location is the location where this resource is. - Location *HashicorpCloudLocationLocation `json:"location,omitempty"` - - // type is the unique type of the resource. Each service publishes a - // unique set of types. The type value is recommended to be formatted - // in "." such as "hashicorp.hvn". This is to prevent conflicts - // in the future, but any string value will work. - Type string `json:"type,omitempty"` - - // uuid is the unique UUID for this resource. - UUID string `json:"uuid,omitempty"` -} - -// Validate validates this hashicorp cloud location link -func (m *HashicorpCloudLocationLink) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLocation(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *HashicorpCloudLocationLink) validateLocation(formats strfmt.Registry) error { - if swag.IsZero(m.Location) { // not required - return nil - } - - if m.Location != nil { - if err := m.Location.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("location") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("location") - } - return err - } - } - - return nil -} - -// ContextValidate validate this hashicorp cloud location link based on the context it is used -func (m *HashicorpCloudLocationLink) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateLocation(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *HashicorpCloudLocationLink) contextValidateLocation(ctx context.Context, formats strfmt.Registry) error { - - if m.Location != nil { - - if swag.IsZero(m.Location) { // not required - return nil - } - - if err := m.Location.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("location") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("location") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *HashicorpCloudLocationLink) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *HashicorpCloudLocationLink) UnmarshalBinary(b []byte) error { - var res HashicorpCloudLocationLink - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/clients/cloud-shared/cloud-shared/v1/models/hashicorp_cloud_location_location.go b/clients/cloud-shared/cloud-shared/v1/models/hashicorp_cloud_location_location.go deleted file mode 100644 index dca30587..00000000 --- a/clients/cloud-shared/cloud-shared/v1/models/hashicorp_cloud_location_location.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// HashicorpCloudLocationLocation Location represents a target for an operation in HCP. -// -// swagger:model hashicorp.cloud.location.Location -type HashicorpCloudLocationLocation struct { - - // organization_id is the id of the organization. - OrganizationID string `json:"organization_id,omitempty"` - - // project_id is the projects id. - ProjectID string `json:"project_id,omitempty"` - - // region is the region that the resource is located in. It is - // optional if the object being referenced is a global object. - Region *HashicorpCloudLocationRegion `json:"region,omitempty"` -} - -// Validate validates this hashicorp cloud location location -func (m *HashicorpCloudLocationLocation) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateRegion(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *HashicorpCloudLocationLocation) validateRegion(formats strfmt.Registry) error { - if swag.IsZero(m.Region) { // not required - return nil - } - - if m.Region != nil { - if err := m.Region.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("region") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("region") - } - return err - } - } - - return nil -} - -// ContextValidate validate this hashicorp cloud location location based on the context it is used -func (m *HashicorpCloudLocationLocation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateRegion(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *HashicorpCloudLocationLocation) contextValidateRegion(ctx context.Context, formats strfmt.Registry) error { - - if m.Region != nil { - - if swag.IsZero(m.Region) { // not required - return nil - } - - if err := m.Region.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("region") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("region") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *HashicorpCloudLocationLocation) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *HashicorpCloudLocationLocation) UnmarshalBinary(b []byte) error { - var res HashicorpCloudLocationLocation - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/clients/cloud-shared/cloud-shared/v1/models/hashicorp_cloud_location_region.go b/clients/cloud-shared/cloud-shared/v1/models/hashicorp_cloud_location_region.go deleted file mode 100644 index d9ed0339..00000000 --- a/clients/cloud-shared/cloud-shared/v1/models/hashicorp_cloud_location_region.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// HashicorpCloudLocationRegion Region identifies a Cloud data-plane region. -// -// swagger:model hashicorp.cloud.location.Region -type HashicorpCloudLocationRegion struct { - - // provider is the named cloud provider ("aws", "gcp", "azure") - Provider string `json:"provider,omitempty"` - - // region is the cloud region ("us-west1", "us-east1") - Region string `json:"region,omitempty"` -} - -// Validate validates this hashicorp cloud location region -func (m *HashicorpCloudLocationRegion) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this hashicorp cloud location region based on context it is used -func (m *HashicorpCloudLocationRegion) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *HashicorpCloudLocationRegion) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *HashicorpCloudLocationRegion) UnmarshalBinary(b []byte) error { - var res HashicorpCloudLocationRegion - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/clients/cloud-shared/cloud-shared/v1/models/hashicorp_cloud_operation_operation.go b/clients/cloud-shared/cloud-shared/v1/models/hashicorp_cloud_operation_operation.go deleted file mode 100644 index 27204b53..00000000 --- a/clients/cloud-shared/cloud-shared/v1/models/hashicorp_cloud_operation_operation.go +++ /dev/null @@ -1,363 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// HashicorpCloudOperationOperation Operation represents a single operation. -// -// swagger:model hashicorp.cloud.operation.Operation -type HashicorpCloudOperationOperation struct { - - // CreatedAt is the timestamp of when the operation was first created. - // Format: date-time - CreatedAt strfmt.DateTime `json:"created_at,omitempty"` - - // error is the error that occurred in the operation. - Error *GoogleRPCStatus `json:"error,omitempty"` - - // id is the unique ID for this operation used in other RPC calls. - // This ID is only guaranteed to be unique within the region that - // the operation is running in. - ID string `json:"id,omitempty"` - - // Link is the resource link the operation is associated with. - Link *HashicorpCloudLocationLink `json:"link,omitempty"` - - // Location is location of the resource that this operation belongs to. - Location *HashicorpCloudLocationLocation `json:"location,omitempty"` - - // response is the result of the operation. See the documentation for the API - // call creating the operation to understand what the value of this is. - Response *GoogleProtobufAny `json:"response,omitempty"` - - // state is the current state of the operation. This is a simple tri-state: - // PENDING means the operation is created but not yet started, RUNNING means - // the operation is currently running (though it may be very long-running), - // and DONE means the operation is complete whether successfully or not. - State *HashicorpCloudOperationOperationState `json:"state,omitempty"` - - // UpdatedAt is the timestamp of when the operation was last updated. - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updated_at,omitempty"` -} - -// Validate validates this hashicorp cloud operation operation -func (m *HashicorpCloudOperationOperation) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateError(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLink(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLocation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateResponse(formats); err != nil { - res = append(res, err) - } - - if err := m.validateState(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *HashicorpCloudOperationOperation) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *HashicorpCloudOperationOperation) validateError(formats strfmt.Registry) error { - if swag.IsZero(m.Error) { // not required - return nil - } - - if m.Error != nil { - if err := m.Error.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("error") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("error") - } - return err - } - } - - return nil -} - -func (m *HashicorpCloudOperationOperation) validateLink(formats strfmt.Registry) error { - if swag.IsZero(m.Link) { // not required - return nil - } - - if m.Link != nil { - if err := m.Link.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("link") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("link") - } - return err - } - } - - return nil -} - -func (m *HashicorpCloudOperationOperation) validateLocation(formats strfmt.Registry) error { - if swag.IsZero(m.Location) { // not required - return nil - } - - if m.Location != nil { - if err := m.Location.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("location") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("location") - } - return err - } - } - - return nil -} - -func (m *HashicorpCloudOperationOperation) validateResponse(formats strfmt.Registry) error { - if swag.IsZero(m.Response) { // not required - return nil - } - - if m.Response != nil { - if err := m.Response.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("response") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("response") - } - return err - } - } - - return nil -} - -func (m *HashicorpCloudOperationOperation) validateState(formats strfmt.Registry) error { - if swag.IsZero(m.State) { // not required - return nil - } - - if m.State != nil { - if err := m.State.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("state") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("state") - } - return err - } - } - - return nil -} - -func (m *HashicorpCloudOperationOperation) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updated_at", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this hashicorp cloud operation operation based on the context it is used -func (m *HashicorpCloudOperationOperation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateError(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateLink(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateLocation(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateResponse(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateState(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *HashicorpCloudOperationOperation) contextValidateError(ctx context.Context, formats strfmt.Registry) error { - - if m.Error != nil { - - if swag.IsZero(m.Error) { // not required - return nil - } - - if err := m.Error.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("error") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("error") - } - return err - } - } - - return nil -} - -func (m *HashicorpCloudOperationOperation) contextValidateLink(ctx context.Context, formats strfmt.Registry) error { - - if m.Link != nil { - - if swag.IsZero(m.Link) { // not required - return nil - } - - if err := m.Link.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("link") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("link") - } - return err - } - } - - return nil -} - -func (m *HashicorpCloudOperationOperation) contextValidateLocation(ctx context.Context, formats strfmt.Registry) error { - - if m.Location != nil { - - if swag.IsZero(m.Location) { // not required - return nil - } - - if err := m.Location.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("location") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("location") - } - return err - } - } - - return nil -} - -func (m *HashicorpCloudOperationOperation) contextValidateResponse(ctx context.Context, formats strfmt.Registry) error { - - if m.Response != nil { - - if swag.IsZero(m.Response) { // not required - return nil - } - - if err := m.Response.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("response") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("response") - } - return err - } - } - - return nil -} - -func (m *HashicorpCloudOperationOperation) contextValidateState(ctx context.Context, formats strfmt.Registry) error { - - if m.State != nil { - - if swag.IsZero(m.State) { // not required - return nil - } - - if err := m.State.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("state") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("state") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *HashicorpCloudOperationOperation) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *HashicorpCloudOperationOperation) UnmarshalBinary(b []byte) error { - var res HashicorpCloudOperationOperation - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/clients/cloud-shared/cloud-shared/v1/models/hashicorp_cloud_operation_operation_state.go b/clients/cloud-shared/cloud-shared/v1/models/hashicorp_cloud_operation_operation_state.go deleted file mode 100644 index 2f9e5b9d..00000000 --- a/clients/cloud-shared/cloud-shared/v1/models/hashicorp_cloud_operation_operation_state.go +++ /dev/null @@ -1,89 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// HashicorpCloudOperationOperationState State is one of the states that an Operation can be in. -// -// The states are purposely coarse grained to make it easy to understand -// the operation state machine: pending => running => done. Or pending => -// queued => running => done. No other state transitions are possible. -// Success/failure can be determined based on the result oneof. -// -// swagger:model hashicorp.cloud.operation.Operation.State -type HashicorpCloudOperationOperationState string - -func NewHashicorpCloudOperationOperationState(value HashicorpCloudOperationOperationState) *HashicorpCloudOperationOperationState { - return &value -} - -// Pointer returns a pointer to a freshly-allocated HashicorpCloudOperationOperationState. -func (m HashicorpCloudOperationOperationState) Pointer() *HashicorpCloudOperationOperationState { - return &m -} - -const ( - - // HashicorpCloudOperationOperationStatePENDING captures enum value "PENDING" - HashicorpCloudOperationOperationStatePENDING HashicorpCloudOperationOperationState = "PENDING" - - // HashicorpCloudOperationOperationStateRUNNING captures enum value "RUNNING" - HashicorpCloudOperationOperationStateRUNNING HashicorpCloudOperationOperationState = "RUNNING" - - // HashicorpCloudOperationOperationStateDONE captures enum value "DONE" - HashicorpCloudOperationOperationStateDONE HashicorpCloudOperationOperationState = "DONE" - - // HashicorpCloudOperationOperationStateQUEUED captures enum value "QUEUED" - HashicorpCloudOperationOperationStateQUEUED HashicorpCloudOperationOperationState = "QUEUED" -) - -// for schema -var hashicorpCloudOperationOperationStateEnum []interface{} - -func init() { - var res []HashicorpCloudOperationOperationState - if err := json.Unmarshal([]byte(`["PENDING","RUNNING","DONE","QUEUED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - hashicorpCloudOperationOperationStateEnum = append(hashicorpCloudOperationOperationStateEnum, v) - } -} - -func (m HashicorpCloudOperationOperationState) validateHashicorpCloudOperationOperationStateEnum(path, location string, value HashicorpCloudOperationOperationState) error { - if err := validate.EnumCase(path, location, value, hashicorpCloudOperationOperationStateEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this hashicorp cloud operation operation state -func (m HashicorpCloudOperationOperationState) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateHashicorpCloudOperationOperationStateEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this hashicorp cloud operation operation state based on context it is used -func (m HashicorpCloudOperationOperationState) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -}