From 7b4027d7083d329b75397e340e2b878a2553d627 Mon Sep 17 00:00:00 2001 From: HashiCorp Cloud Services Date: Tue, 5 Dec 2023 18:50:25 +0000 Subject: [PATCH] Update cloud-network SDK --- ..._route53_private_hosted_zone_parameters.go | 14 +- ...s_route53_private_hosted_zone_responses.go | 207 +----- .../create_h_v_n_route_parameters.go | 14 +- .../create_h_v_n_route_responses.go | 421 +---------- .../network_service/create_parameters.go | 14 +- .../create_peering_parameters.go | 14 +- .../create_peering_responses.go | 669 +----------------- .../network_service/create_responses.go | 453 +----------- .../create_t_g_w_attachment_parameters.go | 14 +- .../create_t_g_w_attachment_responses.go | 374 +--------- .../create_token_parameters.go | 14 +- .../network_service/create_token_responses.go | 204 +----- .../delete_h_v_n_route_parameters.go | 4 +- .../delete_h_v_n_route_responses.go | 6 +- .../network_service/delete_parameters.go | 4 +- .../delete_peering_parameters.go | 4 +- .../delete_peering_responses.go | 6 +- .../network_service/delete_responses.go | 6 +- .../delete_t_g_w_attachment_parameters.go | 4 +- .../delete_t_g_w_attachment_responses.go | 6 +- .../get_h_v_n_route_parameters.go | 4 +- .../get_h_v_n_route_responses.go | 6 +- .../client/network_service/get_parameters.go | 4 +- .../network_service/get_peering_parameters.go | 4 +- .../network_service/get_peering_responses.go | 6 +- .../client/network_service/get_responses.go | 6 +- .../get_t_g_w_attachment_parameters.go | 4 +- .../get_t_g_w_attachment_responses.go | 6 +- .../list_dependencies_parameters.go | 4 +- .../list_dependencies_responses.go | 6 +- .../list_h_v_n_routes_parameters.go | 4 +- .../list_h_v_n_routes_responses.go | 6 +- .../client/network_service/list_parameters.go | 4 +- .../list_peerings_parameters.go | 4 +- .../list_peerings_responses.go | 6 +- .../client/network_service/list_responses.go | 6 +- .../list_t_g_w_attachments_parameters.go | 6 +- .../list_t_g_w_attachments_responses.go | 6 +- ...w_s_route53_private_hosted_zone_request.go | 116 +++ ...work20200907_create_h_v_n_route_request.go | 218 ++++++ ..._network20200907_create_peering_request.go | 109 +++ ...rp_cloud_network20200907_create_request.go | 109 +++ ...0200907_create_t_g_w_attachment_request.go | 169 +++++ ...ud_network20200907_create_token_request.go | 113 +++ 44 files changed, 972 insertions(+), 2406 deletions(-) create mode 100644 clients/cloud-network/stable/2020-09-07/models/hashicorp_cloud_network20200907_associate_h_v_n_with_a_w_s_route53_private_hosted_zone_request.go create mode 100644 clients/cloud-network/stable/2020-09-07/models/hashicorp_cloud_network20200907_create_h_v_n_route_request.go create mode 100644 clients/cloud-network/stable/2020-09-07/models/hashicorp_cloud_network20200907_create_peering_request.go create mode 100644 clients/cloud-network/stable/2020-09-07/models/hashicorp_cloud_network20200907_create_request.go create mode 100644 clients/cloud-network/stable/2020-09-07/models/hashicorp_cloud_network20200907_create_t_g_w_attachment_request.go create mode 100644 clients/cloud-network/stable/2020-09-07/models/hashicorp_cloud_network20200907_create_token_request.go diff --git a/clients/cloud-network/stable/2020-09-07/client/network_service/associate_h_v_n_with_a_w_s_route53_private_hosted_zone_parameters.go b/clients/cloud-network/stable/2020-09-07/client/network_service/associate_h_v_n_with_a_w_s_route53_private_hosted_zone_parameters.go index bdbbccb2..b104fa05 100644 --- a/clients/cloud-network/stable/2020-09-07/client/network_service/associate_h_v_n_with_a_w_s_route53_private_hosted_zone_parameters.go +++ b/clients/cloud-network/stable/2020-09-07/client/network_service/associate_h_v_n_with_a_w_s_route53_private_hosted_zone_parameters.go @@ -14,6 +14,8 @@ import ( "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" + + "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/stable/2020-09-07/models" ) // NewAssociateHVNWithAWSRoute53PrivateHostedZoneParams creates a new AssociateHVNWithAWSRoute53PrivateHostedZoneParams object, @@ -62,7 +64,7 @@ AssociateHVNWithAWSRoute53PrivateHostedZoneParams contains all the parameters to type AssociateHVNWithAWSRoute53PrivateHostedZoneParams struct { // Body. - Body AssociateHVNWithAWSRoute53PrivateHostedZoneBody + Body *models.HashicorpCloudNetwork20200907AssociateHVNWithAWSRoute53PrivateHostedZoneRequest /* HvnID. @@ -136,13 +138,13 @@ func (o *AssociateHVNWithAWSRoute53PrivateHostedZoneParams) SetHTTPClient(client } // WithBody adds the body to the associate h v n with a w s route53 private hosted zone params -func (o *AssociateHVNWithAWSRoute53PrivateHostedZoneParams) WithBody(body AssociateHVNWithAWSRoute53PrivateHostedZoneBody) *AssociateHVNWithAWSRoute53PrivateHostedZoneParams { +func (o *AssociateHVNWithAWSRoute53PrivateHostedZoneParams) WithBody(body *models.HashicorpCloudNetwork20200907AssociateHVNWithAWSRoute53PrivateHostedZoneRequest) *AssociateHVNWithAWSRoute53PrivateHostedZoneParams { o.SetBody(body) return o } // SetBody adds the body to the associate h v n with a w s route53 private hosted zone params -func (o *AssociateHVNWithAWSRoute53PrivateHostedZoneParams) SetBody(body AssociateHVNWithAWSRoute53PrivateHostedZoneBody) { +func (o *AssociateHVNWithAWSRoute53PrivateHostedZoneParams) SetBody(body *models.HashicorpCloudNetwork20200907AssociateHVNWithAWSRoute53PrivateHostedZoneRequest) { o.Body = body } @@ -186,8 +188,10 @@ func (o *AssociateHVNWithAWSRoute53PrivateHostedZoneParams) WriteToRequest(r run return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { - return err + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } } // path param hvn_id diff --git a/clients/cloud-network/stable/2020-09-07/client/network_service/associate_h_v_n_with_a_w_s_route53_private_hosted_zone_responses.go b/clients/cloud-network/stable/2020-09-07/client/network_service/associate_h_v_n_with_a_w_s_route53_private_hosted_zone_responses.go index 1e298ffc..f01f0c9b 100644 --- a/clients/cloud-network/stable/2020-09-07/client/network_service/associate_h_v_n_with_a_w_s_route53_private_hosted_zone_responses.go +++ b/clients/cloud-network/stable/2020-09-07/client/network_service/associate_h_v_n_with_a_w_s_route53_private_hosted_zone_responses.go @@ -6,14 +6,11 @@ package network_service // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" "fmt" "io" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" ) @@ -125,7 +122,7 @@ An unexpected error response. type AssociateHVNWithAWSRoute53PrivateHostedZoneDefault struct { _statusCode int - Payload *cloud.GoogleRPCStatus + Payload *cloud.GrpcGatewayRuntimeError } // IsSuccess returns true when this associate h v n with a w s route53 private hosted zone default response has a 2xx status code @@ -166,13 +163,13 @@ func (o *AssociateHVNWithAWSRoute53PrivateHostedZoneDefault) String() string { return fmt.Sprintf("[POST /network/2020-09-07/organizations/{location.organization_id}/projects/{location.project_id}/networks/{hvn_id}/aws-route53-private-hosted-zone-associations][%d] AssociateHVNWithAWSRoute53PrivateHostedZone default %+v", o._statusCode, o.Payload) } -func (o *AssociateHVNWithAWSRoute53PrivateHostedZoneDefault) GetPayload() *cloud.GoogleRPCStatus { +func (o *AssociateHVNWithAWSRoute53PrivateHostedZoneDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { return o.Payload } func (o *AssociateHVNWithAWSRoute53PrivateHostedZoneDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(cloud.GoogleRPCStatus) + o.Payload = new(cloud.GrpcGatewayRuntimeError) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -181,201 +178,3 @@ func (o *AssociateHVNWithAWSRoute53PrivateHostedZoneDefault) readResponse(respon return nil } - -/* -AssociateHVNWithAWSRoute53PrivateHostedZoneBody See NetworkService.AssociateHVNWithAWSRoute53PrivateHostedZone for more details. -swagger:model AssociateHVNWithAWSRoute53PrivateHostedZoneBody -*/ -type AssociateHVNWithAWSRoute53PrivateHostedZoneBody struct { - - // hosted_zone_id is the ID of the hosted zone in the external AWS account. - HostedZoneID string `json:"hosted_zone_id,omitempty"` - - // location - Location *AssociateHVNWithAWSRoute53PrivateHostedZoneParamsBodyLocation `json:"location,omitempty"` -} - -// Validate validates this associate h v n with a w s route53 private hosted zone body -func (o *AssociateHVNWithAWSRoute53PrivateHostedZoneBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateLocation(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AssociateHVNWithAWSRoute53PrivateHostedZoneBody) validateLocation(formats strfmt.Registry) error { - if swag.IsZero(o.Location) { // not required - return nil - } - - if o.Location != nil { - if err := o.Location.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "location") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "location") - } - return err - } - } - - return nil -} - -// ContextValidate validate this associate h v n with a w s route53 private hosted zone body based on the context it is used -func (o *AssociateHVNWithAWSRoute53PrivateHostedZoneBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateLocation(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AssociateHVNWithAWSRoute53PrivateHostedZoneBody) contextValidateLocation(ctx context.Context, formats strfmt.Registry) error { - - if o.Location != nil { - - if swag.IsZero(o.Location) { // not required - return nil - } - - if err := o.Location.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "location") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "location") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *AssociateHVNWithAWSRoute53PrivateHostedZoneBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AssociateHVNWithAWSRoute53PrivateHostedZoneBody) UnmarshalBinary(b []byte) error { - var res AssociateHVNWithAWSRoute53PrivateHostedZoneBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -AssociateHVNWithAWSRoute53PrivateHostedZoneParamsBodyLocation location is the location of the HVN. -// -// location is the location of the HVN. -swagger:model AssociateHVNWithAWSRoute53PrivateHostedZoneParamsBodyLocation -*/ -type AssociateHVNWithAWSRoute53PrivateHostedZoneParamsBodyLocation struct { - - // region is the region that the resource is located in. It is - // optional if the object being referenced is a global object. - Region *cloud.HashicorpCloudLocationRegion `json:"region,omitempty"` -} - -// Validate validates this associate h v n with a w s route53 private hosted zone params body location -func (o *AssociateHVNWithAWSRoute53PrivateHostedZoneParamsBodyLocation) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateRegion(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AssociateHVNWithAWSRoute53PrivateHostedZoneParamsBodyLocation) validateRegion(formats strfmt.Registry) error { - if swag.IsZero(o.Region) { // not required - return nil - } - - if o.Region != nil { - if err := o.Region.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "location" + "." + "region") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "location" + "." + "region") - } - return err - } - } - - return nil -} - -// ContextValidate validate this associate h v n with a w s route53 private hosted zone params body location based on the context it is used -func (o *AssociateHVNWithAWSRoute53PrivateHostedZoneParamsBodyLocation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateRegion(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *AssociateHVNWithAWSRoute53PrivateHostedZoneParamsBodyLocation) contextValidateRegion(ctx context.Context, formats strfmt.Registry) error { - - if o.Region != nil { - - if swag.IsZero(o.Region) { // not required - return nil - } - - if err := o.Region.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "location" + "." + "region") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "location" + "." + "region") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *AssociateHVNWithAWSRoute53PrivateHostedZoneParamsBodyLocation) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AssociateHVNWithAWSRoute53PrivateHostedZoneParamsBodyLocation) UnmarshalBinary(b []byte) error { - var res AssociateHVNWithAWSRoute53PrivateHostedZoneParamsBodyLocation - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/clients/cloud-network/stable/2020-09-07/client/network_service/create_h_v_n_route_parameters.go b/clients/cloud-network/stable/2020-09-07/client/network_service/create_h_v_n_route_parameters.go index 1c68fce1..7b8ff1c2 100644 --- a/clients/cloud-network/stable/2020-09-07/client/network_service/create_h_v_n_route_parameters.go +++ b/clients/cloud-network/stable/2020-09-07/client/network_service/create_h_v_n_route_parameters.go @@ -14,6 +14,8 @@ import ( "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" + + "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/stable/2020-09-07/models" ) // NewCreateHVNRouteParams creates a new CreateHVNRouteParams object, @@ -62,7 +64,7 @@ CreateHVNRouteParams contains all the parameters to send to the API endpoint type CreateHVNRouteParams struct { // Body. - Body CreateHVNRouteBody + Body *models.HashicorpCloudNetwork20200907CreateHVNRouteRequest /* HvnID. @@ -136,13 +138,13 @@ func (o *CreateHVNRouteParams) SetHTTPClient(client *http.Client) { } // WithBody adds the body to the create h v n route params -func (o *CreateHVNRouteParams) WithBody(body CreateHVNRouteBody) *CreateHVNRouteParams { +func (o *CreateHVNRouteParams) WithBody(body *models.HashicorpCloudNetwork20200907CreateHVNRouteRequest) *CreateHVNRouteParams { o.SetBody(body) return o } // SetBody adds the body to the create h v n route params -func (o *CreateHVNRouteParams) SetBody(body CreateHVNRouteBody) { +func (o *CreateHVNRouteParams) SetBody(body *models.HashicorpCloudNetwork20200907CreateHVNRouteRequest) { o.Body = body } @@ -186,8 +188,10 @@ func (o *CreateHVNRouteParams) WriteToRequest(r runtime.ClientRequest, reg strfm return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { - return err + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } } // path param hvn.id diff --git a/clients/cloud-network/stable/2020-09-07/client/network_service/create_h_v_n_route_responses.go b/clients/cloud-network/stable/2020-09-07/client/network_service/create_h_v_n_route_responses.go index f3a3a2a9..61a0ddfa 100644 --- a/clients/cloud-network/stable/2020-09-07/client/network_service/create_h_v_n_route_responses.go +++ b/clients/cloud-network/stable/2020-09-07/client/network_service/create_h_v_n_route_responses.go @@ -6,14 +6,11 @@ package network_service // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" "fmt" "io" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/stable/2020-09-07/models" cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" @@ -128,7 +125,7 @@ An unexpected error response. type CreateHVNRouteDefault struct { _statusCode int - Payload *cloud.GoogleRPCStatus + Payload *cloud.GrpcGatewayRuntimeError } // IsSuccess returns true when this create h v n route default response has a 2xx status code @@ -169,13 +166,13 @@ func (o *CreateHVNRouteDefault) String() string { return fmt.Sprintf("[POST /network/2020-09-07/organizations/{hvn.location.organization_id}/projects/{hvn.location.project_id}/networks/{hvn.id}/routes][%d] CreateHVNRoute default %+v", o._statusCode, o.Payload) } -func (o *CreateHVNRouteDefault) GetPayload() *cloud.GoogleRPCStatus { +func (o *CreateHVNRouteDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { return o.Payload } func (o *CreateHVNRouteDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(cloud.GoogleRPCStatus) + o.Payload = new(cloud.GrpcGatewayRuntimeError) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -184,415 +181,3 @@ func (o *CreateHVNRouteDefault) readResponse(response runtime.ClientResponse, co return nil } - -/* -CreateHVNRouteBody create h v n route body -swagger:model CreateHVNRouteBody -*/ -type CreateHVNRouteBody struct { - - // azure_route contains specific configuration about the azure route - AzureRoute *models.HashicorpCloudNetwork20200907AzureRoute `json:"azure_route,omitempty"` - - // destination is a destination CIDR for this HVN Route - Destination string `json:"destination,omitempty"` - - // hvn - Hvn *CreateHVNRouteParamsBodyHvn `json:"hvn,omitempty"` - - // id is a user generated id for the route - ID string `json:"id,omitempty"` - - // target is a target for this HVN Route - Target *models.HashicorpCloudNetwork20200907HVNRouteTarget `json:"target,omitempty"` -} - -// Validate validates this create h v n route body -func (o *CreateHVNRouteBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateAzureRoute(formats); err != nil { - res = append(res, err) - } - - if err := o.validateHvn(formats); err != nil { - res = append(res, err) - } - - if err := o.validateTarget(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CreateHVNRouteBody) validateAzureRoute(formats strfmt.Registry) error { - if swag.IsZero(o.AzureRoute) { // not required - return nil - } - - if o.AzureRoute != nil { - if err := o.AzureRoute.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "azure_route") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "azure_route") - } - return err - } - } - - return nil -} - -func (o *CreateHVNRouteBody) validateHvn(formats strfmt.Registry) error { - if swag.IsZero(o.Hvn) { // not required - return nil - } - - if o.Hvn != nil { - if err := o.Hvn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "hvn") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "hvn") - } - return err - } - } - - return nil -} - -func (o *CreateHVNRouteBody) validateTarget(formats strfmt.Registry) error { - if swag.IsZero(o.Target) { // not required - return nil - } - - if o.Target != nil { - if err := o.Target.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "target") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "target") - } - return err - } - } - - return nil -} - -// ContextValidate validate this create h v n route body based on the context it is used -func (o *CreateHVNRouteBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateAzureRoute(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateHvn(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateTarget(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CreateHVNRouteBody) contextValidateAzureRoute(ctx context.Context, formats strfmt.Registry) error { - - if o.AzureRoute != nil { - - if swag.IsZero(o.AzureRoute) { // not required - return nil - } - - if err := o.AzureRoute.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "azure_route") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "azure_route") - } - return err - } - } - - return nil -} - -func (o *CreateHVNRouteBody) contextValidateHvn(ctx context.Context, formats strfmt.Registry) error { - - if o.Hvn != nil { - - if swag.IsZero(o.Hvn) { // not required - return nil - } - - if err := o.Hvn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "hvn") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "hvn") - } - return err - } - } - - return nil -} - -func (o *CreateHVNRouteBody) contextValidateTarget(ctx context.Context, formats strfmt.Registry) error { - - if o.Target != nil { - - if swag.IsZero(o.Target) { // not required - return nil - } - - if err := o.Target.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "target") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "target") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *CreateHVNRouteBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreateHVNRouteBody) UnmarshalBinary(b []byte) error { - var res CreateHVNRouteBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CreateHVNRouteParamsBodyHvn hvn is the HVN where a route being created -swagger:model CreateHVNRouteParamsBodyHvn -*/ -type CreateHVNRouteParamsBodyHvn 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"` - - // location - Location *CreateHVNRouteParamsBodyHvnLocation `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 create h v n route params body hvn -func (o *CreateHVNRouteParamsBodyHvn) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateLocation(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CreateHVNRouteParamsBodyHvn) validateLocation(formats strfmt.Registry) error { - if swag.IsZero(o.Location) { // not required - return nil - } - - if o.Location != nil { - if err := o.Location.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "hvn" + "." + "location") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "hvn" + "." + "location") - } - return err - } - } - - return nil -} - -// ContextValidate validate this create h v n route params body hvn based on the context it is used -func (o *CreateHVNRouteParamsBodyHvn) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateLocation(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CreateHVNRouteParamsBodyHvn) contextValidateLocation(ctx context.Context, formats strfmt.Registry) error { - - if o.Location != nil { - - if swag.IsZero(o.Location) { // not required - return nil - } - - if err := o.Location.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "hvn" + "." + "location") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "hvn" + "." + "location") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *CreateHVNRouteParamsBodyHvn) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreateHVNRouteParamsBodyHvn) UnmarshalBinary(b []byte) error { - var res CreateHVNRouteParamsBodyHvn - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CreateHVNRouteParamsBodyHvnLocation location is the location where this resource is. -// -// location is the location where this resource is. -swagger:model CreateHVNRouteParamsBodyHvnLocation -*/ -type CreateHVNRouteParamsBodyHvnLocation struct { - - // region is the region that the resource is located in. It is - // optional if the object being referenced is a global object. - Region *cloud.HashicorpCloudLocationRegion `json:"region,omitempty"` -} - -// Validate validates this create h v n route params body hvn location -func (o *CreateHVNRouteParamsBodyHvnLocation) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateRegion(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CreateHVNRouteParamsBodyHvnLocation) validateRegion(formats strfmt.Registry) error { - if swag.IsZero(o.Region) { // not required - return nil - } - - if o.Region != nil { - if err := o.Region.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "hvn" + "." + "location" + "." + "region") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "hvn" + "." + "location" + "." + "region") - } - return err - } - } - - return nil -} - -// ContextValidate validate this create h v n route params body hvn location based on the context it is used -func (o *CreateHVNRouteParamsBodyHvnLocation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateRegion(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CreateHVNRouteParamsBodyHvnLocation) contextValidateRegion(ctx context.Context, formats strfmt.Registry) error { - - if o.Region != nil { - - if swag.IsZero(o.Region) { // not required - return nil - } - - if err := o.Region.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "hvn" + "." + "location" + "." + "region") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "hvn" + "." + "location" + "." + "region") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *CreateHVNRouteParamsBodyHvnLocation) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreateHVNRouteParamsBodyHvnLocation) UnmarshalBinary(b []byte) error { - var res CreateHVNRouteParamsBodyHvnLocation - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/clients/cloud-network/stable/2020-09-07/client/network_service/create_parameters.go b/clients/cloud-network/stable/2020-09-07/client/network_service/create_parameters.go index b5a6a64c..fb8e3153 100644 --- a/clients/cloud-network/stable/2020-09-07/client/network_service/create_parameters.go +++ b/clients/cloud-network/stable/2020-09-07/client/network_service/create_parameters.go @@ -14,6 +14,8 @@ import ( "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" + + "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/stable/2020-09-07/models" ) // NewCreateParams creates a new CreateParams object, @@ -62,7 +64,7 @@ CreateParams contains all the parameters to send to the API endpoint type CreateParams struct { // Body. - Body CreateBody + Body *models.HashicorpCloudNetwork20200907CreateRequest /* NetworkLocationOrganizationID. @@ -130,13 +132,13 @@ func (o *CreateParams) SetHTTPClient(client *http.Client) { } // WithBody adds the body to the create params -func (o *CreateParams) WithBody(body CreateBody) *CreateParams { +func (o *CreateParams) WithBody(body *models.HashicorpCloudNetwork20200907CreateRequest) *CreateParams { o.SetBody(body) return o } // SetBody adds the body to the create params -func (o *CreateParams) SetBody(body CreateBody) { +func (o *CreateParams) SetBody(body *models.HashicorpCloudNetwork20200907CreateRequest) { o.Body = body } @@ -169,8 +171,10 @@ func (o *CreateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Regist return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { - return err + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } } // path param network.location.organization_id diff --git a/clients/cloud-network/stable/2020-09-07/client/network_service/create_peering_parameters.go b/clients/cloud-network/stable/2020-09-07/client/network_service/create_peering_parameters.go index 68e49a90..995b4f71 100644 --- a/clients/cloud-network/stable/2020-09-07/client/network_service/create_peering_parameters.go +++ b/clients/cloud-network/stable/2020-09-07/client/network_service/create_peering_parameters.go @@ -14,6 +14,8 @@ import ( "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" + + "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/stable/2020-09-07/models" ) // NewCreatePeeringParams creates a new CreatePeeringParams object, @@ -62,7 +64,7 @@ CreatePeeringParams contains all the parameters to send to the API endpoint type CreatePeeringParams struct { // Body. - Body CreatePeeringBody + Body *models.HashicorpCloudNetwork20200907CreatePeeringRequest /* PeeringHvnID. @@ -136,13 +138,13 @@ func (o *CreatePeeringParams) SetHTTPClient(client *http.Client) { } // WithBody adds the body to the create peering params -func (o *CreatePeeringParams) WithBody(body CreatePeeringBody) *CreatePeeringParams { +func (o *CreatePeeringParams) WithBody(body *models.HashicorpCloudNetwork20200907CreatePeeringRequest) *CreatePeeringParams { o.SetBody(body) return o } // SetBody adds the body to the create peering params -func (o *CreatePeeringParams) SetBody(body CreatePeeringBody) { +func (o *CreatePeeringParams) SetBody(body *models.HashicorpCloudNetwork20200907CreatePeeringRequest) { o.Body = body } @@ -186,8 +188,10 @@ func (o *CreatePeeringParams) WriteToRequest(r runtime.ClientRequest, reg strfmt return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { - return err + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } } // path param peering.hvn.id diff --git a/clients/cloud-network/stable/2020-09-07/client/network_service/create_peering_responses.go b/clients/cloud-network/stable/2020-09-07/client/network_service/create_peering_responses.go index f142fa54..45112d9b 100644 --- a/clients/cloud-network/stable/2020-09-07/client/network_service/create_peering_responses.go +++ b/clients/cloud-network/stable/2020-09-07/client/network_service/create_peering_responses.go @@ -6,15 +6,11 @@ package network_service // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" "fmt" "io" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/stable/2020-09-07/models" cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" @@ -129,7 +125,7 @@ An unexpected error response. type CreatePeeringDefault struct { _statusCode int - Payload *cloud.GoogleRPCStatus + Payload *cloud.GrpcGatewayRuntimeError } // IsSuccess returns true when this create peering default response has a 2xx status code @@ -170,13 +166,13 @@ func (o *CreatePeeringDefault) String() string { return fmt.Sprintf("[POST /network/2020-09-07/organizations/{peering.hvn.location.organization_id}/projects/{peering.hvn.location.project_id}/networks/{peering.hvn.id}/peerings][%d] CreatePeering default %+v", o._statusCode, o.Payload) } -func (o *CreatePeeringDefault) GetPayload() *cloud.GoogleRPCStatus { +func (o *CreatePeeringDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { return o.Payload } func (o *CreatePeeringDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(cloud.GoogleRPCStatus) + o.Payload = new(cloud.GrpcGatewayRuntimeError) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -185,662 +181,3 @@ func (o *CreatePeeringDefault) readResponse(response runtime.ClientResponse, con return nil } - -/* -CreatePeeringBody CreatePeeringRequest is a request type for CreatePeering endpoint -swagger:model CreatePeeringBody -*/ -type CreatePeeringBody struct { - - // peering - Peering *CreatePeeringParamsBodyPeering `json:"peering,omitempty"` -} - -// Validate validates this create peering body -func (o *CreatePeeringBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validatePeering(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CreatePeeringBody) validatePeering(formats strfmt.Registry) error { - if swag.IsZero(o.Peering) { // not required - return nil - } - - if o.Peering != nil { - if err := o.Peering.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "peering") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "peering") - } - return err - } - } - - return nil -} - -// ContextValidate validate this create peering body based on the context it is used -func (o *CreatePeeringBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidatePeering(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CreatePeeringBody) contextValidatePeering(ctx context.Context, formats strfmt.Registry) error { - - if o.Peering != nil { - - if swag.IsZero(o.Peering) { // not required - return nil - } - - if err := o.Peering.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "peering") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "peering") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *CreatePeeringBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreatePeeringBody) UnmarshalBinary(b []byte) error { - var res CreatePeeringBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CreatePeeringParamsBodyPeering peering is the peering to be created. -// -// peering is the peering to be created. -swagger:model CreatePeeringParamsBodyPeering -*/ -type CreatePeeringParamsBodyPeering struct { - - // CreatedAt is a timestamp when peering was originally created - // - // Output only. - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"created_at,omitempty"` - - // ExpiresAt is the timestamp after which peering will be considered - // Expired if it doesn't transition into Accepted or Active state before that - // - // Output only. - // Read Only: true - // Format: date-time - ExpiresAt strfmt.DateTime `json:"expires_at,omitempty"` - - // hvn - Hvn *CreatePeeringParamsBodyPeeringHvn `json:"hvn,omitempty"` - - // Id is the id of a peering. - ID string `json:"id,omitempty"` - - // ProviderPeeringId is the id of this peering in the cloud provider - // - // Output only. - // Read Only: true - ProviderPeeringID string `json:"provider_peering_id,omitempty"` - - // SourceChannel is a string representing the issuer of the peering request - // - // Output only. - // Read Only: true - SourceChannel string `json:"source_channel,omitempty"` - - // State is the state of a peering - // - // Output only. - // Read Only: true - State *models.HashicorpCloudNetwork20200907PeeringState `json:"state,omitempty"` - - // Target is a provider specific details about peering target - Target *models.HashicorpCloudNetwork20200907PeeringTarget `json:"target,omitempty"` - - // UpdatedAt is a timestamp when peering was originally created - // - // Output only. - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updated_at,omitempty"` -} - -// Validate validates this create peering params body peering -func (o *CreatePeeringParamsBodyPeering) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := o.validateExpiresAt(formats); err != nil { - res = append(res, err) - } - - if err := o.validateHvn(formats); err != nil { - res = append(res, err) - } - - if err := o.validateState(formats); err != nil { - res = append(res, err) - } - - if err := o.validateTarget(formats); err != nil { - res = append(res, err) - } - - if err := o.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CreatePeeringParamsBodyPeering) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(o.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("body"+"."+"peering"+"."+"created_at", "body", "date-time", o.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (o *CreatePeeringParamsBodyPeering) validateExpiresAt(formats strfmt.Registry) error { - if swag.IsZero(o.ExpiresAt) { // not required - return nil - } - - if err := validate.FormatOf("body"+"."+"peering"+"."+"expires_at", "body", "date-time", o.ExpiresAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (o *CreatePeeringParamsBodyPeering) validateHvn(formats strfmt.Registry) error { - if swag.IsZero(o.Hvn) { // not required - return nil - } - - if o.Hvn != nil { - if err := o.Hvn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "peering" + "." + "hvn") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "peering" + "." + "hvn") - } - return err - } - } - - return nil -} - -func (o *CreatePeeringParamsBodyPeering) validateState(formats strfmt.Registry) error { - if swag.IsZero(o.State) { // not required - return nil - } - - if o.State != nil { - if err := o.State.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "peering" + "." + "state") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "peering" + "." + "state") - } - return err - } - } - - return nil -} - -func (o *CreatePeeringParamsBodyPeering) validateTarget(formats strfmt.Registry) error { - if swag.IsZero(o.Target) { // not required - return nil - } - - if o.Target != nil { - if err := o.Target.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "peering" + "." + "target") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "peering" + "." + "target") - } - return err - } - } - - return nil -} - -func (o *CreatePeeringParamsBodyPeering) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(o.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("body"+"."+"peering"+"."+"updated_at", "body", "date-time", o.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this create peering params body peering based on the context it is used -func (o *CreatePeeringParamsBodyPeering) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateExpiresAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateHvn(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateProviderPeeringID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateSourceChannel(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateState(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateTarget(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CreatePeeringParamsBodyPeering) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "body"+"."+"peering"+"."+"created_at", "body", strfmt.DateTime(o.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (o *CreatePeeringParamsBodyPeering) contextValidateExpiresAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "body"+"."+"peering"+"."+"expires_at", "body", strfmt.DateTime(o.ExpiresAt)); err != nil { - return err - } - - return nil -} - -func (o *CreatePeeringParamsBodyPeering) contextValidateHvn(ctx context.Context, formats strfmt.Registry) error { - - if o.Hvn != nil { - - if swag.IsZero(o.Hvn) { // not required - return nil - } - - if err := o.Hvn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "peering" + "." + "hvn") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "peering" + "." + "hvn") - } - return err - } - } - - return nil -} - -func (o *CreatePeeringParamsBodyPeering) contextValidateProviderPeeringID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "body"+"."+"peering"+"."+"provider_peering_id", "body", string(o.ProviderPeeringID)); err != nil { - return err - } - - return nil -} - -func (o *CreatePeeringParamsBodyPeering) contextValidateSourceChannel(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "body"+"."+"peering"+"."+"source_channel", "body", string(o.SourceChannel)); err != nil { - return err - } - - return nil -} - -func (o *CreatePeeringParamsBodyPeering) contextValidateState(ctx context.Context, formats strfmt.Registry) error { - - if o.State != nil { - - if swag.IsZero(o.State) { // not required - return nil - } - - if err := o.State.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "peering" + "." + "state") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "peering" + "." + "state") - } - return err - } - } - - return nil -} - -func (o *CreatePeeringParamsBodyPeering) contextValidateTarget(ctx context.Context, formats strfmt.Registry) error { - - if o.Target != nil { - - if swag.IsZero(o.Target) { // not required - return nil - } - - if err := o.Target.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "peering" + "." + "target") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "peering" + "." + "target") - } - return err - } - } - - return nil -} - -func (o *CreatePeeringParamsBodyPeering) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "body"+"."+"peering"+"."+"updated_at", "body", strfmt.DateTime(o.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (o *CreatePeeringParamsBodyPeering) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreatePeeringParamsBodyPeering) UnmarshalBinary(b []byte) error { - var res CreatePeeringParamsBodyPeering - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CreatePeeringParamsBodyPeeringHvn Hvn is the a link to the HVN where peering belongs to. -// -// Hvn is the a link to the HVN where peering belongs to. -swagger:model CreatePeeringParamsBodyPeeringHvn -*/ -type CreatePeeringParamsBodyPeeringHvn 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"` - - // location - Location *CreatePeeringParamsBodyPeeringHvnLocation `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 create peering params body peering hvn -func (o *CreatePeeringParamsBodyPeeringHvn) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateLocation(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CreatePeeringParamsBodyPeeringHvn) validateLocation(formats strfmt.Registry) error { - if swag.IsZero(o.Location) { // not required - return nil - } - - if o.Location != nil { - if err := o.Location.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "peering" + "." + "hvn" + "." + "location") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "peering" + "." + "hvn" + "." + "location") - } - return err - } - } - - return nil -} - -// ContextValidate validate this create peering params body peering hvn based on the context it is used -func (o *CreatePeeringParamsBodyPeeringHvn) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateLocation(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CreatePeeringParamsBodyPeeringHvn) contextValidateLocation(ctx context.Context, formats strfmt.Registry) error { - - if o.Location != nil { - - if swag.IsZero(o.Location) { // not required - return nil - } - - if err := o.Location.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "peering" + "." + "hvn" + "." + "location") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "peering" + "." + "hvn" + "." + "location") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *CreatePeeringParamsBodyPeeringHvn) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreatePeeringParamsBodyPeeringHvn) UnmarshalBinary(b []byte) error { - var res CreatePeeringParamsBodyPeeringHvn - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CreatePeeringParamsBodyPeeringHvnLocation location is the location where this resource is. -// -// location is the location where this resource is. -swagger:model CreatePeeringParamsBodyPeeringHvnLocation -*/ -type CreatePeeringParamsBodyPeeringHvnLocation struct { - - // region is the region that the resource is located in. It is - // optional if the object being referenced is a global object. - Region *cloud.HashicorpCloudLocationRegion `json:"region,omitempty"` -} - -// Validate validates this create peering params body peering hvn location -func (o *CreatePeeringParamsBodyPeeringHvnLocation) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateRegion(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CreatePeeringParamsBodyPeeringHvnLocation) validateRegion(formats strfmt.Registry) error { - if swag.IsZero(o.Region) { // not required - return nil - } - - if o.Region != nil { - if err := o.Region.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "peering" + "." + "hvn" + "." + "location" + "." + "region") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "peering" + "." + "hvn" + "." + "location" + "." + "region") - } - return err - } - } - - return nil -} - -// ContextValidate validate this create peering params body peering hvn location based on the context it is used -func (o *CreatePeeringParamsBodyPeeringHvnLocation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateRegion(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CreatePeeringParamsBodyPeeringHvnLocation) contextValidateRegion(ctx context.Context, formats strfmt.Registry) error { - - if o.Region != nil { - - if swag.IsZero(o.Region) { // not required - return nil - } - - if err := o.Region.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "peering" + "." + "hvn" + "." + "location" + "." + "region") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "peering" + "." + "hvn" + "." + "location" + "." + "region") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *CreatePeeringParamsBodyPeeringHvnLocation) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreatePeeringParamsBodyPeeringHvnLocation) UnmarshalBinary(b []byte) error { - var res CreatePeeringParamsBodyPeeringHvnLocation - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/clients/cloud-network/stable/2020-09-07/client/network_service/create_responses.go b/clients/cloud-network/stable/2020-09-07/client/network_service/create_responses.go index 99985ad2..d067c7fa 100644 --- a/clients/cloud-network/stable/2020-09-07/client/network_service/create_responses.go +++ b/clients/cloud-network/stable/2020-09-07/client/network_service/create_responses.go @@ -6,15 +6,11 @@ package network_service // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" "fmt" "io" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/stable/2020-09-07/models" cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" @@ -129,7 +125,7 @@ An unexpected error response. type CreateDefault struct { _statusCode int - Payload *cloud.GoogleRPCStatus + Payload *cloud.GrpcGatewayRuntimeError } // IsSuccess returns true when this create default response has a 2xx status code @@ -170,13 +166,13 @@ func (o *CreateDefault) String() string { return fmt.Sprintf("[POST /network/2020-09-07/organizations/{network.location.organization_id}/projects/{network.location.project_id}/networks][%d] Create default %+v", o._statusCode, o.Payload) } -func (o *CreateDefault) GetPayload() *cloud.GoogleRPCStatus { +func (o *CreateDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { return o.Payload } func (o *CreateDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(cloud.GoogleRPCStatus) + o.Payload = new(cloud.GrpcGatewayRuntimeError) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -185,446 +181,3 @@ func (o *CreateDefault) readResponse(response runtime.ClientResponse, consumer r return nil } - -/* -CreateBody create body -swagger:model CreateBody -*/ -type CreateBody struct { - - // network - Network *CreateParamsBodyNetwork `json:"network,omitempty"` -} - -// Validate validates this create body -func (o *CreateBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateNetwork(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CreateBody) validateNetwork(formats strfmt.Registry) error { - if swag.IsZero(o.Network) { // not required - return nil - } - - if o.Network != nil { - if err := o.Network.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "network") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "network") - } - return err - } - } - - return nil -} - -// ContextValidate validate this create body based on the context it is used -func (o *CreateBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateNetwork(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CreateBody) contextValidateNetwork(ctx context.Context, formats strfmt.Registry) error { - - if o.Network != nil { - - if swag.IsZero(o.Network) { // not required - return nil - } - - if err := o.Network.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "network") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "network") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *CreateBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreateBody) UnmarshalBinary(b []byte) error { - var res CreateBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CreateParamsBodyNetwork network is the network object to be created. -// -// network is the network object to be created. -swagger:model CreateParamsBodyNetwork -*/ -type CreateParamsBodyNetwork struct { - - // cidr_block is the IP range of the HVN. - CidrBlock string `json:"cidr_block,omitempty"` - - // created_at is a timestamp when the network was originally created - // - // Output only. - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"created_at,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"` - - // location - Location *CreateParamsBodyNetworkLocation `json:"location,omitempty"` - - // provider_network_data contains information about the underlying cloud provider network. - // - // Output only. - // Read Only: true - ProviderNetworkData *models.HashicorpCloudNetwork20200907NetworkProviderNetworkData `json:"provider_network_data,omitempty"` - - // state is the current state of the network. - // - // Output only. - // Read Only: true - State *models.HashicorpCloudNetwork20200907NetworkState `json:"state,omitempty"` -} - -// Validate validates this create params body network -func (o *CreateParamsBodyNetwork) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := o.validateLocation(formats); err != nil { - res = append(res, err) - } - - if err := o.validateProviderNetworkData(formats); err != nil { - res = append(res, err) - } - - if err := o.validateState(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CreateParamsBodyNetwork) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(o.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("body"+"."+"network"+"."+"created_at", "body", "date-time", o.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (o *CreateParamsBodyNetwork) validateLocation(formats strfmt.Registry) error { - if swag.IsZero(o.Location) { // not required - return nil - } - - if o.Location != nil { - if err := o.Location.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "network" + "." + "location") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "network" + "." + "location") - } - return err - } - } - - return nil -} - -func (o *CreateParamsBodyNetwork) validateProviderNetworkData(formats strfmt.Registry) error { - if swag.IsZero(o.ProviderNetworkData) { // not required - return nil - } - - if o.ProviderNetworkData != nil { - if err := o.ProviderNetworkData.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "network" + "." + "provider_network_data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "network" + "." + "provider_network_data") - } - return err - } - } - - return nil -} - -func (o *CreateParamsBodyNetwork) validateState(formats strfmt.Registry) error { - if swag.IsZero(o.State) { // not required - return nil - } - - if o.State != nil { - if err := o.State.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "network" + "." + "state") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "network" + "." + "state") - } - return err - } - } - - return nil -} - -// ContextValidate validate this create params body network based on the context it is used -func (o *CreateParamsBodyNetwork) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateLocation(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateProviderNetworkData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateState(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CreateParamsBodyNetwork) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "body"+"."+"network"+"."+"created_at", "body", strfmt.DateTime(o.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (o *CreateParamsBodyNetwork) contextValidateLocation(ctx context.Context, formats strfmt.Registry) error { - - if o.Location != nil { - - if swag.IsZero(o.Location) { // not required - return nil - } - - if err := o.Location.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "network" + "." + "location") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "network" + "." + "location") - } - return err - } - } - - return nil -} - -func (o *CreateParamsBodyNetwork) contextValidateProviderNetworkData(ctx context.Context, formats strfmt.Registry) error { - - if o.ProviderNetworkData != nil { - - if swag.IsZero(o.ProviderNetworkData) { // not required - return nil - } - - if err := o.ProviderNetworkData.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "network" + "." + "provider_network_data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "network" + "." + "provider_network_data") - } - return err - } - } - - return nil -} - -func (o *CreateParamsBodyNetwork) contextValidateState(ctx context.Context, formats strfmt.Registry) error { - - if o.State != nil { - - if swag.IsZero(o.State) { // not required - return nil - } - - if err := o.State.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "network" + "." + "state") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "network" + "." + "state") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *CreateParamsBodyNetwork) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreateParamsBodyNetwork) UnmarshalBinary(b []byte) error { - var res CreateParamsBodyNetwork - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CreateParamsBodyNetworkLocation location is the location of the HVN -swagger:model CreateParamsBodyNetworkLocation -*/ -type CreateParamsBodyNetworkLocation struct { - - // region is the region that the resource is located in. It is - // optional if the object being referenced is a global object. - Region *cloud.HashicorpCloudLocationRegion `json:"region,omitempty"` -} - -// Validate validates this create params body network location -func (o *CreateParamsBodyNetworkLocation) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateRegion(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CreateParamsBodyNetworkLocation) validateRegion(formats strfmt.Registry) error { - if swag.IsZero(o.Region) { // not required - return nil - } - - if o.Region != nil { - if err := o.Region.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "network" + "." + "location" + "." + "region") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "network" + "." + "location" + "." + "region") - } - return err - } - } - - return nil -} - -// ContextValidate validate this create params body network location based on the context it is used -func (o *CreateParamsBodyNetworkLocation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateRegion(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CreateParamsBodyNetworkLocation) contextValidateRegion(ctx context.Context, formats strfmt.Registry) error { - - if o.Region != nil { - - if swag.IsZero(o.Region) { // not required - return nil - } - - if err := o.Region.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "network" + "." + "location" + "." + "region") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "network" + "." + "location" + "." + "region") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *CreateParamsBodyNetworkLocation) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreateParamsBodyNetworkLocation) UnmarshalBinary(b []byte) error { - var res CreateParamsBodyNetworkLocation - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/clients/cloud-network/stable/2020-09-07/client/network_service/create_t_g_w_attachment_parameters.go b/clients/cloud-network/stable/2020-09-07/client/network_service/create_t_g_w_attachment_parameters.go index a475a028..0d594178 100644 --- a/clients/cloud-network/stable/2020-09-07/client/network_service/create_t_g_w_attachment_parameters.go +++ b/clients/cloud-network/stable/2020-09-07/client/network_service/create_t_g_w_attachment_parameters.go @@ -14,6 +14,8 @@ import ( "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" + + "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/stable/2020-09-07/models" ) // NewCreateTGWAttachmentParams creates a new CreateTGWAttachmentParams object, @@ -62,7 +64,7 @@ CreateTGWAttachmentParams contains all the parameters to send to the API endpoin type CreateTGWAttachmentParams struct { // Body. - Body CreateTGWAttachmentBody + Body *models.HashicorpCloudNetwork20200907CreateTGWAttachmentRequest /* HvnID. @@ -136,13 +138,13 @@ func (o *CreateTGWAttachmentParams) SetHTTPClient(client *http.Client) { } // WithBody adds the body to the create t g w attachment params -func (o *CreateTGWAttachmentParams) WithBody(body CreateTGWAttachmentBody) *CreateTGWAttachmentParams { +func (o *CreateTGWAttachmentParams) WithBody(body *models.HashicorpCloudNetwork20200907CreateTGWAttachmentRequest) *CreateTGWAttachmentParams { o.SetBody(body) return o } // SetBody adds the body to the create t g w attachment params -func (o *CreateTGWAttachmentParams) SetBody(body CreateTGWAttachmentBody) { +func (o *CreateTGWAttachmentParams) SetBody(body *models.HashicorpCloudNetwork20200907CreateTGWAttachmentRequest) { o.Body = body } @@ -186,8 +188,10 @@ func (o *CreateTGWAttachmentParams) WriteToRequest(r runtime.ClientRequest, reg return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { - return err + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } } // path param hvn.id diff --git a/clients/cloud-network/stable/2020-09-07/client/network_service/create_t_g_w_attachment_responses.go b/clients/cloud-network/stable/2020-09-07/client/network_service/create_t_g_w_attachment_responses.go index dc48ecfc..cf008033 100644 --- a/clients/cloud-network/stable/2020-09-07/client/network_service/create_t_g_w_attachment_responses.go +++ b/clients/cloud-network/stable/2020-09-07/client/network_service/create_t_g_w_attachment_responses.go @@ -6,14 +6,11 @@ package network_service // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" "fmt" "io" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/stable/2020-09-07/models" cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" @@ -128,7 +125,7 @@ An unexpected error response. type CreateTGWAttachmentDefault struct { _statusCode int - Payload *cloud.GoogleRPCStatus + Payload *cloud.GrpcGatewayRuntimeError } // IsSuccess returns true when this create t g w attachment default response has a 2xx status code @@ -169,13 +166,13 @@ func (o *CreateTGWAttachmentDefault) String() string { return fmt.Sprintf("[POST /network/2020-09-07/organizations/{hvn.location.organization_id}/projects/{hvn.location.project_id}/networks/{hvn.id}/transit-gateway-attachments][%d] CreateTGWAttachment default %+v", o._statusCode, o.Payload) } -func (o *CreateTGWAttachmentDefault) GetPayload() *cloud.GoogleRPCStatus { +func (o *CreateTGWAttachmentDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { return o.Payload } func (o *CreateTGWAttachmentDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(cloud.GoogleRPCStatus) + o.Payload = new(cloud.GrpcGatewayRuntimeError) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -184,368 +181,3 @@ func (o *CreateTGWAttachmentDefault) readResponse(response runtime.ClientRespons return nil } - -/* -CreateTGWAttachmentBody create t g w attachment body -swagger:model CreateTGWAttachmentBody -*/ -type CreateTGWAttachmentBody struct { - - // cidrs is a list of destination CIDRs this TGW attachment will be routing to through the - // transit gateway. - Cidrs []string `json:"cidrs"` - - // hvn - Hvn *CreateTGWAttachmentParamsBodyHvn `json:"hvn,omitempty"` - - // id is the user-set transit gateway attachment slug ID, optional for now, if not present we will use internal-id. - ID string `json:"id,omitempty"` - - // provider_data is the provider specific data to create a TGW Attachment. - // For AWS it includes the transit gateway ID and the resource share ARN. - ProviderData *models.HashicorpCloudNetwork20200907CreateTGWAttachmentRequestProviderData `json:"provider_data,omitempty"` -} - -// Validate validates this create t g w attachment body -func (o *CreateTGWAttachmentBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateHvn(formats); err != nil { - res = append(res, err) - } - - if err := o.validateProviderData(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CreateTGWAttachmentBody) validateHvn(formats strfmt.Registry) error { - if swag.IsZero(o.Hvn) { // not required - return nil - } - - if o.Hvn != nil { - if err := o.Hvn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "hvn") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "hvn") - } - return err - } - } - - return nil -} - -func (o *CreateTGWAttachmentBody) validateProviderData(formats strfmt.Registry) error { - if swag.IsZero(o.ProviderData) { // not required - return nil - } - - if o.ProviderData != nil { - if err := o.ProviderData.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "provider_data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "provider_data") - } - return err - } - } - - return nil -} - -// ContextValidate validate this create t g w attachment body based on the context it is used -func (o *CreateTGWAttachmentBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateHvn(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateProviderData(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CreateTGWAttachmentBody) contextValidateHvn(ctx context.Context, formats strfmt.Registry) error { - - if o.Hvn != nil { - - if swag.IsZero(o.Hvn) { // not required - return nil - } - - if err := o.Hvn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "hvn") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "hvn") - } - return err - } - } - - return nil -} - -func (o *CreateTGWAttachmentBody) contextValidateProviderData(ctx context.Context, formats strfmt.Registry) error { - - if o.ProviderData != nil { - - if swag.IsZero(o.ProviderData) { // not required - return nil - } - - if err := o.ProviderData.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "provider_data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "provider_data") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *CreateTGWAttachmentBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreateTGWAttachmentBody) UnmarshalBinary(b []byte) error { - var res CreateTGWAttachmentBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CreateTGWAttachmentParamsBodyHvn HVN is a link to the HVN the TGW Attachment belongs to. -// -// HVN is a link to the HVN the TGW Attachment belongs to. -swagger:model CreateTGWAttachmentParamsBodyHvn -*/ -type CreateTGWAttachmentParamsBodyHvn 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"` - - // location - Location *CreateTGWAttachmentParamsBodyHvnLocation `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 create t g w attachment params body hvn -func (o *CreateTGWAttachmentParamsBodyHvn) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateLocation(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CreateTGWAttachmentParamsBodyHvn) validateLocation(formats strfmt.Registry) error { - if swag.IsZero(o.Location) { // not required - return nil - } - - if o.Location != nil { - if err := o.Location.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "hvn" + "." + "location") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "hvn" + "." + "location") - } - return err - } - } - - return nil -} - -// ContextValidate validate this create t g w attachment params body hvn based on the context it is used -func (o *CreateTGWAttachmentParamsBodyHvn) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateLocation(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CreateTGWAttachmentParamsBodyHvn) contextValidateLocation(ctx context.Context, formats strfmt.Registry) error { - - if o.Location != nil { - - if swag.IsZero(o.Location) { // not required - return nil - } - - if err := o.Location.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "hvn" + "." + "location") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "hvn" + "." + "location") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *CreateTGWAttachmentParamsBodyHvn) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreateTGWAttachmentParamsBodyHvn) UnmarshalBinary(b []byte) error { - var res CreateTGWAttachmentParamsBodyHvn - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CreateTGWAttachmentParamsBodyHvnLocation location is the location where this resource is. -// -// location is the location where this resource is. -swagger:model CreateTGWAttachmentParamsBodyHvnLocation -*/ -type CreateTGWAttachmentParamsBodyHvnLocation struct { - - // region is the region that the resource is located in. It is - // optional if the object being referenced is a global object. - Region *cloud.HashicorpCloudLocationRegion `json:"region,omitempty"` -} - -// Validate validates this create t g w attachment params body hvn location -func (o *CreateTGWAttachmentParamsBodyHvnLocation) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateRegion(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CreateTGWAttachmentParamsBodyHvnLocation) validateRegion(formats strfmt.Registry) error { - if swag.IsZero(o.Region) { // not required - return nil - } - - if o.Region != nil { - if err := o.Region.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "hvn" + "." + "location" + "." + "region") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "hvn" + "." + "location" + "." + "region") - } - return err - } - } - - return nil -} - -// ContextValidate validate this create t g w attachment params body hvn location based on the context it is used -func (o *CreateTGWAttachmentParamsBodyHvnLocation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateRegion(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CreateTGWAttachmentParamsBodyHvnLocation) contextValidateRegion(ctx context.Context, formats strfmt.Registry) error { - - if o.Region != nil { - - if swag.IsZero(o.Region) { // not required - return nil - } - - if err := o.Region.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "hvn" + "." + "location" + "." + "region") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "hvn" + "." + "location" + "." + "region") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *CreateTGWAttachmentParamsBodyHvnLocation) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreateTGWAttachmentParamsBodyHvnLocation) UnmarshalBinary(b []byte) error { - var res CreateTGWAttachmentParamsBodyHvnLocation - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/clients/cloud-network/stable/2020-09-07/client/network_service/create_token_parameters.go b/clients/cloud-network/stable/2020-09-07/client/network_service/create_token_parameters.go index 5216b0e1..e8b3c324 100644 --- a/clients/cloud-network/stable/2020-09-07/client/network_service/create_token_parameters.go +++ b/clients/cloud-network/stable/2020-09-07/client/network_service/create_token_parameters.go @@ -14,6 +14,8 @@ import ( "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" + + "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/stable/2020-09-07/models" ) // NewCreateTokenParams creates a new CreateTokenParams object, @@ -62,7 +64,7 @@ CreateTokenParams contains all the parameters to send to the API endpoint type CreateTokenParams struct { // Body. - Body CreateTokenBody + Body *models.HashicorpCloudNetwork20200907CreateTokenRequest /* ID. @@ -136,13 +138,13 @@ func (o *CreateTokenParams) SetHTTPClient(client *http.Client) { } // WithBody adds the body to the create token params -func (o *CreateTokenParams) WithBody(body CreateTokenBody) *CreateTokenParams { +func (o *CreateTokenParams) WithBody(body *models.HashicorpCloudNetwork20200907CreateTokenRequest) *CreateTokenParams { o.SetBody(body) return o } // SetBody adds the body to the create token params -func (o *CreateTokenParams) SetBody(body CreateTokenBody) { +func (o *CreateTokenParams) SetBody(body *models.HashicorpCloudNetwork20200907CreateTokenRequest) { o.Body = body } @@ -186,8 +188,10 @@ func (o *CreateTokenParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { - return err + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } } // path param id diff --git a/clients/cloud-network/stable/2020-09-07/client/network_service/create_token_responses.go b/clients/cloud-network/stable/2020-09-07/client/network_service/create_token_responses.go index c5ebbad7..c6e18f62 100644 --- a/clients/cloud-network/stable/2020-09-07/client/network_service/create_token_responses.go +++ b/clients/cloud-network/stable/2020-09-07/client/network_service/create_token_responses.go @@ -6,14 +6,11 @@ package network_service // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" "fmt" "io" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/stable/2020-09-07/models" cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" @@ -128,7 +125,7 @@ An unexpected error response. type CreateTokenDefault struct { _statusCode int - Payload *cloud.GoogleRPCStatus + Payload *cloud.GrpcGatewayRuntimeError } // IsSuccess returns true when this create token default response has a 2xx status code @@ -169,13 +166,13 @@ func (o *CreateTokenDefault) String() string { return fmt.Sprintf("[POST /network/2020-09-07/organizations/{location.organization_id}/projects/{location.project_id}/networks/{id}/tokens][%d] CreateToken default %+v", o._statusCode, o.Payload) } -func (o *CreateTokenDefault) GetPayload() *cloud.GoogleRPCStatus { +func (o *CreateTokenDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { return o.Payload } func (o *CreateTokenDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(cloud.GoogleRPCStatus) + o.Payload = new(cloud.GrpcGatewayRuntimeError) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -184,198 +181,3 @@ func (o *CreateTokenDefault) readResponse(response runtime.ClientResponse, consu return nil } - -/* -CreateTokenBody CreateTokenRequest is a request type for the CreateToken endpoint. -swagger:model CreateTokenBody -*/ -type CreateTokenBody struct { - - // location - Location *CreateTokenParamsBodyLocation `json:"location,omitempty"` -} - -// Validate validates this create token body -func (o *CreateTokenBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateLocation(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CreateTokenBody) validateLocation(formats strfmt.Registry) error { - if swag.IsZero(o.Location) { // not required - return nil - } - - if o.Location != nil { - if err := o.Location.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "location") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "location") - } - return err - } - } - - return nil -} - -// ContextValidate validate this create token body based on the context it is used -func (o *CreateTokenBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateLocation(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CreateTokenBody) contextValidateLocation(ctx context.Context, formats strfmt.Registry) error { - - if o.Location != nil { - - if swag.IsZero(o.Location) { // not required - return nil - } - - if err := o.Location.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "location") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "location") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *CreateTokenBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreateTokenBody) UnmarshalBinary(b []byte) error { - var res CreateTokenBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CreateTokenParamsBodyLocation location is the location of the HVN. -// -// location is the location of the HVN. -swagger:model CreateTokenParamsBodyLocation -*/ -type CreateTokenParamsBodyLocation struct { - - // region is the region that the resource is located in. It is - // optional if the object being referenced is a global object. - Region *cloud.HashicorpCloudLocationRegion `json:"region,omitempty"` -} - -// Validate validates this create token params body location -func (o *CreateTokenParamsBodyLocation) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateRegion(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CreateTokenParamsBodyLocation) validateRegion(formats strfmt.Registry) error { - if swag.IsZero(o.Region) { // not required - return nil - } - - if o.Region != nil { - if err := o.Region.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "location" + "." + "region") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "location" + "." + "region") - } - return err - } - } - - return nil -} - -// ContextValidate validate this create token params body location based on the context it is used -func (o *CreateTokenParamsBodyLocation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateRegion(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CreateTokenParamsBodyLocation) contextValidateRegion(ctx context.Context, formats strfmt.Registry) error { - - if o.Region != nil { - - if swag.IsZero(o.Region) { // not required - return nil - } - - if err := o.Region.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "location" + "." + "region") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "location" + "." + "region") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *CreateTokenParamsBodyLocation) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreateTokenParamsBodyLocation) UnmarshalBinary(b []byte) error { - var res CreateTokenParamsBodyLocation - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/clients/cloud-network/stable/2020-09-07/client/network_service/delete_h_v_n_route_parameters.go b/clients/cloud-network/stable/2020-09-07/client/network_service/delete_h_v_n_route_parameters.go index e3ac75ec..0fdb8677 100644 --- a/clients/cloud-network/stable/2020-09-07/client/network_service/delete_h_v_n_route_parameters.go +++ b/clients/cloud-network/stable/2020-09-07/client/network_service/delete_h_v_n_route_parameters.go @@ -88,13 +88,13 @@ type DeleteHVNRouteParams struct { /* HvnLocationRegionProvider. - provider is the named cloud provider ("aws", "gcp", "azure") + provider is the named cloud provider ("aws", "gcp", "azure"). */ HvnLocationRegionProvider *string /* HvnLocationRegionRegion. - region is the cloud region ("us-west1", "us-east1") + region is the cloud region ("us-west1", "us-east1"). */ HvnLocationRegionRegion *string diff --git a/clients/cloud-network/stable/2020-09-07/client/network_service/delete_h_v_n_route_responses.go b/clients/cloud-network/stable/2020-09-07/client/network_service/delete_h_v_n_route_responses.go index f5d9e0f2..2550dc94 100644 --- a/clients/cloud-network/stable/2020-09-07/client/network_service/delete_h_v_n_route_responses.go +++ b/clients/cloud-network/stable/2020-09-07/client/network_service/delete_h_v_n_route_responses.go @@ -125,7 +125,7 @@ An unexpected error response. type DeleteHVNRouteDefault struct { _statusCode int - Payload *cloud.GoogleRPCStatus + Payload *cloud.GrpcGatewayRuntimeError } // IsSuccess returns true when this delete h v n route default response has a 2xx status code @@ -166,13 +166,13 @@ func (o *DeleteHVNRouteDefault) String() string { return fmt.Sprintf("[DELETE /network/2020-09-07/organizations/{hvn.location.organization_id}/projects/{hvn.location.project_id}/networks/{hvn.id}/routes/{id}][%d] DeleteHVNRoute default %+v", o._statusCode, o.Payload) } -func (o *DeleteHVNRouteDefault) GetPayload() *cloud.GoogleRPCStatus { +func (o *DeleteHVNRouteDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { return o.Payload } func (o *DeleteHVNRouteDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(cloud.GoogleRPCStatus) + o.Payload = new(cloud.GrpcGatewayRuntimeError) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/clients/cloud-network/stable/2020-09-07/client/network_service/delete_parameters.go b/clients/cloud-network/stable/2020-09-07/client/network_service/delete_parameters.go index ad04cfa2..4e4408be 100644 --- a/clients/cloud-network/stable/2020-09-07/client/network_service/delete_parameters.go +++ b/clients/cloud-network/stable/2020-09-07/client/network_service/delete_parameters.go @@ -81,13 +81,13 @@ type DeleteParams struct { /* LocationRegionProvider. - provider is the named cloud provider ("aws", "gcp", "azure") + provider is the named cloud provider ("aws", "gcp", "azure"). */ LocationRegionProvider *string /* LocationRegionRegion. - region is the cloud region ("us-west1", "us-east1") + region is the cloud region ("us-west1", "us-east1"). */ LocationRegionRegion *string diff --git a/clients/cloud-network/stable/2020-09-07/client/network_service/delete_peering_parameters.go b/clients/cloud-network/stable/2020-09-07/client/network_service/delete_peering_parameters.go index 0d5c248c..352af94a 100644 --- a/clients/cloud-network/stable/2020-09-07/client/network_service/delete_peering_parameters.go +++ b/clients/cloud-network/stable/2020-09-07/client/network_service/delete_peering_parameters.go @@ -87,13 +87,13 @@ type DeletePeeringParams struct { /* LocationRegionProvider. - provider is the named cloud provider ("aws", "gcp", "azure") + provider is the named cloud provider ("aws", "gcp", "azure"). */ LocationRegionProvider *string /* LocationRegionRegion. - region is the cloud region ("us-west1", "us-east1") + region is the cloud region ("us-west1", "us-east1"). */ LocationRegionRegion *string diff --git a/clients/cloud-network/stable/2020-09-07/client/network_service/delete_peering_responses.go b/clients/cloud-network/stable/2020-09-07/client/network_service/delete_peering_responses.go index 18d3bace..165fcd0e 100644 --- a/clients/cloud-network/stable/2020-09-07/client/network_service/delete_peering_responses.go +++ b/clients/cloud-network/stable/2020-09-07/client/network_service/delete_peering_responses.go @@ -125,7 +125,7 @@ An unexpected error response. type DeletePeeringDefault struct { _statusCode int - Payload *cloud.GoogleRPCStatus + Payload *cloud.GrpcGatewayRuntimeError } // IsSuccess returns true when this delete peering default response has a 2xx status code @@ -166,13 +166,13 @@ func (o *DeletePeeringDefault) String() string { return fmt.Sprintf("[DELETE /network/2020-09-07/organizations/{location.organization_id}/projects/{location.project_id}/networks/{hvn_id}/peerings/{id}][%d] DeletePeering default %+v", o._statusCode, o.Payload) } -func (o *DeletePeeringDefault) GetPayload() *cloud.GoogleRPCStatus { +func (o *DeletePeeringDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { return o.Payload } func (o *DeletePeeringDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(cloud.GoogleRPCStatus) + o.Payload = new(cloud.GrpcGatewayRuntimeError) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/clients/cloud-network/stable/2020-09-07/client/network_service/delete_responses.go b/clients/cloud-network/stable/2020-09-07/client/network_service/delete_responses.go index c5e885ff..a731588f 100644 --- a/clients/cloud-network/stable/2020-09-07/client/network_service/delete_responses.go +++ b/clients/cloud-network/stable/2020-09-07/client/network_service/delete_responses.go @@ -125,7 +125,7 @@ An unexpected error response. type DeleteDefault struct { _statusCode int - Payload *cloud.GoogleRPCStatus + Payload *cloud.GrpcGatewayRuntimeError } // IsSuccess returns true when this delete default response has a 2xx status code @@ -166,13 +166,13 @@ func (o *DeleteDefault) String() string { return fmt.Sprintf("[DELETE /network/2020-09-07/organizations/{location.organization_id}/projects/{location.project_id}/networks/{id}][%d] Delete default %+v", o._statusCode, o.Payload) } -func (o *DeleteDefault) GetPayload() *cloud.GoogleRPCStatus { +func (o *DeleteDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { return o.Payload } func (o *DeleteDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(cloud.GoogleRPCStatus) + o.Payload = new(cloud.GrpcGatewayRuntimeError) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/clients/cloud-network/stable/2020-09-07/client/network_service/delete_t_g_w_attachment_parameters.go b/clients/cloud-network/stable/2020-09-07/client/network_service/delete_t_g_w_attachment_parameters.go index 8878a254..0110e86d 100644 --- a/clients/cloud-network/stable/2020-09-07/client/network_service/delete_t_g_w_attachment_parameters.go +++ b/clients/cloud-network/stable/2020-09-07/client/network_service/delete_t_g_w_attachment_parameters.go @@ -88,13 +88,13 @@ type DeleteTGWAttachmentParams struct { /* HvnLocationRegionProvider. - provider is the named cloud provider ("aws", "gcp", "azure") + provider is the named cloud provider ("aws", "gcp", "azure"). */ HvnLocationRegionProvider *string /* HvnLocationRegionRegion. - region is the cloud region ("us-west1", "us-east1") + region is the cloud region ("us-west1", "us-east1"). */ HvnLocationRegionRegion *string diff --git a/clients/cloud-network/stable/2020-09-07/client/network_service/delete_t_g_w_attachment_responses.go b/clients/cloud-network/stable/2020-09-07/client/network_service/delete_t_g_w_attachment_responses.go index eb778fce..a27e9c0b 100644 --- a/clients/cloud-network/stable/2020-09-07/client/network_service/delete_t_g_w_attachment_responses.go +++ b/clients/cloud-network/stable/2020-09-07/client/network_service/delete_t_g_w_attachment_responses.go @@ -125,7 +125,7 @@ An unexpected error response. type DeleteTGWAttachmentDefault struct { _statusCode int - Payload *cloud.GoogleRPCStatus + Payload *cloud.GrpcGatewayRuntimeError } // IsSuccess returns true when this delete t g w attachment default response has a 2xx status code @@ -166,13 +166,13 @@ func (o *DeleteTGWAttachmentDefault) String() string { return fmt.Sprintf("[DELETE /network/2020-09-07/organizations/{hvn.location.organization_id}/projects/{hvn.location.project_id}/networks/{hvn.id}/transit-gateway-attachments/{id}][%d] DeleteTGWAttachment default %+v", o._statusCode, o.Payload) } -func (o *DeleteTGWAttachmentDefault) GetPayload() *cloud.GoogleRPCStatus { +func (o *DeleteTGWAttachmentDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { return o.Payload } func (o *DeleteTGWAttachmentDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(cloud.GoogleRPCStatus) + o.Payload = new(cloud.GrpcGatewayRuntimeError) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/clients/cloud-network/stable/2020-09-07/client/network_service/get_h_v_n_route_parameters.go b/clients/cloud-network/stable/2020-09-07/client/network_service/get_h_v_n_route_parameters.go index ac50dca7..5472d967 100644 --- a/clients/cloud-network/stable/2020-09-07/client/network_service/get_h_v_n_route_parameters.go +++ b/clients/cloud-network/stable/2020-09-07/client/network_service/get_h_v_n_route_parameters.go @@ -88,13 +88,13 @@ type GetHVNRouteParams struct { /* HvnLocationRegionProvider. - provider is the named cloud provider ("aws", "gcp", "azure") + provider is the named cloud provider ("aws", "gcp", "azure"). */ HvnLocationRegionProvider *string /* HvnLocationRegionRegion. - region is the cloud region ("us-west1", "us-east1") + region is the cloud region ("us-west1", "us-east1"). */ HvnLocationRegionRegion *string diff --git a/clients/cloud-network/stable/2020-09-07/client/network_service/get_h_v_n_route_responses.go b/clients/cloud-network/stable/2020-09-07/client/network_service/get_h_v_n_route_responses.go index 99c2c5db..3dad132e 100644 --- a/clients/cloud-network/stable/2020-09-07/client/network_service/get_h_v_n_route_responses.go +++ b/clients/cloud-network/stable/2020-09-07/client/network_service/get_h_v_n_route_responses.go @@ -125,7 +125,7 @@ An unexpected error response. type GetHVNRouteDefault struct { _statusCode int - Payload *cloud.GoogleRPCStatus + Payload *cloud.GrpcGatewayRuntimeError } // IsSuccess returns true when this get h v n route default response has a 2xx status code @@ -166,13 +166,13 @@ func (o *GetHVNRouteDefault) String() string { return fmt.Sprintf("[GET /network/2020-09-07/organizations/{hvn.location.organization_id}/projects/{hvn.location.project_id}/networks/{hvn.id}/routes/{id}][%d] GetHVNRoute default %+v", o._statusCode, o.Payload) } -func (o *GetHVNRouteDefault) GetPayload() *cloud.GoogleRPCStatus { +func (o *GetHVNRouteDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { return o.Payload } func (o *GetHVNRouteDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(cloud.GoogleRPCStatus) + o.Payload = new(cloud.GrpcGatewayRuntimeError) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/clients/cloud-network/stable/2020-09-07/client/network_service/get_parameters.go b/clients/cloud-network/stable/2020-09-07/client/network_service/get_parameters.go index 321aafa8..4b98e8c0 100644 --- a/clients/cloud-network/stable/2020-09-07/client/network_service/get_parameters.go +++ b/clients/cloud-network/stable/2020-09-07/client/network_service/get_parameters.go @@ -81,13 +81,13 @@ type GetParams struct { /* LocationRegionProvider. - provider is the named cloud provider ("aws", "gcp", "azure") + provider is the named cloud provider ("aws", "gcp", "azure"). */ LocationRegionProvider *string /* LocationRegionRegion. - region is the cloud region ("us-west1", "us-east1") + region is the cloud region ("us-west1", "us-east1"). */ LocationRegionRegion *string diff --git a/clients/cloud-network/stable/2020-09-07/client/network_service/get_peering_parameters.go b/clients/cloud-network/stable/2020-09-07/client/network_service/get_peering_parameters.go index 5a37eb97..e3e7d2a7 100644 --- a/clients/cloud-network/stable/2020-09-07/client/network_service/get_peering_parameters.go +++ b/clients/cloud-network/stable/2020-09-07/client/network_service/get_peering_parameters.go @@ -87,13 +87,13 @@ type GetPeeringParams struct { /* LocationRegionProvider. - provider is the named cloud provider ("aws", "gcp", "azure") + provider is the named cloud provider ("aws", "gcp", "azure"). */ LocationRegionProvider *string /* LocationRegionRegion. - region is the cloud region ("us-west1", "us-east1") + region is the cloud region ("us-west1", "us-east1"). */ LocationRegionRegion *string diff --git a/clients/cloud-network/stable/2020-09-07/client/network_service/get_peering_responses.go b/clients/cloud-network/stable/2020-09-07/client/network_service/get_peering_responses.go index 02869377..bf9ec443 100644 --- a/clients/cloud-network/stable/2020-09-07/client/network_service/get_peering_responses.go +++ b/clients/cloud-network/stable/2020-09-07/client/network_service/get_peering_responses.go @@ -125,7 +125,7 @@ An unexpected error response. type GetPeeringDefault struct { _statusCode int - Payload *cloud.GoogleRPCStatus + Payload *cloud.GrpcGatewayRuntimeError } // IsSuccess returns true when this get peering default response has a 2xx status code @@ -166,13 +166,13 @@ func (o *GetPeeringDefault) String() string { return fmt.Sprintf("[GET /network/2020-09-07/organizations/{location.organization_id}/projects/{location.project_id}/networks/{hvn_id}/peerings/{id}][%d] GetPeering default %+v", o._statusCode, o.Payload) } -func (o *GetPeeringDefault) GetPayload() *cloud.GoogleRPCStatus { +func (o *GetPeeringDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { return o.Payload } func (o *GetPeeringDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(cloud.GoogleRPCStatus) + o.Payload = new(cloud.GrpcGatewayRuntimeError) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/clients/cloud-network/stable/2020-09-07/client/network_service/get_responses.go b/clients/cloud-network/stable/2020-09-07/client/network_service/get_responses.go index 2ec3638e..0925349d 100644 --- a/clients/cloud-network/stable/2020-09-07/client/network_service/get_responses.go +++ b/clients/cloud-network/stable/2020-09-07/client/network_service/get_responses.go @@ -125,7 +125,7 @@ An unexpected error response. type GetDefault struct { _statusCode int - Payload *cloud.GoogleRPCStatus + Payload *cloud.GrpcGatewayRuntimeError } // IsSuccess returns true when this get default response has a 2xx status code @@ -166,13 +166,13 @@ func (o *GetDefault) String() string { return fmt.Sprintf("[GET /network/2020-09-07/organizations/{location.organization_id}/projects/{location.project_id}/networks/{id}][%d] Get default %+v", o._statusCode, o.Payload) } -func (o *GetDefault) GetPayload() *cloud.GoogleRPCStatus { +func (o *GetDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { return o.Payload } func (o *GetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(cloud.GoogleRPCStatus) + o.Payload = new(cloud.GrpcGatewayRuntimeError) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/clients/cloud-network/stable/2020-09-07/client/network_service/get_t_g_w_attachment_parameters.go b/clients/cloud-network/stable/2020-09-07/client/network_service/get_t_g_w_attachment_parameters.go index e8974369..6bd93337 100644 --- a/clients/cloud-network/stable/2020-09-07/client/network_service/get_t_g_w_attachment_parameters.go +++ b/clients/cloud-network/stable/2020-09-07/client/network_service/get_t_g_w_attachment_parameters.go @@ -88,13 +88,13 @@ type GetTGWAttachmentParams struct { /* HvnLocationRegionProvider. - provider is the named cloud provider ("aws", "gcp", "azure") + provider is the named cloud provider ("aws", "gcp", "azure"). */ HvnLocationRegionProvider *string /* HvnLocationRegionRegion. - region is the cloud region ("us-west1", "us-east1") + region is the cloud region ("us-west1", "us-east1"). */ HvnLocationRegionRegion *string diff --git a/clients/cloud-network/stable/2020-09-07/client/network_service/get_t_g_w_attachment_responses.go b/clients/cloud-network/stable/2020-09-07/client/network_service/get_t_g_w_attachment_responses.go index 823c855b..10dfcb99 100644 --- a/clients/cloud-network/stable/2020-09-07/client/network_service/get_t_g_w_attachment_responses.go +++ b/clients/cloud-network/stable/2020-09-07/client/network_service/get_t_g_w_attachment_responses.go @@ -125,7 +125,7 @@ An unexpected error response. type GetTGWAttachmentDefault struct { _statusCode int - Payload *cloud.GoogleRPCStatus + Payload *cloud.GrpcGatewayRuntimeError } // IsSuccess returns true when this get t g w attachment default response has a 2xx status code @@ -166,13 +166,13 @@ func (o *GetTGWAttachmentDefault) String() string { return fmt.Sprintf("[GET /network/2020-09-07/organizations/{hvn.location.organization_id}/projects/{hvn.location.project_id}/networks/{hvn.id}/transit-gateway-attachments/{id}][%d] GetTGWAttachment default %+v", o._statusCode, o.Payload) } -func (o *GetTGWAttachmentDefault) GetPayload() *cloud.GoogleRPCStatus { +func (o *GetTGWAttachmentDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { return o.Payload } func (o *GetTGWAttachmentDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(cloud.GoogleRPCStatus) + o.Payload = new(cloud.GrpcGatewayRuntimeError) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/clients/cloud-network/stable/2020-09-07/client/network_service/list_dependencies_parameters.go b/clients/cloud-network/stable/2020-09-07/client/network_service/list_dependencies_parameters.go index 9d1e1d88..97e25825 100644 --- a/clients/cloud-network/stable/2020-09-07/client/network_service/list_dependencies_parameters.go +++ b/clients/cloud-network/stable/2020-09-07/client/network_service/list_dependencies_parameters.go @@ -82,13 +82,13 @@ type ListDependenciesParams struct { /* LocationRegionProvider. - provider is the named cloud provider ("aws", "gcp", "azure") + provider is the named cloud provider ("aws", "gcp", "azure"). */ LocationRegionProvider *string /* LocationRegionRegion. - region is the cloud region ("us-west1", "us-east1") + region is the cloud region ("us-west1", "us-east1"). */ LocationRegionRegion *string diff --git a/clients/cloud-network/stable/2020-09-07/client/network_service/list_dependencies_responses.go b/clients/cloud-network/stable/2020-09-07/client/network_service/list_dependencies_responses.go index bb9a2bf6..77572687 100644 --- a/clients/cloud-network/stable/2020-09-07/client/network_service/list_dependencies_responses.go +++ b/clients/cloud-network/stable/2020-09-07/client/network_service/list_dependencies_responses.go @@ -125,7 +125,7 @@ An unexpected error response. type ListDependenciesDefault struct { _statusCode int - Payload *cloud.GoogleRPCStatus + Payload *cloud.GrpcGatewayRuntimeError } // IsSuccess returns true when this list dependencies default response has a 2xx status code @@ -166,13 +166,13 @@ func (o *ListDependenciesDefault) String() string { return fmt.Sprintf("[GET /network/2020-09-07/organizations/{location.organization_id}/projects/{location.project_id}/networks/{id}/dependencies][%d] ListDependencies default %+v", o._statusCode, o.Payload) } -func (o *ListDependenciesDefault) GetPayload() *cloud.GoogleRPCStatus { +func (o *ListDependenciesDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { return o.Payload } func (o *ListDependenciesDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(cloud.GoogleRPCStatus) + o.Payload = new(cloud.GrpcGatewayRuntimeError) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/clients/cloud-network/stable/2020-09-07/client/network_service/list_h_v_n_routes_parameters.go b/clients/cloud-network/stable/2020-09-07/client/network_service/list_h_v_n_routes_parameters.go index e33134ad..4f18d0f0 100644 --- a/clients/cloud-network/stable/2020-09-07/client/network_service/list_h_v_n_routes_parameters.go +++ b/clients/cloud-network/stable/2020-09-07/client/network_service/list_h_v_n_routes_parameters.go @@ -96,13 +96,13 @@ type ListHVNRoutesParams struct { /* HvnLocationRegionProvider. - provider is the named cloud provider ("aws", "gcp", "azure") + provider is the named cloud provider ("aws", "gcp", "azure"). */ HvnLocationRegionProvider *string /* HvnLocationRegionRegion. - region is the cloud region ("us-west1", "us-east1") + region is the cloud region ("us-west1", "us-east1"). */ HvnLocationRegionRegion *string diff --git a/clients/cloud-network/stable/2020-09-07/client/network_service/list_h_v_n_routes_responses.go b/clients/cloud-network/stable/2020-09-07/client/network_service/list_h_v_n_routes_responses.go index dd48e7f0..537b2b6c 100644 --- a/clients/cloud-network/stable/2020-09-07/client/network_service/list_h_v_n_routes_responses.go +++ b/clients/cloud-network/stable/2020-09-07/client/network_service/list_h_v_n_routes_responses.go @@ -125,7 +125,7 @@ An unexpected error response. type ListHVNRoutesDefault struct { _statusCode int - Payload *cloud.GoogleRPCStatus + Payload *cloud.GrpcGatewayRuntimeError } // IsSuccess returns true when this list h v n routes default response has a 2xx status code @@ -166,13 +166,13 @@ func (o *ListHVNRoutesDefault) String() string { return fmt.Sprintf("[GET /network/2020-09-07/organizations/{hvn.location.organization_id}/projects/{hvn.location.project_id}/networks/{hvn.id}/routes][%d] ListHVNRoutes default %+v", o._statusCode, o.Payload) } -func (o *ListHVNRoutesDefault) GetPayload() *cloud.GoogleRPCStatus { +func (o *ListHVNRoutesDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { return o.Payload } func (o *ListHVNRoutesDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(cloud.GoogleRPCStatus) + o.Payload = new(cloud.GrpcGatewayRuntimeError) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/clients/cloud-network/stable/2020-09-07/client/network_service/list_parameters.go b/clients/cloud-network/stable/2020-09-07/client/network_service/list_parameters.go index 4fcefc72..7464c681 100644 --- a/clients/cloud-network/stable/2020-09-07/client/network_service/list_parameters.go +++ b/clients/cloud-network/stable/2020-09-07/client/network_service/list_parameters.go @@ -76,13 +76,13 @@ type ListParams struct { /* LocationRegionProvider. - provider is the named cloud provider ("aws", "gcp", "azure") + provider is the named cloud provider ("aws", "gcp", "azure"). */ LocationRegionProvider *string /* LocationRegionRegion. - region is the cloud region ("us-west1", "us-east1") + region is the cloud region ("us-west1", "us-east1"). */ LocationRegionRegion *string diff --git a/clients/cloud-network/stable/2020-09-07/client/network_service/list_peerings_parameters.go b/clients/cloud-network/stable/2020-09-07/client/network_service/list_peerings_parameters.go index 1b12daac..e0a0feb2 100644 --- a/clients/cloud-network/stable/2020-09-07/client/network_service/list_peerings_parameters.go +++ b/clients/cloud-network/stable/2020-09-07/client/network_service/list_peerings_parameters.go @@ -82,13 +82,13 @@ type ListPeeringsParams struct { /* LocationRegionProvider. - provider is the named cloud provider ("aws", "gcp", "azure") + provider is the named cloud provider ("aws", "gcp", "azure"). */ LocationRegionProvider *string /* LocationRegionRegion. - region is the cloud region ("us-west1", "us-east1") + region is the cloud region ("us-west1", "us-east1"). */ LocationRegionRegion *string diff --git a/clients/cloud-network/stable/2020-09-07/client/network_service/list_peerings_responses.go b/clients/cloud-network/stable/2020-09-07/client/network_service/list_peerings_responses.go index 7edacf69..98783a1c 100644 --- a/clients/cloud-network/stable/2020-09-07/client/network_service/list_peerings_responses.go +++ b/clients/cloud-network/stable/2020-09-07/client/network_service/list_peerings_responses.go @@ -125,7 +125,7 @@ An unexpected error response. type ListPeeringsDefault struct { _statusCode int - Payload *cloud.GoogleRPCStatus + Payload *cloud.GrpcGatewayRuntimeError } // IsSuccess returns true when this list peerings default response has a 2xx status code @@ -166,13 +166,13 @@ func (o *ListPeeringsDefault) String() string { return fmt.Sprintf("[GET /network/2020-09-07/organizations/{location.organization_id}/projects/{location.project_id}/networks/{hvn_id}/peerings][%d] ListPeerings default %+v", o._statusCode, o.Payload) } -func (o *ListPeeringsDefault) GetPayload() *cloud.GoogleRPCStatus { +func (o *ListPeeringsDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { return o.Payload } func (o *ListPeeringsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(cloud.GoogleRPCStatus) + o.Payload = new(cloud.GrpcGatewayRuntimeError) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/clients/cloud-network/stable/2020-09-07/client/network_service/list_responses.go b/clients/cloud-network/stable/2020-09-07/client/network_service/list_responses.go index a64e3de9..a08ae5eb 100644 --- a/clients/cloud-network/stable/2020-09-07/client/network_service/list_responses.go +++ b/clients/cloud-network/stable/2020-09-07/client/network_service/list_responses.go @@ -125,7 +125,7 @@ An unexpected error response. type ListDefault struct { _statusCode int - Payload *cloud.GoogleRPCStatus + Payload *cloud.GrpcGatewayRuntimeError } // IsSuccess returns true when this list default response has a 2xx status code @@ -166,13 +166,13 @@ func (o *ListDefault) String() string { return fmt.Sprintf("[GET /network/2020-09-07/organizations/{location.organization_id}/projects/{location.project_id}/networks][%d] List default %+v", o._statusCode, o.Payload) } -func (o *ListDefault) GetPayload() *cloud.GoogleRPCStatus { +func (o *ListDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { return o.Payload } func (o *ListDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(cloud.GoogleRPCStatus) + o.Payload = new(cloud.GrpcGatewayRuntimeError) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/clients/cloud-network/stable/2020-09-07/client/network_service/list_t_g_w_attachments_parameters.go b/clients/cloud-network/stable/2020-09-07/client/network_service/list_t_g_w_attachments_parameters.go index 20e91213..465e0939 100644 --- a/clients/cloud-network/stable/2020-09-07/client/network_service/list_t_g_w_attachments_parameters.go +++ b/clients/cloud-network/stable/2020-09-07/client/network_service/list_t_g_w_attachments_parameters.go @@ -89,13 +89,13 @@ type ListTGWAttachmentsParams struct { /* HvnLocationRegionProvider. - provider is the named cloud provider ("aws", "gcp", "azure") + provider is the named cloud provider ("aws", "gcp", "azure"). */ HvnLocationRegionProvider *string /* HvnLocationRegionRegion. - region is the cloud region ("us-west1", "us-east1") + region is the cloud region ("us-west1", "us-east1"). */ HvnLocationRegionRegion *string @@ -144,7 +144,7 @@ type ListTGWAttachmentsParams struct { /* States. States is an optional parameter to list only TGW Attachments in a certain states - if not specified all TGW Attachments will be returned + if not specified all TGW Attachments will be returned. */ States []string diff --git a/clients/cloud-network/stable/2020-09-07/client/network_service/list_t_g_w_attachments_responses.go b/clients/cloud-network/stable/2020-09-07/client/network_service/list_t_g_w_attachments_responses.go index 7d637b70..62f305c2 100644 --- a/clients/cloud-network/stable/2020-09-07/client/network_service/list_t_g_w_attachments_responses.go +++ b/clients/cloud-network/stable/2020-09-07/client/network_service/list_t_g_w_attachments_responses.go @@ -125,7 +125,7 @@ An unexpected error response. type ListTGWAttachmentsDefault struct { _statusCode int - Payload *cloud.GoogleRPCStatus + Payload *cloud.GrpcGatewayRuntimeError } // IsSuccess returns true when this list t g w attachments default response has a 2xx status code @@ -166,13 +166,13 @@ func (o *ListTGWAttachmentsDefault) String() string { return fmt.Sprintf("[GET /network/2020-09-07/organizations/{hvn.location.organization_id}/projects/{hvn.location.project_id}/networks/{hvn.id}/transit-gateway-attachments][%d] ListTGWAttachments default %+v", o._statusCode, o.Payload) } -func (o *ListTGWAttachmentsDefault) GetPayload() *cloud.GoogleRPCStatus { +func (o *ListTGWAttachmentsDefault) GetPayload() *cloud.GrpcGatewayRuntimeError { return o.Payload } func (o *ListTGWAttachmentsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(cloud.GoogleRPCStatus) + o.Payload = new(cloud.GrpcGatewayRuntimeError) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/clients/cloud-network/stable/2020-09-07/models/hashicorp_cloud_network20200907_associate_h_v_n_with_a_w_s_route53_private_hosted_zone_request.go b/clients/cloud-network/stable/2020-09-07/models/hashicorp_cloud_network20200907_associate_h_v_n_with_a_w_s_route53_private_hosted_zone_request.go new file mode 100644 index 00000000..a07328f0 --- /dev/null +++ b/clients/cloud-network/stable/2020-09-07/models/hashicorp_cloud_network20200907_associate_h_v_n_with_a_w_s_route53_private_hosted_zone_request.go @@ -0,0 +1,116 @@ +// 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" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// HashicorpCloudNetwork20200907AssociateHVNWithAWSRoute53PrivateHostedZoneRequest See NetworkService.AssociateHVNWithAWSRoute53PrivateHostedZone for more details. +// +// swagger:model hashicorp.cloud.network_20200907.AssociateHVNWithAWSRoute53PrivateHostedZoneRequest +type HashicorpCloudNetwork20200907AssociateHVNWithAWSRoute53PrivateHostedZoneRequest struct { + + // hosted_zone_id is the ID of the hosted zone in the external AWS account. + HostedZoneID string `json:"hosted_zone_id,omitempty"` + + // hvn_id is the id of the HVN the private hosted zone should be associated with. + HvnID string `json:"hvn_id,omitempty"` + + // location is the location of the HVN. + Location *cloud.HashicorpCloudLocationLocation `json:"location,omitempty"` +} + +// Validate validates this hashicorp cloud network 20200907 associate h v n with a w s route53 private hosted zone request +func (m *HashicorpCloudNetwork20200907AssociateHVNWithAWSRoute53PrivateHostedZoneRequest) 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 *HashicorpCloudNetwork20200907AssociateHVNWithAWSRoute53PrivateHostedZoneRequest) 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 network 20200907 associate h v n with a w s route53 private hosted zone request based on the context it is used +func (m *HashicorpCloudNetwork20200907AssociateHVNWithAWSRoute53PrivateHostedZoneRequest) 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 *HashicorpCloudNetwork20200907AssociateHVNWithAWSRoute53PrivateHostedZoneRequest) 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 *HashicorpCloudNetwork20200907AssociateHVNWithAWSRoute53PrivateHostedZoneRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudNetwork20200907AssociateHVNWithAWSRoute53PrivateHostedZoneRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudNetwork20200907AssociateHVNWithAWSRoute53PrivateHostedZoneRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-network/stable/2020-09-07/models/hashicorp_cloud_network20200907_create_h_v_n_route_request.go b/clients/cloud-network/stable/2020-09-07/models/hashicorp_cloud_network20200907_create_h_v_n_route_request.go new file mode 100644 index 00000000..c963002c --- /dev/null +++ b/clients/cloud-network/stable/2020-09-07/models/hashicorp_cloud_network20200907_create_h_v_n_route_request.go @@ -0,0 +1,218 @@ +// 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" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// HashicorpCloudNetwork20200907CreateHVNRouteRequest hashicorp cloud network 20200907 create h v n route request +// +// swagger:model hashicorp.cloud.network_20200907.CreateHVNRouteRequest +type HashicorpCloudNetwork20200907CreateHVNRouteRequest struct { + + // azure_route contains specific configuration about the azure route + AzureRoute *HashicorpCloudNetwork20200907AzureRoute `json:"azure_route,omitempty"` + + // destination is a destination CIDR for this HVN Route + Destination string `json:"destination,omitempty"` + + // hvn is the HVN where a route being created + Hvn *cloud.HashicorpCloudLocationLink `json:"hvn,omitempty"` + + // id is a user generated id for the route + ID string `json:"id,omitempty"` + + // target is a target for this HVN Route + Target *HashicorpCloudNetwork20200907HVNRouteTarget `json:"target,omitempty"` +} + +// Validate validates this hashicorp cloud network 20200907 create h v n route request +func (m *HashicorpCloudNetwork20200907CreateHVNRouteRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAzureRoute(formats); err != nil { + res = append(res, err) + } + + if err := m.validateHvn(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTarget(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudNetwork20200907CreateHVNRouteRequest) validateAzureRoute(formats strfmt.Registry) error { + if swag.IsZero(m.AzureRoute) { // not required + return nil + } + + if m.AzureRoute != nil { + if err := m.AzureRoute.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("azure_route") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("azure_route") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudNetwork20200907CreateHVNRouteRequest) validateHvn(formats strfmt.Registry) error { + if swag.IsZero(m.Hvn) { // not required + return nil + } + + if m.Hvn != nil { + if err := m.Hvn.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("hvn") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("hvn") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudNetwork20200907CreateHVNRouteRequest) validateTarget(formats strfmt.Registry) error { + if swag.IsZero(m.Target) { // not required + return nil + } + + if m.Target != nil { + if err := m.Target.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("target") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("target") + } + return err + } + } + + return nil +} + +// ContextValidate validate this hashicorp cloud network 20200907 create h v n route request based on the context it is used +func (m *HashicorpCloudNetwork20200907CreateHVNRouteRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAzureRoute(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateHvn(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTarget(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudNetwork20200907CreateHVNRouteRequest) contextValidateAzureRoute(ctx context.Context, formats strfmt.Registry) error { + + if m.AzureRoute != nil { + + if swag.IsZero(m.AzureRoute) { // not required + return nil + } + + if err := m.AzureRoute.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("azure_route") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("azure_route") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudNetwork20200907CreateHVNRouteRequest) contextValidateHvn(ctx context.Context, formats strfmt.Registry) error { + + if m.Hvn != nil { + + if swag.IsZero(m.Hvn) { // not required + return nil + } + + if err := m.Hvn.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("hvn") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("hvn") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudNetwork20200907CreateHVNRouteRequest) contextValidateTarget(ctx context.Context, formats strfmt.Registry) error { + + if m.Target != nil { + + if swag.IsZero(m.Target) { // not required + return nil + } + + if err := m.Target.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("target") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("target") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudNetwork20200907CreateHVNRouteRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudNetwork20200907CreateHVNRouteRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudNetwork20200907CreateHVNRouteRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-network/stable/2020-09-07/models/hashicorp_cloud_network20200907_create_peering_request.go b/clients/cloud-network/stable/2020-09-07/models/hashicorp_cloud_network20200907_create_peering_request.go new file mode 100644 index 00000000..9af8edd6 --- /dev/null +++ b/clients/cloud-network/stable/2020-09-07/models/hashicorp_cloud_network20200907_create_peering_request.go @@ -0,0 +1,109 @@ +// 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" +) + +// HashicorpCloudNetwork20200907CreatePeeringRequest CreatePeeringRequest is a request type for CreatePeering endpoint +// +// swagger:model hashicorp.cloud.network_20200907.CreatePeeringRequest +type HashicorpCloudNetwork20200907CreatePeeringRequest struct { + + // peering is the peering to be created. + Peering *HashicorpCloudNetwork20200907Peering `json:"peering,omitempty"` +} + +// Validate validates this hashicorp cloud network 20200907 create peering request +func (m *HashicorpCloudNetwork20200907CreatePeeringRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validatePeering(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudNetwork20200907CreatePeeringRequest) validatePeering(formats strfmt.Registry) error { + if swag.IsZero(m.Peering) { // not required + return nil + } + + if m.Peering != nil { + if err := m.Peering.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("peering") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("peering") + } + return err + } + } + + return nil +} + +// ContextValidate validate this hashicorp cloud network 20200907 create peering request based on the context it is used +func (m *HashicorpCloudNetwork20200907CreatePeeringRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidatePeering(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudNetwork20200907CreatePeeringRequest) contextValidatePeering(ctx context.Context, formats strfmt.Registry) error { + + if m.Peering != nil { + + if swag.IsZero(m.Peering) { // not required + return nil + } + + if err := m.Peering.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("peering") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("peering") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudNetwork20200907CreatePeeringRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudNetwork20200907CreatePeeringRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudNetwork20200907CreatePeeringRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-network/stable/2020-09-07/models/hashicorp_cloud_network20200907_create_request.go b/clients/cloud-network/stable/2020-09-07/models/hashicorp_cloud_network20200907_create_request.go new file mode 100644 index 00000000..00d41770 --- /dev/null +++ b/clients/cloud-network/stable/2020-09-07/models/hashicorp_cloud_network20200907_create_request.go @@ -0,0 +1,109 @@ +// 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" +) + +// HashicorpCloudNetwork20200907CreateRequest hashicorp cloud network 20200907 create request +// +// swagger:model hashicorp.cloud.network_20200907.CreateRequest +type HashicorpCloudNetwork20200907CreateRequest struct { + + // network is the network object to be created. + Network *HashicorpCloudNetwork20200907Network `json:"network,omitempty"` +} + +// Validate validates this hashicorp cloud network 20200907 create request +func (m *HashicorpCloudNetwork20200907CreateRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateNetwork(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudNetwork20200907CreateRequest) validateNetwork(formats strfmt.Registry) error { + if swag.IsZero(m.Network) { // not required + return nil + } + + if m.Network != nil { + if err := m.Network.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("network") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("network") + } + return err + } + } + + return nil +} + +// ContextValidate validate this hashicorp cloud network 20200907 create request based on the context it is used +func (m *HashicorpCloudNetwork20200907CreateRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateNetwork(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudNetwork20200907CreateRequest) contextValidateNetwork(ctx context.Context, formats strfmt.Registry) error { + + if m.Network != nil { + + if swag.IsZero(m.Network) { // not required + return nil + } + + if err := m.Network.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("network") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("network") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudNetwork20200907CreateRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudNetwork20200907CreateRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudNetwork20200907CreateRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-network/stable/2020-09-07/models/hashicorp_cloud_network20200907_create_t_g_w_attachment_request.go b/clients/cloud-network/stable/2020-09-07/models/hashicorp_cloud_network20200907_create_t_g_w_attachment_request.go new file mode 100644 index 00000000..2ee033fa --- /dev/null +++ b/clients/cloud-network/stable/2020-09-07/models/hashicorp_cloud_network20200907_create_t_g_w_attachment_request.go @@ -0,0 +1,169 @@ +// 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" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// HashicorpCloudNetwork20200907CreateTGWAttachmentRequest hashicorp cloud network 20200907 create t g w attachment request +// +// swagger:model hashicorp.cloud.network_20200907.CreateTGWAttachmentRequest +type HashicorpCloudNetwork20200907CreateTGWAttachmentRequest struct { + + // cidrs is a list of destination CIDRs this TGW attachment will be routing to through the + // transit gateway. + Cidrs []string `json:"cidrs"` + + // HVN is a link to the HVN the TGW Attachment belongs to. + Hvn *cloud.HashicorpCloudLocationLink `json:"hvn,omitempty"` + + // id is the user-set transit gateway attachment slug ID, optional for now, if not present we will use internal-id. + ID string `json:"id,omitempty"` + + // provider_data is the provider specific data to create a TGW Attachment. + // For AWS it includes the transit gateway ID and the resource share ARN. + ProviderData *HashicorpCloudNetwork20200907CreateTGWAttachmentRequestProviderData `json:"provider_data,omitempty"` +} + +// Validate validates this hashicorp cloud network 20200907 create t g w attachment request +func (m *HashicorpCloudNetwork20200907CreateTGWAttachmentRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateHvn(formats); err != nil { + res = append(res, err) + } + + if err := m.validateProviderData(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudNetwork20200907CreateTGWAttachmentRequest) validateHvn(formats strfmt.Registry) error { + if swag.IsZero(m.Hvn) { // not required + return nil + } + + if m.Hvn != nil { + if err := m.Hvn.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("hvn") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("hvn") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudNetwork20200907CreateTGWAttachmentRequest) validateProviderData(formats strfmt.Registry) error { + if swag.IsZero(m.ProviderData) { // not required + return nil + } + + if m.ProviderData != nil { + if err := m.ProviderData.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("provider_data") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("provider_data") + } + return err + } + } + + return nil +} + +// ContextValidate validate this hashicorp cloud network 20200907 create t g w attachment request based on the context it is used +func (m *HashicorpCloudNetwork20200907CreateTGWAttachmentRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateHvn(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateProviderData(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HashicorpCloudNetwork20200907CreateTGWAttachmentRequest) contextValidateHvn(ctx context.Context, formats strfmt.Registry) error { + + if m.Hvn != nil { + + if swag.IsZero(m.Hvn) { // not required + return nil + } + + if err := m.Hvn.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("hvn") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("hvn") + } + return err + } + } + + return nil +} + +func (m *HashicorpCloudNetwork20200907CreateTGWAttachmentRequest) contextValidateProviderData(ctx context.Context, formats strfmt.Registry) error { + + if m.ProviderData != nil { + + if swag.IsZero(m.ProviderData) { // not required + return nil + } + + if err := m.ProviderData.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("provider_data") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("provider_data") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HashicorpCloudNetwork20200907CreateTGWAttachmentRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudNetwork20200907CreateTGWAttachmentRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudNetwork20200907CreateTGWAttachmentRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/clients/cloud-network/stable/2020-09-07/models/hashicorp_cloud_network20200907_create_token_request.go b/clients/cloud-network/stable/2020-09-07/models/hashicorp_cloud_network20200907_create_token_request.go new file mode 100644 index 00000000..cb90fdf9 --- /dev/null +++ b/clients/cloud-network/stable/2020-09-07/models/hashicorp_cloud_network20200907_create_token_request.go @@ -0,0 +1,113 @@ +// 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" + cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" +) + +// HashicorpCloudNetwork20200907CreateTokenRequest CreateTokenRequest is a request type for the CreateToken endpoint. +// +// swagger:model hashicorp.cloud.network_20200907.CreateTokenRequest +type HashicorpCloudNetwork20200907CreateTokenRequest struct { + + // id the id of the HVN we are creating a token for. + ID string `json:"id,omitempty"` + + // location is the location of the HVN. + Location *cloud.HashicorpCloudLocationLocation `json:"location,omitempty"` +} + +// Validate validates this hashicorp cloud network 20200907 create token request +func (m *HashicorpCloudNetwork20200907CreateTokenRequest) 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 *HashicorpCloudNetwork20200907CreateTokenRequest) 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 network 20200907 create token request based on the context it is used +func (m *HashicorpCloudNetwork20200907CreateTokenRequest) 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 *HashicorpCloudNetwork20200907CreateTokenRequest) 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 *HashicorpCloudNetwork20200907CreateTokenRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HashicorpCloudNetwork20200907CreateTokenRequest) UnmarshalBinary(b []byte) error { + var res HashicorpCloudNetwork20200907CreateTokenRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +}