diff --git a/client/models/a_w_s_cloud_watch_logs.go b/client/models/a_w_s_cloud_watch_logs.go index 66bc89c3..36aec23d 100644 --- a/client/models/a_w_s_cloud_watch_logs.go +++ b/client/models/a_w_s_cloud_watch_logs.go @@ -9,7 +9,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -105,7 +105,7 @@ func (m AWSCloudWatchLogs) MarshalJSON() ([]byte, error) { return nil, err } - return swag.ConcatJSON(b1, b2, b3), nil + return jsonutils.ConcatJSON(b1, b2, b3), nil } // Validate validates this a w s cloud watch logs @@ -146,13 +146,13 @@ func (m *AWSCloudWatchLogs) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *AWSCloudWatchLogs) UnmarshalBinary(b []byte) error { var res AWSCloudWatchLogs - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/a_w_s_infrastructure_resources_aggregation.go b/client/models/a_w_s_infrastructure_resources_aggregation.go index c481b628..75aa67d9 100644 --- a/client/models/a_w_s_infrastructure_resources_aggregation.go +++ b/client/models/a_w_s_infrastructure_resources_aggregation.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" ) // AWSInfrastructureResourcesAggregation AWS Infrastructure Resources Aggregation @@ -229,7 +230,7 @@ func (m AWSInfrastructureResourcesAggregation) MarshalJSON() ([]byte, error) { } // concatenate the 2 objects - return swag.ConcatJSON(props, additional), nil + return jsonutils.ConcatJSON(props, additional), nil } // Validate validates this a w s infrastructure resources aggregation @@ -242,12 +243,12 @@ func (m *AWSInfrastructureResourcesAggregation) Validate(formats strfmt.Registry } props := make(map[string]json.RawMessage, 12+10) - j, err := swag.WriteJSON(m) + j, err := jsonutils.WriteJSON(m) if err != nil { return err } - if err = swag.ReadJSON(j, &props); err != nil { + if err = jsonutils.ReadJSON(j, &props); err != nil { return err } @@ -318,7 +319,7 @@ func (m *AWSInfrastructureResourcesAggregation) Validate(formats strfmt.Registry } func (m *AWSInfrastructureResourcesAggregation) validateBuckets(formats strfmt.Registry) error { - if swag.IsZero(m.Buckets) { // not required + if typeutils.IsZero(m.Buckets) { // not required return nil } @@ -341,7 +342,7 @@ func (m *AWSInfrastructureResourcesAggregation) validateBuckets(formats strfmt.R } func (m *AWSInfrastructureResourcesAggregation) validateCacheClusters(formats strfmt.Registry) error { - if swag.IsZero(m.CacheClusters) { // not required + if typeutils.IsZero(m.CacheClusters) { // not required return nil } @@ -364,7 +365,7 @@ func (m *AWSInfrastructureResourcesAggregation) validateCacheClusters(formats st } func (m *AWSInfrastructureResourcesAggregation) validateDbInstances(formats strfmt.Registry) error { - if swag.IsZero(m.DbInstances) { // not required + if typeutils.IsZero(m.DbInstances) { // not required return nil } @@ -387,7 +388,7 @@ func (m *AWSInfrastructureResourcesAggregation) validateDbInstances(formats strf } func (m *AWSInfrastructureResourcesAggregation) validateImages(formats strfmt.Registry) error { - if swag.IsZero(m.Images) { // not required + if typeutils.IsZero(m.Images) { // not required return nil } @@ -410,7 +411,7 @@ func (m *AWSInfrastructureResourcesAggregation) validateImages(formats strfmt.Re } func (m *AWSInfrastructureResourcesAggregation) validateInstances(formats strfmt.Registry) error { - if swag.IsZero(m.Instances) { // not required + if typeutils.IsZero(m.Instances) { // not required return nil } @@ -433,7 +434,7 @@ func (m *AWSInfrastructureResourcesAggregation) validateInstances(formats strfmt } func (m *AWSInfrastructureResourcesAggregation) validateLoadBalancersV1(formats strfmt.Registry) error { - if swag.IsZero(m.LoadBalancersV1) { // not required + if typeutils.IsZero(m.LoadBalancersV1) { // not required return nil } @@ -456,7 +457,7 @@ func (m *AWSInfrastructureResourcesAggregation) validateLoadBalancersV1(formats } func (m *AWSInfrastructureResourcesAggregation) validateLoadBalancersV2(formats strfmt.Registry) error { - if swag.IsZero(m.LoadBalancersV2) { // not required + if typeutils.IsZero(m.LoadBalancersV2) { // not required return nil } @@ -479,7 +480,7 @@ func (m *AWSInfrastructureResourcesAggregation) validateLoadBalancersV2(formats } func (m *AWSInfrastructureResourcesAggregation) validateSecurityGroups(formats strfmt.Registry) error { - if swag.IsZero(m.SecurityGroups) { // not required + if typeutils.IsZero(m.SecurityGroups) { // not required return nil } @@ -502,7 +503,7 @@ func (m *AWSInfrastructureResourcesAggregation) validateSecurityGroups(formats s } func (m *AWSInfrastructureResourcesAggregation) validateSnapshots(formats strfmt.Registry) error { - if swag.IsZero(m.Snapshots) { // not required + if typeutils.IsZero(m.Snapshots) { // not required return nil } @@ -525,7 +526,7 @@ func (m *AWSInfrastructureResourcesAggregation) validateSnapshots(formats strfmt } func (m *AWSInfrastructureResourcesAggregation) validateSubnets(formats strfmt.Registry) error { - if swag.IsZero(m.Subnets) { // not required + if typeutils.IsZero(m.Subnets) { // not required return nil } @@ -548,7 +549,7 @@ func (m *AWSInfrastructureResourcesAggregation) validateSubnets(formats strfmt.R } func (m *AWSInfrastructureResourcesAggregation) validateVolumes(formats strfmt.Registry) error { - if swag.IsZero(m.Volumes) { // not required + if typeutils.IsZero(m.Volumes) { // not required return nil } @@ -571,7 +572,7 @@ func (m *AWSInfrastructureResourcesAggregation) validateVolumes(formats strfmt.R } func (m *AWSInfrastructureResourcesAggregation) validateVpcs(formats strfmt.Registry) error { - if swag.IsZero(m.Vpcs) { // not required + if typeutils.IsZero(m.Vpcs) { // not required return nil } @@ -655,7 +656,7 @@ func (m *AWSInfrastructureResourcesAggregation) contextValidateBuckets(ctx conte if m.Buckets != nil { - if swag.IsZero(m.Buckets) { // not required + if typeutils.IsZero(m.Buckets) { // not required return nil } @@ -680,7 +681,7 @@ func (m *AWSInfrastructureResourcesAggregation) contextValidateCacheClusters(ctx if m.CacheClusters != nil { - if swag.IsZero(m.CacheClusters) { // not required + if typeutils.IsZero(m.CacheClusters) { // not required return nil } @@ -705,7 +706,7 @@ func (m *AWSInfrastructureResourcesAggregation) contextValidateDbInstances(ctx c if m.DbInstances != nil { - if swag.IsZero(m.DbInstances) { // not required + if typeutils.IsZero(m.DbInstances) { // not required return nil } @@ -730,7 +731,7 @@ func (m *AWSInfrastructureResourcesAggregation) contextValidateImages(ctx contex if m.Images != nil { - if swag.IsZero(m.Images) { // not required + if typeutils.IsZero(m.Images) { // not required return nil } @@ -755,7 +756,7 @@ func (m *AWSInfrastructureResourcesAggregation) contextValidateInstances(ctx con if m.Instances != nil { - if swag.IsZero(m.Instances) { // not required + if typeutils.IsZero(m.Instances) { // not required return nil } @@ -780,7 +781,7 @@ func (m *AWSInfrastructureResourcesAggregation) contextValidateLoadBalancersV1(c if m.LoadBalancersV1 != nil { - if swag.IsZero(m.LoadBalancersV1) { // not required + if typeutils.IsZero(m.LoadBalancersV1) { // not required return nil } @@ -805,7 +806,7 @@ func (m *AWSInfrastructureResourcesAggregation) contextValidateLoadBalancersV2(c if m.LoadBalancersV2 != nil { - if swag.IsZero(m.LoadBalancersV2) { // not required + if typeutils.IsZero(m.LoadBalancersV2) { // not required return nil } @@ -830,7 +831,7 @@ func (m *AWSInfrastructureResourcesAggregation) contextValidateSecurityGroups(ct if m.SecurityGroups != nil { - if swag.IsZero(m.SecurityGroups) { // not required + if typeutils.IsZero(m.SecurityGroups) { // not required return nil } @@ -855,7 +856,7 @@ func (m *AWSInfrastructureResourcesAggregation) contextValidateSnapshots(ctx con if m.Snapshots != nil { - if swag.IsZero(m.Snapshots) { // not required + if typeutils.IsZero(m.Snapshots) { // not required return nil } @@ -880,7 +881,7 @@ func (m *AWSInfrastructureResourcesAggregation) contextValidateSubnets(ctx conte if m.Subnets != nil { - if swag.IsZero(m.Subnets) { // not required + if typeutils.IsZero(m.Subnets) { // not required return nil } @@ -905,7 +906,7 @@ func (m *AWSInfrastructureResourcesAggregation) contextValidateVolumes(ctx conte if m.Volumes != nil { - if swag.IsZero(m.Volumes) { // not required + if typeutils.IsZero(m.Volumes) { // not required return nil } @@ -930,7 +931,7 @@ func (m *AWSInfrastructureResourcesAggregation) contextValidateVpcs(ctx context. if m.Vpcs != nil { - if swag.IsZero(m.Vpcs) { // not required + if typeutils.IsZero(m.Vpcs) { // not required return nil } @@ -956,13 +957,13 @@ func (m *AWSInfrastructureResourcesAggregation) MarshalBinary() ([]byte, error) if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *AWSInfrastructureResourcesAggregation) UnmarshalBinary(b []byte) error { var res AWSInfrastructureResourcesAggregation - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/a_w_s_remote_t_f_state.go b/client/models/a_w_s_remote_t_f_state.go index 0ae920c2..45cd4034 100644 --- a/client/models/a_w_s_remote_t_f_state.go +++ b/client/models/a_w_s_remote_t_f_state.go @@ -9,7 +9,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -187,7 +187,7 @@ func (m AWSRemoteTFState) MarshalJSON() ([]byte, error) { return nil, err } - return swag.ConcatJSON(b1, b2, b3), nil + return jsonutils.ConcatJSON(b1, b2, b3), nil } // Validate validates this a w s remote t f state @@ -241,13 +241,13 @@ func (m *AWSRemoteTFState) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *AWSRemoteTFState) UnmarshalBinary(b []byte) error { var res AWSRemoteTFState - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/a_w_s_storage.go b/client/models/a_w_s_storage.go index dfb97956..eec8c901 100644 --- a/client/models/a_w_s_storage.go +++ b/client/models/a_w_s_storage.go @@ -9,7 +9,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -183,7 +183,7 @@ func (m AWSStorage) MarshalJSON() ([]byte, error) { return nil, err } - return swag.ConcatJSON(b1, b2, b3), nil + return jsonutils.ConcatJSON(b1, b2, b3), nil } // Validate validates this a w s storage @@ -237,13 +237,13 @@ func (m *AWSStorage) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *AWSStorage) UnmarshalBinary(b []byte) error { var res AWSStorage - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/api_key.go b/client/models/api_key.go index cdfcca44..fb0c25bb 100644 --- a/client/models/api_key.go +++ b/client/models/api_key.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -152,7 +153,7 @@ func (m *APIKey) validateName(formats strfmt.Registry) error { } func (m *APIKey) validateOwner(formats strfmt.Registry) error { - if swag.IsZero(m.Owner) { // not required + if typeutils.IsZero(m.Owner) { // not required return nil } @@ -181,7 +182,7 @@ func (m *APIKey) validateRules(formats strfmt.Registry) error { } for i := 0; i < len(m.Rules); i++ { - if swag.IsZero(m.Rules[i]) { // not required + if typeutils.IsZero(m.Rules[i]) { // not required continue } @@ -227,7 +228,7 @@ func (m *APIKey) contextValidateOwner(ctx context.Context, formats strfmt.Regist if m.Owner != nil { - if swag.IsZero(m.Owner) { // not required + if typeutils.IsZero(m.Owner) { // not required return nil } @@ -254,7 +255,7 @@ func (m *APIKey) contextValidateRules(ctx context.Context, formats strfmt.Regist if m.Rules[i] != nil { - if swag.IsZero(m.Rules[i]) { // not required + if typeutils.IsZero(m.Rules[i]) { // not required return nil } @@ -282,13 +283,13 @@ func (m *APIKey) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *APIKey) UnmarshalBinary(b []byte) error { var res APIKey - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/app_configuration.go b/client/models/app_configuration.go index 016ddfa8..9741d4ab 100644 --- a/client/models/app_configuration.go +++ b/client/models/app_configuration.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -65,13 +65,13 @@ func (m *AppConfiguration) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *AppConfiguration) UnmarshalBinary(b []byte) error { var res AppConfiguration - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/app_version.go b/client/models/app_version.go index 8e636c1f..917a2a7e 100644 --- a/client/models/app_version.go +++ b/client/models/app_version.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -108,13 +108,13 @@ func (m *AppVersion) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *AppVersion) UnmarshalBinary(b []byte) error { var res AppVersion - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/appearance.go b/client/models/appearance.go index 5554b164..340853f7 100644 --- a/client/models/appearance.go +++ b/client/models/appearance.go @@ -8,7 +8,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -172,7 +173,7 @@ func (m *Appearance) validateColor(formats strfmt.Registry) error { } func (m *Appearance) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required + if typeutils.IsZero(m.CreatedAt) { // not required return nil } @@ -278,7 +279,7 @@ func (m *Appearance) validateTabTitle(formats strfmt.Registry) error { } func (m *Appearance) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required + if typeutils.IsZero(m.UpdatedAt) { // not required return nil } @@ -329,13 +330,13 @@ func (m *Appearance) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *Appearance) UnmarshalBinary(b []byte) error { var res Appearance - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res @@ -449,13 +450,13 @@ func (m *AppearanceColor) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *AppearanceColor) UnmarshalBinary(b []byte) error { var res AppearanceColor - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/authentication.go b/client/models/authentication.go index ca0fb567..80991bfd 100644 --- a/client/models/authentication.go +++ b/client/models/authentication.go @@ -12,7 +12,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" ) // Authentication AuthenticationWrapper @@ -83,7 +84,7 @@ func (m Authentication) MarshalJSON() ([]byte, error) { return nil, err } - return swag.ConcatJSON(b1, b2, b3), nil + return jsonutils.ConcatJSON(b1, b2, b3), nil } // Validate validates this authentication @@ -101,7 +102,7 @@ func (m *Authentication) Validate(formats strfmt.Registry) error { } func (m *Authentication) validateConfig(formats strfmt.Registry) error { - if swag.IsZero(m.Config()) { // not required + if typeutils.IsZero(m.Config()) { // not required return nil } @@ -137,7 +138,7 @@ func (m *Authentication) ContextValidate(ctx context.Context, formats strfmt.Reg func (m *Authentication) contextValidateConfig(ctx context.Context, formats strfmt.Registry) error { - if swag.IsZero(m.Config()) { // not required + if typeutils.IsZero(m.Config()) { // not required return nil } @@ -162,13 +163,13 @@ func (m *Authentication) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *Authentication) UnmarshalBinary(b []byte) error { var res Authentication - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/authentication_azure_a_d.go b/client/models/authentication_azure_a_d.go index f6538546..442a251b 100644 --- a/client/models/authentication_azure_a_d.go +++ b/client/models/authentication_azure_a_d.go @@ -9,7 +9,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -131,7 +131,7 @@ func (m AuthenticationAzureAD) MarshalJSON() ([]byte, error) { return nil, err } - return swag.ConcatJSON(b1, b2, b3), nil + return jsonutils.ConcatJSON(b1, b2, b3), nil } // Validate validates this authentication azure a d @@ -172,13 +172,13 @@ func (m *AuthenticationAzureAD) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *AuthenticationAzureAD) UnmarshalBinary(b []byte) error { var res AuthenticationAzureAD - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/authentication_git_hub.go b/client/models/authentication_git_hub.go index 805ceeb7..9d752fe6 100644 --- a/client/models/authentication_git_hub.go +++ b/client/models/authentication_git_hub.go @@ -9,7 +9,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -167,7 +167,7 @@ func (m AuthenticationGitHub) MarshalJSON() ([]byte, error) { return nil, err } - return swag.ConcatJSON(b1, b2, b3), nil + return jsonutils.ConcatJSON(b1, b2, b3), nil } // Validate validates this authentication git hub @@ -221,13 +221,13 @@ func (m *AuthenticationGitHub) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *AuthenticationGitHub) UnmarshalBinary(b []byte) error { var res AuthenticationGitHub - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/authentication_google.go b/client/models/authentication_google.go index f34e8dae..4f6d42f0 100644 --- a/client/models/authentication_google.go +++ b/client/models/authentication_google.go @@ -9,7 +9,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -119,7 +119,7 @@ func (m AuthenticationGoogle) MarshalJSON() ([]byte, error) { return nil, err } - return swag.ConcatJSON(b1, b2, b3), nil + return jsonutils.ConcatJSON(b1, b2, b3), nil } // Validate validates this authentication google @@ -160,13 +160,13 @@ func (m *AuthenticationGoogle) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *AuthenticationGoogle) UnmarshalBinary(b []byte) error { var res AuthenticationGoogle - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/authentication_local.go b/client/models/authentication_local.go index 9b401bec..55cfbbc1 100644 --- a/client/models/authentication_local.go +++ b/client/models/authentication_local.go @@ -9,7 +9,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -105,7 +105,7 @@ func (m AuthenticationLocal) MarshalJSON() ([]byte, error) { return nil, err } - return swag.ConcatJSON(b1, b2, b3), nil + return jsonutils.ConcatJSON(b1, b2, b3), nil } // Validate validates this authentication local @@ -146,13 +146,13 @@ func (m *AuthenticationLocal) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *AuthenticationLocal) UnmarshalBinary(b []byte) error { var res AuthenticationLocal - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/authentication_o_id_c.go b/client/models/authentication_o_id_c.go index 75f2d7be..de0f64a5 100644 --- a/client/models/authentication_o_id_c.go +++ b/client/models/authentication_o_id_c.go @@ -9,7 +9,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -29,6 +29,12 @@ type AuthenticationOIDC struct { // Read Only: true HasSecret *bool `json:"has_secret,omitempty"` + // Allow oidc_discovery_url to use plain HTTP when oidc_issuer is HTTPS. Set to true only when the network path between the Cycloid backend and the discovery URL is privately trusted (VPC, internal LAN, service mesh). Equivalent security trade-off to oidc_skip_tls_verify, scoped to the discovery URL. + OidcAllowInsecureDiscovery *bool `json:"oidc_allow_insecure_discovery,omitempty"` + + // When true, automatically provision a user record on the first OIDC login for this integration (BE-1438). Opt-in; defaults to false. No behaviour change for existing integrations unless explicitly enabled. + OidcAutoCreate bool `json:"oidc_auto_create,omitempty"` + // PEM-encoded CA certificate to verify the OIDC provider's TLS certificate. OidcCaCert string `json:"oidc_ca_cert,omitempty"` @@ -39,17 +45,26 @@ type AuthenticationOIDC struct { OidcClientSecret string `json:"oidc_client_secret,omitempty"` // Enables client authentication via signed JWT (HS512) using the client secret, as per RFC 7523. - OidcClientSecretJwt bool `json:"oidc_client_secret_jwt,omitempty"` + OidcClientSecretJwt *bool `json:"oidc_client_secret_jwt,omitempty"` + + // Optional base URL override for the OIDC provider as seen from the Cycloid backend. The backend appends /.well-known/openid-configuration to fetch the discovery document. Defaults to oidc_issuer when omitted. The discovery document's issuer field MUST equal oidc_issuer (enforced server-side). Useful when the backend reaches the IdP via a different network path than user browsers (corporate DMZ, K8s ingress vs cluster DNS, split-horizon DNS). Send an empty string to clear a previously stored override. + OidcDiscoveryURL *string `json:"oidc_discovery_url,omitempty"` // The friendly name shown on the login button OidcDisplayName string `json:"oidc_display_name,omitempty"` + // Name of the OIDC token claim listing the user's group memberships, used for OIDC group mapping. Defaults to "groups" when omitted. The IdP must be configured to include this claim in the issued ID token — group mapping has no effect if the provider omits it. Enterprise IdPs such as Keycloak, Okta, Azure AD/Entra ID, and Auth0 support configurable group claims; consumer providers such as Google Workspace and GitHub do not include group claims in standard OIDC tokens. + OidcGroupsClaimName string `json:"oidc_groups_claim_name,omitempty"` + // URL of the icon to display on the OIDC authentication login screen. OidcIcon string `json:"oidc_icon,omitempty"` // The base URL of the OIDC provider. Used for automatic endpoint discovery. OidcIssuer string `json:"oidc_issuer,omitempty"` + // Session lifetime in seconds for JWTs issued from a login through this OIDC integration (BE-1424). The backend clamps the effective value to the range 5 minutes .. 30 days. When omitted or null the global default session TTL applies. + OidcSessionTTLSeconds *int64 `json:"oidc_session_ttl_seconds,omitempty"` + // Disables TLS certificate verification when connecting to the OIDC provider. Use only in development or with self-signed certificates. OidcSkipTLSVerify bool `json:"oidc_skip_tls_verify,omitempty"` @@ -88,6 +103,12 @@ func (m *AuthenticationOIDC) UnmarshalJSON(raw []byte) error { // Read Only: true HasSecret *bool `json:"has_secret,omitempty"` + // Allow oidc_discovery_url to use plain HTTP when oidc_issuer is HTTPS. Set to true only when the network path between the Cycloid backend and the discovery URL is privately trusted (VPC, internal LAN, service mesh). Equivalent security trade-off to oidc_skip_tls_verify, scoped to the discovery URL. + OidcAllowInsecureDiscovery *bool `json:"oidc_allow_insecure_discovery,omitempty"` + + // When true, automatically provision a user record on the first OIDC login for this integration (BE-1438). Opt-in; defaults to false. No behaviour change for existing integrations unless explicitly enabled. + OidcAutoCreate bool `json:"oidc_auto_create,omitempty"` + // PEM-encoded CA certificate to verify the OIDC provider's TLS certificate. OidcCaCert string `json:"oidc_ca_cert,omitempty"` @@ -98,17 +119,26 @@ func (m *AuthenticationOIDC) UnmarshalJSON(raw []byte) error { OidcClientSecret string `json:"oidc_client_secret,omitempty"` // Enables client authentication via signed JWT (HS512) using the client secret, as per RFC 7523. - OidcClientSecretJwt bool `json:"oidc_client_secret_jwt,omitempty"` + OidcClientSecretJwt *bool `json:"oidc_client_secret_jwt,omitempty"` + + // Optional base URL override for the OIDC provider as seen from the Cycloid backend. The backend appends /.well-known/openid-configuration to fetch the discovery document. Defaults to oidc_issuer when omitted. The discovery document's issuer field MUST equal oidc_issuer (enforced server-side). Useful when the backend reaches the IdP via a different network path than user browsers (corporate DMZ, K8s ingress vs cluster DNS, split-horizon DNS). Send an empty string to clear a previously stored override. + OidcDiscoveryURL *string `json:"oidc_discovery_url,omitempty"` // The friendly name shown on the login button OidcDisplayName string `json:"oidc_display_name,omitempty"` + // Name of the OIDC token claim listing the user's group memberships, used for OIDC group mapping. Defaults to "groups" when omitted. The IdP must be configured to include this claim in the issued ID token — group mapping has no effect if the provider omits it. Enterprise IdPs such as Keycloak, Okta, Azure AD/Entra ID, and Auth0 support configurable group claims; consumer providers such as Google Workspace and GitHub do not include group claims in standard OIDC tokens. + OidcGroupsClaimName string `json:"oidc_groups_claim_name,omitempty"` + // URL of the icon to display on the OIDC authentication login screen. OidcIcon string `json:"oidc_icon,omitempty"` // The base URL of the OIDC provider. Used for automatic endpoint discovery. OidcIssuer string `json:"oidc_issuer,omitempty"` + // Session lifetime in seconds for JWTs issued from a login through this OIDC integration (BE-1424). The backend clamps the effective value to the range 5 minutes .. 30 days. When omitted or null the global default session TTL applies. + OidcSessionTTLSeconds *int64 `json:"oidc_session_ttl_seconds,omitempty"` + // Disables TLS certificate verification when connecting to the OIDC provider. Use only in development or with self-signed certificates. OidcSkipTLSVerify bool `json:"oidc_skip_tls_verify,omitempty"` @@ -149,13 +179,18 @@ func (m *AuthenticationOIDC) UnmarshalJSON(raw []byte) error { result.HasCaCertificate = data.HasCaCertificate result.HasSecret = data.HasSecret + result.OidcAllowInsecureDiscovery = data.OidcAllowInsecureDiscovery + result.OidcAutoCreate = data.OidcAutoCreate result.OidcCaCert = data.OidcCaCert result.OidcClientID = data.OidcClientID result.OidcClientSecret = data.OidcClientSecret result.OidcClientSecretJwt = data.OidcClientSecretJwt + result.OidcDiscoveryURL = data.OidcDiscoveryURL result.OidcDisplayName = data.OidcDisplayName + result.OidcGroupsClaimName = data.OidcGroupsClaimName result.OidcIcon = data.OidcIcon result.OidcIssuer = data.OidcIssuer + result.OidcSessionTTLSeconds = data.OidcSessionTTLSeconds result.OidcSkipTLSVerify = data.OidcSkipTLSVerify result.OidcUseCaCert = data.OidcUseCaCert @@ -178,6 +213,12 @@ func (m AuthenticationOIDC) MarshalJSON() ([]byte, error) { // Read Only: true HasSecret *bool `json:"has_secret,omitempty"` + // Allow oidc_discovery_url to use plain HTTP when oidc_issuer is HTTPS. Set to true only when the network path between the Cycloid backend and the discovery URL is privately trusted (VPC, internal LAN, service mesh). Equivalent security trade-off to oidc_skip_tls_verify, scoped to the discovery URL. + OidcAllowInsecureDiscovery *bool `json:"oidc_allow_insecure_discovery,omitempty"` + + // When true, automatically provision a user record on the first OIDC login for this integration (BE-1438). Opt-in; defaults to false. No behaviour change for existing integrations unless explicitly enabled. + OidcAutoCreate bool `json:"oidc_auto_create,omitempty"` + // PEM-encoded CA certificate to verify the OIDC provider's TLS certificate. OidcCaCert string `json:"oidc_ca_cert,omitempty"` @@ -188,17 +229,26 @@ func (m AuthenticationOIDC) MarshalJSON() ([]byte, error) { OidcClientSecret string `json:"oidc_client_secret,omitempty"` // Enables client authentication via signed JWT (HS512) using the client secret, as per RFC 7523. - OidcClientSecretJwt bool `json:"oidc_client_secret_jwt,omitempty"` + OidcClientSecretJwt *bool `json:"oidc_client_secret_jwt,omitempty"` + + // Optional base URL override for the OIDC provider as seen from the Cycloid backend. The backend appends /.well-known/openid-configuration to fetch the discovery document. Defaults to oidc_issuer when omitted. The discovery document's issuer field MUST equal oidc_issuer (enforced server-side). Useful when the backend reaches the IdP via a different network path than user browsers (corporate DMZ, K8s ingress vs cluster DNS, split-horizon DNS). Send an empty string to clear a previously stored override. + OidcDiscoveryURL *string `json:"oidc_discovery_url,omitempty"` // The friendly name shown on the login button OidcDisplayName string `json:"oidc_display_name,omitempty"` + // Name of the OIDC token claim listing the user's group memberships, used for OIDC group mapping. Defaults to "groups" when omitted. The IdP must be configured to include this claim in the issued ID token — group mapping has no effect if the provider omits it. Enterprise IdPs such as Keycloak, Okta, Azure AD/Entra ID, and Auth0 support configurable group claims; consumer providers such as Google Workspace and GitHub do not include group claims in standard OIDC tokens. + OidcGroupsClaimName string `json:"oidc_groups_claim_name,omitempty"` + // URL of the icon to display on the OIDC authentication login screen. OidcIcon string `json:"oidc_icon,omitempty"` // The base URL of the OIDC provider. Used for automatic endpoint discovery. OidcIssuer string `json:"oidc_issuer,omitempty"` + // Session lifetime in seconds for JWTs issued from a login through this OIDC integration (BE-1424). The backend clamps the effective value to the range 5 minutes .. 30 days. When omitted or null the global default session TTL applies. + OidcSessionTTLSeconds *int64 `json:"oidc_session_ttl_seconds,omitempty"` + // Disables TLS certificate verification when connecting to the OIDC provider. Use only in development or with self-signed certificates. OidcSkipTLSVerify bool `json:"oidc_skip_tls_verify,omitempty"` @@ -210,6 +260,10 @@ func (m AuthenticationOIDC) MarshalJSON() ([]byte, error) { HasSecret: m.HasSecret, + OidcAllowInsecureDiscovery: m.OidcAllowInsecureDiscovery, + + OidcAutoCreate: m.OidcAutoCreate, + OidcCaCert: m.OidcCaCert, OidcClientID: m.OidcClientID, @@ -218,12 +272,18 @@ func (m AuthenticationOIDC) MarshalJSON() ([]byte, error) { OidcClientSecretJwt: m.OidcClientSecretJwt, + OidcDiscoveryURL: m.OidcDiscoveryURL, + OidcDisplayName: m.OidcDisplayName, + OidcGroupsClaimName: m.OidcGroupsClaimName, + OidcIcon: m.OidcIcon, OidcIssuer: m.OidcIssuer, + OidcSessionTTLSeconds: m.OidcSessionTTLSeconds, + OidcSkipTLSVerify: m.OidcSkipTLSVerify, OidcUseCaCert: m.OidcUseCaCert, @@ -245,7 +305,7 @@ func (m AuthenticationOIDC) MarshalJSON() ([]byte, error) { return nil, err } - return swag.ConcatJSON(b1, b2, b3), nil + return jsonutils.ConcatJSON(b1, b2, b3), nil } // Validate validates this authentication o ID c @@ -312,13 +372,13 @@ func (m *AuthenticationOIDC) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *AuthenticationOIDC) UnmarshalBinary(b []byte) error { var res AuthenticationOIDC - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/authentication_s_a_m_l.go b/client/models/authentication_s_a_m_l.go index fe3e7563..548acd86 100644 --- a/client/models/authentication_s_a_m_l.go +++ b/client/models/authentication_s_a_m_l.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -134,7 +135,7 @@ func (m AuthenticationSAML) MarshalJSON() ([]byte, error) { return nil, err } - return swag.ConcatJSON(b1, b2, b3), nil + return jsonutils.ConcatJSON(b1, b2, b3), nil } // Validate validates this authentication s a m l @@ -166,7 +167,7 @@ func (m *AuthenticationSAML) validateEnabled(formats strfmt.Registry) error { func (m *AuthenticationSAML) validateSsoURL(formats strfmt.Registry) error { - if swag.IsZero(m.SsoURL) { // not required + if typeutils.IsZero(m.SsoURL) { // not required return nil } @@ -192,13 +193,13 @@ func (m *AuthenticationSAML) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *AuthenticationSAML) UnmarshalBinary(b []byte) error { var res AuthenticationSAML - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/azure_cost_export.go b/client/models/azure_cost_export.go index d5246a74..a0aff665 100644 --- a/client/models/azure_cost_export.go +++ b/client/models/azure_cost_export.go @@ -9,7 +9,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" ) // AzureCostExport Representation of AzureCostExport external backend. @@ -122,7 +122,7 @@ func (m AzureCostExport) MarshalJSON() ([]byte, error) { return nil, err } - return swag.ConcatJSON(b1, b2, b3), nil + return jsonutils.ConcatJSON(b1, b2, b3), nil } // Validate validates this azure cost export @@ -150,13 +150,13 @@ func (m *AzureCostExport) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *AzureCostExport) UnmarshalBinary(b []byte) error { var res AzureCostExport - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/azure_remote_t_f_state.go b/client/models/azure_remote_t_f_state.go index 6e68fbe5..85437122 100644 --- a/client/models/azure_remote_t_f_state.go +++ b/client/models/azure_remote_t_f_state.go @@ -9,7 +9,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -145,7 +145,7 @@ func (m AzureRemoteTFState) MarshalJSON() ([]byte, error) { return nil, err } - return swag.ConcatJSON(b1, b2, b3), nil + return jsonutils.ConcatJSON(b1, b2, b3), nil } // Validate validates this azure remote t f state @@ -186,13 +186,13 @@ func (m *AzureRemoteTFState) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *AzureRemoteTFState) UnmarshalBinary(b []byte) error { var res AzureRemoteTFState - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/azure_storage.go b/client/models/azure_storage.go index 17a68fd4..af46adee 100644 --- a/client/models/azure_storage.go +++ b/client/models/azure_storage.go @@ -9,7 +9,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -144,7 +144,7 @@ func (m AzureStorage) MarshalJSON() ([]byte, error) { return nil, err } - return swag.ConcatJSON(b1, b2, b3), nil + return jsonutils.ConcatJSON(b1, b2, b3), nil } // Validate validates this azure storage @@ -185,13 +185,13 @@ func (m *AzureStorage) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *AzureStorage) UnmarshalBinary(b []byte) error { var res AzureStorage - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/bare_credential.go b/client/models/bare_credential.go index 6e7f7716..0fb92b8b 100644 --- a/client/models/bare_credential.go +++ b/client/models/bare_credential.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -73,7 +74,7 @@ func (m *BareCredential) Validate(formats strfmt.Registry) error { } func (m *BareCredential) validateCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.Canonical) { // not required + if typeutils.IsZero(m.Canonical) { // not required return nil } @@ -93,7 +94,7 @@ func (m *BareCredential) validateCanonical(formats strfmt.Registry) error { } func (m *BareCredential) validatePath(formats strfmt.Registry) error { - if swag.IsZero(m.Path) { // not required + if typeutils.IsZero(m.Path) { // not required return nil } @@ -235,13 +236,13 @@ func (m *BareCredential) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *BareCredential) UnmarshalBinary(b []byte) error { var res BareCredential - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/build.go b/client/models/build.go index adcdc1eb..8c2e931d 100644 --- a/client/models/build.go +++ b/client/models/build.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -142,13 +142,13 @@ func (m *Build) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *Build) UnmarshalBinary(b []byte) error { var res Build - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/build_inputs_outputs.go b/client/models/build_inputs_outputs.go index 9db475f1..2a3564f1 100644 --- a/client/models/build_inputs_outputs.go +++ b/client/models/build_inputs_outputs.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -54,7 +55,7 @@ func (m *BuildInputsOutputs) validateInputs(formats strfmt.Registry) error { } for i := 0; i < len(m.Inputs); i++ { - if swag.IsZero(m.Inputs[i]) { // not required + if typeutils.IsZero(m.Inputs[i]) { // not required continue } @@ -85,7 +86,7 @@ func (m *BuildInputsOutputs) validateOutputs(formats strfmt.Registry) error { } for i := 0; i < len(m.Outputs); i++ { - if swag.IsZero(m.Outputs[i]) { // not required + if typeutils.IsZero(m.Outputs[i]) { // not required continue } @@ -133,7 +134,7 @@ func (m *BuildInputsOutputs) contextValidateInputs(ctx context.Context, formats if m.Inputs[i] != nil { - if swag.IsZero(m.Inputs[i]) { // not required + if typeutils.IsZero(m.Inputs[i]) { // not required return nil } @@ -162,7 +163,7 @@ func (m *BuildInputsOutputs) contextValidateOutputs(ctx context.Context, formats if m.Outputs[i] != nil { - if swag.IsZero(m.Outputs[i]) { // not required + if typeutils.IsZero(m.Outputs[i]) { // not required return nil } @@ -190,13 +191,13 @@ func (m *BuildInputsOutputs) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *BuildInputsOutputs) UnmarshalBinary(b []byte) error { var res BuildInputsOutputs - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/build_summary.go b/client/models/build_summary.go index 80afc36e..23e25810 100644 --- a/client/models/build_summary.go +++ b/client/models/build_summary.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -125,13 +125,13 @@ func (m *BuildSummary) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *BuildSummary) UnmarshalBinary(b []byte) error { var res BuildSummary - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/can_do_batch_action_input.go b/client/models/can_do_batch_action_input.go new file mode 100644 index 00000000..4ef0475f --- /dev/null +++ b/client/models/can_do_batch_action_input.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/validate" +) + +// CanDoBatchActionInput CanDoBatchActionInput +// +// A single action item in the 'can_do_batch' input +// +// swagger:model CanDoBatchActionInput +type CanDoBatchActionInput struct { + + // action + // Required: true + Action *string `json:"action"` + + // A client-chosen key used to identify this action in the response map + // Required: true + // Min Length: 1 + Canonical *string `json:"canonical"` + + // List of the canonicals to the Resource excluding the Organization + // Required: true + EntityCanonicals []string `json:"entity_canonicals"` +} + +// Validate validates this can do batch action input +func (m *CanDoBatchActionInput) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAction(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCanonical(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEntityCanonicals(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CanDoBatchActionInput) validateAction(formats strfmt.Registry) error { + + if err := validate.Required("action", "body", m.Action); err != nil { + return err + } + + return nil +} + +func (m *CanDoBatchActionInput) validateCanonical(formats strfmt.Registry) error { + + if err := validate.Required("canonical", "body", m.Canonical); err != nil { + return err + } + + if err := validate.MinLength("canonical", "body", *m.Canonical, 1); err != nil { + return err + } + + return nil +} + +func (m *CanDoBatchActionInput) validateEntityCanonicals(formats strfmt.Registry) error { + + if err := validate.Required("entity_canonicals", "body", m.EntityCanonicals); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this can do batch action input based on context it is used +func (m *CanDoBatchActionInput) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CanDoBatchActionInput) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return jsonutils.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CanDoBatchActionInput) UnmarshalBinary(b []byte) error { + var res CanDoBatchActionInput + if err := jsonutils.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/client/models/can_do_batch_input.go b/client/models/can_do_batch_input.go new file mode 100644 index 00000000..adeda5f8 --- /dev/null +++ b/client/models/can_do_batch_input.go @@ -0,0 +1,133 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +import ( + "context" + stderrors "errors" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" + "github.com/go-openapi/validate" +) + +// CanDoBatchInput CanDoBatchInput +// +// The input of the 'can_do_batch' endpoint +// +// swagger:model CanDoBatchInput +type CanDoBatchInput struct { + + // actions + // Required: true + Actions []*CanDoBatchActionInput `json:"actions"` +} + +// Validate validates this can do batch input +func (m *CanDoBatchInput) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateActions(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CanDoBatchInput) validateActions(formats strfmt.Registry) error { + + if err := validate.Required("actions", "body", m.Actions); err != nil { + return err + } + + for i := 0; i < len(m.Actions); i++ { + if typeutils.IsZero(m.Actions[i]) { // not required + continue + } + + if m.Actions[i] != nil { + if err := m.Actions[i].Validate(formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("actions" + "." + strconv.Itoa(i)) + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("actions" + "." + strconv.Itoa(i)) + } + + return err + } + } + + } + + return nil +} + +// ContextValidate validate this can do batch input based on the context it is used +func (m *CanDoBatchInput) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateActions(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CanDoBatchInput) contextValidateActions(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Actions); i++ { + + if m.Actions[i] != nil { + + if typeutils.IsZero(m.Actions[i]) { // not required + return nil + } + + if err := m.Actions[i].ContextValidate(ctx, formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("actions" + "." + strconv.Itoa(i)) + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("actions" + "." + strconv.Itoa(i)) + } + + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CanDoBatchInput) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return jsonutils.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CanDoBatchInput) UnmarshalBinary(b []byte) error { + var res CanDoBatchInput + if err := jsonutils.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/client/models/can_do_batch_output_item.go b/client/models/can_do_batch_output_item.go new file mode 100644 index 00000000..c30c5c38 --- /dev/null +++ b/client/models/can_do_batch_output_item.go @@ -0,0 +1,90 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/validate" +) + +// CanDoBatchOutputItem CanDoBatchOutputItem +// +// A single result item from the 'can_do_batch' endpoint +// +// swagger:model CanDoBatchOutputItem +type CanDoBatchOutputItem struct { + + // action + // Required: true + Action *string `json:"action"` + + // entity canonicals + EntityCanonicals []string `json:"entity_canonicals"` + + // ok + // Required: true + Ok *bool `json:"ok"` +} + +// Validate validates this can do batch output item +func (m *CanDoBatchOutputItem) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAction(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOk(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CanDoBatchOutputItem) validateAction(formats strfmt.Registry) error { + + if err := validate.Required("action", "body", m.Action); err != nil { + return err + } + + return nil +} + +func (m *CanDoBatchOutputItem) validateOk(formats strfmt.Registry) error { + + if err := validate.Required("ok", "body", m.Ok); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this can do batch output item based on context it is used +func (m *CanDoBatchOutputItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CanDoBatchOutputItem) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return jsonutils.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CanDoBatchOutputItem) UnmarshalBinary(b []byte) error { + var res CanDoBatchOutputItem + if err := jsonutils.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/client/models/can_do_input.go b/client/models/can_do_input.go index 33542aa8..bf5eb300 100644 --- a/client/models/can_do_input.go +++ b/client/models/can_do_input.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -73,13 +73,13 @@ func (m *CanDoInput) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *CanDoInput) UnmarshalBinary(b []byte) error { var res CanDoInput - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/can_do_output.go b/client/models/can_do_output.go index 42ddfbda..d64bec6f 100644 --- a/client/models/can_do_output.go +++ b/client/models/can_do_output.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -59,13 +59,13 @@ func (m *CanDoOutput) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *CanDoOutput) UnmarshalBinary(b []byte) error { var res CanDoOutput - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/check_report.go b/client/models/check_report.go index 310fa170..fa17b4c6 100644 --- a/client/models/check_report.go +++ b/client/models/check_report.go @@ -8,7 +8,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -159,13 +159,13 @@ func (m *CheckReport) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *CheckReport) UnmarshalBinary(b []byte) error { var res CheckReport - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/clear_task_cache.go b/client/models/clear_task_cache.go index 17f03e83..6b115c26 100644 --- a/client/models/clear_task_cache.go +++ b/client/models/clear_task_cache.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -56,13 +56,13 @@ func (m *ClearTaskCache) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *ClearTaskCache) UnmarshalBinary(b []byte) error { var res ClearTaskCache - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/cloud_account.go b/client/models/cloud_account.go index 31836678..fcd5a2cc 100644 --- a/client/models/cloud_account.go +++ b/client/models/cloud_account.go @@ -8,7 +8,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -204,7 +205,7 @@ func (m *CloudAccount) validateName(formats strfmt.Registry) error { } func (m *CloudAccount) validateOwner(formats strfmt.Registry) error { - if swag.IsZero(m.Owner) { // not required + if typeutils.IsZero(m.Owner) { // not required return nil } @@ -282,7 +283,7 @@ func (m *CloudAccount) contextValidateOwner(ctx context.Context, formats strfmt. if m.Owner != nil { - if swag.IsZero(m.Owner) { // not required + if typeutils.IsZero(m.Owner) { // not required return nil } @@ -308,13 +309,13 @@ func (m *CloudAccount) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *CloudAccount) UnmarshalBinary(b []byte) error { var res CloudAccount - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/cloud_account_detail.go b/client/models/cloud_account_detail.go index b4710de8..7c262bde 100644 --- a/client/models/cloud_account_detail.go +++ b/client/models/cloud_account_detail.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" ) // CloudAccountDetail Cloud Account Detail @@ -34,7 +35,7 @@ type CloudAccountDetail struct { func (m *CloudAccountDetail) UnmarshalJSON(raw []byte) error { // AO0 var aO0 CloudAccount - if err := swag.ReadJSON(raw, &aO0); err != nil { + if err := jsonutils.ReadJSON(raw, &aO0); err != nil { return err } m.CloudAccount = aO0 @@ -47,7 +48,7 @@ func (m *CloudAccountDetail) UnmarshalJSON(raw []byte) error { FinopsEnabled bool `json:"finops_enabled,omitempty"` } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { + if err := jsonutils.ReadJSON(raw, &dataAO1); err != nil { return err } @@ -64,7 +65,7 @@ func (m *CloudAccountDetail) UnmarshalJSON(raw []byte) error { func (m CloudAccountDetail) MarshalJSON() ([]byte, error) { _parts := make([][]byte, 0, 2) - aO0, err := swag.WriteJSON(m.CloudAccount) + aO0, err := jsonutils.WriteJSON(m.CloudAccount) if err != nil { return nil, err } @@ -83,12 +84,12 @@ func (m CloudAccountDetail) MarshalJSON() ([]byte, error) { dataAO1.FinopsEnabled = m.FinopsEnabled - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) + jsonDataAO1, errAO1 := jsonutils.WriteJSON(dataAO1) if errAO1 != nil { return nil, errAO1 } _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil + return jsonutils.ConcatJSON(_parts...), nil } // Validate validates this cloud account detail @@ -116,12 +117,12 @@ func (m *CloudAccountDetail) Validate(formats strfmt.Registry) error { func (m *CloudAccountDetail) validateEnvironments(formats strfmt.Registry) error { - if swag.IsZero(m.Environments) { // not required + if typeutils.IsZero(m.Environments) { // not required return nil } for i := 0; i < len(m.Environments); i++ { - if swag.IsZero(m.Environments[i]) { // not required + if typeutils.IsZero(m.Environments[i]) { // not required continue } @@ -147,7 +148,7 @@ func (m *CloudAccountDetail) validateEnvironments(formats strfmt.Registry) error func (m *CloudAccountDetail) validateFinopsAccount(formats strfmt.Registry) error { - if swag.IsZero(m.FinopsAccount) { // not required + if typeutils.IsZero(m.FinopsAccount) { // not required return nil } @@ -198,7 +199,7 @@ func (m *CloudAccountDetail) contextValidateEnvironments(ctx context.Context, fo if m.Environments[i] != nil { - if swag.IsZero(m.Environments[i]) { // not required + if typeutils.IsZero(m.Environments[i]) { // not required return nil } @@ -225,7 +226,7 @@ func (m *CloudAccountDetail) contextValidateFinopsAccount(ctx context.Context, f if m.FinopsAccount != nil { - if swag.IsZero(m.FinopsAccount) { // not required + if typeutils.IsZero(m.FinopsAccount) { // not required return nil } @@ -251,13 +252,13 @@ func (m *CloudAccountDetail) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *CloudAccountDetail) UnmarshalBinary(b []byte) error { var res CloudAccountDetail - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/cloud_account_simple.go b/client/models/cloud_account_simple.go index 06771753..133f27cc 100644 --- a/client/models/cloud_account_simple.go +++ b/client/models/cloud_account_simple.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -137,13 +137,13 @@ func (m *CloudAccountSimple) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *CloudAccountSimple) UnmarshalBinary(b []byte) error { var res CloudAccountSimple - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/cloud_cost_management_account.go b/client/models/cloud_cost_management_account.go index 389ca354..32fd8621 100644 --- a/client/models/cloud_cost_management_account.go +++ b/client/models/cloud_cost_management_account.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -224,7 +225,7 @@ func (m *CloudCostManagementAccount) validateEnabled(formats strfmt.Registry) er } func (m *CloudCostManagementAccount) validateExternalBackend(formats strfmt.Registry) error { - if swag.IsZero(m.ExternalBackend) { // not required + if typeutils.IsZero(m.ExternalBackend) { // not required return nil } @@ -260,7 +261,7 @@ func (m *CloudCostManagementAccount) validateID(formats strfmt.Registry) error { } func (m *CloudCostManagementAccount) validateLastIngestionEndedAt(formats strfmt.Registry) error { - if swag.IsZero(m.LastIngestionEndedAt) { // not required + if typeutils.IsZero(m.LastIngestionEndedAt) { // not required return nil } @@ -272,7 +273,7 @@ func (m *CloudCostManagementAccount) validateLastIngestionEndedAt(formats strfmt } func (m *CloudCostManagementAccount) validateLastIngestionStartedAt(formats strfmt.Registry) error { - if swag.IsZero(m.LastIngestionStartedAt) { // not required + if typeutils.IsZero(m.LastIngestionStartedAt) { // not required return nil } @@ -322,7 +323,7 @@ func (m *CloudCostManagementAccount) validatePhaseEnum(path, location string, va } func (m *CloudCostManagementAccount) validatePhase(formats strfmt.Registry) error { - if swag.IsZero(m.Phase) { // not required + if typeutils.IsZero(m.Phase) { // not required return nil } @@ -436,7 +437,7 @@ func (m *CloudCostManagementAccount) contextValidateExternalBackend(ctx context. if m.ExternalBackend != nil { - if swag.IsZero(m.ExternalBackend) { // not required + if typeutils.IsZero(m.ExternalBackend) { // not required return nil } @@ -462,13 +463,13 @@ func (m *CloudCostManagementAccount) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *CloudCostManagementAccount) UnmarshalBinary(b []byte) error { var res CloudCostManagementAccount - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/cloud_cost_management_bucket.go b/client/models/cloud_cost_management_bucket.go index 374f0201..b54a3e54 100644 --- a/client/models/cloud_cost_management_bucket.go +++ b/client/models/cloud_cost_management_bucket.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -79,12 +80,12 @@ func (m *CloudCostManagementBucket) Validate(formats strfmt.Registry) error { } func (m *CloudCostManagementBucket) validateBuckets(formats strfmt.Registry) error { - if swag.IsZero(m.Buckets) { // not required + if typeutils.IsZero(m.Buckets) { // not required return nil } for i := 0; i < len(m.Buckets); i++ { - if swag.IsZero(m.Buckets[i]) { // not required + if typeutils.IsZero(m.Buckets[i]) { // not required continue } @@ -164,7 +165,7 @@ func (m *CloudCostManagementBucket) contextValidateBuckets(ctx context.Context, if m.Buckets[i] != nil { - if swag.IsZero(m.Buckets[i]) { // not required + if typeutils.IsZero(m.Buckets[i]) { // not required return nil } @@ -192,13 +193,13 @@ func (m *CloudCostManagementBucket) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *CloudCostManagementBucket) UnmarshalBinary(b []byte) error { var res CloudCostManagementBucket - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/cloud_cost_management_dashboard.go b/client/models/cloud_cost_management_dashboard.go index 6285e413..4e752dc8 100644 --- a/client/models/cloud_cost_management_dashboard.go +++ b/client/models/cloud_cost_management_dashboard.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -110,7 +111,7 @@ func (m *CloudCostManagementDashboard) validateProjectResources(formats strfmt.R } for i := 0; i < len(m.ProjectResources); i++ { - if swag.IsZero(m.ProjectResources[i]) { // not required + if typeutils.IsZero(m.ProjectResources[i]) { // not required continue } @@ -235,7 +236,7 @@ func (m *CloudCostManagementDashboard) contextValidateProjectResources(ctx conte if m.ProjectResources[i] != nil { - if swag.IsZero(m.ProjectResources[i]) { // not required + if typeutils.IsZero(m.ProjectResources[i]) { // not required return nil } @@ -305,13 +306,13 @@ func (m *CloudCostManagementDashboard) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *CloudCostManagementDashboard) UnmarshalBinary(b []byte) error { var res CloudCostManagementDashboard - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/cloud_cost_management_filter_values.go b/client/models/cloud_cost_management_filter_values.go index ed719b3c..79f924ec 100644 --- a/client/models/cloud_cost_management_filter_values.go +++ b/client/models/cloud_cost_management_filter_values.go @@ -6,7 +6,7 @@ import ( "context" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" ) // CloudCostManagementFilterValues CloudCostManagementFilterValues @@ -78,13 +78,13 @@ func (m *CloudCostManagementFilterValues) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *CloudCostManagementFilterValues) UnmarshalBinary(b []byte) error { var res CloudCostManagementFilterValues - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/cloud_cost_management_histogram.go b/client/models/cloud_cost_management_histogram.go index 1099cb10..0b126907 100644 --- a/client/models/cloud_cost_management_histogram.go +++ b/client/models/cloud_cost_management_histogram.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -70,7 +71,7 @@ func (m *CloudCostManagementHistogram) validateBuckets(formats strfmt.Registry) } for i := 0; i < len(m.Buckets); i++ { - if swag.IsZero(m.Buckets[i]) { // not required + if typeutils.IsZero(m.Buckets[i]) { // not required continue } @@ -141,7 +142,7 @@ func (m *CloudCostManagementHistogram) contextValidateBuckets(ctx context.Contex if m.Buckets[i] != nil { - if swag.IsZero(m.Buckets[i]) { // not required + if typeutils.IsZero(m.Buckets[i]) { // not required return nil } @@ -169,13 +170,13 @@ func (m *CloudCostManagementHistogram) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *CloudCostManagementHistogram) UnmarshalBinary(b []byte) error { var res CloudCostManagementHistogram - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/cloud_cost_management_linked_account.go b/client/models/cloud_cost_management_linked_account.go index c17ab2c5..f9c962ca 100644 --- a/client/models/cloud_cost_management_linked_account.go +++ b/client/models/cloud_cost_management_linked_account.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -115,13 +115,13 @@ func (m *CloudCostManagementLinkedAccount) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *CloudCostManagementLinkedAccount) UnmarshalBinary(b []byte) error { var res CloudCostManagementLinkedAccount - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/cloud_cost_management_project_provider_resources.go b/client/models/cloud_cost_management_project_provider_resources.go index 7ad40251..a919f5d5 100644 --- a/client/models/cloud_cost_management_project_provider_resources.go +++ b/client/models/cloud_cost_management_project_provider_resources.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -141,13 +141,13 @@ func (m *CloudCostManagementProjectProviderResources) MarshalBinary() ([]byte, e if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *CloudCostManagementProjectProviderResources) UnmarshalBinary(b []byte) error { var res CloudCostManagementProjectProviderResources - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/cloud_cost_management_project_resources.go b/client/models/cloud_cost_management_project_resources.go index f902444b..06509453 100644 --- a/client/models/cloud_cost_management_project_resources.go +++ b/client/models/cloud_cost_management_project_resources.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -80,7 +81,7 @@ func (m *CloudCostManagementProjectResources) validateProviders(formats strfmt.R } for i := 0; i < len(m.Providers); i++ { - if swag.IsZero(m.Providers[i]) { // not required + if typeutils.IsZero(m.Providers[i]) { // not required continue } @@ -124,7 +125,7 @@ func (m *CloudCostManagementProjectResources) contextValidateProviders(ctx conte if m.Providers[i] != nil { - if swag.IsZero(m.Providers[i]) { // not required + if typeutils.IsZero(m.Providers[i]) { // not required return nil } @@ -152,13 +153,13 @@ func (m *CloudCostManagementProjectResources) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *CloudCostManagementProjectResources) UnmarshalBinary(b []byte) error { var res CloudCostManagementProjectResources - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/cloud_cost_management_projects_dashboard.go b/client/models/cloud_cost_management_projects_dashboard.go index 32c56657..092c0001 100644 --- a/client/models/cloud_cost_management_projects_dashboard.go +++ b/client/models/cloud_cost_management_projects_dashboard.go @@ -8,7 +8,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -161,13 +161,13 @@ func (m *CloudCostManagementProjectsDashboard) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *CloudCostManagementProjectsDashboard) UnmarshalBinary(b []byte) error { var res CloudCostManagementProjectsDashboard - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/cloud_cost_management_provider_details.go b/client/models/cloud_cost_management_provider_details.go index b41b788d..3588b8c1 100644 --- a/client/models/cloud_cost_management_provider_details.go +++ b/client/models/cloud_cost_management_provider_details.go @@ -8,7 +8,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -70,7 +71,7 @@ func (m *CloudCostManagementProviderDetails) validateCostHistogram(formats strfm } func (m *CloudCostManagementProviderDetails) validateFilterValues(formats strfmt.Registry) error { - if swag.IsZero(m.FilterValues) { // not required + if typeutils.IsZero(m.FilterValues) { // not required return nil } @@ -135,7 +136,7 @@ func (m *CloudCostManagementProviderDetails) contextValidateFilterValues(ctx con if m.FilterValues != nil { - if swag.IsZero(m.FilterValues) { // not required + if typeutils.IsZero(m.FilterValues) { // not required return nil } @@ -161,13 +162,13 @@ func (m *CloudCostManagementProviderDetails) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *CloudCostManagementProviderDetails) UnmarshalBinary(b []byte) error { var res CloudCostManagementProviderDetails - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/cloud_cost_management_providers.go b/client/models/cloud_cost_management_providers.go index 8d6345f2..3a0f5be9 100644 --- a/client/models/cloud_cost_management_providers.go +++ b/client/models/cloud_cost_management_providers.go @@ -8,7 +8,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -102,13 +102,13 @@ func (m *CloudCostManagementProviders) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *CloudCostManagementProviders) UnmarshalBinary(b []byte) error { var res CloudCostManagementProviders - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/cloud_cost_management_tag_mapping.go b/client/models/cloud_cost_management_tag_mapping.go index e581021c..bc59e7b3 100644 --- a/client/models/cloud_cost_management_tag_mapping.go +++ b/client/models/cloud_cost_management_tag_mapping.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -129,13 +129,13 @@ func (m *CloudCostManagementTagMapping) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *CloudCostManagementTagMapping) UnmarshalBinary(b []byte) error { var res CloudCostManagementTagMapping - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/cloud_provider.go b/client/models/cloud_provider.go index 983e811f..300b5d04 100644 --- a/client/models/cloud_provider.go +++ b/client/models/cloud_provider.go @@ -8,7 +8,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -89,7 +90,7 @@ func (m *CloudProvider) Validate(formats strfmt.Registry) error { } func (m *CloudProvider) validateAbbreviation(formats strfmt.Registry) error { - if swag.IsZero(m.Abbreviation) { // not required + if typeutils.IsZero(m.Abbreviation) { // not required return nil } @@ -190,7 +191,7 @@ func (m *CloudProvider) validateCanonical(formats strfmt.Registry) error { } func (m *CloudProvider) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required + if typeutils.IsZero(m.CreatedAt) { // not required return nil } @@ -202,7 +203,7 @@ func (m *CloudProvider) validateCreatedAt(formats strfmt.Registry) error { } func (m *CloudProvider) validateID(formats strfmt.Registry) error { - if swag.IsZero(m.ID) { // not required + if typeutils.IsZero(m.ID) { // not required return nil } @@ -231,7 +232,7 @@ func (m *CloudProvider) validateName(formats strfmt.Registry) error { } func (m *CloudProvider) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required + if typeutils.IsZero(m.UpdatedAt) { // not required return nil } @@ -252,13 +253,13 @@ func (m *CloudProvider) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *CloudProvider) UnmarshalBinary(b []byte) error { var res CloudProvider - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/cloud_provider_a_w_s_configuration.go b/client/models/cloud_provider_a_w_s_configuration.go index 9af0828f..48382331 100644 --- a/client/models/cloud_provider_a_w_s_configuration.go +++ b/client/models/cloud_provider_a_w_s_configuration.go @@ -9,7 +9,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -104,7 +104,7 @@ func (m CloudProviderAWSConfiguration) MarshalJSON() ([]byte, error) { return nil, err } - return swag.ConcatJSON(b1, b2, b3), nil + return jsonutils.ConcatJSON(b1, b2, b3), nil } // Validate validates this cloud provider a w s configuration @@ -145,13 +145,13 @@ func (m *CloudProviderAWSConfiguration) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *CloudProviderAWSConfiguration) UnmarshalBinary(b []byte) error { var res CloudProviderAWSConfiguration - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/cloud_provider_azure_configuration.go b/client/models/cloud_provider_azure_configuration.go index f6a6403a..6b8479d2 100644 --- a/client/models/cloud_provider_azure_configuration.go +++ b/client/models/cloud_provider_azure_configuration.go @@ -9,7 +9,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -125,7 +125,7 @@ func (m CloudProviderAzureConfiguration) MarshalJSON() ([]byte, error) { return nil, err } - return swag.ConcatJSON(b1, b2, b3), nil + return jsonutils.ConcatJSON(b1, b2, b3), nil } // Validate validates this cloud provider azure configuration @@ -185,13 +185,13 @@ func (m *CloudProviderAzureConfiguration) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *CloudProviderAzureConfiguration) UnmarshalBinary(b []byte) error { var res CloudProviderAzureConfiguration - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/cloud_provider_g_c_p_configuration.go b/client/models/cloud_provider_g_c_p_configuration.go index 90c48f4d..ecc5e611 100644 --- a/client/models/cloud_provider_g_c_p_configuration.go +++ b/client/models/cloud_provider_g_c_p_configuration.go @@ -9,7 +9,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -122,7 +122,7 @@ func (m CloudProviderGCPConfiguration) MarshalJSON() ([]byte, error) { return nil, err } - return swag.ConcatJSON(b1, b2, b3), nil + return jsonutils.ConcatJSON(b1, b2, b3), nil } // Validate validates this cloud provider g c p configuration @@ -176,13 +176,13 @@ func (m *CloudProviderGCPConfiguration) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *CloudProviderGCPConfiguration) UnmarshalBinary(b []byte) error { var res CloudProviderGCPConfiguration - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/cloud_provider_vm_ware_v_sphere_configuration.go b/client/models/cloud_provider_vm_ware_v_sphere_configuration.go index 1300c8e8..b6d2c67f 100644 --- a/client/models/cloud_provider_vm_ware_v_sphere_configuration.go +++ b/client/models/cloud_provider_vm_ware_v_sphere_configuration.go @@ -9,7 +9,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -122,7 +122,7 @@ func (m CloudProviderVMWareVSphereConfiguration) MarshalJSON() ([]byte, error) { return nil, err } - return swag.ConcatJSON(b1, b2, b3), nil + return jsonutils.ConcatJSON(b1, b2, b3), nil } // Validate validates this cloud provider VM ware v sphere configuration @@ -176,13 +176,13 @@ func (m *CloudProviderVMWareVSphereConfiguration) MarshalBinary() ([]byte, error if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *CloudProviderVMWareVSphereConfiguration) UnmarshalBinary(b []byte) error { var res CloudProviderVMWareVSphereConfiguration - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/component.go b/client/models/component.go index a327de4c..a573240c 100644 --- a/client/models/component.go +++ b/client/models/component.go @@ -4,12 +4,12 @@ package models import ( "context" - "encoding/json" stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -50,10 +50,6 @@ type Component struct { // Minimum: 1 ID *uint32 `json:"id"` - // The import process status. - // Enum: ["succeeded","failed","importing"] - ImportStatus string `json:"import_status,omitempty"` - // The status of the component. IsConfigured bool `json:"is_configured,omitempty"` @@ -114,10 +110,6 @@ func (m *Component) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateImportStatus(formats); err != nil { - res = append(res, err) - } - if err := m.validateName(formats); err != nil { res = append(res, err) } @@ -174,7 +166,7 @@ func (m *Component) validateCanonical(formats strfmt.Registry) error { } func (m *Component) validateCloudProvider(formats strfmt.Registry) error { - if swag.IsZero(m.CloudProvider) { // not required + if typeutils.IsZero(m.CloudProvider) { // not required return nil } @@ -246,51 +238,6 @@ func (m *Component) validateID(formats strfmt.Registry) error { return nil } -var componentTypeImportStatusPropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["succeeded","failed","importing"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - componentTypeImportStatusPropEnum = append(componentTypeImportStatusPropEnum, v) - } -} - -const ( - - // ComponentImportStatusSucceeded captures enum value "succeeded" - ComponentImportStatusSucceeded string = "succeeded" - - // ComponentImportStatusFailed captures enum value "failed" - ComponentImportStatusFailed string = "failed" - - // ComponentImportStatusImporting captures enum value "importing" - ComponentImportStatusImporting string = "importing" -) - -// prop value enum -func (m *Component) validateImportStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, componentTypeImportStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *Component) validateImportStatus(formats strfmt.Registry) error { - if swag.IsZero(m.ImportStatus) { // not required - return nil - } - - // value enum - if err := m.validateImportStatusEnum("import_status", "body", m.ImportStatus); err != nil { - return err - } - - return nil -} - func (m *Component) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { @@ -353,7 +300,7 @@ func (m *Component) validateServiceCatalog(formats strfmt.Registry) error { } func (m *Component) validateStackformUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.StackformUpdatedAt) { // not required + if typeutils.IsZero(m.StackformUpdatedAt) { // not required return nil } @@ -378,7 +325,7 @@ func (m *Component) validateUpdatedAt(formats strfmt.Registry) error { } func (m *Component) validateUseCase(formats strfmt.Registry) error { - if swag.IsZero(m.UseCase) { // not required + if typeutils.IsZero(m.UseCase) { // not required return nil } @@ -455,7 +402,7 @@ func (m *Component) contextValidateCloudProvider(ctx context.Context, formats st if m.CloudProvider != nil { - if swag.IsZero(m.CloudProvider) { // not required + if typeutils.IsZero(m.CloudProvider) { // not required return nil } @@ -565,13 +512,13 @@ func (m *Component) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *Component) UnmarshalBinary(b []byte) error { var res Component - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/component_simple.go b/client/models/component_simple.go index 7c6f0ff3..e5203db8 100644 --- a/client/models/component_simple.go +++ b/client/models/component_simple.go @@ -8,7 +8,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -138,7 +139,7 @@ func (m *ComponentSimple) validateCanonical(formats strfmt.Registry) error { } func (m *ComponentSimple) validateCloudProvider(formats strfmt.Registry) error { - if swag.IsZero(m.CloudProvider) { // not required + if typeutils.IsZero(m.CloudProvider) { // not required return nil } @@ -237,7 +238,7 @@ func (m *ComponentSimple) validateUpdatedAt(formats strfmt.Registry) error { } func (m *ComponentSimple) validateUseCase(formats strfmt.Registry) error { - if swag.IsZero(m.UseCase) { // not required + if typeutils.IsZero(m.UseCase) { // not required return nil } @@ -306,7 +307,7 @@ func (m *ComponentSimple) contextValidateCloudProvider(ctx context.Context, form if m.CloudProvider != nil { - if swag.IsZero(m.CloudProvider) { // not required + if typeutils.IsZero(m.CloudProvider) { // not required return nil } @@ -374,13 +375,13 @@ func (m *ComponentSimple) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *ComponentSimple) UnmarshalBinary(b []byte) error { var res ComponentSimple - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/config_file.go b/client/models/config_file.go index 80af2fdd..8f09f261 100644 --- a/client/models/config_file.go +++ b/client/models/config_file.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -74,13 +74,13 @@ func (m *ConfigFile) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *ConfigFile) UnmarshalBinary(b []byte) error { var res ConfigFile - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/config_repository.go b/client/models/config_repository.go index feb76ea8..ddf35db9 100644 --- a/client/models/config_repository.go +++ b/client/models/config_repository.go @@ -7,7 +7,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -123,7 +124,7 @@ func (m *ConfigRepository) validateCanonical(formats strfmt.Registry) error { } func (m *ConfigRepository) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required + if typeutils.IsZero(m.CreatedAt) { // not required return nil } @@ -135,7 +136,7 @@ func (m *ConfigRepository) validateCreatedAt(formats strfmt.Registry) error { } func (m *ConfigRepository) validateCredentialCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.CredentialCanonical) { // not required + if typeutils.IsZero(m.CredentialCanonical) { // not required return nil } @@ -186,7 +187,7 @@ func (m *ConfigRepository) validateName(formats strfmt.Registry) error { } func (m *ConfigRepository) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required + if typeutils.IsZero(m.UpdatedAt) { // not required return nil } @@ -220,13 +221,13 @@ func (m *ConfigRepository) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *ConfigRepository) UnmarshalBinary(b []byte) error { var res ConfigRepository - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/configure_component.go b/client/models/configure_component.go index 06a83008..ab07f14b 100644 --- a/client/models/configure_component.go +++ b/client/models/configure_component.go @@ -8,7 +8,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -57,7 +58,7 @@ func (m *ConfigureComponent) Validate(formats strfmt.Registry) error { } func (m *ConfigureComponent) validateServiceCatalogSourceVersionID(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceCatalogSourceVersionID) { // not required + if typeutils.IsZero(m.ServiceCatalogSourceVersionID) { // not required return nil } @@ -90,7 +91,7 @@ func (m *ConfigureComponent) validateUseCase(formats strfmt.Registry) error { } func (m *ConfigureComponent) validateVars(formats strfmt.Registry) error { - if swag.IsZero(m.Vars) { // not required + if typeutils.IsZero(m.Vars) { // not required return nil } @@ -128,7 +129,7 @@ func (m *ConfigureComponent) ContextValidate(ctx context.Context, formats strfmt func (m *ConfigureComponent) contextValidateVars(ctx context.Context, formats strfmt.Registry) error { - if swag.IsZero(m.Vars) { // not required + if typeutils.IsZero(m.Vars) { // not required return nil } @@ -153,13 +154,13 @@ func (m *ConfigureComponent) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *ConfigureComponent) UnmarshalBinary(b []byte) error { var res ConfigureComponent - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/cost_estimation_component.go b/client/models/cost_estimation_component.go index 300aea1b..13f251cc 100644 --- a/client/models/cost_estimation_component.go +++ b/client/models/cost_estimation_component.go @@ -8,7 +8,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -76,7 +77,7 @@ func (m *CostEstimationComponent) validateLabel(formats strfmt.Registry) error { } func (m *CostEstimationComponent) validatePlanned(formats strfmt.Registry) error { - if swag.IsZero(m.Planned) { // not required + if typeutils.IsZero(m.Planned) { // not required return nil } @@ -99,7 +100,7 @@ func (m *CostEstimationComponent) validatePlanned(formats strfmt.Registry) error } func (m *CostEstimationComponent) validatePrior(formats strfmt.Registry) error { - if swag.IsZero(m.Prior) { // not required + if typeutils.IsZero(m.Prior) { // not required return nil } @@ -152,7 +153,7 @@ func (m *CostEstimationComponent) contextValidatePlanned(ctx context.Context, fo if m.Planned != nil { - if swag.IsZero(m.Planned) { // not required + if typeutils.IsZero(m.Planned) { // not required return nil } @@ -177,7 +178,7 @@ func (m *CostEstimationComponent) contextValidatePrior(ctx context.Context, form if m.Prior != nil { - if swag.IsZero(m.Prior) { // not required + if typeutils.IsZero(m.Prior) { // not required return nil } @@ -203,13 +204,13 @@ func (m *CostEstimationComponent) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *CostEstimationComponent) UnmarshalBinary(b []byte) error { var res CostEstimationComponent - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/cost_estimation_component_state.go b/client/models/cost_estimation_component_state.go index 482b56e0..328cda38 100644 --- a/client/models/cost_estimation_component_state.go +++ b/client/models/cost_estimation_component_state.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -107,13 +107,13 @@ func (m *CostEstimationComponentState) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *CostEstimationComponentState) UnmarshalBinary(b []byte) error { var res CostEstimationComponentState - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/cost_estimation_resource_estimate.go b/client/models/cost_estimation_resource_estimate.go index 9b9efc0a..8484ff50 100644 --- a/client/models/cost_estimation_resource_estimate.go +++ b/client/models/cost_estimation_resource_estimate.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -99,7 +100,7 @@ func (m *CostEstimationResourceEstimate) validateComponents(formats strfmt.Regis } for i := 0; i < len(m.Components); i++ { - if swag.IsZero(m.Components[i]) { // not required + if typeutils.IsZero(m.Components[i]) { // not required continue } @@ -124,7 +125,7 @@ func (m *CostEstimationResourceEstimate) validateComponents(formats strfmt.Regis } func (m *CostEstimationResourceEstimate) validateImage(formats strfmt.Registry) error { - if swag.IsZero(m.Image) { // not required + if typeutils.IsZero(m.Image) { // not required return nil } @@ -173,7 +174,7 @@ func (m *CostEstimationResourceEstimate) contextValidateComponents(ctx context.C if m.Components[i] != nil { - if swag.IsZero(m.Components[i]) { // not required + if typeutils.IsZero(m.Components[i]) { // not required return nil } @@ -201,13 +202,13 @@ func (m *CostEstimationResourceEstimate) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *CostEstimationResourceEstimate) UnmarshalBinary(b []byte) error { var res CostEstimationResourceEstimate - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/cost_estimation_result.go b/client/models/cost_estimation_result.go index 93336fa3..b1192fe2 100644 --- a/client/models/cost_estimation_result.go +++ b/client/models/cost_estimation_result.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -69,7 +70,7 @@ func (m *CostEstimationResult) validateResourceEstimates(formats strfmt.Registry } for i := 0; i < len(m.ResourceEstimates); i++ { - if swag.IsZero(m.ResourceEstimates[i]) { // not required + if typeutils.IsZero(m.ResourceEstimates[i]) { // not required continue } @@ -113,7 +114,7 @@ func (m *CostEstimationResult) contextValidateResourceEstimates(ctx context.Cont if m.ResourceEstimates[i] != nil { - if swag.IsZero(m.ResourceEstimates[i]) { // not required + if typeutils.IsZero(m.ResourceEstimates[i]) { // not required return nil } @@ -141,13 +142,13 @@ func (m *CostEstimationResult) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *CostEstimationResult) UnmarshalBinary(b []byte) error { var res CostEstimationResult - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/country.go b/client/models/country.go index 2615f2ee..8493a7ac 100644 --- a/client/models/country.go +++ b/client/models/country.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -78,13 +78,13 @@ func (m *Country) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *Country) UnmarshalBinary(b []byte) error { var res Country - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/create_or_update_subscription.go b/client/models/create_or_update_subscription.go index 6b0fc255..8d0ba203 100644 --- a/client/models/create_or_update_subscription.go +++ b/client/models/create_or_update_subscription.go @@ -8,7 +8,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -58,7 +59,7 @@ func (m *CreateOrUpdateSubscription) Validate(formats strfmt.Registry) error { } func (m *CreateOrUpdateSubscription) validateExpiresAt(formats strfmt.Registry) error { - if swag.IsZero(m.ExpiresAt) { // not required + if typeutils.IsZero(m.ExpiresAt) { // not required return nil } @@ -70,7 +71,7 @@ func (m *CreateOrUpdateSubscription) validateExpiresAt(formats strfmt.Registry) } func (m *CreateOrUpdateSubscription) validateMembersCount(formats strfmt.Registry) error { - if swag.IsZero(m.MembersCount) { // not required + if typeutils.IsZero(m.MembersCount) { // not required return nil } @@ -111,7 +112,7 @@ func (m *CreateOrUpdateSubscription) validatePlanCanonicalEnum(path, location st } func (m *CreateOrUpdateSubscription) validatePlanCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.PlanCanonical) { // not required + if typeutils.IsZero(m.PlanCanonical) { // not required return nil } @@ -133,13 +134,13 @@ func (m *CreateOrUpdateSubscription) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *CreateOrUpdateSubscription) UnmarshalBinary(b []byte) error { var res CreateOrUpdateSubscription - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/credential.go b/client/models/credential.go index 21183507..d3c30c71 100644 --- a/client/models/credential.go +++ b/client/models/credential.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -150,7 +151,7 @@ func (m *Credential) validateCanonical(formats strfmt.Registry) error { } func (m *Credential) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required + if typeutils.IsZero(m.CreatedAt) { // not required return nil } @@ -175,7 +176,7 @@ func (m *Credential) validateID(formats strfmt.Registry) error { } func (m *Credential) validateInUse(formats strfmt.Registry) error { - if swag.IsZero(m.InUse) { // not required + if typeutils.IsZero(m.InUse) { // not required return nil } @@ -216,7 +217,7 @@ func (m *Credential) validateName(formats strfmt.Registry) error { } func (m *Credential) validateOwner(formats strfmt.Registry) error { - if swag.IsZero(m.Owner) { // not required + if typeutils.IsZero(m.Owner) { // not required return nil } @@ -339,7 +340,7 @@ func (m *Credential) validateType(formats strfmt.Registry) error { } func (m *Credential) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required + if typeutils.IsZero(m.UpdatedAt) { // not required return nil } @@ -376,7 +377,7 @@ func (m *Credential) contextValidateInUse(ctx context.Context, formats strfmt.Re if m.InUse != nil { - if swag.IsZero(m.InUse) { // not required + if typeutils.IsZero(m.InUse) { // not required return nil } @@ -401,7 +402,7 @@ func (m *Credential) contextValidateOwner(ctx context.Context, formats strfmt.Re if m.Owner != nil { - if swag.IsZero(m.Owner) { // not required + if typeutils.IsZero(m.Owner) { // not required return nil } @@ -448,13 +449,13 @@ func (m *Credential) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *Credential) UnmarshalBinary(b []byte) error { var res Credential - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/credential_in_use.go b/client/models/credential_in_use.go index 77e21e30..9cbbbff6 100644 --- a/client/models/credential_in_use.go +++ b/client/models/credential_in_use.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" ) // CredentialInUse Credential in use @@ -52,12 +53,12 @@ func (m *CredentialInUse) Validate(formats strfmt.Registry) error { } func (m *CredentialInUse) validateConfigRepositories(formats strfmt.Registry) error { - if swag.IsZero(m.ConfigRepositories) { // not required + if typeutils.IsZero(m.ConfigRepositories) { // not required return nil } for i := 0; i < len(m.ConfigRepositories); i++ { - if swag.IsZero(m.ConfigRepositories[i]) { // not required + if typeutils.IsZero(m.ConfigRepositories[i]) { // not required continue } @@ -82,12 +83,12 @@ func (m *CredentialInUse) validateConfigRepositories(formats strfmt.Registry) er } func (m *CredentialInUse) validateExternalBackends(formats strfmt.Registry) error { - if swag.IsZero(m.ExternalBackends) { // not required + if typeutils.IsZero(m.ExternalBackends) { // not required return nil } for i := 0; i < len(m.ExternalBackends); i++ { - if swag.IsZero(m.ExternalBackends[i]) { // not required + if typeutils.IsZero(m.ExternalBackends[i]) { // not required continue } @@ -112,12 +113,12 @@ func (m *CredentialInUse) validateExternalBackends(formats strfmt.Registry) erro } func (m *CredentialInUse) validateServiceCatalogSources(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceCatalogSources) { // not required + if typeutils.IsZero(m.ServiceCatalogSources) { // not required return nil } for i := 0; i < len(m.ServiceCatalogSources); i++ { - if swag.IsZero(m.ServiceCatalogSources[i]) { // not required + if typeutils.IsZero(m.ServiceCatalogSources[i]) { // not required continue } @@ -169,7 +170,7 @@ func (m *CredentialInUse) contextValidateConfigRepositories(ctx context.Context, if m.ConfigRepositories[i] != nil { - if swag.IsZero(m.ConfigRepositories[i]) { // not required + if typeutils.IsZero(m.ConfigRepositories[i]) { // not required return nil } @@ -198,7 +199,7 @@ func (m *CredentialInUse) contextValidateExternalBackends(ctx context.Context, f if m.ExternalBackends[i] != nil { - if swag.IsZero(m.ExternalBackends[i]) { // not required + if typeutils.IsZero(m.ExternalBackends[i]) { // not required return nil } @@ -227,7 +228,7 @@ func (m *CredentialInUse) contextValidateServiceCatalogSources(ctx context.Conte if m.ServiceCatalogSources[i] != nil { - if swag.IsZero(m.ServiceCatalogSources[i]) { // not required + if typeutils.IsZero(m.ServiceCatalogSources[i]) { // not required return nil } @@ -255,13 +256,13 @@ func (m *CredentialInUse) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *CredentialInUse) UnmarshalBinary(b []byte) error { var res CredentialInUse - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/credential_raw.go b/client/models/credential_raw.go index d9c954e8..1ed63ae9 100644 --- a/client/models/credential_raw.go +++ b/client/models/credential_raw.go @@ -8,7 +8,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -119,7 +120,7 @@ func (m *CredentialRaw) validateEnvironmentEnum(path, location string, value str } func (m *CredentialRaw) validateEnvironment(formats strfmt.Registry) error { - if swag.IsZero(m.Environment) { // not required + if typeutils.IsZero(m.Environment) { // not required return nil } @@ -141,13 +142,13 @@ func (m *CredentialRaw) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *CredentialRaw) UnmarshalBinary(b []byte) error { var res CredentialRaw - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/credential_simple.go b/client/models/credential_simple.go index efb9d683..a16ae86b 100644 --- a/client/models/credential_simple.go +++ b/client/models/credential_simple.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -142,7 +143,7 @@ func (m *CredentialSimple) validateCanonical(formats strfmt.Registry) error { } func (m *CredentialSimple) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required + if typeutils.IsZero(m.CreatedAt) { // not required return nil } @@ -167,7 +168,7 @@ func (m *CredentialSimple) validateID(formats strfmt.Registry) error { } func (m *CredentialSimple) validateInUse(formats strfmt.Registry) error { - if swag.IsZero(m.InUse) { // not required + if typeutils.IsZero(m.InUse) { // not required return nil } @@ -208,7 +209,7 @@ func (m *CredentialSimple) validateName(formats strfmt.Registry) error { } func (m *CredentialSimple) validateOwner(formats strfmt.Registry) error { - if swag.IsZero(m.Owner) { // not required + if typeutils.IsZero(m.Owner) { // not required return nil } @@ -307,7 +308,7 @@ func (m *CredentialSimple) validateType(formats strfmt.Registry) error { } func (m *CredentialSimple) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required + if typeutils.IsZero(m.UpdatedAt) { // not required return nil } @@ -340,7 +341,7 @@ func (m *CredentialSimple) contextValidateInUse(ctx context.Context, formats str if m.InUse != nil { - if swag.IsZero(m.InUse) { // not required + if typeutils.IsZero(m.InUse) { // not required return nil } @@ -365,7 +366,7 @@ func (m *CredentialSimple) contextValidateOwner(ctx context.Context, formats str if m.Owner != nil { - if swag.IsZero(m.Owner) { // not required + if typeutils.IsZero(m.Owner) { // not required return nil } @@ -391,13 +392,13 @@ func (m *CredentialSimple) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *CredentialSimple) UnmarshalBinary(b []byte) error { var res CredentialSimple - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/elasticsearch_logs.go b/client/models/elasticsearch_logs.go index 4699bbdc..cde89cf2 100644 --- a/client/models/elasticsearch_logs.go +++ b/client/models/elasticsearch_logs.go @@ -10,7 +10,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -145,7 +146,7 @@ func (m ElasticsearchLogs) MarshalJSON() ([]byte, error) { return nil, err } - return swag.ConcatJSON(b1, b2, b3), nil + return jsonutils.ConcatJSON(b1, b2, b3), nil } // Validate validates this elasticsearch logs @@ -277,13 +278,13 @@ func (m *ElasticsearchLogs) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *ElasticsearchLogs) UnmarshalBinary(b []byte) error { var res ElasticsearchLogs - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res @@ -327,7 +328,7 @@ func (m *ElasticsearchLogsSourcesAnon) Validate(formats strfmt.Registry) error { } func (m *ElasticsearchLogsSourcesAnon) validateMapping(formats strfmt.Registry) error { - if swag.IsZero(m.Mapping) { // not required + if typeutils.IsZero(m.Mapping) { // not required return nil } @@ -367,7 +368,7 @@ func (m *ElasticsearchLogsSourcesAnon) contextValidateMapping(ctx context.Contex if m.Mapping != nil { - if swag.IsZero(m.Mapping) { // not required + if typeutils.IsZero(m.Mapping) { // not required return nil } @@ -393,13 +394,13 @@ func (m *ElasticsearchLogsSourcesAnon) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *ElasticsearchLogsSourcesAnon) UnmarshalBinary(b []byte) error { var res ElasticsearchLogsSourcesAnon - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res @@ -487,13 +488,13 @@ func (m *ElasticsearchLogsSourcesAnonMapping) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *ElasticsearchLogsSourcesAnonMapping) UnmarshalBinary(b []byte) error { var res ElasticsearchLogsSourcesAnonMapping - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/ensure_plan.go b/client/models/ensure_plan.go index 1274e545..697c0b66 100644 --- a/client/models/ensure_plan.go +++ b/client/models/ensure_plan.go @@ -8,7 +8,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -159,13 +159,13 @@ func (m *EnsurePlan) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *EnsurePlan) UnmarshalBinary(b []byte) error { var res EnsurePlan - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/environment.go b/client/models/environment.go index 3bb54c1e..ef112e8c 100644 --- a/client/models/environment.go +++ b/client/models/environment.go @@ -10,7 +10,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -163,12 +164,12 @@ func (m *Environment) validateCanonical(formats strfmt.Registry) error { } func (m *Environment) validateCloudAccounts(formats strfmt.Registry) error { - if swag.IsZero(m.CloudAccounts) { // not required + if typeutils.IsZero(m.CloudAccounts) { // not required return nil } for i := 0; i < len(m.CloudAccounts); i++ { - if swag.IsZero(m.CloudAccounts[i]) { // not required + if typeutils.IsZero(m.CloudAccounts[i]) { // not required continue } @@ -193,12 +194,12 @@ func (m *Environment) validateCloudAccounts(formats strfmt.Registry) error { } func (m *Environment) validateComponents(formats strfmt.Registry) error { - if swag.IsZero(m.Components) { // not required + if typeutils.IsZero(m.Components) { // not required return nil } for i := 0; i < len(m.Components); i++ { - if swag.IsZero(m.Components[i]) { // not required + if typeutils.IsZero(m.Components[i]) { // not required continue } @@ -236,7 +237,7 @@ func (m *Environment) validateCreatedAt(formats strfmt.Registry) error { } func (m *Environment) validateDescription(formats strfmt.Registry) error { - if swag.IsZero(m.Description) { // not required + if typeutils.IsZero(m.Description) { // not required return nil } @@ -248,7 +249,7 @@ func (m *Environment) validateDescription(formats strfmt.Registry) error { } func (m *Environment) validateEnvironmentType(formats strfmt.Registry) error { - if swag.IsZero(m.EnvironmentType) { // not required + if typeutils.IsZero(m.EnvironmentType) { // not required return nil } @@ -284,7 +285,7 @@ func (m *Environment) validateID(formats strfmt.Registry) error { } func (m *Environment) validateName(formats strfmt.Registry) error { - if swag.IsZero(m.Name) { // not required + if typeutils.IsZero(m.Name) { // not required return nil } @@ -300,7 +301,7 @@ func (m *Environment) validateName(formats strfmt.Registry) error { } func (m *Environment) validateOwner(formats strfmt.Registry) error { - if swag.IsZero(m.Owner) { // not required + if typeutils.IsZero(m.Owner) { // not required return nil } @@ -349,12 +350,12 @@ func (m *Environment) validateUpdatedAt(formats strfmt.Registry) error { } func (m *Environment) validateVariables(formats strfmt.Registry) error { - if swag.IsZero(m.Variables) { // not required + if typeutils.IsZero(m.Variables) { // not required return nil } for i := 0; i < len(m.Variables); i++ { - if swag.IsZero(m.Variables[i]) { // not required + if typeutils.IsZero(m.Variables[i]) { // not required continue } @@ -398,7 +399,7 @@ func (m *Environment) validateVersionStatusItemsEnum(path, location string, valu } func (m *Environment) validateVersionStatus(formats strfmt.Registry) error { - if swag.IsZero(m.VersionStatus) { // not required + if typeutils.IsZero(m.VersionStatus) { // not required return nil } @@ -450,7 +451,7 @@ func (m *Environment) contextValidateCloudAccounts(ctx context.Context, formats if m.CloudAccounts[i] != nil { - if swag.IsZero(m.CloudAccounts[i]) { // not required + if typeutils.IsZero(m.CloudAccounts[i]) { // not required return nil } @@ -479,7 +480,7 @@ func (m *Environment) contextValidateComponents(ctx context.Context, formats str if m.Components[i] != nil { - if swag.IsZero(m.Components[i]) { // not required + if typeutils.IsZero(m.Components[i]) { // not required return nil } @@ -506,7 +507,7 @@ func (m *Environment) contextValidateEnvironmentType(ctx context.Context, format if m.EnvironmentType != nil { - if swag.IsZero(m.EnvironmentType) { // not required + if typeutils.IsZero(m.EnvironmentType) { // not required return nil } @@ -531,7 +532,7 @@ func (m *Environment) contextValidateOwner(ctx context.Context, formats strfmt.R if m.Owner != nil { - if swag.IsZero(m.Owner) { // not required + if typeutils.IsZero(m.Owner) { // not required return nil } @@ -558,7 +559,7 @@ func (m *Environment) contextValidateVariables(ctx context.Context, formats strf if m.Variables[i] != nil { - if swag.IsZero(m.Variables[i]) { // not required + if typeutils.IsZero(m.Variables[i]) { // not required return nil } @@ -586,13 +587,13 @@ func (m *Environment) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *Environment) UnmarshalBinary(b []byte) error { var res Environment - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/environment_simple.go b/client/models/environment_simple.go index 1b7eea17..50f81f64 100644 --- a/client/models/environment_simple.go +++ b/client/models/environment_simple.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -120,13 +120,13 @@ func (m *EnvironmentSimple) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *EnvironmentSimple) UnmarshalBinary(b []byte) error { var res EnvironmentSimple - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/environment_type.go b/client/models/environment_type.go index 18b77bf8..a4ade973 100644 --- a/client/models/environment_type.go +++ b/client/models/environment_type.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -220,13 +220,13 @@ func (m *EnvironmentType) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *EnvironmentType) UnmarshalBinary(b []byte) error { var res EnvironmentType - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/environment_variable_item.go b/client/models/environment_variable_item.go index d2309ef1..6b8a4d31 100644 --- a/client/models/environment_variable_item.go +++ b/client/models/environment_variable_item.go @@ -8,7 +8,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -78,7 +79,7 @@ func (m *EnvironmentVariableItem) Validate(formats strfmt.Registry) error { } func (m *EnvironmentVariableItem) validateDescription(formats strfmt.Registry) error { - if swag.IsZero(m.Description) { // not required + if typeutils.IsZero(m.Description) { // not required return nil } @@ -215,13 +216,13 @@ func (m *EnvironmentVariableItem) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *EnvironmentVariableItem) UnmarshalBinary(b []byte) error { var res EnvironmentVariableItem - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/error_details_item.go b/client/models/error_details_item.go index 982d3629..b56db262 100644 --- a/client/models/error_details_item.go +++ b/client/models/error_details_item.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -76,13 +76,13 @@ func (m *ErrorDetailsItem) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *ErrorDetailsItem) UnmarshalBinary(b []byte) error { var res ErrorDetailsItem - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/error_payload.go b/client/models/error_payload.go index 6413e6df..8cf81ffa 100644 --- a/client/models/error_payload.go +++ b/client/models/error_payload.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -49,7 +50,7 @@ func (m *ErrorPayload) validateErrors(formats strfmt.Registry) error { } for i := 0; i < len(m.Errors); i++ { - if swag.IsZero(m.Errors[i]) { // not required + if typeutils.IsZero(m.Errors[i]) { // not required continue } @@ -93,7 +94,7 @@ func (m *ErrorPayload) contextValidateErrors(ctx context.Context, formats strfmt if m.Errors[i] != nil { - if swag.IsZero(m.Errors[i]) { // not required + if typeutils.IsZero(m.Errors[i]) { // not required return nil } @@ -121,13 +122,13 @@ func (m *ErrorPayload) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *ErrorPayload) UnmarshalBinary(b []byte) error { var res ErrorPayload - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/event.go b/client/models/event.go index 45724b04..556f57e5 100644 --- a/client/models/event.go +++ b/client/models/event.go @@ -10,7 +10,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -111,7 +112,7 @@ func (m *Event) Validate(formats strfmt.Registry) error { } func (m *Event) validateColor(formats strfmt.Registry) error { - if swag.IsZero(m.Color) { // not required + if typeutils.IsZero(m.Color) { // not required return nil } @@ -131,7 +132,7 @@ func (m *Event) validateColor(formats strfmt.Registry) error { } func (m *Event) validateIcon(formats strfmt.Registry) error { - if swag.IsZero(m.Icon) { // not required + if typeutils.IsZero(m.Icon) { // not required return nil } @@ -220,7 +221,7 @@ func (m *Event) validateTags(formats strfmt.Registry) error { } for i := 0; i < len(m.Tags); i++ { - if swag.IsZero(m.Tags[i]) { // not required + if typeutils.IsZero(m.Tags[i]) { // not required continue } @@ -335,7 +336,7 @@ func (m *Event) contextValidateTags(ctx context.Context, formats strfmt.Registry if m.Tags[i] != nil { - if swag.IsZero(m.Tags[i]) { // not required + if typeutils.IsZero(m.Tags[i]) { // not required return nil } @@ -363,13 +364,13 @@ func (m *Event) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *Event) UnmarshalBinary(b []byte) error { var res Event - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/events_actions_and_entities.go b/client/models/events_actions_and_entities.go index 5eb3796e..912cc944 100644 --- a/client/models/events_actions_and_entities.go +++ b/client/models/events_actions_and_entities.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -73,13 +73,13 @@ func (m *EventsActionsAndEntities) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *EventsActionsAndEntities) UnmarshalBinary(b []byte) error { var res EventsActionsAndEntities - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/events_count.go b/client/models/events_count.go index 3f47e528..e8afbe43 100644 --- a/client/models/events_count.go +++ b/client/models/events_count.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -95,13 +95,13 @@ func (m *EventsCount) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *EventsCount) UnmarshalBinary(b []byte) error { var res EventsCount - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/external_backend.go b/client/models/external_backend.go index 87dc40b2..042b8acb 100644 --- a/client/models/external_backend.go +++ b/client/models/external_backend.go @@ -12,7 +12,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -220,7 +221,7 @@ func (m ExternalBackend) MarshalJSON() ([]byte, error) { return nil, err } - return swag.ConcatJSON(b1, b2, b3), nil + return jsonutils.ConcatJSON(b1, b2, b3), nil } // Validate validates this external backend @@ -274,7 +275,7 @@ func (m *ExternalBackend) Validate(formats strfmt.Registry) error { } func (m *ExternalBackend) validateComponentCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.ComponentCanonical) { // not required + if typeutils.IsZero(m.ComponentCanonical) { // not required return nil } @@ -316,7 +317,7 @@ func (m *ExternalBackend) validateConfiguration(formats strfmt.Registry) error { } func (m *ExternalBackend) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required + if typeutils.IsZero(m.CreatedAt) { // not required return nil } @@ -328,7 +329,7 @@ func (m *ExternalBackend) validateCreatedAt(formats strfmt.Registry) error { } func (m *ExternalBackend) validateCredentialCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.CredentialCanonical) { // not required + if typeutils.IsZero(m.CredentialCanonical) { // not required return nil } @@ -357,7 +358,7 @@ func (m *ExternalBackend) validateDefault(formats strfmt.Registry) error { } func (m *ExternalBackend) validateEnvironmentCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.EnvironmentCanonical) { // not required + if typeutils.IsZero(m.EnvironmentCanonical) { // not required return nil } @@ -377,7 +378,7 @@ func (m *ExternalBackend) validateEnvironmentCanonical(formats strfmt.Registry) } func (m *ExternalBackend) validateID(formats strfmt.Registry) error { - if swag.IsZero(m.ID) { // not required + if typeutils.IsZero(m.ID) { // not required return nil } @@ -389,7 +390,7 @@ func (m *ExternalBackend) validateID(formats strfmt.Registry) error { } func (m *ExternalBackend) validateProjectCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.ProjectCanonical) { // not required + if typeutils.IsZero(m.ProjectCanonical) { // not required return nil } @@ -418,7 +419,7 @@ func (m *ExternalBackend) validatePurpose(formats strfmt.Registry) error { } func (m *ExternalBackend) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required + if typeutils.IsZero(m.UpdatedAt) { // not required return nil } @@ -466,13 +467,13 @@ func (m *ExternalBackend) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *ExternalBackend) UnmarshalBinary(b []byte) error { var res ExternalBackend - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/form_entity.go b/client/models/form_entity.go index 040012e2..1ec4402e 100644 --- a/client/models/form_entity.go +++ b/client/models/form_entity.go @@ -5,10 +5,13 @@ package models import ( "context" "encoding/json" + stderrors "errors" + "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -19,6 +22,9 @@ import ( // swagger:model FormEntity type FormEntity struct { + // Optional condition expression that gates whether this widget is displayed. Same V2 syntax as Group.condition (e.g. "$other_field == 'aws'"). Variables prefixed with "ctx_" are runtime-injected and bypass the entity-existence validation. + Condition string `json:"condition,omitempty"` + // The current value that was previously configured for this variable upon creation or update. In case of shared variables having different values, it will be empty, and 'mismatch_values' will be filled instead. Current any `json:"current,omitempty"` @@ -42,6 +48,9 @@ type FormEntity struct { // Whether or not the entity should be displayed to the user. This entity must be usable as such (not required, or with a default if required) Folded bool `json:"folded,omitempty"` + // Sub-entity definitions for the repeatable widget. Each item defines a field that users can fill N times. Only valid when widget is 'repeatable'. + Items []*FormEntity `json:"items"` + // The key is the name of variables for the ansible/pipeline/terraform technologies. If this is a first level variable then: keyX. If you have multiple terraform modules then use: module.Y.keyX to help identify the unique variable. // Required: true Key *string `json:"key"` @@ -95,7 +104,7 @@ type FormEntity struct { // The widget used to display the data in the most suitable way // Required: true - // Enum: ["auto_complete","dropdown","radios","slider_list","slider_range","number","simple_text","switch","text_area","cy_cred","cy_scs","cy_crs","cy_branch","cy_inventory_resource","cy_inventory_output","date_time","hidden"] + // Enum: ["auto_complete","dropdown","radios","slider_list","slider_range","number","simple_text","switch","text_area","cy_cred","cy_scs","cy_crs","cy_branch","cy_inventory_resource","cy_inventory_output","date_time","hidden","repeatable"] Widget *string `json:"widget"` // Some specific configuration that could be applied to that widget. Currently only a few widgets can be configured: @@ -132,6 +141,10 @@ type FormEntity struct { // * 'environment' (string): Linked environment canonical // * 'component' (string): Linked component canonical // * 'service_catalogs' (list(string)): Linked service catalog (stack) canonicals + // * repeatable + // * 'min_items' (int): minimum number of repeatable instances (0 = no minimum) + // * 'max_items' (int): maximum number of repeatable instances (0 = no maximum) + // * 'item_label' (string): label template for each instance WidgetConfig any `json:"widget_config,omitempty"` } @@ -139,6 +152,10 @@ type FormEntity struct { func (m *FormEntity) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateItems(formats); err != nil { + res = append(res, err) + } + if err := m.validateKey(formats); err != nil { res = append(res, err) } @@ -161,6 +178,36 @@ func (m *FormEntity) Validate(formats strfmt.Registry) error { return nil } +func (m *FormEntity) validateItems(formats strfmt.Registry) error { + if typeutils.IsZero(m.Items) { // not required + return nil + } + + for i := 0; i < len(m.Items); i++ { + if typeutils.IsZero(m.Items[i]) { // not required + continue + } + + if m.Items[i] != nil { + if err := m.Items[i].Validate(formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("items" + "." + strconv.Itoa(i)) + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("items" + "." + strconv.Itoa(i)) + } + + return err + } + } + + } + + return nil +} + func (m *FormEntity) validateKey(formats strfmt.Registry) error { if err := validate.Required("key", "body", m.Key); err != nil { @@ -238,7 +285,7 @@ var formEntityTypeWidgetPropEnum []any func init() { var res []string - if err := json.Unmarshal([]byte(`["auto_complete","dropdown","radios","slider_list","slider_range","number","simple_text","switch","text_area","cy_cred","cy_scs","cy_crs","cy_branch","cy_inventory_resource","cy_inventory_output","date_time","hidden"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["auto_complete","dropdown","radios","slider_list","slider_range","number","simple_text","switch","text_area","cy_cred","cy_scs","cy_crs","cy_branch","cy_inventory_resource","cy_inventory_output","date_time","hidden","repeatable"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -298,6 +345,9 @@ const ( // FormEntityWidgetHidden captures enum value "hidden" FormEntityWidgetHidden string = "hidden" + + // FormEntityWidgetRepeatable captures enum value "repeatable" + FormEntityWidgetRepeatable string = "repeatable" ) // prop value enum @@ -322,8 +372,46 @@ func (m *FormEntity) validateWidget(formats strfmt.Registry) error { return nil } -// ContextValidate validates this form entity based on context it is used +// ContextValidate validate this form entity based on the context it is used func (m *FormEntity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateItems(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FormEntity) contextValidateItems(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Items); i++ { + + if m.Items[i] != nil { + + if typeutils.IsZero(m.Items[i]) { // not required + return nil + } + + if err := m.Items[i].ContextValidate(ctx, formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("items" + "." + strconv.Itoa(i)) + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("items" + "." + strconv.Itoa(i)) + } + + return err + } + } + + } + return nil } @@ -332,13 +420,13 @@ func (m *FormEntity) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *FormEntity) UnmarshalBinary(b []byte) error { var res FormEntity - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/form_group.go b/client/models/form_group.go index cc19980a..e6259488 100644 --- a/client/models/form_group.go +++ b/client/models/form_group.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -90,7 +91,7 @@ func (m *FormGroup) validateVars(formats strfmt.Registry) error { } for i := 0; i < len(m.Vars); i++ { - if swag.IsZero(m.Vars[i]) { // not required + if typeutils.IsZero(m.Vars[i]) { // not required continue } @@ -134,7 +135,7 @@ func (m *FormGroup) contextValidateVars(ctx context.Context, formats strfmt.Regi if m.Vars[i] != nil { - if swag.IsZero(m.Vars[i]) { // not required + if typeutils.IsZero(m.Vars[i]) { // not required return nil } @@ -162,13 +163,13 @@ func (m *FormGroup) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *FormGroup) UnmarshalBinary(b []byte) error { var res FormGroup - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/form_section.go b/client/models/form_section.go index c1f9ba96..bb90c09b 100644 --- a/client/models/form_section.go +++ b/client/models/form_section.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -55,7 +56,7 @@ func (m *FormSection) validateGroups(formats strfmt.Registry) error { } for i := 0; i < len(m.Groups); i++ { - if swag.IsZero(m.Groups[i]) { // not required + if typeutils.IsZero(m.Groups[i]) { // not required continue } @@ -108,7 +109,7 @@ func (m *FormSection) contextValidateGroups(ctx context.Context, formats strfmt. if m.Groups[i] != nil { - if swag.IsZero(m.Groups[i]) { // not required + if typeutils.IsZero(m.Groups[i]) { // not required return nil } @@ -136,13 +137,13 @@ func (m *FormSection) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *FormSection) UnmarshalBinary(b []byte) error { var res FormSection - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/form_use_case.go b/client/models/form_use_case.go index 0143a338..7da12ae1 100644 --- a/client/models/form_use_case.go +++ b/client/models/form_use_case.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -61,7 +62,7 @@ func (m *FormUseCase) validateSections(formats strfmt.Registry) error { } for i := 0; i < len(m.Sections); i++ { - if swag.IsZero(m.Sections[i]) { // not required + if typeutils.IsZero(m.Sections[i]) { // not required continue } @@ -105,7 +106,7 @@ func (m *FormUseCase) contextValidateSections(ctx context.Context, formats strfm if m.Sections[i] != nil { - if swag.IsZero(m.Sections[i]) { // not required + if typeutils.IsZero(m.Sections[i]) { // not required return nil } @@ -133,13 +134,13 @@ func (m *FormUseCase) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *FormUseCase) UnmarshalBinary(b []byte) error { var res FormUseCase - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/forms_file_v3.go b/client/models/forms_file_v3.go index 18dc9b54..ad042a7b 100644 --- a/client/models/forms_file_v3.go +++ b/client/models/forms_file_v3.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -52,7 +53,7 @@ func (m *FormsFileV3) validateUseCases(formats strfmt.Registry) error { } for i := 0; i < len(m.UseCases); i++ { - if swag.IsZero(m.UseCases[i]) { // not required + if typeutils.IsZero(m.UseCases[i]) { // not required continue } @@ -105,7 +106,7 @@ func (m *FormsFileV3) contextValidateUseCases(ctx context.Context, formats strfm if m.UseCases[i] != nil { - if swag.IsZero(m.UseCases[i]) { // not required + if typeutils.IsZero(m.UseCases[i]) { // not required return nil } @@ -133,13 +134,13 @@ func (m *FormsFileV3) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *FormsFileV3) UnmarshalBinary(b []byte) error { var res FormsFileV3 - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/forms_validation.go b/client/models/forms_validation.go index 08da5376..847f9c6c 100644 --- a/client/models/forms_validation.go +++ b/client/models/forms_validation.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" ) // FormsValidation Forms validation @@ -55,13 +55,13 @@ func (m *FormsValidation) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *FormsValidation) UnmarshalBinary(b []byte) error { var res FormsValidation - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/forms_validation_result.go b/client/models/forms_validation_result.go index 904a5d3f..ecede8d9 100644 --- a/client/models/forms_validation_result.go +++ b/client/models/forms_validation_result.go @@ -8,7 +8,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -119,13 +119,13 @@ func (m *FormsValidationResult) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *FormsValidationResult) UnmarshalBinary(b []byte) error { var res FormsValidationResult - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/forms_values_ref.go b/client/models/forms_values_ref.go index d4456381..8e530037 100644 --- a/client/models/forms_values_ref.go +++ b/client/models/forms_values_ref.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -56,13 +56,13 @@ func (m *FormsValuesRef) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *FormsValuesRef) UnmarshalBinary(b []byte) error { var res FormsValuesRef - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/g_c_p_cost_storage.go b/client/models/g_c_p_cost_storage.go index b35e0602..6ea01131 100644 --- a/client/models/g_c_p_cost_storage.go +++ b/client/models/g_c_p_cost_storage.go @@ -9,7 +9,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" ) // GCPCostStorage Representation of BigQuery external backend. @@ -131,7 +131,7 @@ func (m GCPCostStorage) MarshalJSON() ([]byte, error) { return nil, err } - return swag.ConcatJSON(b1, b2, b3), nil + return jsonutils.ConcatJSON(b1, b2, b3), nil } // Validate validates this g c p cost storage @@ -159,13 +159,13 @@ func (m *GCPCostStorage) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *GCPCostStorage) UnmarshalBinary(b []byte) error { var res GCPCostStorage - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/g_c_p_remote_t_f_state.go b/client/models/g_c_p_remote_t_f_state.go index c52e4f9a..6772b9eb 100644 --- a/client/models/g_c_p_remote_t_f_state.go +++ b/client/models/g_c_p_remote_t_f_state.go @@ -9,7 +9,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -121,7 +121,7 @@ func (m GCPRemoteTFState) MarshalJSON() ([]byte, error) { return nil, err } - return swag.ConcatJSON(b1, b2, b3), nil + return jsonutils.ConcatJSON(b1, b2, b3), nil } // Validate validates this g c p remote t f state @@ -162,13 +162,13 @@ func (m *GCPRemoteTFState) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *GCPRemoteTFState) UnmarshalBinary(b []byte) error { var res GCPRemoteTFState - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/g_c_p_storage.go b/client/models/g_c_p_storage.go index 6668238a..9c4e387a 100644 --- a/client/models/g_c_p_storage.go +++ b/client/models/g_c_p_storage.go @@ -9,7 +9,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -123,7 +123,7 @@ func (m GCPStorage) MarshalJSON() ([]byte, error) { return nil, err } - return swag.ConcatJSON(b1, b2, b3), nil + return jsonutils.ConcatJSON(b1, b2, b3), nil } // Validate validates this g c p storage @@ -164,13 +164,13 @@ func (m *GCPStorage) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *GCPStorage) UnmarshalBinary(b []byte) error { var res GCPStorage - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/general_status.go b/client/models/general_status.go index 68d2f067..1ecdfbed 100644 --- a/client/models/general_status.go +++ b/client/models/general_status.go @@ -10,7 +10,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -63,7 +64,7 @@ func (m *GeneralStatus) validateChecks(formats strfmt.Registry) error { } for i := 0; i < len(m.Checks); i++ { - if swag.IsZero(m.Checks[i]) { // not required + if typeutils.IsZero(m.Checks[i]) { // not required continue } @@ -166,7 +167,7 @@ func (m *GeneralStatus) contextValidateChecks(ctx context.Context, formats strfm if m.Checks[i] != nil { - if swag.IsZero(m.Checks[i]) { // not required + if typeutils.IsZero(m.Checks[i]) { // not required return nil } @@ -194,13 +195,13 @@ func (m *GeneralStatus) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *GeneralStatus) UnmarshalBinary(b []byte) error { var res GeneralStatus - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/get_plan.go b/client/models/get_plan.go index 407c823a..150e736b 100644 --- a/client/models/get_plan.go +++ b/client/models/get_plan.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -113,12 +114,12 @@ func (m *GetPlan) validateType(formats strfmt.Registry) error { } func (m *GetPlan) validateVersionedResourceTypes(formats strfmt.Registry) error { - if swag.IsZero(m.VersionedResourceTypes) { // not required + if typeutils.IsZero(m.VersionedResourceTypes) { // not required return nil } for i := 0; i < len(m.VersionedResourceTypes); i++ { - if swag.IsZero(m.VersionedResourceTypes[i]) { // not required + if typeutils.IsZero(m.VersionedResourceTypes[i]) { // not required continue } @@ -162,7 +163,7 @@ func (m *GetPlan) contextValidateVersionedResourceTypes(ctx context.Context, for if m.VersionedResourceTypes[i] != nil { - if swag.IsZero(m.VersionedResourceTypes[i]) { // not required + if typeutils.IsZero(m.VersionedResourceTypes[i]) { // not required return nil } @@ -190,13 +191,13 @@ func (m *GetPlan) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *GetPlan) UnmarshalBinary(b []byte) error { var res GetPlan - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/git_lab_http_storage.go b/client/models/git_lab_http_storage.go index dae8a694..b4684bda 100644 --- a/client/models/git_lab_http_storage.go +++ b/client/models/git_lab_http_storage.go @@ -9,7 +9,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -105,7 +105,7 @@ func (m GitLabHTTPStorage) MarshalJSON() ([]byte, error) { return nil, err } - return swag.ConcatJSON(b1, b2, b3), nil + return jsonutils.ConcatJSON(b1, b2, b3), nil } // Validate validates this git lab HTTP storage @@ -146,13 +146,13 @@ func (m *GitLabHTTPStorage) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *GitLabHTTPStorage) UnmarshalBinary(b []byte) error { var res GitLabHTTPStorage - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/group_config.go b/client/models/group_config.go index 938d08c4..bf3b2c21 100644 --- a/client/models/group_config.go +++ b/client/models/group_config.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -62,13 +62,13 @@ func (m *GroupConfig) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *GroupConfig) UnmarshalBinary(b []byte) error { var res GroupConfig - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/http_storage.go b/client/models/http_storage.go index 8ce09f90..46476d46 100644 --- a/client/models/http_storage.go +++ b/client/models/http_storage.go @@ -9,7 +9,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -105,7 +105,7 @@ func (m HTTPStorage) MarshalJSON() ([]byte, error) { return nil, err } - return swag.ConcatJSON(b1, b2, b3), nil + return jsonutils.ConcatJSON(b1, b2, b3), nil } // Validate validates this HTTP storage @@ -146,13 +146,13 @@ func (m *HTTPStorage) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *HTTPStorage) UnmarshalBinary(b []byte) error { var res HTTPStorage - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/in_use_component.go b/client/models/in_use_component.go index a11f9bc2..22a9f1aa 100644 --- a/client/models/in_use_component.go +++ b/client/models/in_use_component.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -71,13 +71,13 @@ func (m *InUseComponent) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *InUseComponent) UnmarshalBinary(b []byte) error { var res InUseComponent - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/in_use_config_repository.go b/client/models/in_use_config_repository.go index 5dbef6e7..f5fd3a08 100644 --- a/client/models/in_use_config_repository.go +++ b/client/models/in_use_config_repository.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -88,13 +88,13 @@ func (m *InUseConfigRepository) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *InUseConfigRepository) UnmarshalBinary(b []byte) error { var res InUseConfigRepository - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/in_use_environment.go b/client/models/in_use_environment.go index e34972f5..a50af1b8 100644 --- a/client/models/in_use_environment.go +++ b/client/models/in_use_environment.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -71,13 +71,13 @@ func (m *InUseEnvironment) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *InUseEnvironment) UnmarshalBinary(b []byte) error { var res InUseEnvironment - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/in_use_external_backend.go b/client/models/in_use_external_backend.go index b764b1b3..364aa54a 100644 --- a/client/models/in_use_external_backend.go +++ b/client/models/in_use_external_backend.go @@ -8,7 +8,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -68,7 +69,7 @@ func (m *InUseExternalBackend) Validate(formats strfmt.Registry) error { } func (m *InUseExternalBackend) validateComponent(formats strfmt.Registry) error { - if swag.IsZero(m.Component) { // not required + if typeutils.IsZero(m.Component) { // not required return nil } @@ -100,7 +101,7 @@ func (m *InUseExternalBackend) validateEngine(formats strfmt.Registry) error { } func (m *InUseExternalBackend) validateEnvironment(formats strfmt.Registry) error { - if swag.IsZero(m.Environment) { // not required + if typeutils.IsZero(m.Environment) { // not required return nil } @@ -123,7 +124,7 @@ func (m *InUseExternalBackend) validateEnvironment(formats strfmt.Registry) erro } func (m *InUseExternalBackend) validateProject(formats strfmt.Registry) error { - if swag.IsZero(m.Project) { // not required + if typeutils.IsZero(m.Project) { // not required return nil } @@ -180,7 +181,7 @@ func (m *InUseExternalBackend) contextValidateComponent(ctx context.Context, for if m.Component != nil { - if swag.IsZero(m.Component) { // not required + if typeutils.IsZero(m.Component) { // not required return nil } @@ -205,7 +206,7 @@ func (m *InUseExternalBackend) contextValidateEnvironment(ctx context.Context, f if m.Environment != nil { - if swag.IsZero(m.Environment) { // not required + if typeutils.IsZero(m.Environment) { // not required return nil } @@ -230,7 +231,7 @@ func (m *InUseExternalBackend) contextValidateProject(ctx context.Context, forma if m.Project != nil { - if swag.IsZero(m.Project) { // not required + if typeutils.IsZero(m.Project) { // not required return nil } @@ -256,13 +257,13 @@ func (m *InUseExternalBackend) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *InUseExternalBackend) UnmarshalBinary(b []byte) error { var res InUseExternalBackend - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/in_use_project.go b/client/models/in_use_project.go index 12f42348..18d59866 100644 --- a/client/models/in_use_project.go +++ b/client/models/in_use_project.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -88,13 +88,13 @@ func (m *InUseProject) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *InUseProject) UnmarshalBinary(b []byte) error { var res InUseProject - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/in_use_service_catalog_source.go b/client/models/in_use_service_catalog_source.go index 9da231aa..78d9cad4 100644 --- a/client/models/in_use_service_catalog_source.go +++ b/client/models/in_use_service_catalog_source.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -88,13 +88,13 @@ func (m *InUseServiceCatalogSource) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *InUseServiceCatalogSource) UnmarshalBinary(b []byte) error { var res InUseServiceCatalogSource - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/infra_import.go b/client/models/infra_import.go deleted file mode 100644 index 9e16d521..00000000 --- a/client/models/infra_import.go +++ /dev/null @@ -1,250 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// InfraImport Infra Import -// -// The entity which represents the information of for the import of a new Stack or Project. -// -// swagger:model InfraImport -type InfraImport struct { - - // component canonical - // Max Length: 100 - // Min Length: 1 - // Pattern: ^[\da-zA-Z]+(?:(?:[\da-zA-Z\-._]+)?[\da-zA-Z])?$ - ComponentCanonical string `json:"component_canonical,omitempty"` - - // environment canonical - // Max Length: 100 - // Min Length: 1 - // Pattern: ^[\da-zA-Z]+(?:(?:[\da-zA-Z\-._]+)?[\da-zA-Z])?$ - EnvironmentCanonical string `json:"environment_canonical,omitempty"` - - // error - // Required: true - Error *string `json:"error"` - - // logs - // Required: true - Logs *string `json:"logs"` - - // project canonical - // Max Length: 100 - // Min Length: 1 - // Pattern: (^[a-z0-9]+(([a-z0-9\-_]+)?[a-z0-9]+)?$) - ProjectCanonical string `json:"project_canonical,omitempty"` - - // It's the ref of the Service Catalog, like 'cycloidio:stack-magento' - // Required: true - ServiceCatalogRef *string `json:"service_catalog_ref"` - - // The import process status. - // Required: true - // Enum: ["succeeded","failed","importing"] - Status *string `json:"status"` -} - -// Validate validates this infra import -func (m *InfraImport) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateComponentCanonical(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEnvironmentCanonical(formats); err != nil { - res = append(res, err) - } - - if err := m.validateError(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLogs(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProjectCanonical(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceCatalogRef(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *InfraImport) validateComponentCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.ComponentCanonical) { // not required - return nil - } - - if err := validate.MinLength("component_canonical", "body", m.ComponentCanonical, 1); err != nil { - return err - } - - if err := validate.MaxLength("component_canonical", "body", m.ComponentCanonical, 100); err != nil { - return err - } - - if err := validate.Pattern("component_canonical", "body", m.ComponentCanonical, `^[\da-zA-Z]+(?:(?:[\da-zA-Z\-._]+)?[\da-zA-Z])?$`); err != nil { - return err - } - - return nil -} - -func (m *InfraImport) validateEnvironmentCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.EnvironmentCanonical) { // not required - return nil - } - - if err := validate.MinLength("environment_canonical", "body", m.EnvironmentCanonical, 1); err != nil { - return err - } - - if err := validate.MaxLength("environment_canonical", "body", m.EnvironmentCanonical, 100); err != nil { - return err - } - - if err := validate.Pattern("environment_canonical", "body", m.EnvironmentCanonical, `^[\da-zA-Z]+(?:(?:[\da-zA-Z\-._]+)?[\da-zA-Z])?$`); err != nil { - return err - } - - return nil -} - -func (m *InfraImport) validateError(formats strfmt.Registry) error { - - if err := validate.Required("error", "body", m.Error); err != nil { - return err - } - - return nil -} - -func (m *InfraImport) validateLogs(formats strfmt.Registry) error { - - if err := validate.Required("logs", "body", m.Logs); err != nil { - return err - } - - return nil -} - -func (m *InfraImport) validateProjectCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.ProjectCanonical) { // not required - return nil - } - - if err := validate.MinLength("project_canonical", "body", m.ProjectCanonical, 1); err != nil { - return err - } - - if err := validate.MaxLength("project_canonical", "body", m.ProjectCanonical, 100); err != nil { - return err - } - - if err := validate.Pattern("project_canonical", "body", m.ProjectCanonical, `(^[a-z0-9]+(([a-z0-9\-_]+)?[a-z0-9]+)?$)`); err != nil { - return err - } - - return nil -} - -func (m *InfraImport) validateServiceCatalogRef(formats strfmt.Registry) error { - - if err := validate.Required("service_catalog_ref", "body", m.ServiceCatalogRef); err != nil { - return err - } - - return nil -} - -var infraImportTypeStatusPropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["succeeded","failed","importing"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - infraImportTypeStatusPropEnum = append(infraImportTypeStatusPropEnum, v) - } -} - -const ( - - // InfraImportStatusSucceeded captures enum value "succeeded" - InfraImportStatusSucceeded string = "succeeded" - - // InfraImportStatusFailed captures enum value "failed" - InfraImportStatusFailed string = "failed" - - // InfraImportStatusImporting captures enum value "importing" - InfraImportStatusImporting string = "importing" -) - -// prop value enum -func (m *InfraImport) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, infraImportTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *InfraImport) validateStatus(formats strfmt.Registry) error { - - if err := validate.Required("status", "body", m.Status); err != nil { - return err - } - - // value enum - if err := m.validateStatusEnum("status", "body", *m.Status); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this infra import based on context it is used -func (m *InfraImport) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *InfraImport) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *InfraImport) UnmarshalBinary(b []byte) error { - var res InfraImport - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/client/models/infra_import_preset.go b/client/models/infra_import_preset.go deleted file mode 100644 index 552e53e7..00000000 --- a/client/models/infra_import_preset.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// InfraImportPreset InfraImportPreset -// -// Infra Import's pre-configured group with Resources commonly used together in a specific context. -// -// swagger:model InfraImportPreset -type InfraImportPreset struct { - - // name - // Required: true - Name *string `json:"name"` - - // resources - // Required: true - Resources []string `json:"resources"` -} - -// Validate validates this infra import preset -func (m *InfraImportPreset) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateResources(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *InfraImportPreset) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *InfraImportPreset) validateResources(formats strfmt.Registry) error { - - if err := validate.Required("resources", "body", m.Resources); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this infra import preset based on context it is used -func (m *InfraImportPreset) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *InfraImportPreset) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *InfraImportPreset) UnmarshalBinary(b []byte) error { - var res InfraImportPreset - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/client/models/infra_import_resource.go b/client/models/infra_import_resource.go deleted file mode 100644 index 8a13a9fe..00000000 --- a/client/models/infra_import_resource.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// InfraImportResource Infra Import Resource -// -// The representation of the Infra Import's Resource of a Cloud Provider. -// -// swagger:model InfraImportResource -type InfraImportResource struct { - - // id - // Required: true - ID *string `json:"id"` -} - -// Validate validates this infra import resource -func (m *InfraImportResource) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *InfraImportResource) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this infra import resource based on context it is used -func (m *InfraImportResource) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *InfraImportResource) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *InfraImportResource) UnmarshalBinary(b []byte) error { - var res InfraImportResource - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/client/models/infra_import_resource_body.go b/client/models/infra_import_resource_body.go deleted file mode 100644 index 27ae47fe..00000000 --- a/client/models/infra_import_resource_body.go +++ /dev/null @@ -1,225 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -import ( - "bytes" - "context" - "encoding/json" - stderrors "errors" - "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" -) - -// InfraImportResourceBody Provider Resources body -// -// # Entry that represents all the data needed for fetching resource -// -// swagger:model InfraImportResourceBody -type InfraImportResourceBody struct { - configurationField CloudProviderConfiguration - - // Credential that will be used to import from the provider - // Required: true - // Max Length: 100 - // Min Length: 3 - // Pattern: ^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$ - CredentialCanonical *string `json:"credential_canonical"` - - // tags - Tags []string `json:"tags"` -} - -// Configuration gets the configuration of this base type -func (m *InfraImportResourceBody) Configuration() CloudProviderConfiguration { - return m.configurationField -} - -// SetConfiguration sets the configuration of this base type -func (m *InfraImportResourceBody) SetConfiguration(val CloudProviderConfiguration) { - m.configurationField = val -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *InfraImportResourceBody) UnmarshalJSON(raw []byte) error { - var data struct { - Configuration json.RawMessage `json:"configuration"` - - CredentialCanonical *string `json:"credential_canonical"` - - Tags []string `json:"tags"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - propConfiguration, err := UnmarshalCloudProviderConfiguration(bytes.NewBuffer(data.Configuration), runtime.JSONConsumer()) - if err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - var result InfraImportResourceBody - - // configuration - result.configurationField = propConfiguration - - // credential_canonical - result.CredentialCanonical = data.CredentialCanonical - - // tags - result.Tags = data.Tags - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m InfraImportResourceBody) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - CredentialCanonical *string `json:"credential_canonical"` - - Tags []string `json:"tags"` - }{ - - CredentialCanonical: m.CredentialCanonical, - - Tags: m.Tags, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - Configuration CloudProviderConfiguration `json:"configuration"` - }{ - - Configuration: m.configurationField, - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this infra import resource body -func (m *InfraImportResourceBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateConfiguration(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCredentialCanonical(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *InfraImportResourceBody) validateConfiguration(formats strfmt.Registry) error { - - if err := validate.Required("configuration", "body", m.Configuration()); err != nil { - return err - } - - if err := m.Configuration().Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("configuration") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("configuration") - } - - return err - } - - return nil -} - -func (m *InfraImportResourceBody) validateCredentialCanonical(formats strfmt.Registry) error { - - if err := validate.Required("credential_canonical", "body", m.CredentialCanonical); err != nil { - return err - } - - if err := validate.MinLength("credential_canonical", "body", *m.CredentialCanonical, 3); err != nil { - return err - } - - if err := validate.MaxLength("credential_canonical", "body", *m.CredentialCanonical, 100); err != nil { - return err - } - - if err := validate.Pattern("credential_canonical", "body", *m.CredentialCanonical, `^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$`); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this infra import resource body based on the context it is used -func (m *InfraImportResourceBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateConfiguration(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *InfraImportResourceBody) contextValidateConfiguration(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Configuration().ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("configuration") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("configuration") - } - - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *InfraImportResourceBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *InfraImportResourceBody) UnmarshalBinary(b []byte) error { - var res InfraImportResourceBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/client/models/infra_import_resources_body.go b/client/models/infra_import_resources_body.go deleted file mode 100644 index 77b73aa6..00000000 --- a/client/models/infra_import_resources_body.go +++ /dev/null @@ -1,213 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -import ( - "bytes" - "context" - "encoding/json" - stderrors "errors" - "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" -) - -// InfraImportResourcesBody Provider's Resources body -// -// # Entry that represents all the data needed for fetching resources -// -// swagger:model InfraImportResourcesBody -type InfraImportResourcesBody struct { - configurationField CloudProviderConfiguration - - // Credential that will be used to import from the provider - // Required: true - // Max Length: 100 - // Min Length: 3 - // Pattern: ^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$ - CredentialCanonical *string `json:"credential_canonical"` -} - -// Configuration gets the configuration of this base type -func (m *InfraImportResourcesBody) Configuration() CloudProviderConfiguration { - return m.configurationField -} - -// SetConfiguration sets the configuration of this base type -func (m *InfraImportResourcesBody) SetConfiguration(val CloudProviderConfiguration) { - m.configurationField = val -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *InfraImportResourcesBody) UnmarshalJSON(raw []byte) error { - var data struct { - Configuration json.RawMessage `json:"configuration"` - - CredentialCanonical *string `json:"credential_canonical"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - propConfiguration, err := UnmarshalCloudProviderConfiguration(bytes.NewBuffer(data.Configuration), runtime.JSONConsumer()) - if err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - var result InfraImportResourcesBody - - // configuration - result.configurationField = propConfiguration - - // credential_canonical - result.CredentialCanonical = data.CredentialCanonical - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m InfraImportResourcesBody) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - CredentialCanonical *string `json:"credential_canonical"` - }{ - - CredentialCanonical: m.CredentialCanonical, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - Configuration CloudProviderConfiguration `json:"configuration"` - }{ - - Configuration: m.configurationField, - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this infra import resources body -func (m *InfraImportResourcesBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateConfiguration(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCredentialCanonical(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *InfraImportResourcesBody) validateConfiguration(formats strfmt.Registry) error { - - if err := validate.Required("configuration", "body", m.Configuration()); err != nil { - return err - } - - if err := m.Configuration().Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("configuration") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("configuration") - } - - return err - } - - return nil -} - -func (m *InfraImportResourcesBody) validateCredentialCanonical(formats strfmt.Registry) error { - - if err := validate.Required("credential_canonical", "body", m.CredentialCanonical); err != nil { - return err - } - - if err := validate.MinLength("credential_canonical", "body", *m.CredentialCanonical, 3); err != nil { - return err - } - - if err := validate.MaxLength("credential_canonical", "body", *m.CredentialCanonical, 100); err != nil { - return err - } - - if err := validate.Pattern("credential_canonical", "body", *m.CredentialCanonical, `^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$`); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this infra import resources body based on the context it is used -func (m *InfraImportResourcesBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateConfiguration(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *InfraImportResourcesBody) contextValidateConfiguration(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Configuration().ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("configuration") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("configuration") - } - - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *InfraImportResourcesBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *InfraImportResourcesBody) UnmarshalBinary(b []byte) error { - var res InfraImportResourcesBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/client/models/infra_policies_validation_result.go b/client/models/infra_policies_validation_result.go index 81067103..f000185e 100644 --- a/client/models/infra_policies_validation_result.go +++ b/client/models/infra_policies_validation_result.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" ) // InfraPoliciesValidationResult Infra policies validation results. @@ -52,12 +53,12 @@ func (m *InfraPoliciesValidationResult) Validate(formats strfmt.Registry) error } func (m *InfraPoliciesValidationResult) validateAdvisories(formats strfmt.Registry) error { - if swag.IsZero(m.Advisories) { // not required + if typeutils.IsZero(m.Advisories) { // not required return nil } for i := 0; i < len(m.Advisories); i++ { - if swag.IsZero(m.Advisories[i]) { // not required + if typeutils.IsZero(m.Advisories[i]) { // not required continue } @@ -82,12 +83,12 @@ func (m *InfraPoliciesValidationResult) validateAdvisories(formats strfmt.Regist } func (m *InfraPoliciesValidationResult) validateCriticals(formats strfmt.Registry) error { - if swag.IsZero(m.Criticals) { // not required + if typeutils.IsZero(m.Criticals) { // not required return nil } for i := 0; i < len(m.Criticals); i++ { - if swag.IsZero(m.Criticals[i]) { // not required + if typeutils.IsZero(m.Criticals[i]) { // not required continue } @@ -112,12 +113,12 @@ func (m *InfraPoliciesValidationResult) validateCriticals(formats strfmt.Registr } func (m *InfraPoliciesValidationResult) validateWarnings(formats strfmt.Registry) error { - if swag.IsZero(m.Warnings) { // not required + if typeutils.IsZero(m.Warnings) { // not required return nil } for i := 0; i < len(m.Warnings); i++ { - if swag.IsZero(m.Warnings[i]) { // not required + if typeutils.IsZero(m.Warnings[i]) { // not required continue } @@ -169,7 +170,7 @@ func (m *InfraPoliciesValidationResult) contextValidateAdvisories(ctx context.Co if m.Advisories[i] != nil { - if swag.IsZero(m.Advisories[i]) { // not required + if typeutils.IsZero(m.Advisories[i]) { // not required return nil } @@ -198,7 +199,7 @@ func (m *InfraPoliciesValidationResult) contextValidateCriticals(ctx context.Con if m.Criticals[i] != nil { - if swag.IsZero(m.Criticals[i]) { // not required + if typeutils.IsZero(m.Criticals[i]) { // not required return nil } @@ -227,7 +228,7 @@ func (m *InfraPoliciesValidationResult) contextValidateWarnings(ctx context.Cont if m.Warnings[i] != nil { - if swag.IsZero(m.Warnings[i]) { // not required + if typeutils.IsZero(m.Warnings[i]) { // not required return nil } @@ -255,13 +256,13 @@ func (m *InfraPoliciesValidationResult) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *InfraPoliciesValidationResult) UnmarshalBinary(b []byte) error { var res InfraPoliciesValidationResult - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/infra_policies_validation_result_item.go b/client/models/infra_policies_validation_result_item.go index 6d131203..979337a0 100644 --- a/client/models/infra_policies_validation_result_item.go +++ b/client/models/infra_policies_validation_result_item.go @@ -8,7 +8,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -106,13 +106,13 @@ func (m *InfraPoliciesValidationResultItem) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *InfraPoliciesValidationResultItem) UnmarshalBinary(b []byte) error { var res InfraPoliciesValidationResultItem - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/infra_policy.go b/client/models/infra_policy.go index 31c70ad2..91c3e1d3 100644 --- a/client/models/infra_policy.go +++ b/client/models/infra_policy.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -208,7 +209,7 @@ func (m *InfraPolicy) validateName(formats strfmt.Registry) error { } func (m *InfraPolicy) validateOwner(formats strfmt.Registry) error { - if swag.IsZero(m.Owner) { // not required + if typeutils.IsZero(m.Owner) { // not required return nil } @@ -303,7 +304,7 @@ func (m *InfraPolicy) contextValidateOwner(ctx context.Context, formats strfmt.R if m.Owner != nil { - if swag.IsZero(m.Owner) { // not required + if typeutils.IsZero(m.Owner) { // not required return nil } @@ -329,13 +330,13 @@ func (m *InfraPolicy) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *InfraPolicy) UnmarshalBinary(b []byte) error { var res InfraPolicy - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/infrastructure.go b/client/models/infrastructure.go index cfb3ec99..b409c819 100644 --- a/client/models/infrastructure.go +++ b/client/models/infrastructure.go @@ -8,7 +8,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -119,13 +119,13 @@ func (m *Infrastructure) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *Infrastructure) UnmarshalBinary(b []byte) error { var res Infrastructure - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/infrastructure_graph.go b/client/models/infrastructure_graph.go index 64f99578..826f1e3b 100644 --- a/client/models/infrastructure_graph.go +++ b/client/models/infrastructure_graph.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -54,7 +55,7 @@ func (m *InfrastructureGraph) validateEdges(formats strfmt.Registry) error { } for i := 0; i < len(m.Edges); i++ { - if swag.IsZero(m.Edges[i]) { // not required + if typeutils.IsZero(m.Edges[i]) { // not required continue } @@ -85,7 +86,7 @@ func (m *InfrastructureGraph) validateNodes(formats strfmt.Registry) error { } for i := 0; i < len(m.Nodes); i++ { - if swag.IsZero(m.Nodes[i]) { // not required + if typeutils.IsZero(m.Nodes[i]) { // not required continue } @@ -133,7 +134,7 @@ func (m *InfrastructureGraph) contextValidateEdges(ctx context.Context, formats if m.Edges[i] != nil { - if swag.IsZero(m.Edges[i]) { // not required + if typeutils.IsZero(m.Edges[i]) { // not required return nil } @@ -162,7 +163,7 @@ func (m *InfrastructureGraph) contextValidateNodes(ctx context.Context, formats if m.Nodes[i] != nil { - if swag.IsZero(m.Nodes[i]) { // not required + if typeutils.IsZero(m.Nodes[i]) { // not required return nil } @@ -190,13 +191,13 @@ func (m *InfrastructureGraph) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *InfrastructureGraph) UnmarshalBinary(b []byte) error { var res InfrastructureGraph - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/infrastructure_graph_edge.go b/client/models/infrastructure_graph_edge.go index 0d2685ef..eb83b91d 100644 --- a/client/models/infrastructure_graph_edge.go +++ b/client/models/infrastructure_graph_edge.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -107,13 +107,13 @@ func (m *InfrastructureGraphEdge) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *InfrastructureGraphEdge) UnmarshalBinary(b []byte) error { var res InfrastructureGraphEdge - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/infrastructure_graph_node.go b/client/models/infrastructure_graph_node.go index 9752a03f..f1594cb0 100644 --- a/client/models/infrastructure_graph_node.go +++ b/client/models/infrastructure_graph_node.go @@ -8,7 +8,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -156,13 +156,13 @@ func (m *InfrastructureGraphNode) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *InfrastructureGraphNode) UnmarshalBinary(b []byte) error { var res InfrastructureGraphNode - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/infrastructure_resources_aggregation_item.go b/client/models/infrastructure_resources_aggregation_item.go index c1261027..b567fddd 100644 --- a/client/models/infrastructure_resources_aggregation_item.go +++ b/client/models/infrastructure_resources_aggregation_item.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -56,13 +56,13 @@ func (m *InfrastructureResourcesAggregationItem) MarshalBinary() ([]byte, error) if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *InfrastructureResourcesAggregationItem) UnmarshalBinary(b []byte) error { var res InfrastructureResourcesAggregationItem - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/inventory_output.go b/client/models/inventory_output.go index f67311f2..aa6ed6c7 100644 --- a/client/models/inventory_output.go +++ b/client/models/inventory_output.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -93,13 +93,13 @@ func (m *InventoryOutput) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *InventoryOutput) UnmarshalBinary(b []byte) error { var res InventoryOutput - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/inventory_resource.go b/client/models/inventory_resource.go index 919b94d8..c470a741 100644 --- a/client/models/inventory_resource.go +++ b/client/models/inventory_resource.go @@ -8,7 +8,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -143,7 +144,7 @@ func (m *InventoryResource) Validate(formats strfmt.Registry) error { } func (m *InventoryResource) validateComponent(formats strfmt.Registry) error { - if swag.IsZero(m.Component) { // not required + if typeutils.IsZero(m.Component) { // not required return nil } @@ -166,7 +167,7 @@ func (m *InventoryResource) validateComponent(formats strfmt.Registry) error { } func (m *InventoryResource) validateCPU(formats strfmt.Registry) error { - if swag.IsZero(m.CPU) { // not required + if typeutils.IsZero(m.CPU) { // not required return nil } @@ -178,7 +179,7 @@ func (m *InventoryResource) validateCPU(formats strfmt.Registry) error { } func (m *InventoryResource) validateEnvironment(formats strfmt.Registry) error { - if swag.IsZero(m.Environment) { // not required + if typeutils.IsZero(m.Environment) { // not required return nil } @@ -201,7 +202,7 @@ func (m *InventoryResource) validateEnvironment(formats strfmt.Registry) error { } func (m *InventoryResource) validateID(formats strfmt.Registry) error { - if swag.IsZero(m.ID) { // not required + if typeutils.IsZero(m.ID) { // not required return nil } @@ -213,7 +214,7 @@ func (m *InventoryResource) validateID(formats strfmt.Registry) error { } func (m *InventoryResource) validateImage(formats strfmt.Registry) error { - if swag.IsZero(m.Image) { // not required + if typeutils.IsZero(m.Image) { // not required return nil } @@ -225,7 +226,7 @@ func (m *InventoryResource) validateImage(formats strfmt.Registry) error { } func (m *InventoryResource) validateMemory(formats strfmt.Registry) error { - if swag.IsZero(m.Memory) { // not required + if typeutils.IsZero(m.Memory) { // not required return nil } @@ -246,7 +247,7 @@ func (m *InventoryResource) validateName(formats strfmt.Registry) error { } func (m *InventoryResource) validateProject(formats strfmt.Registry) error { - if swag.IsZero(m.Project) { // not required + if typeutils.IsZero(m.Project) { // not required return nil } @@ -278,7 +279,7 @@ func (m *InventoryResource) validateProvider(formats strfmt.Registry) error { } func (m *InventoryResource) validateStorage(formats strfmt.Registry) error { - if swag.IsZero(m.Storage) { // not required + if typeutils.IsZero(m.Storage) { // not required return nil } @@ -324,7 +325,7 @@ func (m *InventoryResource) contextValidateComponent(ctx context.Context, format if m.Component != nil { - if swag.IsZero(m.Component) { // not required + if typeutils.IsZero(m.Component) { // not required return nil } @@ -349,7 +350,7 @@ func (m *InventoryResource) contextValidateEnvironment(ctx context.Context, form if m.Environment != nil { - if swag.IsZero(m.Environment) { // not required + if typeutils.IsZero(m.Environment) { // not required return nil } @@ -374,7 +375,7 @@ func (m *InventoryResource) contextValidateProject(ctx context.Context, formats if m.Project != nil { - if swag.IsZero(m.Project) { // not required + if typeutils.IsZero(m.Project) { // not required return nil } @@ -400,13 +401,13 @@ func (m *InventoryResource) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *InventoryResource) UnmarshalBinary(b []byte) error { var res InventoryResource - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/inventory_resource_label.go b/client/models/inventory_resource_label.go index dc14b640..60dd80f2 100644 --- a/client/models/inventory_resource_label.go +++ b/client/models/inventory_resource_label.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -122,13 +122,13 @@ func (m *InventoryResourceLabel) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *InventoryResourceLabel) UnmarshalBinary(b []byte) error { var res InventoryResourceLabel - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/job.go b/client/models/job.go index 75af63d3..da53e2f4 100644 --- a/client/models/job.go +++ b/client/models/job.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -107,7 +108,7 @@ func (m *Job) Validate(formats strfmt.Registry) error { } func (m *Job) validateFinishedBuild(formats strfmt.Registry) error { - if swag.IsZero(m.FinishedBuild) { // not required + if typeutils.IsZero(m.FinishedBuild) { // not required return nil } @@ -139,12 +140,12 @@ func (m *Job) validateID(formats strfmt.Registry) error { } func (m *Job) validateInputs(formats strfmt.Registry) error { - if swag.IsZero(m.Inputs) { // not required + if typeutils.IsZero(m.Inputs) { // not required return nil } for i := 0; i < len(m.Inputs); i++ { - if swag.IsZero(m.Inputs[i]) { // not required + if typeutils.IsZero(m.Inputs[i]) { // not required continue } @@ -178,7 +179,7 @@ func (m *Job) validateName(formats strfmt.Registry) error { } func (m *Job) validateNextBuild(formats strfmt.Registry) error { - if swag.IsZero(m.NextBuild) { // not required + if typeutils.IsZero(m.NextBuild) { // not required return nil } @@ -201,12 +202,12 @@ func (m *Job) validateNextBuild(formats strfmt.Registry) error { } func (m *Job) validateOutputs(formats strfmt.Registry) error { - if swag.IsZero(m.Outputs) { // not required + if typeutils.IsZero(m.Outputs) { // not required return nil } for i := 0; i < len(m.Outputs); i++ { - if swag.IsZero(m.Outputs[i]) { // not required + if typeutils.IsZero(m.Outputs[i]) { // not required continue } @@ -231,7 +232,7 @@ func (m *Job) validateOutputs(formats strfmt.Registry) error { } func (m *Job) validateTransitionBuild(formats strfmt.Registry) error { - if swag.IsZero(m.TransitionBuild) { // not required + if typeutils.IsZero(m.TransitionBuild) { // not required return nil } @@ -287,7 +288,7 @@ func (m *Job) contextValidateFinishedBuild(ctx context.Context, formats strfmt.R if m.FinishedBuild != nil { - if swag.IsZero(m.FinishedBuild) { // not required + if typeutils.IsZero(m.FinishedBuild) { // not required return nil } @@ -314,7 +315,7 @@ func (m *Job) contextValidateInputs(ctx context.Context, formats strfmt.Registry if m.Inputs[i] != nil { - if swag.IsZero(m.Inputs[i]) { // not required + if typeutils.IsZero(m.Inputs[i]) { // not required return nil } @@ -341,7 +342,7 @@ func (m *Job) contextValidateNextBuild(ctx context.Context, formats strfmt.Regis if m.NextBuild != nil { - if swag.IsZero(m.NextBuild) { // not required + if typeutils.IsZero(m.NextBuild) { // not required return nil } @@ -368,7 +369,7 @@ func (m *Job) contextValidateOutputs(ctx context.Context, formats strfmt.Registr if m.Outputs[i] != nil { - if swag.IsZero(m.Outputs[i]) { // not required + if typeutils.IsZero(m.Outputs[i]) { // not required return nil } @@ -395,7 +396,7 @@ func (m *Job) contextValidateTransitionBuild(ctx context.Context, formats strfmt if m.TransitionBuild != nil { - if swag.IsZero(m.TransitionBuild) { // not required + if typeutils.IsZero(m.TransitionBuild) { // not required return nil } @@ -421,13 +422,13 @@ func (m *Job) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *Job) UnmarshalBinary(b []byte) error { var res Job - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/job_input.go b/client/models/job_input.go index 110503b9..52f129ee 100644 --- a/client/models/job_input.go +++ b/client/models/job_input.go @@ -8,7 +8,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -92,7 +93,7 @@ func (m *JobInput) validateTrigger(formats strfmt.Registry) error { } func (m *JobInput) validateVersion(formats strfmt.Registry) error { - if swag.IsZero(m.Version) { // not required + if typeutils.IsZero(m.Version) { // not required return nil } @@ -132,7 +133,7 @@ func (m *JobInput) contextValidateVersion(ctx context.Context, formats strfmt.Re if m.Version != nil { - if swag.IsZero(m.Version) { // not required + if typeutils.IsZero(m.Version) { // not required return nil } @@ -158,13 +159,13 @@ func (m *JobInput) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *JobInput) UnmarshalBinary(b []byte) error { var res JobInput - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/job_output.go b/client/models/job_output.go index ed9254f6..3152883b 100644 --- a/client/models/job_output.go +++ b/client/models/job_output.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -73,13 +73,13 @@ func (m *JobOutput) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *JobOutput) UnmarshalBinary(b []byte) error { var res JobOutput - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/k_p_i.go b/client/models/k_p_i.go index 0a13ddf3..d7ec6c38 100644 --- a/client/models/k_p_i.go +++ b/client/models/k_p_i.go @@ -9,7 +9,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -421,13 +421,13 @@ func (m *KPI) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *KPI) UnmarshalBinary(b []byte) error { var res KPI - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/licence.go b/client/models/licence.go index 3491e213..f26c996c 100644 --- a/client/models/licence.go +++ b/client/models/licence.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -234,13 +234,13 @@ func (m *Licence) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *Licence) UnmarshalBinary(b []byte) error { var res Licence - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/log_source.go b/client/models/log_source.go index 38d86be1..603757de 100644 --- a/client/models/log_source.go +++ b/client/models/log_source.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -61,13 +61,13 @@ func (m *LogSource) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *LogSource) UnmarshalBinary(b []byte) error { var res LogSource - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/log_source_entry.go b/client/models/log_source_entry.go index daae9c64..7446080b 100644 --- a/client/models/log_source_entry.go +++ b/client/models/log_source_entry.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -100,13 +100,13 @@ func (m *LogSourceEntry) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *LogSourceEntry) UnmarshalBinary(b []byte) error { var res LogSourceEntry - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/member_assignation.go b/client/models/member_assignation.go index 9761cbee..ff6bf830 100644 --- a/client/models/member_assignation.go +++ b/client/models/member_assignation.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -71,13 +71,13 @@ func (m *MemberAssignation) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *MemberAssignation) UnmarshalBinary(b []byte) error { var res MemberAssignation - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/member_org.go b/client/models/member_org.go index b3e7f412..3ed0d533 100644 --- a/client/models/member_org.go +++ b/client/models/member_org.go @@ -10,7 +10,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -174,7 +175,7 @@ func (m *MemberOrg) validateCreatedAt(formats strfmt.Registry) error { } func (m *MemberOrg) validateEmail(formats strfmt.Registry) error { - if swag.IsZero(m.Email) { // not required + if typeutils.IsZero(m.Email) { // not required return nil } @@ -199,7 +200,7 @@ func (m *MemberOrg) validateID(formats strfmt.Registry) error { } func (m *MemberOrg) validateInvitationEmail(formats strfmt.Registry) error { - if swag.IsZero(m.InvitationEmail) { // not required + if typeutils.IsZero(m.InvitationEmail) { // not required return nil } @@ -211,7 +212,7 @@ func (m *MemberOrg) validateInvitationEmail(formats strfmt.Registry) error { } func (m *MemberOrg) validateInvitationResentAt(formats strfmt.Registry) error { - if swag.IsZero(m.InvitationResentAt) { // not required + if typeutils.IsZero(m.InvitationResentAt) { // not required return nil } @@ -255,7 +256,7 @@ func (m *MemberOrg) validateInvitationStateEnum(path, location string, value str } func (m *MemberOrg) validateInvitationState(formats strfmt.Registry) error { - if swag.IsZero(m.InvitationState) { // not required + if typeutils.IsZero(m.InvitationState) { // not required return nil } @@ -268,7 +269,7 @@ func (m *MemberOrg) validateInvitationState(formats strfmt.Registry) error { } func (m *MemberOrg) validateInvitedAt(formats strfmt.Registry) error { - if swag.IsZero(m.InvitedAt) { // not required + if typeutils.IsZero(m.InvitedAt) { // not required return nil } @@ -280,7 +281,7 @@ func (m *MemberOrg) validateInvitedAt(formats strfmt.Registry) error { } func (m *MemberOrg) validateInvitedBy(formats strfmt.Registry) error { - if swag.IsZero(m.InvitedBy) { // not required + if typeutils.IsZero(m.InvitedBy) { // not required return nil } @@ -303,7 +304,7 @@ func (m *MemberOrg) validateInvitedBy(formats strfmt.Registry) error { } func (m *MemberOrg) validateLastLoginAt(formats strfmt.Registry) error { - if swag.IsZero(m.LastLoginAt) { // not required + if typeutils.IsZero(m.LastLoginAt) { // not required return nil } @@ -347,7 +348,7 @@ func (m *MemberOrg) validateLocaleEnum(path, location string, value string) erro } func (m *MemberOrg) validateLocale(formats strfmt.Registry) error { - if swag.IsZero(m.Locale) { // not required + if typeutils.IsZero(m.Locale) { // not required return nil } @@ -360,7 +361,7 @@ func (m *MemberOrg) validateLocale(formats strfmt.Registry) error { } func (m *MemberOrg) validatePictureURL(formats strfmt.Registry) error { - if swag.IsZero(m.PictureURL) { // not required + if typeutils.IsZero(m.PictureURL) { // not required return nil } @@ -396,12 +397,12 @@ func (m *MemberOrg) validateRole(formats strfmt.Registry) error { } func (m *MemberOrg) validateTeams(formats strfmt.Registry) error { - if swag.IsZero(m.Teams) { // not required + if typeutils.IsZero(m.Teams) { // not required return nil } for i := 0; i < len(m.Teams); i++ { - if swag.IsZero(m.Teams[i]) { // not required + if typeutils.IsZero(m.Teams[i]) { // not required continue } @@ -426,7 +427,7 @@ func (m *MemberOrg) validateTeams(formats strfmt.Registry) error { } func (m *MemberOrg) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required + if typeutils.IsZero(m.UpdatedAt) { // not required return nil } @@ -438,7 +439,7 @@ func (m *MemberOrg) validateUpdatedAt(formats strfmt.Registry) error { } func (m *MemberOrg) validateUsername(formats strfmt.Registry) error { - if swag.IsZero(m.Username) { // not required + if typeutils.IsZero(m.Username) { // not required return nil } @@ -483,7 +484,7 @@ func (m *MemberOrg) contextValidateInvitedBy(ctx context.Context, formats strfmt if m.InvitedBy != nil { - if swag.IsZero(m.InvitedBy) { // not required + if typeutils.IsZero(m.InvitedBy) { // not required return nil } @@ -531,7 +532,7 @@ func (m *MemberOrg) contextValidateTeams(ctx context.Context, formats strfmt.Reg if m.Teams[i] != nil { - if swag.IsZero(m.Teams[i]) { // not required + if typeutils.IsZero(m.Teams[i]) { // not required return nil } @@ -559,13 +560,13 @@ func (m *MemberOrg) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *MemberOrg) UnmarshalBinary(b []byte) error { var res MemberOrg - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/member_team.go b/client/models/member_team.go index 9c9936aa..71274b6c 100644 --- a/client/models/member_team.go +++ b/client/models/member_team.go @@ -8,7 +8,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -142,7 +143,7 @@ func (m *MemberTeam) validateEmail(formats strfmt.Registry) error { } func (m *MemberTeam) validateFullName(formats strfmt.Registry) error { - if swag.IsZero(m.FullName) { // not required + if typeutils.IsZero(m.FullName) { // not required return nil } @@ -171,7 +172,7 @@ func (m *MemberTeam) validateID(formats strfmt.Registry) error { } func (m *MemberTeam) validateInvitedBy(formats strfmt.Registry) error { - if swag.IsZero(m.InvitedBy) { // not required + if typeutils.IsZero(m.InvitedBy) { // not required return nil } @@ -194,7 +195,7 @@ func (m *MemberTeam) validateInvitedBy(formats strfmt.Registry) error { } func (m *MemberTeam) validateLastLoginAt(formats strfmt.Registry) error { - if swag.IsZero(m.LastLoginAt) { // not required + if typeutils.IsZero(m.LastLoginAt) { // not required return nil } @@ -215,7 +216,7 @@ func (m *MemberTeam) validateMfaEnabled(formats strfmt.Registry) error { } func (m *MemberTeam) validatePictureURL(formats strfmt.Registry) error { - if swag.IsZero(m.PictureURL) { // not required + if typeutils.IsZero(m.PictureURL) { // not required return nil } @@ -227,7 +228,7 @@ func (m *MemberTeam) validatePictureURL(formats strfmt.Registry) error { } func (m *MemberTeam) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required + if typeutils.IsZero(m.UpdatedAt) { // not required return nil } @@ -239,7 +240,7 @@ func (m *MemberTeam) validateUpdatedAt(formats strfmt.Registry) error { } func (m *MemberTeam) validateUsername(formats strfmt.Registry) error { - if swag.IsZero(m.Username) { // not required + if typeutils.IsZero(m.Username) { // not required return nil } @@ -276,7 +277,7 @@ func (m *MemberTeam) contextValidateInvitedBy(ctx context.Context, formats strfm if m.InvitedBy != nil { - if swag.IsZero(m.InvitedBy) { // not required + if typeutils.IsZero(m.InvitedBy) { // not required return nil } @@ -302,13 +303,13 @@ func (m *MemberTeam) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *MemberTeam) UnmarshalBinary(b []byte) error { var res MemberTeam - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/metadata_field.go b/client/models/metadata_field.go index 2997dab6..b12ea1eb 100644 --- a/client/models/metadata_field.go +++ b/client/models/metadata_field.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -73,13 +73,13 @@ func (m *MetadataField) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *MetadataField) UnmarshalBinary(b []byte) error { var res MetadataField - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/migrate_component.go b/client/models/migrate_component.go index a033e6ed..072c5ecb 100644 --- a/client/models/migrate_component.go +++ b/client/models/migrate_component.go @@ -7,7 +7,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -63,7 +64,7 @@ func (m *MigrateComponent) Validate(formats strfmt.Registry) error { } func (m *MigrateComponent) validateDestinationComponentCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationComponentCanonical) { // not required + if typeutils.IsZero(m.DestinationComponentCanonical) { // not required return nil } @@ -83,7 +84,7 @@ func (m *MigrateComponent) validateDestinationComponentCanonical(formats strfmt. } func (m *MigrateComponent) validateDestinationEnvironmentCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationEnvironmentCanonical) { // not required + if typeutils.IsZero(m.DestinationEnvironmentCanonical) { // not required return nil } @@ -103,7 +104,7 @@ func (m *MigrateComponent) validateDestinationEnvironmentCanonical(formats strfm } func (m *MigrateComponent) validateDestinationProjectCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationProjectCanonical) { // not required + if typeutils.IsZero(m.DestinationProjectCanonical) { // not required return nil } @@ -132,13 +133,13 @@ func (m *MigrateComponent) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *MigrateComponent) UnmarshalBinary(b []byte) error { var res MigrateComponent - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/new_a_w_s_marketplace_user_account.go b/client/models/new_a_w_s_marketplace_user_account.go index d5d688f6..512f82b2 100644 --- a/client/models/new_a_w_s_marketplace_user_account.go +++ b/client/models/new_a_w_s_marketplace_user_account.go @@ -8,7 +8,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -108,7 +109,7 @@ func (m *NewAWSMarketplaceUserAccount) validateAwsMarketplaceToken(formats strfm } func (m *NewAWSMarketplaceUserAccount) validateCountryCode(formats strfmt.Registry) error { - if swag.IsZero(m.CountryCode) { // not required + if typeutils.IsZero(m.CountryCode) { // not required return nil } @@ -182,7 +183,7 @@ func (m *NewAWSMarketplaceUserAccount) validateLocaleEnum(path, location string, } func (m *NewAWSMarketplaceUserAccount) validateLocale(formats strfmt.Registry) error { - if swag.IsZero(m.Locale) { // not required + if typeutils.IsZero(m.Locale) { // not required return nil } @@ -212,7 +213,7 @@ func (m *NewAWSMarketplaceUserAccount) validatePassword(formats strfmt.Registry) } func (m *NewAWSMarketplaceUserAccount) validateUsername(formats strfmt.Registry) error { - if swag.IsZero(m.Username) { // not required + if typeutils.IsZero(m.Username) { // not required return nil } @@ -241,13 +242,13 @@ func (m *NewAWSMarketplaceUserAccount) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *NewAWSMarketplaceUserAccount) UnmarshalBinary(b []byte) error { var res NewAWSMarketplaceUserAccount - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/new_and_configured_component.go b/client/models/new_and_configured_component.go index f4501844..f203b1d3 100644 --- a/client/models/new_and_configured_component.go +++ b/client/models/new_and_configured_component.go @@ -8,7 +8,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -91,7 +92,7 @@ func (m *NewAndConfiguredComponent) Validate(formats strfmt.Registry) error { } func (m *NewAndConfiguredComponent) validateCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.Canonical) { // not required + if typeutils.IsZero(m.Canonical) { // not required return nil } @@ -111,7 +112,7 @@ func (m *NewAndConfiguredComponent) validateCanonical(formats strfmt.Registry) e } func (m *NewAndConfiguredComponent) validateCloudProviderCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.CloudProviderCanonical) { // not required + if typeutils.IsZero(m.CloudProviderCanonical) { // not required return nil } @@ -144,7 +145,7 @@ func (m *NewAndConfiguredComponent) validateName(formats strfmt.Registry) error } func (m *NewAndConfiguredComponent) validateServiceCatalogSourceVersionID(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceCatalogSourceVersionID) { // not required + if typeutils.IsZero(m.ServiceCatalogSourceVersionID) { // not required return nil } @@ -156,7 +157,7 @@ func (m *NewAndConfiguredComponent) validateServiceCatalogSourceVersionID(format } func (m *NewAndConfiguredComponent) validateUseCase(formats strfmt.Registry) error { - if swag.IsZero(m.UseCase) { // not required + if typeutils.IsZero(m.UseCase) { // not required return nil } @@ -176,7 +177,7 @@ func (m *NewAndConfiguredComponent) validateUseCase(formats strfmt.Registry) err } func (m *NewAndConfiguredComponent) validateVars(formats strfmt.Registry) error { - if swag.IsZero(m.Vars) { // not required + if typeutils.IsZero(m.Vars) { // not required return nil } @@ -214,7 +215,7 @@ func (m *NewAndConfiguredComponent) ContextValidate(ctx context.Context, formats func (m *NewAndConfiguredComponent) contextValidateVars(ctx context.Context, formats strfmt.Registry) error { - if swag.IsZero(m.Vars) { // not required + if typeutils.IsZero(m.Vars) { // not required return nil } @@ -239,13 +240,13 @@ func (m *NewAndConfiguredComponent) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *NewAndConfiguredComponent) UnmarshalBinary(b []byte) error { var res NewAndConfiguredComponent - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/new_api_key.go b/client/models/new_api_key.go index 88eb2d6d..7d118c0e 100644 --- a/client/models/new_api_key.go +++ b/client/models/new_api_key.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -68,7 +69,7 @@ func (m *NewAPIKey) Validate(formats strfmt.Registry) error { } func (m *NewAPIKey) validateCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.Canonical) { // not required + if typeutils.IsZero(m.Canonical) { // not required return nil } @@ -107,7 +108,7 @@ func (m *NewAPIKey) validateRules(formats strfmt.Registry) error { } for i := 0; i < len(m.Rules); i++ { - if swag.IsZero(m.Rules[i]) { // not required + if typeutils.IsZero(m.Rules[i]) { // not required continue } @@ -151,7 +152,7 @@ func (m *NewAPIKey) contextValidateRules(ctx context.Context, formats strfmt.Reg if m.Rules[i] != nil { - if swag.IsZero(m.Rules[i]) { // not required + if typeutils.IsZero(m.Rules[i]) { // not required return nil } @@ -179,13 +180,13 @@ func (m *NewAPIKey) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *NewAPIKey) UnmarshalBinary(b []byte) error { var res NewAPIKey - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/new_appearance.go b/client/models/new_appearance.go index f1da8bec..979e4bdc 100644 --- a/client/models/new_appearance.go +++ b/client/models/new_appearance.go @@ -8,7 +8,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -254,13 +254,13 @@ func (m *NewAppearance) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *NewAppearance) UnmarshalBinary(b []byte) error { var res NewAppearance - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res @@ -374,13 +374,13 @@ func (m *NewAppearanceColor) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *NewAppearanceColor) UnmarshalBinary(b []byte) error { var res NewAppearanceColor - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/new_cloud_account.go b/client/models/new_cloud_account.go index 49607952..28621194 100644 --- a/client/models/new_cloud_account.go +++ b/client/models/new_cloud_account.go @@ -7,7 +7,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -79,7 +80,7 @@ func (m *NewCloudAccount) Validate(formats strfmt.Registry) error { } func (m *NewCloudAccount) validateCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.Canonical) { // not required + if typeutils.IsZero(m.Canonical) { // not required return nil } @@ -163,13 +164,13 @@ func (m *NewCloudAccount) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *NewCloudAccount) UnmarshalBinary(b []byte) error { var res NewCloudAccount - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/new_cloud_account_credential.go b/client/models/new_cloud_account_credential.go index 262b57e7..e168d662 100644 --- a/client/models/new_cloud_account_credential.go +++ b/client/models/new_cloud_account_credential.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -78,7 +79,7 @@ func (m *NewCloudAccountCredential) Validate(formats strfmt.Registry) error { } func (m *NewCloudAccountCredential) validateCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.Canonical) { // not required + if typeutils.IsZero(m.Canonical) { // not required return nil } @@ -107,7 +108,7 @@ func (m *NewCloudAccountCredential) validateName(formats strfmt.Registry) error } func (m *NewCloudAccountCredential) validatePath(formats strfmt.Registry) error { - if swag.IsZero(m.Path) { // not required + if typeutils.IsZero(m.Path) { // not required return nil } @@ -249,13 +250,13 @@ func (m *NewCloudAccountCredential) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *NewCloudAccountCredential) UnmarshalBinary(b []byte) error { var res NewCloudAccountCredential - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/new_cloud_account_with_credentials.go b/client/models/new_cloud_account_with_credentials.go index fb89a001..a2bc047d 100644 --- a/client/models/new_cloud_account_with_credentials.go +++ b/client/models/new_cloud_account_with_credentials.go @@ -8,7 +8,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -119,7 +120,7 @@ func (m *NewCloudAccountWithCredentials) validateAccessCredential(formats strfmt } func (m *NewCloudAccountWithCredentials) validateCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.Canonical) { // not required + if typeutils.IsZero(m.Canonical) { // not required return nil } @@ -160,7 +161,7 @@ func (m *NewCloudAccountWithCredentials) validateCloudProvider(formats strfmt.Re } func (m *NewCloudAccountWithCredentials) validateFinopsConfig(formats strfmt.Registry) error { - if swag.IsZero(m.FinopsConfig) { // not required + if typeutils.IsZero(m.FinopsConfig) { // not required return nil } @@ -183,7 +184,7 @@ func (m *NewCloudAccountWithCredentials) validateFinopsConfig(formats strfmt.Reg } func (m *NewCloudAccountWithCredentials) validateFinopsCredential(formats strfmt.Registry) error { - if swag.IsZero(m.FinopsCredential) { // not required + if typeutils.IsZero(m.FinopsCredential) { // not required return nil } @@ -269,7 +270,7 @@ func (m *NewCloudAccountWithCredentials) contextValidateFinopsConfig(ctx context if m.FinopsConfig != nil { - if swag.IsZero(m.FinopsConfig) { // not required + if typeutils.IsZero(m.FinopsConfig) { // not required return nil } @@ -294,7 +295,7 @@ func (m *NewCloudAccountWithCredentials) contextValidateFinopsCredential(ctx con if m.FinopsCredential != nil { - if swag.IsZero(m.FinopsCredential) { // not required + if typeutils.IsZero(m.FinopsCredential) { // not required return nil } @@ -320,13 +321,13 @@ func (m *NewCloudAccountWithCredentials) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *NewCloudAccountWithCredentials) UnmarshalBinary(b []byte) error { var res NewCloudAccountWithCredentials - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/new_cloud_cost_management_account.go b/client/models/new_cloud_cost_management_account.go index 51c48b9c..102f4eef 100644 --- a/client/models/new_cloud_cost_management_account.go +++ b/client/models/new_cloud_cost_management_account.go @@ -8,7 +8,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -53,7 +54,7 @@ func (m *NewCloudCostManagementAccount) Validate(formats strfmt.Registry) error } func (m *NewCloudCostManagementAccount) validateCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.Canonical) { // not required + if typeutils.IsZero(m.Canonical) { // not required return nil } @@ -136,13 +137,13 @@ func (m *NewCloudCostManagementAccount) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *NewCloudCostManagementAccount) UnmarshalBinary(b []byte) error { var res NewCloudCostManagementAccount - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/new_component.go b/client/models/new_component.go index dbc8bbde..61689dbf 100644 --- a/client/models/new_component.go +++ b/client/models/new_component.go @@ -7,7 +7,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -78,7 +79,7 @@ func (m *NewComponent) Validate(formats strfmt.Registry) error { } func (m *NewComponent) validateCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.Canonical) { // not required + if typeutils.IsZero(m.Canonical) { // not required return nil } @@ -98,7 +99,7 @@ func (m *NewComponent) validateCanonical(formats strfmt.Registry) error { } func (m *NewComponent) validateCloudProviderCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.CloudProviderCanonical) { // not required + if typeutils.IsZero(m.CloudProviderCanonical) { // not required return nil } @@ -140,7 +141,7 @@ func (m *NewComponent) validateServiceCatalogRef(formats strfmt.Registry) error } func (m *NewComponent) validateServiceCatalogSourceVersionID(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceCatalogSourceVersionID) { // not required + if typeutils.IsZero(m.ServiceCatalogSourceVersionID) { // not required return nil } @@ -161,13 +162,13 @@ func (m *NewComponent) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *NewComponent) UnmarshalBinary(b []byte) error { var res NewComponent - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/new_config_repository.go b/client/models/new_config_repository.go index d1fc319c..8f0cf353 100644 --- a/client/models/new_config_repository.go +++ b/client/models/new_config_repository.go @@ -7,7 +7,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -91,7 +92,7 @@ func (m *NewConfigRepository) validateBranch(formats strfmt.Registry) error { } func (m *NewConfigRepository) validateCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.Canonical) { // not required + if typeutils.IsZero(m.Canonical) { // not required return nil } @@ -172,13 +173,13 @@ func (m *NewConfigRepository) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *NewConfigRepository) UnmarshalBinary(b []byte) error { var res NewConfigRepository - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/new_credential.go b/client/models/new_credential.go index 3b050763..ada80c5d 100644 --- a/client/models/new_credential.go +++ b/client/models/new_credential.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -85,7 +86,7 @@ func (m *NewCredential) Validate(formats strfmt.Registry) error { } func (m *NewCredential) validateCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.Canonical) { // not required + if typeutils.IsZero(m.Canonical) { // not required return nil } @@ -257,13 +258,13 @@ func (m *NewCredential) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *NewCredential) UnmarshalBinary(b []byte) error { var res NewCredential - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/new_environment.go b/client/models/new_environment.go index 0064b2b1..69342111 100644 --- a/client/models/new_environment.go +++ b/client/models/new_environment.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -45,10 +46,14 @@ type NewEnvironment struct { // Owner string `json:"owner,omitempty"` - // type + // Canonical of the environment type. When omitted, it is auto-detected + // from the environment canonical by matching the keywords + // `production`/`prod`/`prd`/`live`, `pre-prod`/`preprod`/`staging`/`stage`/`stg`/`uat`, + // `development`/`dev`/`test`/`qa`/`sandbox`, or `preview`/`prev`. + // When no keyword is recognised, it defaults to `production`. + // // Example: production - // Required: true - Type *string `json:"type"` + Type string `json:"type,omitempty"` // Environment variables to attach to the new environment. Keys must not contain dots and must include at least one alphanumeric character. Omit or pass an empty array to create the environment without variables. Variables []*EnvironmentVariableItem `json:"variables"` @@ -74,10 +79,6 @@ func (m *NewEnvironment) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - if err := m.validateVariables(formats); err != nil { res = append(res, err) } @@ -89,7 +90,7 @@ func (m *NewEnvironment) Validate(formats strfmt.Registry) error { } func (m *NewEnvironment) validateCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.Canonical) { // not required + if typeutils.IsZero(m.Canonical) { // not required return nil } @@ -109,7 +110,7 @@ func (m *NewEnvironment) validateCanonical(formats strfmt.Registry) error { } func (m *NewEnvironment) validateCloudAccountCanonicals(formats strfmt.Registry) error { - if swag.IsZero(m.CloudAccountCanonicals) { // not required + if typeutils.IsZero(m.CloudAccountCanonicals) { // not required return nil } @@ -129,7 +130,7 @@ func (m *NewEnvironment) validateCloudAccountCanonicals(formats strfmt.Registry) } func (m *NewEnvironment) validateDescription(formats strfmt.Registry) error { - if swag.IsZero(m.Description) { // not required + if typeutils.IsZero(m.Description) { // not required return nil } @@ -157,22 +158,13 @@ func (m *NewEnvironment) validateName(formats strfmt.Registry) error { return nil } -func (m *NewEnvironment) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - return nil -} - func (m *NewEnvironment) validateVariables(formats strfmt.Registry) error { - if swag.IsZero(m.Variables) { // not required + if typeutils.IsZero(m.Variables) { // not required return nil } for i := 0; i < len(m.Variables); i++ { - if swag.IsZero(m.Variables[i]) { // not required + if typeutils.IsZero(m.Variables[i]) { // not required continue } @@ -216,7 +208,7 @@ func (m *NewEnvironment) contextValidateVariables(ctx context.Context, formats s if m.Variables[i] != nil { - if swag.IsZero(m.Variables[i]) { // not required + if typeutils.IsZero(m.Variables[i]) { // not required return nil } @@ -244,13 +236,13 @@ func (m *NewEnvironment) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *NewEnvironment) UnmarshalBinary(b []byte) error { var res NewEnvironment - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/new_environment_type.go b/client/models/new_environment_type.go index 3d042b3f..6188cbc5 100644 --- a/client/models/new_environment_type.go +++ b/client/models/new_environment_type.go @@ -7,7 +7,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -59,7 +60,7 @@ func (m *NewEnvironmentType) Validate(formats strfmt.Registry) error { } func (m *NewEnvironmentType) validateCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.Canonical) { // not required + if typeutils.IsZero(m.Canonical) { // not required return nil } @@ -118,13 +119,13 @@ func (m *NewEnvironmentType) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *NewEnvironmentType) UnmarshalBinary(b []byte) error { var res NewEnvironmentType - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/new_event.go b/client/models/new_event.go index 287a38ec..56e5acba 100644 --- a/client/models/new_event.go +++ b/client/models/new_event.go @@ -10,7 +10,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -95,7 +96,7 @@ func (m *NewEvent) Validate(formats strfmt.Registry) error { } func (m *NewEvent) validateColor(formats strfmt.Registry) error { - if swag.IsZero(m.Color) { // not required + if typeutils.IsZero(m.Color) { // not required return nil } @@ -115,7 +116,7 @@ func (m *NewEvent) validateColor(formats strfmt.Registry) error { } func (m *NewEvent) validateIcon(formats strfmt.Registry) error { - if swag.IsZero(m.Icon) { // not required + if typeutils.IsZero(m.Icon) { // not required return nil } @@ -195,7 +196,7 @@ func (m *NewEvent) validateTags(formats strfmt.Registry) error { } for i := 0; i < len(m.Tags); i++ { - if swag.IsZero(m.Tags[i]) { // not required + if typeutils.IsZero(m.Tags[i]) { // not required continue } @@ -301,7 +302,7 @@ func (m *NewEvent) contextValidateTags(ctx context.Context, formats strfmt.Regis if m.Tags[i] != nil { - if swag.IsZero(m.Tags[i]) { // not required + if typeutils.IsZero(m.Tags[i]) { // not required return nil } @@ -329,13 +330,13 @@ func (m *NewEvent) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *NewEvent) UnmarshalBinary(b []byte) error { var res NewEvent - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/new_external_backend.go b/client/models/new_external_backend.go index 893516c2..fea7ec1b 100644 --- a/client/models/new_external_backend.go +++ b/client/models/new_external_backend.go @@ -12,7 +12,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -170,7 +171,7 @@ func (m NewExternalBackend) MarshalJSON() ([]byte, error) { return nil, err } - return swag.ConcatJSON(b1, b2, b3), nil + return jsonutils.ConcatJSON(b1, b2, b3), nil } // Validate validates this new external backend @@ -208,7 +209,7 @@ func (m *NewExternalBackend) Validate(formats strfmt.Registry) error { } func (m *NewExternalBackend) validateComponentCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.ComponentCanonical) { // not required + if typeutils.IsZero(m.ComponentCanonical) { // not required return nil } @@ -250,7 +251,7 @@ func (m *NewExternalBackend) validateConfiguration(formats strfmt.Registry) erro } func (m *NewExternalBackend) validateCredentialCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.CredentialCanonical) { // not required + if typeutils.IsZero(m.CredentialCanonical) { // not required return nil } @@ -270,7 +271,7 @@ func (m *NewExternalBackend) validateCredentialCanonical(formats strfmt.Registry } func (m *NewExternalBackend) validateEnvironmentCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.EnvironmentCanonical) { // not required + if typeutils.IsZero(m.EnvironmentCanonical) { // not required return nil } @@ -290,7 +291,7 @@ func (m *NewExternalBackend) validateEnvironmentCanonical(formats strfmt.Registr } func (m *NewExternalBackend) validateProjectCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.ProjectCanonical) { // not required + if typeutils.IsZero(m.ProjectCanonical) { // not required return nil } @@ -395,13 +396,13 @@ func (m *NewExternalBackend) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *NewExternalBackend) UnmarshalBinary(b []byte) error { var res NewExternalBackend - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/new_infra_import.go b/client/models/new_infra_import.go deleted file mode 100644 index bb545150..00000000 --- a/client/models/new_infra_import.go +++ /dev/null @@ -1,600 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -import ( - "bytes" - "context" - "encoding/json" - stderrors "errors" - "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" -) - -// NewInfraImport New Infra Import -// -// # Entry that represents all the data needed to import a stack -// -// swagger:model NewInfraImport -type NewInfraImport struct { - - // component - Component *NewInfraImportComponent `json:"component,omitempty"` - - configurationField CloudProviderConfiguration - - // Credential that will be used to import from the provider - // Required: true - // Max Length: 100 - // Min Length: 3 - // Pattern: ^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$ - CredentialCanonical *string `json:"credential_canonical"` - - // environment - Environment *NewEnvironment `json:"environment,omitempty"` - - // external backend - ExternalBackend *NewInfraImportExternalBackend `json:"external_backend,omitempty"` - - // List of resources to import, these names are the ones on TF (ex: aws_instance). If not set then it means that all the resources will be imported - Include []string `json:"include"` - - // It's a KV where the key is the resource name and the value is the list (array) of attributes to include as part of the module - ModuleVariables map[string][]string `json:"module_variables,omitempty"` - - // project - Project *NewInfraImportProject `json:"project,omitempty"` - - // stack - // Required: true - Stack *NewServiceCatalog `json:"stack"` - - // List of tags to filter with format NAME:VALUE - Tags []string `json:"tags"` - - // List of resources to import via ID, those IDs are the ones documented on Terraform that are needed to Import. The format is 'aws_instance.ID' - Targets []string `json:"targets"` -} - -// Configuration gets the configuration of this base type -func (m *NewInfraImport) Configuration() CloudProviderConfiguration { - return m.configurationField -} - -// SetConfiguration sets the configuration of this base type -func (m *NewInfraImport) SetConfiguration(val CloudProviderConfiguration) { - m.configurationField = val -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *NewInfraImport) UnmarshalJSON(raw []byte) error { - var data struct { - Component *NewInfraImportComponent `json:"component,omitempty"` - - Configuration json.RawMessage `json:"configuration"` - - CredentialCanonical *string `json:"credential_canonical"` - - Environment *NewEnvironment `json:"environment,omitempty"` - - ExternalBackend *NewInfraImportExternalBackend `json:"external_backend,omitempty"` - - Include []string `json:"include"` - - ModuleVariables map[string][]string `json:"module_variables,omitempty"` - - Project *NewInfraImportProject `json:"project,omitempty"` - - Stack *NewServiceCatalog `json:"stack"` - - Tags []string `json:"tags"` - - Targets []string `json:"targets"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - propConfiguration, err := UnmarshalCloudProviderConfiguration(bytes.NewBuffer(data.Configuration), runtime.JSONConsumer()) - if err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - var result NewInfraImport - - // component - result.Component = data.Component - - // configuration - result.configurationField = propConfiguration - - // credential_canonical - result.CredentialCanonical = data.CredentialCanonical - - // environment - result.Environment = data.Environment - - // external_backend - result.ExternalBackend = data.ExternalBackend - - // include - result.Include = data.Include - - // module_variables - result.ModuleVariables = data.ModuleVariables - - // project - result.Project = data.Project - - // stack - result.Stack = data.Stack - - // tags - result.Tags = data.Tags - - // targets - result.Targets = data.Targets - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m NewInfraImport) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - Component *NewInfraImportComponent `json:"component,omitempty"` - - CredentialCanonical *string `json:"credential_canonical"` - - Environment *NewEnvironment `json:"environment,omitempty"` - - ExternalBackend *NewInfraImportExternalBackend `json:"external_backend,omitempty"` - - Include []string `json:"include"` - - ModuleVariables map[string][]string `json:"module_variables,omitempty"` - - Project *NewInfraImportProject `json:"project,omitempty"` - - Stack *NewServiceCatalog `json:"stack"` - - Tags []string `json:"tags"` - - Targets []string `json:"targets"` - }{ - - Component: m.Component, - - CredentialCanonical: m.CredentialCanonical, - - Environment: m.Environment, - - ExternalBackend: m.ExternalBackend, - - Include: m.Include, - - ModuleVariables: m.ModuleVariables, - - Project: m.Project, - - Stack: m.Stack, - - Tags: m.Tags, - - Targets: m.Targets, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - Configuration CloudProviderConfiguration `json:"configuration"` - }{ - - Configuration: m.configurationField, - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this new infra import -func (m *NewInfraImport) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateComponent(formats); err != nil { - res = append(res, err) - } - - if err := m.validateConfiguration(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCredentialCanonical(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEnvironment(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExternalBackend(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProject(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStack(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NewInfraImport) validateComponent(formats strfmt.Registry) error { - if swag.IsZero(m.Component) { // not required - return nil - } - - if m.Component != nil { - if err := m.Component.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("component") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("component") - } - - return err - } - } - - return nil -} - -func (m *NewInfraImport) validateConfiguration(formats strfmt.Registry) error { - - if err := validate.Required("configuration", "body", m.Configuration()); err != nil { - return err - } - - if err := m.Configuration().Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("configuration") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("configuration") - } - - return err - } - - return nil -} - -func (m *NewInfraImport) validateCredentialCanonical(formats strfmt.Registry) error { - - if err := validate.Required("credential_canonical", "body", m.CredentialCanonical); err != nil { - return err - } - - if err := validate.MinLength("credential_canonical", "body", *m.CredentialCanonical, 3); err != nil { - return err - } - - if err := validate.MaxLength("credential_canonical", "body", *m.CredentialCanonical, 100); err != nil { - return err - } - - if err := validate.Pattern("credential_canonical", "body", *m.CredentialCanonical, `^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$`); err != nil { - return err - } - - return nil -} - -func (m *NewInfraImport) validateEnvironment(formats strfmt.Registry) error { - if swag.IsZero(m.Environment) { // not required - return nil - } - - if m.Environment != nil { - if err := m.Environment.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("environment") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("environment") - } - - return err - } - } - - return nil -} - -func (m *NewInfraImport) validateExternalBackend(formats strfmt.Registry) error { - if swag.IsZero(m.ExternalBackend) { // not required - return nil - } - - if m.ExternalBackend != nil { - if err := m.ExternalBackend.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("external_backend") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("external_backend") - } - - return err - } - } - - return nil -} - -func (m *NewInfraImport) validateProject(formats strfmt.Registry) error { - if swag.IsZero(m.Project) { // not required - return nil - } - - if m.Project != nil { - if err := m.Project.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("project") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("project") - } - - return err - } - } - - return nil -} - -func (m *NewInfraImport) validateStack(formats strfmt.Registry) error { - - if err := validate.Required("stack", "body", m.Stack); err != nil { - return err - } - - if m.Stack != nil { - if err := m.Stack.Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("stack") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("stack") - } - - return err - } - } - - return nil -} - -// ContextValidate validate this new infra import based on the context it is used -func (m *NewInfraImport) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateComponent(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateConfiguration(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateEnvironment(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateExternalBackend(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateProject(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStack(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NewInfraImport) contextValidateComponent(ctx context.Context, formats strfmt.Registry) error { - - if m.Component != nil { - - if swag.IsZero(m.Component) { // not required - return nil - } - - if err := m.Component.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("component") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("component") - } - - return err - } - } - - return nil -} - -func (m *NewInfraImport) contextValidateConfiguration(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Configuration().ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("configuration") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("configuration") - } - - return err - } - - return nil -} - -func (m *NewInfraImport) contextValidateEnvironment(ctx context.Context, formats strfmt.Registry) error { - - if m.Environment != nil { - - if swag.IsZero(m.Environment) { // not required - return nil - } - - if err := m.Environment.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("environment") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("environment") - } - - return err - } - } - - return nil -} - -func (m *NewInfraImport) contextValidateExternalBackend(ctx context.Context, formats strfmt.Registry) error { - - if m.ExternalBackend != nil { - - if swag.IsZero(m.ExternalBackend) { // not required - return nil - } - - if err := m.ExternalBackend.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("external_backend") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("external_backend") - } - - return err - } - } - - return nil -} - -func (m *NewInfraImport) contextValidateProject(ctx context.Context, formats strfmt.Registry) error { - - if m.Project != nil { - - if swag.IsZero(m.Project) { // not required - return nil - } - - if err := m.Project.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("project") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("project") - } - - return err - } - } - - return nil -} - -func (m *NewInfraImport) contextValidateStack(ctx context.Context, formats strfmt.Registry) error { - - if m.Stack != nil { - - if err := m.Stack.ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("stack") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("stack") - } - - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *NewInfraImport) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NewInfraImport) UnmarshalBinary(b []byte) error { - var res NewInfraImport - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/client/models/new_infra_import_component.go b/client/models/new_infra_import_component.go deleted file mode 100644 index 645095c3..00000000 --- a/client/models/new_infra_import_component.go +++ /dev/null @@ -1,137 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// NewInfraImportComponent Create Component for the Infra Import -// -// The entity which represents the information of a new component. -// -// swagger:model NewInfraImportComponent -type NewInfraImportComponent struct { - - // canonical - // Max Length: 100 - // Min Length: 1 - // Pattern: ^[\da-zA-Z]+(?:[\da-zA-Z\-._]+[\da-zA-Z]|[\da-zA-Z])$ - Canonical string `json:"canonical,omitempty"` - - // cloud provider canonical - // Required: true - // Max Length: 100 - // Min Length: 3 - // Pattern: ^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$ - CloudProviderCanonical *string `json:"cloud_provider_canonical"` - - // name - // Required: true - // Min Length: 1 - Name *string `json:"name"` -} - -// Validate validates this new infra import component -func (m *NewInfraImportComponent) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCanonical(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCloudProviderCanonical(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NewInfraImportComponent) validateCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.Canonical) { // not required - return nil - } - - if err := validate.MinLength("canonical", "body", m.Canonical, 1); err != nil { - return err - } - - if err := validate.MaxLength("canonical", "body", m.Canonical, 100); err != nil { - return err - } - - if err := validate.Pattern("canonical", "body", m.Canonical, `^[\da-zA-Z]+(?:[\da-zA-Z\-._]+[\da-zA-Z]|[\da-zA-Z])$`); err != nil { - return err - } - - return nil -} - -func (m *NewInfraImportComponent) validateCloudProviderCanonical(formats strfmt.Registry) error { - - if err := validate.Required("cloud_provider_canonical", "body", m.CloudProviderCanonical); err != nil { - return err - } - - if err := validate.MinLength("cloud_provider_canonical", "body", *m.CloudProviderCanonical, 3); err != nil { - return err - } - - if err := validate.MaxLength("cloud_provider_canonical", "body", *m.CloudProviderCanonical, 100); err != nil { - return err - } - - if err := validate.Pattern("cloud_provider_canonical", "body", *m.CloudProviderCanonical, `^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$`); err != nil { - return err - } - - return nil -} - -func (m *NewInfraImportComponent) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - if err := validate.MinLength("name", "body", *m.Name, 1); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this new infra import component based on context it is used -func (m *NewInfraImportComponent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *NewInfraImportComponent) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NewInfraImportComponent) UnmarshalBinary(b []byte) error { - var res NewInfraImportComponent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/client/models/new_infra_import_external_backend.go b/client/models/new_infra_import_external_backend.go deleted file mode 100644 index 6dc4aa3d..00000000 --- a/client/models/new_infra_import_external_backend.go +++ /dev/null @@ -1,211 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -import ( - "bytes" - "context" - "encoding/json" - stderrors "errors" - "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" -) - -// NewInfraImportExternalBackend New External backend -// -// An external backend contains the configuration needed in order to be plugged into the Cycloid system. A backend is a general purpose concept, but Cycloid specifies which ones are supported and the list of those which are supported for every concrete feature. -// -// swagger:model NewInfraImportExternalBackend -type NewInfraImportExternalBackend struct { - configurationField ExternalBackendConfiguration - - // credential canonical - // Max Length: 100 - // Min Length: 3 - // Pattern: ^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$ - CredentialCanonical string `json:"credential_canonical,omitempty"` -} - -// Configuration gets the configuration of this base type -func (m *NewInfraImportExternalBackend) Configuration() ExternalBackendConfiguration { - return m.configurationField -} - -// SetConfiguration sets the configuration of this base type -func (m *NewInfraImportExternalBackend) SetConfiguration(val ExternalBackendConfiguration) { - m.configurationField = val -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *NewInfraImportExternalBackend) UnmarshalJSON(raw []byte) error { - var data struct { - Configuration json.RawMessage `json:"configuration"` - - CredentialCanonical string `json:"credential_canonical,omitempty"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - propConfiguration, err := UnmarshalExternalBackendConfiguration(bytes.NewBuffer(data.Configuration), runtime.JSONConsumer()) - if err != nil && !stderrors.Is(err, io.EOF) { - return err - } - - var result NewInfraImportExternalBackend - - // configuration - result.configurationField = propConfiguration - - // credential_canonical - result.CredentialCanonical = data.CredentialCanonical - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m NewInfraImportExternalBackend) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - CredentialCanonical string `json:"credential_canonical,omitempty"` - }{ - - CredentialCanonical: m.CredentialCanonical, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - Configuration ExternalBackendConfiguration `json:"configuration"` - }{ - - Configuration: m.configurationField, - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this new infra import external backend -func (m *NewInfraImportExternalBackend) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateConfiguration(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCredentialCanonical(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NewInfraImportExternalBackend) validateConfiguration(formats strfmt.Registry) error { - - if err := validate.Required("configuration", "body", m.Configuration()); err != nil { - return err - } - - if err := m.Configuration().Validate(formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("configuration") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("configuration") - } - - return err - } - - return nil -} - -func (m *NewInfraImportExternalBackend) validateCredentialCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.CredentialCanonical) { // not required - return nil - } - - if err := validate.MinLength("credential_canonical", "body", m.CredentialCanonical, 3); err != nil { - return err - } - - if err := validate.MaxLength("credential_canonical", "body", m.CredentialCanonical, 100); err != nil { - return err - } - - if err := validate.Pattern("credential_canonical", "body", m.CredentialCanonical, `^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$`); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this new infra import external backend based on the context it is used -func (m *NewInfraImportExternalBackend) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateConfiguration(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NewInfraImportExternalBackend) contextValidateConfiguration(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Configuration().ContextValidate(ctx, formats); err != nil { - ve := new(errors.Validation) - if stderrors.As(err, &ve) { - return ve.ValidateName("configuration") - } - ce := new(errors.CompositeError) - if stderrors.As(err, &ce) { - return ce.ValidateName("configuration") - } - - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *NewInfraImportExternalBackend) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NewInfraImportExternalBackend) UnmarshalBinary(b []byte) error { - var res NewInfraImportExternalBackend - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/client/models/new_infra_import_project.go b/client/models/new_infra_import_project.go deleted file mode 100644 index 6b56ad7c..00000000 --- a/client/models/new_infra_import_project.go +++ /dev/null @@ -1,142 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// NewInfraImportProject Create Project for the Infra Import -// -// The entity which represents the information of a new project. -// -// swagger:model NewInfraImportProject -type NewInfraImportProject struct { - - // canonical - // Max Length: 100 - // Min Length: 1 - // Pattern: (^[a-z0-9]+(([a-z0-9\-_]+)?[a-z0-9]+)?$) - Canonical string `json:"canonical,omitempty"` - - // config repository canonical - // Required: true - // Max Length: 100 - // Min Length: 3 - // Pattern: ^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$ - ConfigRepositoryCanonical *string `json:"config_repository_canonical"` - - // A description regarding the project to help identify/remember details, - // implementation, purpose, etc. - // - Description string `json:"description,omitempty"` - - // name - // Required: true - // Min Length: 1 - Name *string `json:"name"` -} - -// Validate validates this new infra import project -func (m *NewInfraImportProject) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCanonical(formats); err != nil { - res = append(res, err) - } - - if err := m.validateConfigRepositoryCanonical(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *NewInfraImportProject) validateCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.Canonical) { // not required - return nil - } - - if err := validate.MinLength("canonical", "body", m.Canonical, 1); err != nil { - return err - } - - if err := validate.MaxLength("canonical", "body", m.Canonical, 100); err != nil { - return err - } - - if err := validate.Pattern("canonical", "body", m.Canonical, `(^[a-z0-9]+(([a-z0-9\-_]+)?[a-z0-9]+)?$)`); err != nil { - return err - } - - return nil -} - -func (m *NewInfraImportProject) validateConfigRepositoryCanonical(formats strfmt.Registry) error { - - if err := validate.Required("config_repository_canonical", "body", m.ConfigRepositoryCanonical); err != nil { - return err - } - - if err := validate.MinLength("config_repository_canonical", "body", *m.ConfigRepositoryCanonical, 3); err != nil { - return err - } - - if err := validate.MaxLength("config_repository_canonical", "body", *m.ConfigRepositoryCanonical, 100); err != nil { - return err - } - - if err := validate.Pattern("config_repository_canonical", "body", *m.ConfigRepositoryCanonical, `^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$`); err != nil { - return err - } - - return nil -} - -func (m *NewInfraImportProject) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - if err := validate.MinLength("name", "body", *m.Name, 1); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this new infra import project based on context it is used -func (m *NewInfraImportProject) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *NewInfraImportProject) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NewInfraImportProject) UnmarshalBinary(b []byte) error { - var res NewInfraImportProject - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/client/models/new_infra_policy.go b/client/models/new_infra_policy.go index e6d425ff..2e7e7dd4 100644 --- a/client/models/new_infra_policy.go +++ b/client/models/new_infra_policy.go @@ -8,7 +8,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -95,7 +96,7 @@ func (m *NewInfraPolicy) validateBody(formats strfmt.Registry) error { } func (m *NewInfraPolicy) validateCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.Canonical) { // not required + if typeutils.IsZero(m.Canonical) { // not required return nil } @@ -204,13 +205,13 @@ func (m *NewInfraPolicy) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *NewInfraPolicy) UnmarshalBinary(b []byte) error { var res NewInfraPolicy - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/new_inventory_resource.go b/client/models/new_inventory_resource.go index 18376147..9f5851da 100644 --- a/client/models/new_inventory_resource.go +++ b/client/models/new_inventory_resource.go @@ -7,7 +7,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -91,7 +92,7 @@ func (m *NewInventoryResource) Validate(formats strfmt.Registry) error { } func (m *NewInventoryResource) validateCPU(formats strfmt.Registry) error { - if swag.IsZero(m.CPU) { // not required + if typeutils.IsZero(m.CPU) { // not required return nil } @@ -112,7 +113,7 @@ func (m *NewInventoryResource) validateLabel(formats strfmt.Registry) error { } func (m *NewInventoryResource) validateMemory(formats strfmt.Registry) error { - if swag.IsZero(m.Memory) { // not required + if typeutils.IsZero(m.Memory) { // not required return nil } @@ -142,7 +143,7 @@ func (m *NewInventoryResource) validateProvider(formats strfmt.Registry) error { } func (m *NewInventoryResource) validateStorage(formats strfmt.Registry) error { - if swag.IsZero(m.Storage) { // not required + if typeutils.IsZero(m.Storage) { // not required return nil } @@ -172,13 +173,13 @@ func (m *NewInventoryResource) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *NewInventoryResource) UnmarshalBinary(b []byte) error { var res NewInventoryResource - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/new_k_p_i.go b/client/models/new_k_p_i.go index b46410f3..da820520 100644 --- a/client/models/new_k_p_i.go +++ b/client/models/new_k_p_i.go @@ -8,7 +8,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -81,7 +82,7 @@ func (m *NewKPI) Validate(formats strfmt.Registry) error { } func (m *NewKPI) validateCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.Canonical) { // not required + if typeutils.IsZero(m.Canonical) { // not required return nil } @@ -233,13 +234,13 @@ func (m *NewKPI) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *NewKPI) UnmarshalBinary(b []byte) error { var res NewKPI - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/new_licence.go b/client/models/new_licence.go index 73c2e231..981dd42f 100644 --- a/client/models/new_licence.go +++ b/client/models/new_licence.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -56,13 +56,13 @@ func (m *NewLicence) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *NewLicence) UnmarshalBinary(b []byte) error { var res NewLicence - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/new_member_invitation.go b/client/models/new_member_invitation.go index b302dd63..c1d46d67 100644 --- a/client/models/new_member_invitation.go +++ b/client/models/new_member_invitation.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -93,13 +93,13 @@ func (m *NewMemberInvitation) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *NewMemberInvitation) UnmarshalBinary(b []byte) error { var res NewMemberInvitation - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/new_o_auth_user.go b/client/models/new_o_auth_user.go index 20a11489..6a08f576 100644 --- a/client/models/new_o_auth_user.go +++ b/client/models/new_o_auth_user.go @@ -8,7 +8,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -28,9 +29,6 @@ type NewOAuthUser struct { // Format: email Email *strfmt.Email `json:"email"` - // User's email has been verified - EmailVerified bool `json:"email_verified,omitempty"` - // full name // Required: true // Max Length: 255 @@ -106,7 +104,7 @@ func (m *NewOAuthUser) Validate(formats strfmt.Registry) error { } func (m *NewOAuthUser) validateCountryCode(formats strfmt.Registry) error { - if swag.IsZero(m.CountryCode) { // not required + if typeutils.IsZero(m.CountryCode) { // not required return nil } @@ -148,7 +146,7 @@ func (m *NewOAuthUser) validateFullName(formats strfmt.Registry) error { } func (m *NewOAuthUser) validateInvitationToken(formats strfmt.Registry) error { - if swag.IsZero(m.InvitationToken) { // not required + if typeutils.IsZero(m.InvitationToken) { // not required return nil } @@ -192,7 +190,7 @@ func (m *NewOAuthUser) validateLocaleEnum(path, location string, value string) e } func (m *NewOAuthUser) validateLocale(formats strfmt.Registry) error { - if swag.IsZero(m.Locale) { // not required + if typeutils.IsZero(m.Locale) { // not required return nil } @@ -205,7 +203,7 @@ func (m *NewOAuthUser) validateLocale(formats strfmt.Registry) error { } func (m *NewOAuthUser) validatePictureURL(formats strfmt.Registry) error { - if swag.IsZero(m.PictureURL) { // not required + if typeutils.IsZero(m.PictureURL) { // not required return nil } @@ -226,7 +224,7 @@ func (m *NewOAuthUser) validateSocialID(formats strfmt.Registry) error { } func (m *NewOAuthUser) validateUsername(formats strfmt.Registry) error { - if swag.IsZero(m.Username) { // not required + if typeutils.IsZero(m.Username) { // not required return nil } @@ -255,13 +253,13 @@ func (m *NewOAuthUser) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *NewOAuthUser) UnmarshalBinary(b []byte) error { var res NewOAuthUser - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/new_o_id_c_group_mapping.go b/client/models/new_o_id_c_group_mapping.go new file mode 100644 index 00000000..2c476de1 --- /dev/null +++ b/client/models/new_o_id_c_group_mapping.go @@ -0,0 +1,112 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/validate" +) + +// NewOIDCGroupMapping NewOIDCGroupMapping +// +// The information required to create an OIDC group mapping (organization, group, team). Multiple teams are expressed via multiple mappings. +// +// swagger:model NewOIDCGroupMapping +type NewOIDCGroupMapping struct { + + // The OIDC group claim value to match. + // Required: true + // Max Length: 255 + // Min Length: 1 + GroupName *string `json:"group_name"` + + // The canonical of the team to assign the user to. + // Required: true + // Max Length: 100 + // Min Length: 3 + // Pattern: ^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$ + TeamCanonical *string `json:"team_canonical"` +} + +// Validate validates this new o ID c group mapping +func (m *NewOIDCGroupMapping) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateGroupName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTeamCanonical(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NewOIDCGroupMapping) validateGroupName(formats strfmt.Registry) error { + + if err := validate.Required("group_name", "body", m.GroupName); err != nil { + return err + } + + if err := validate.MinLength("group_name", "body", *m.GroupName, 1); err != nil { + return err + } + + if err := validate.MaxLength("group_name", "body", *m.GroupName, 255); err != nil { + return err + } + + return nil +} + +func (m *NewOIDCGroupMapping) validateTeamCanonical(formats strfmt.Registry) error { + + if err := validate.Required("team_canonical", "body", m.TeamCanonical); err != nil { + return err + } + + if err := validate.MinLength("team_canonical", "body", *m.TeamCanonical, 3); err != nil { + return err + } + + if err := validate.MaxLength("team_canonical", "body", *m.TeamCanonical, 100); err != nil { + return err + } + + if err := validate.Pattern("team_canonical", "body", *m.TeamCanonical, `^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$`); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this new o ID c group mapping based on context it is used +func (m *NewOIDCGroupMapping) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *NewOIDCGroupMapping) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return jsonutils.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NewOIDCGroupMapping) UnmarshalBinary(b []byte) error { + var res NewOIDCGroupMapping + if err := jsonutils.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/client/models/new_organization.go b/client/models/new_organization.go index 6e8411ff..b9bb10b0 100644 --- a/client/models/new_organization.go +++ b/client/models/new_organization.go @@ -7,7 +7,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -49,7 +50,7 @@ func (m *NewOrganization) Validate(formats strfmt.Registry) error { } func (m *NewOrganization) validateCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.Canonical) { // not required + if typeutils.IsZero(m.Canonical) { // not required return nil } @@ -91,13 +92,13 @@ func (m *NewOrganization) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *NewOrganization) UnmarshalBinary(b []byte) error { var res NewOrganization - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/new_pipeline.go b/client/models/new_pipeline.go index 81e9699e..353cea4b 100644 --- a/client/models/new_pipeline.go +++ b/client/models/new_pipeline.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -80,13 +80,13 @@ func (m *NewPipeline) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *NewPipeline) UnmarshalBinary(b []byte) error { var res NewPipeline - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/new_plugin.go b/client/models/new_plugin.go index b4250f14..e3db3a7d 100644 --- a/client/models/new_plugin.go +++ b/client/models/new_plugin.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -56,13 +56,13 @@ func (m *NewPlugin) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *NewPlugin) UnmarshalBinary(b []byte) error { var res NewPlugin - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/new_plugin_install.go b/client/models/new_plugin_install.go index 0b54dbf2..02dcdfa6 100644 --- a/client/models/new_plugin_install.go +++ b/client/models/new_plugin_install.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -56,13 +56,13 @@ func (m *NewPluginInstall) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *NewPluginInstall) UnmarshalBinary(b []byte) error { var res NewPluginInstall - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/new_plugin_manager.go b/client/models/new_plugin_manager.go index bc63e46a..bb401672 100644 --- a/client/models/new_plugin_manager.go +++ b/client/models/new_plugin_manager.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -81,13 +81,13 @@ func (m *NewPluginManager) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *NewPluginManager) UnmarshalBinary(b []byte) error { var res NewPluginManager - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/new_plugin_registry.go b/client/models/new_plugin_registry.go index 04e6a5ad..feb6d2e8 100644 --- a/client/models/new_plugin_registry.go +++ b/client/models/new_plugin_registry.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -78,13 +78,13 @@ func (m *NewPluginRegistry) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *NewPluginRegistry) UnmarshalBinary(b []byte) error { var res NewPluginRegistry - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/new_plugin_version.go b/client/models/new_plugin_version.go index 1c546114..cf60bfe0 100644 --- a/client/models/new_plugin_version.go +++ b/client/models/new_plugin_version.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -56,13 +56,13 @@ func (m *NewPluginVersion) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *NewPluginVersion) UnmarshalBinary(b []byte) error { var res NewPluginVersion - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/new_project.go b/client/models/new_project.go index e5a561f6..9a45d4d5 100644 --- a/client/models/new_project.go +++ b/client/models/new_project.go @@ -7,7 +7,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -87,7 +88,7 @@ func (m *NewProject) Validate(formats strfmt.Registry) error { } func (m *NewProject) validateCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.Canonical) { // not required + if typeutils.IsZero(m.Canonical) { // not required return nil } @@ -107,7 +108,7 @@ func (m *NewProject) validateCanonical(formats strfmt.Registry) error { } func (m *NewProject) validateColor(formats strfmt.Registry) error { - if swag.IsZero(m.Color) { // not required + if typeutils.IsZero(m.Color) { // not required return nil } @@ -140,7 +141,7 @@ func (m *NewProject) validateConfigRepositoryCanonical(formats strfmt.Registry) } func (m *NewProject) validateIcon(formats strfmt.Registry) error { - if swag.IsZero(m.Icon) { // not required + if typeutils.IsZero(m.Icon) { // not required return nil } @@ -174,13 +175,13 @@ func (m *NewProject) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *NewProject) UnmarshalBinary(b []byte) error { var res NewProject - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/new_role.go b/client/models/new_role.go index 1dcc0172..00b76093 100644 --- a/client/models/new_role.go +++ b/client/models/new_role.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -63,7 +64,7 @@ func (m *NewRole) Validate(formats strfmt.Registry) error { } func (m *NewRole) validateCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.Canonical) { // not required + if typeutils.IsZero(m.Canonical) { // not required return nil } @@ -106,7 +107,7 @@ func (m *NewRole) validateRules(formats strfmt.Registry) error { } for i := 0; i < len(m.Rules); i++ { - if swag.IsZero(m.Rules[i]) { // not required + if typeutils.IsZero(m.Rules[i]) { // not required continue } @@ -150,7 +151,7 @@ func (m *NewRole) contextValidateRules(ctx context.Context, formats strfmt.Regis if m.Rules[i] != nil { - if swag.IsZero(m.Rules[i]) { // not required + if typeutils.IsZero(m.Rules[i]) { // not required return nil } @@ -178,13 +179,13 @@ func (m *NewRole) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *NewRole) UnmarshalBinary(b []byte) error { var res NewRole - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/new_rule.go b/client/models/new_rule.go index 2e7e92b8..79dc921a 100644 --- a/client/models/new_rule.go +++ b/client/models/new_rule.go @@ -8,7 +8,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -109,13 +109,13 @@ func (m *NewRule) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *NewRule) UnmarshalBinary(b []byte) error { var res NewRule - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/new_service_catalog.go b/client/models/new_service_catalog.go index 363ba0cc..a7720175 100644 --- a/client/models/new_service_catalog.go +++ b/client/models/new_service_catalog.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -125,7 +126,7 @@ func (m *NewServiceCatalog) validateAuthor(formats strfmt.Registry) error { } func (m *NewServiceCatalog) validateCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.Canonical) { // not required + if typeutils.IsZero(m.Canonical) { // not required return nil } @@ -145,12 +146,12 @@ func (m *NewServiceCatalog) validateCanonical(formats strfmt.Registry) error { } func (m *NewServiceCatalog) validateDependencies(formats strfmt.Registry) error { - if swag.IsZero(m.Dependencies) { // not required + if typeutils.IsZero(m.Dependencies) { // not required return nil } for i := 0; i < len(m.Dependencies); i++ { - if swag.IsZero(m.Dependencies[i]) { // not required + if typeutils.IsZero(m.Dependencies[i]) { // not required continue } @@ -175,7 +176,7 @@ func (m *NewServiceCatalog) validateDependencies(formats strfmt.Registry) error } func (m *NewServiceCatalog) validateImage(formats strfmt.Registry) error { - if swag.IsZero(m.Image) { // not required + if typeutils.IsZero(m.Image) { // not required return nil } @@ -226,7 +227,7 @@ func (m *NewServiceCatalog) validateServiceCatalogSourceCanonical(formats strfmt } func (m *NewServiceCatalog) validateTeamCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.TeamCanonical) { // not required + if typeutils.IsZero(m.TeamCanonical) { // not required return nil } @@ -246,12 +247,12 @@ func (m *NewServiceCatalog) validateTeamCanonical(formats strfmt.Registry) error } func (m *NewServiceCatalog) validateTechnologies(formats strfmt.Registry) error { - if swag.IsZero(m.Technologies) { // not required + if typeutils.IsZero(m.Technologies) { // not required return nil } for i := 0; i < len(m.Technologies); i++ { - if swag.IsZero(m.Technologies[i]) { // not required + if typeutils.IsZero(m.Technologies[i]) { // not required continue } @@ -299,7 +300,7 @@ func (m *NewServiceCatalog) contextValidateDependencies(ctx context.Context, for if m.Dependencies[i] != nil { - if swag.IsZero(m.Dependencies[i]) { // not required + if typeutils.IsZero(m.Dependencies[i]) { // not required return nil } @@ -328,7 +329,7 @@ func (m *NewServiceCatalog) contextValidateTechnologies(ctx context.Context, for if m.Technologies[i] != nil { - if swag.IsZero(m.Technologies[i]) { // not required + if typeutils.IsZero(m.Technologies[i]) { // not required return nil } @@ -356,13 +357,13 @@ func (m *NewServiceCatalog) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *NewServiceCatalog) UnmarshalBinary(b []byte) error { var res NewServiceCatalog - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/new_service_catalog_from_template.go b/client/models/new_service_catalog_from_template.go index 98ccaf2d..0c820e36 100644 --- a/client/models/new_service_catalog_from_template.go +++ b/client/models/new_service_catalog_from_template.go @@ -7,7 +7,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -139,7 +140,7 @@ func (m *NewServiceCatalogFromTemplate) validateServiceCatalogSourceCanonical(fo } func (m *NewServiceCatalogFromTemplate) validateTeamCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.TeamCanonical) { // not required + if typeutils.IsZero(m.TeamCanonical) { // not required return nil } @@ -189,13 +190,13 @@ func (m *NewServiceCatalogFromTemplate) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *NewServiceCatalogFromTemplate) UnmarshalBinary(b []byte) error { var res NewServiceCatalogFromTemplate - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/new_service_catalog_source.go b/client/models/new_service_catalog_source.go index 1be51e32..46cdcfca 100644 --- a/client/models/new_service_catalog_source.go +++ b/client/models/new_service_catalog_source.go @@ -7,7 +7,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -104,7 +105,7 @@ func (m *NewServiceCatalogSource) validateBranch(formats strfmt.Registry) error } func (m *NewServiceCatalogSource) validateCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.Canonical) { // not required + if typeutils.IsZero(m.Canonical) { // not required return nil } @@ -124,7 +125,7 @@ func (m *NewServiceCatalogSource) validateCanonical(formats strfmt.Registry) err } func (m *NewServiceCatalogSource) validateCredentialCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.CredentialCanonical) { // not required + if typeutils.IsZero(m.CredentialCanonical) { // not required return nil } @@ -153,7 +154,7 @@ func (m *NewServiceCatalogSource) validateName(formats strfmt.Registry) error { } func (m *NewServiceCatalogSource) validateTeamCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.TeamCanonical) { // not required + if typeutils.IsZero(m.TeamCanonical) { // not required return nil } @@ -195,13 +196,13 @@ func (m *NewServiceCatalogSource) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *NewServiceCatalogSource) UnmarshalBinary(b []byte) error { var res NewServiceCatalogSource - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/new_subscription.go b/client/models/new_subscription.go index fadd3b76..f3cbcf90 100644 --- a/client/models/new_subscription.go +++ b/client/models/new_subscription.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -71,13 +71,13 @@ func (m *NewSubscription) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *NewSubscription) UnmarshalBinary(b []byte) error { var res NewSubscription - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/new_team.go b/client/models/new_team.go index 24c3e440..0ed0ad6d 100644 --- a/client/models/new_team.go +++ b/client/models/new_team.go @@ -8,7 +8,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -64,7 +65,7 @@ func (m *NewTeam) Validate(formats strfmt.Registry) error { } func (m *NewTeam) validateCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.Canonical) { // not required + if typeutils.IsZero(m.Canonical) { // not required return nil } @@ -131,13 +132,13 @@ func (m *NewTeam) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *NewTeam) UnmarshalBinary(b []byte) error { var res NewTeam - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/new_team_member_assignation.go b/client/models/new_team_member_assignation.go index 3d684f6b..0f983d10 100644 --- a/client/models/new_team_member_assignation.go +++ b/client/models/new_team_member_assignation.go @@ -7,7 +7,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -43,7 +44,7 @@ func (m *NewTeamMemberAssignation) Validate(formats strfmt.Registry) error { } func (m *NewTeamMemberAssignation) validateEmail(formats strfmt.Registry) error { - if swag.IsZero(m.Email) { // not required + if typeutils.IsZero(m.Email) { // not required return nil } @@ -64,13 +65,13 @@ func (m *NewTeamMemberAssignation) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *NewTeamMemberAssignation) UnmarshalBinary(b []byte) error { var res NewTeamMemberAssignation - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/new_user_account.go b/client/models/new_user_account.go index 1646647f..8889e9cf 100644 --- a/client/models/new_user_account.go +++ b/client/models/new_user_account.go @@ -8,7 +8,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -94,7 +95,7 @@ func (m *NewUserAccount) Validate(formats strfmt.Registry) error { } func (m *NewUserAccount) validateCountryCode(formats strfmt.Registry) error { - if swag.IsZero(m.CountryCode) { // not required + if typeutils.IsZero(m.CountryCode) { // not required return nil } @@ -136,7 +137,7 @@ func (m *NewUserAccount) validateFullName(formats strfmt.Registry) error { } func (m *NewUserAccount) validateInvitationToken(formats strfmt.Registry) error { - if swag.IsZero(m.InvitationToken) { // not required + if typeutils.IsZero(m.InvitationToken) { // not required return nil } @@ -180,7 +181,7 @@ func (m *NewUserAccount) validateLocaleEnum(path, location string, value string) } func (m *NewUserAccount) validateLocale(formats strfmt.Registry) error { - if swag.IsZero(m.Locale) { // not required + if typeutils.IsZero(m.Locale) { // not required return nil } @@ -210,7 +211,7 @@ func (m *NewUserAccount) validatePassword(formats strfmt.Registry) error { } func (m *NewUserAccount) validateUsername(formats strfmt.Registry) error { - if swag.IsZero(m.Username) { // not required + if typeutils.IsZero(m.Username) { // not required return nil } @@ -239,13 +240,13 @@ func (m *NewUserAccount) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *NewUserAccount) UnmarshalBinary(b []byte) error { var res NewUserAccount - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/new_watch_rule.go b/client/models/new_watch_rule.go index 288b2384..a56c2267 100644 --- a/client/models/new_watch_rule.go +++ b/client/models/new_watch_rule.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -81,7 +82,7 @@ func (m *NewWatchRule) Validate(formats strfmt.Registry) error { } func (m *NewWatchRule) validateCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.Canonical) { // not required + if typeutils.IsZero(m.Canonical) { // not required return nil } @@ -113,7 +114,7 @@ func (m *NewWatchRule) validateFilters(formats strfmt.Registry) error { } for i := 0; i < len(m.Filters); i++ { - if swag.IsZero(m.Filters[i]) { // not required + if typeutils.IsZero(m.Filters[i]) { // not required continue } @@ -172,7 +173,7 @@ func (m *NewWatchRule) validateOrganizationCanonical(formats strfmt.Registry) er } func (m *NewWatchRule) validateProjectCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.ProjectCanonical) { // not required + if typeutils.IsZero(m.ProjectCanonical) { // not required return nil } @@ -211,7 +212,7 @@ func (m *NewWatchRule) contextValidateFilters(ctx context.Context, formats strfm if m.Filters[i] != nil { - if swag.IsZero(m.Filters[i]) { // not required + if typeutils.IsZero(m.Filters[i]) { // not required return nil } @@ -239,13 +240,13 @@ func (m *NewWatchRule) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *NewWatchRule) UnmarshalBinary(b []byte) error { var res NewWatchRule - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/new_watch_rule_filter.go b/client/models/new_watch_rule_filter.go index 4312b4c0..fcf9fc58 100644 --- a/client/models/new_watch_rule_filter.go +++ b/client/models/new_watch_rule_filter.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -73,13 +73,13 @@ func (m *NewWatchRuleFilter) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *NewWatchRuleFilter) UnmarshalBinary(b []byte) error { var res NewWatchRuleFilter - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/notification.go b/client/models/notification.go index 5c787213..a0eea99f 100644 --- a/client/models/notification.go +++ b/client/models/notification.go @@ -8,7 +8,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -132,7 +133,7 @@ func (m *Notification) validateUpdatedAt(formats strfmt.Registry) error { } func (m *Notification) validateWatchRuleCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.WatchRuleCanonical) { // not required + if typeutils.IsZero(m.WatchRuleCanonical) { // not required return nil } @@ -191,13 +192,13 @@ func (m *Notification) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *Notification) UnmarshalBinary(b []byte) error { var res Notification - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/notification_settings.go b/client/models/notification_settings.go index b15d7126..405db4fb 100644 --- a/client/models/notification_settings.go +++ b/client/models/notification_settings.go @@ -8,7 +8,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -110,13 +110,13 @@ func (m *NotificationSettings) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *NotificationSettings) UnmarshalBinary(b []byte) error { var res NotificationSettings - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/o_id_c_group_mapping.go b/client/models/o_id_c_group_mapping.go new file mode 100644 index 00000000..d5ee876d --- /dev/null +++ b/client/models/o_id_c_group_mapping.go @@ -0,0 +1,191 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +import ( + "context" + stderrors "errors" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" + "github.com/go-openapi/validate" +) + +// OIDCGroupMapping OIDCGroupMapping +// +// Maps an OIDC group claim to a team within an organization. The org-level role is driven by the per-organization OIDC settings (default_role), not by the mapping. Requires the IdP to include group claims in the issued token — enterprise IdPs (Keycloak, Okta, Azure AD/Entra ID, Auth0, EU Login/ECAS) support this; consumer providers such as Google Workspace and GitHub do not. +// +// swagger:model OIDCGroupMapping +type OIDCGroupMapping struct { + + // created at + // Minimum: 0 + CreatedAt *uint64 `json:"created_at,omitempty"` + + // The OIDC group claim value to match. + // Required: true + GroupName *string `json:"group_name"` + + // id + // Required: true + ID *uint32 `json:"id"` + + // The team the user is added to when this mapping matches. + // Required: true + Team *OIDCGroupMappingTeam `json:"team"` + + // updated at + // Minimum: 0 + UpdatedAt *uint64 `json:"updated_at,omitempty"` +} + +// Validate validates this o ID c group mapping +func (m *OIDCGroupMapping) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateGroupName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTeam(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *OIDCGroupMapping) validateCreatedAt(formats strfmt.Registry) error { + if typeutils.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.MinimumUint("created_at", "body", *m.CreatedAt, 0, false); err != nil { + return err + } + + return nil +} + +func (m *OIDCGroupMapping) validateGroupName(formats strfmt.Registry) error { + + if err := validate.Required("group_name", "body", m.GroupName); err != nil { + return err + } + + return nil +} + +func (m *OIDCGroupMapping) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +func (m *OIDCGroupMapping) validateTeam(formats strfmt.Registry) error { + + if err := validate.Required("team", "body", m.Team); err != nil { + return err + } + + if m.Team != nil { + if err := m.Team.Validate(formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("team") + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("team") + } + + return err + } + } + + return nil +} + +func (m *OIDCGroupMapping) validateUpdatedAt(formats strfmt.Registry) error { + if typeutils.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.MinimumUint("updated_at", "body", *m.UpdatedAt, 0, false); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this o ID c group mapping based on the context it is used +func (m *OIDCGroupMapping) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTeam(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *OIDCGroupMapping) contextValidateTeam(ctx context.Context, formats strfmt.Registry) error { + + if m.Team != nil { + + if err := m.Team.ContextValidate(ctx, formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("team") + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("team") + } + + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *OIDCGroupMapping) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return jsonutils.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *OIDCGroupMapping) UnmarshalBinary(b []byte) error { + var res OIDCGroupMapping + if err := jsonutils.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/client/models/o_id_c_group_mapping_team.go b/client/models/o_id_c_group_mapping_team.go new file mode 100644 index 00000000..246f40c3 --- /dev/null +++ b/client/models/o_id_c_group_mapping_team.go @@ -0,0 +1,209 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +import ( + "context" + stderrors "errors" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" + "github.com/go-openapi/validate" +) + +// OIDCGroupMappingTeam OIDCGroupMappingTeam +// +// A summary of a team used within an OIDC group mapping, including its associated roles. +// +// swagger:model OIDCGroupMappingTeam +type OIDCGroupMappingTeam struct { + + // canonical + // Required: true + // Max Length: 100 + // Min Length: 3 + // Pattern: ^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$ + Canonical *string `json:"canonical"` + + // id + // Required: true + // Minimum: 1 + ID *uint32 `json:"id"` + + // name + // Required: true + // Min Length: 3 + Name *string `json:"name"` + + // The roles granted to members of this team. + // Required: true + Roles []*Role `json:"roles"` +} + +// Validate validates this o ID c group mapping team +func (m *OIDCGroupMappingTeam) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCanonical(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRoles(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *OIDCGroupMappingTeam) validateCanonical(formats strfmt.Registry) error { + + if err := validate.Required("canonical", "body", m.Canonical); err != nil { + return err + } + + if err := validate.MinLength("canonical", "body", *m.Canonical, 3); err != nil { + return err + } + + if err := validate.MaxLength("canonical", "body", *m.Canonical, 100); err != nil { + return err + } + + if err := validate.Pattern("canonical", "body", *m.Canonical, `^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$`); err != nil { + return err + } + + return nil +} + +func (m *OIDCGroupMappingTeam) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + if err := validate.MinimumUint("id", "body", uint64(*m.ID), 1, false); err != nil { + return err + } + + return nil +} + +func (m *OIDCGroupMappingTeam) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MinLength("name", "body", *m.Name, 3); err != nil { + return err + } + + return nil +} + +func (m *OIDCGroupMappingTeam) validateRoles(formats strfmt.Registry) error { + + if err := validate.Required("roles", "body", m.Roles); err != nil { + return err + } + + for i := 0; i < len(m.Roles); i++ { + if typeutils.IsZero(m.Roles[i]) { // not required + continue + } + + if m.Roles[i] != nil { + if err := m.Roles[i].Validate(formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("roles" + "." + strconv.Itoa(i)) + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("roles" + "." + strconv.Itoa(i)) + } + + return err + } + } + + } + + return nil +} + +// ContextValidate validate this o ID c group mapping team based on the context it is used +func (m *OIDCGroupMappingTeam) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateRoles(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *OIDCGroupMappingTeam) contextValidateRoles(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Roles); i++ { + + if m.Roles[i] != nil { + + if typeutils.IsZero(m.Roles[i]) { // not required + return nil + } + + if err := m.Roles[i].ContextValidate(ctx, formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("roles" + "." + strconv.Itoa(i)) + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("roles" + "." + strconv.Itoa(i)) + } + + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *OIDCGroupMappingTeam) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return jsonutils.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *OIDCGroupMappingTeam) UnmarshalBinary(b []byte) error { + var res OIDCGroupMappingTeam + if err := jsonutils.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/client/models/o_id_c_organization_settings.go b/client/models/o_id_c_organization_settings.go new file mode 100644 index 00000000..a8fb640c --- /dev/null +++ b/client/models/o_id_c_organization_settings.go @@ -0,0 +1,126 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/validate" +) + +// OIDCOrganizationSettings OIDCOrganizationSettings +// +// The per-organization OIDC reconciliation settings. +// +// swagger:model OIDCOrganizationSettings +type OIDCOrganizationSettings struct { + + // The canonical of the org-level role granted on OIDC provisioning. Empty when no default role is configured. + DefaultRoleCanonical string `json:"default_role_canonical,omitempty"` + + // When true, local member/team/invite edits are disabled (strict mode). + // Required: true + OidcManaged *bool `json:"oidc_managed"` + + // The policy applied when no group mapping matches on login. + // Required: true + // Enum: ["keep_membership","eject"] + OidcNoMatchPolicy *string `json:"oidc_no_match_policy"` +} + +// Validate validates this o ID c organization settings +func (m *OIDCOrganizationSettings) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateOidcManaged(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOidcNoMatchPolicy(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *OIDCOrganizationSettings) validateOidcManaged(formats strfmt.Registry) error { + + if err := validate.Required("oidc_managed", "body", m.OidcManaged); err != nil { + return err + } + + return nil +} + +var oIdCOrganizationSettingsTypeOidcNoMatchPolicyPropEnum []any + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["keep_membership","eject"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + oIdCOrganizationSettingsTypeOidcNoMatchPolicyPropEnum = append(oIdCOrganizationSettingsTypeOidcNoMatchPolicyPropEnum, v) + } +} + +const ( + + // OIDCOrganizationSettingsOidcNoMatchPolicyKeepMembership captures enum value "keep_membership" + OIDCOrganizationSettingsOidcNoMatchPolicyKeepMembership string = "keep_membership" + + // OIDCOrganizationSettingsOidcNoMatchPolicyEject captures enum value "eject" + OIDCOrganizationSettingsOidcNoMatchPolicyEject string = "eject" +) + +// prop value enum +func (m *OIDCOrganizationSettings) validateOidcNoMatchPolicyEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, oIdCOrganizationSettingsTypeOidcNoMatchPolicyPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *OIDCOrganizationSettings) validateOidcNoMatchPolicy(formats strfmt.Registry) error { + + if err := validate.Required("oidc_no_match_policy", "body", m.OidcNoMatchPolicy); err != nil { + return err + } + + // value enum + if err := m.validateOidcNoMatchPolicyEnum("oidc_no_match_policy", "body", *m.OidcNoMatchPolicy); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this o ID c organization settings based on context it is used +func (m *OIDCOrganizationSettings) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *OIDCOrganizationSettings) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return jsonutils.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *OIDCOrganizationSettings) UnmarshalBinary(b []byte) error { + var res OIDCOrganizationSettings + if err := jsonutils.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/client/models/on_failure_plan.go b/client/models/on_failure_plan.go index 6a36449f..8df160e4 100644 --- a/client/models/on_failure_plan.go +++ b/client/models/on_failure_plan.go @@ -8,7 +8,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -159,13 +159,13 @@ func (m *OnFailurePlan) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *OnFailurePlan) UnmarshalBinary(b []byte) error { var res OnFailurePlan - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/on_success_plan.go b/client/models/on_success_plan.go index 2795ca7e..4b507548 100644 --- a/client/models/on_success_plan.go +++ b/client/models/on_success_plan.go @@ -8,7 +8,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -159,13 +159,13 @@ func (m *OnSuccessPlan) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *OnSuccessPlan) UnmarshalBinary(b []byte) error { var res OnSuccessPlan - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/organization.go b/client/models/organization.go index b012ce56..5c5144cc 100644 --- a/client/models/organization.go +++ b/client/models/organization.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -105,6 +106,14 @@ type Organization struct { // When true, SSO users can only join the organization if they have been explicitly invited SsoInviteOnly *bool `json:"sso_invite_only,omitempty"` + // Glob patterns (filepath.Match syntax). Versions matching any of these are hidden from non-team-member users. + // Max Items: 50 + StackBranchExcludePatterns []string `json:"stack_branch_exclude_patterns"` + + // Glob patterns (filepath.Match syntax). When set, only versions whose name matches at least one pattern are shown to non-team-member users. Empty means show all. + // Max Items: 50 + StackBranchIncludePatterns []string `json:"stack_branch_include_patterns"` + // subscription Subscription *Subscription `json:"subscription,omitempty"` @@ -194,6 +203,14 @@ func (m *Organization) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateStackBranchExcludePatterns(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStackBranchIncludePatterns(formats); err != nil { + res = append(res, err) + } + if err := m.validateSubscription(formats); err != nil { res = append(res, err) } @@ -209,12 +226,12 @@ func (m *Organization) Validate(formats strfmt.Registry) error { } func (m *Organization) validateAdmins(formats strfmt.Registry) error { - if swag.IsZero(m.Admins) { // not required + if typeutils.IsZero(m.Admins) { // not required return nil } for i := 0; i < len(m.Admins); i++ { - if swag.IsZero(m.Admins[i]) { // not required + if typeutils.IsZero(m.Admins[i]) { // not required continue } @@ -239,7 +256,7 @@ func (m *Organization) validateAdmins(formats strfmt.Registry) error { } func (m *Organization) validateAppearance(formats strfmt.Registry) error { - if swag.IsZero(m.Appearance) { // not required + if typeutils.IsZero(m.Appearance) { // not required return nil } @@ -430,7 +447,7 @@ func (m *Organization) validateName(formats strfmt.Registry) error { } func (m *Organization) validateParentCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.ParentCanonical) { // not required + if typeutils.IsZero(m.ParentCanonical) { // not required return nil } @@ -449,8 +466,52 @@ func (m *Organization) validateParentCanonical(formats strfmt.Registry) error { return nil } +func (m *Organization) validateStackBranchExcludePatterns(formats strfmt.Registry) error { + if typeutils.IsZero(m.StackBranchExcludePatterns) { // not required + return nil + } + + iStackBranchExcludePatternsSize := int64(len(m.StackBranchExcludePatterns)) + + if err := validate.MaxItems("stack_branch_exclude_patterns", "body", iStackBranchExcludePatternsSize, 50); err != nil { + return err + } + + for i := 0; i < len(m.StackBranchExcludePatterns); i++ { + + if err := validate.MaxLength("stack_branch_exclude_patterns"+"."+strconv.Itoa(i), "body", m.StackBranchExcludePatterns[i], 200); err != nil { + return err + } + + } + + return nil +} + +func (m *Organization) validateStackBranchIncludePatterns(formats strfmt.Registry) error { + if typeutils.IsZero(m.StackBranchIncludePatterns) { // not required + return nil + } + + iStackBranchIncludePatternsSize := int64(len(m.StackBranchIncludePatterns)) + + if err := validate.MaxItems("stack_branch_include_patterns", "body", iStackBranchIncludePatternsSize, 50); err != nil { + return err + } + + for i := 0; i < len(m.StackBranchIncludePatterns); i++ { + + if err := validate.MaxLength("stack_branch_include_patterns"+"."+strconv.Itoa(i), "body", m.StackBranchIncludePatterns[i], 200); err != nil { + return err + } + + } + + return nil +} + func (m *Organization) validateSubscription(formats strfmt.Registry) error { - if swag.IsZero(m.Subscription) { // not required + if typeutils.IsZero(m.Subscription) { // not required return nil } @@ -513,7 +574,7 @@ func (m *Organization) contextValidateAdmins(ctx context.Context, formats strfmt if m.Admins[i] != nil { - if swag.IsZero(m.Admins[i]) { // not required + if typeutils.IsZero(m.Admins[i]) { // not required return nil } @@ -540,7 +601,7 @@ func (m *Organization) contextValidateAppearance(ctx context.Context, formats st if m.Appearance != nil { - if swag.IsZero(m.Appearance) { // not required + if typeutils.IsZero(m.Appearance) { // not required return nil } @@ -565,7 +626,7 @@ func (m *Organization) contextValidateSubscription(ctx context.Context, formats if m.Subscription != nil { - if swag.IsZero(m.Subscription) { // not required + if typeutils.IsZero(m.Subscription) { // not required return nil } @@ -591,13 +652,13 @@ func (m *Organization) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *Organization) UnmarshalBinary(b []byte) error { var res Organization - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/organization_messages.go b/client/models/organization_messages.go index 6daaf769..4fce0337 100644 --- a/client/models/organization_messages.go +++ b/client/models/organization_messages.go @@ -6,7 +6,7 @@ import ( "context" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" ) // OrganizationMessages organization messages @@ -33,13 +33,13 @@ func (m *OrganizationMessages) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *OrganizationMessages) UnmarshalBinary(b []byte) error { var res OrganizationMessages - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/organization_naming_rules.go b/client/models/organization_naming_rules.go index 00c88367..4f2cc310 100644 --- a/client/models/organization_naming_rules.go +++ b/client/models/organization_naming_rules.go @@ -7,7 +7,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -78,7 +79,7 @@ func (m *OrganizationNamingRules) Validate(formats strfmt.Registry) error { } func (m *OrganizationNamingRules) validateComponentMessage(formats strfmt.Registry) error { - if swag.IsZero(m.ComponentMessage) { // not required + if typeutils.IsZero(m.ComponentMessage) { // not required return nil } @@ -90,7 +91,7 @@ func (m *OrganizationNamingRules) validateComponentMessage(formats strfmt.Regist } func (m *OrganizationNamingRules) validateComponentRegex(formats strfmt.Registry) error { - if swag.IsZero(m.ComponentRegex) { // not required + if typeutils.IsZero(m.ComponentRegex) { // not required return nil } @@ -102,7 +103,7 @@ func (m *OrganizationNamingRules) validateComponentRegex(formats strfmt.Registry } func (m *OrganizationNamingRules) validateEnvMessage(formats strfmt.Registry) error { - if swag.IsZero(m.EnvMessage) { // not required + if typeutils.IsZero(m.EnvMessage) { // not required return nil } @@ -114,7 +115,7 @@ func (m *OrganizationNamingRules) validateEnvMessage(formats strfmt.Registry) er } func (m *OrganizationNamingRules) validateEnvRegex(formats strfmt.Registry) error { - if swag.IsZero(m.EnvRegex) { // not required + if typeutils.IsZero(m.EnvRegex) { // not required return nil } @@ -126,7 +127,7 @@ func (m *OrganizationNamingRules) validateEnvRegex(formats strfmt.Registry) erro } func (m *OrganizationNamingRules) validateProjectMessage(formats strfmt.Registry) error { - if swag.IsZero(m.ProjectMessage) { // not required + if typeutils.IsZero(m.ProjectMessage) { // not required return nil } @@ -138,7 +139,7 @@ func (m *OrganizationNamingRules) validateProjectMessage(formats strfmt.Registry } func (m *OrganizationNamingRules) validateProjectRegex(formats strfmt.Registry) error { - if swag.IsZero(m.ProjectRegex) { // not required + if typeutils.IsZero(m.ProjectRegex) { // not required return nil } @@ -159,13 +160,13 @@ func (m *OrganizationNamingRules) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *OrganizationNamingRules) UnmarshalBinary(b []byte) error { var res OrganizationNamingRules - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/page_concourse.go b/client/models/page_concourse.go index fecddfb6..1a9d5b2f 100644 --- a/client/models/page_concourse.go +++ b/client/models/page_concourse.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -88,13 +88,13 @@ func (m *PageConcourse) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *PageConcourse) UnmarshalBinary(b []byte) error { var res PageConcourse - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/pagination.go b/client/models/pagination.go index ebe791b2..5ae220c6 100644 --- a/client/models/pagination.go +++ b/client/models/pagination.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -103,13 +103,13 @@ func (m *Pagination) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *Pagination) UnmarshalBinary(b []byte) error { var res Pagination - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/pagination_a_w_s.go b/client/models/pagination_a_w_s.go index efa9f94b..f9225ab9 100644 --- a/client/models/pagination_a_w_s.go +++ b/client/models/pagination_a_w_s.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -54,13 +54,13 @@ func (m *PaginationAWS) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *PaginationAWS) UnmarshalBinary(b []byte) error { var res PaginationAWS - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/pagination_concourse.go b/client/models/pagination_concourse.go index 57d86165..96fcf436 100644 --- a/client/models/pagination_concourse.go +++ b/client/models/pagination_concourse.go @@ -8,7 +8,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -157,13 +157,13 @@ func (m *PaginationConcourse) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *PaginationConcourse) UnmarshalBinary(b []byte) error { var res PaginationConcourse - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/pending_member_invitation.go b/client/models/pending_member_invitation.go index 52f9e491..4f4d5d7b 100644 --- a/client/models/pending_member_invitation.go +++ b/client/models/pending_member_invitation.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -61,13 +61,13 @@ func (m *PendingMemberInvitation) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *PendingMemberInvitation) UnmarshalBinary(b []byte) error { var res PendingMemberInvitation - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/pin_comment.go b/client/models/pin_comment.go index d3dfe06c..db286043 100644 --- a/client/models/pin_comment.go +++ b/client/models/pin_comment.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -56,13 +56,13 @@ func (m *PinComment) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *PinComment) UnmarshalBinary(b []byte) error { var res PinComment - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/pipeline.go b/client/models/pipeline.go index ee9a9261..de6bdeef 100644 --- a/client/models/pipeline.go +++ b/client/models/pipeline.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -199,12 +200,12 @@ func (m *Pipeline) validateEnvironment(formats strfmt.Registry) error { } func (m *Pipeline) validateGroups(formats strfmt.Registry) error { - if swag.IsZero(m.Groups) { // not required + if typeutils.IsZero(m.Groups) { // not required return nil } for i := 0; i < len(m.Groups); i++ { - if swag.IsZero(m.Groups[i]) { // not required + if typeutils.IsZero(m.Groups[i]) { // not required continue } @@ -244,7 +245,7 @@ func (m *Pipeline) validateJobs(formats strfmt.Registry) error { } for i := 0; i < len(m.Jobs); i++ { - if swag.IsZero(m.Jobs[i]) { // not required + if typeutils.IsZero(m.Jobs[i]) { // not required continue } @@ -419,7 +420,7 @@ func (m *Pipeline) contextValidateGroups(ctx context.Context, formats strfmt.Reg if m.Groups[i] != nil { - if swag.IsZero(m.Groups[i]) { // not required + if typeutils.IsZero(m.Groups[i]) { // not required return nil } @@ -448,7 +449,7 @@ func (m *Pipeline) contextValidateJobs(ctx context.Context, formats strfmt.Regis if m.Jobs[i] != nil { - if swag.IsZero(m.Jobs[i]) { // not required + if typeutils.IsZero(m.Jobs[i]) { // not required return nil } @@ -497,13 +498,13 @@ func (m *Pipeline) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *Pipeline) UnmarshalBinary(b []byte) error { var res Pipeline - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/pipeline_diff.go b/client/models/pipeline_diff.go index 7e94be46..594b2ffc 100644 --- a/client/models/pipeline_diff.go +++ b/client/models/pipeline_diff.go @@ -10,7 +10,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -64,7 +65,7 @@ func (m *PipelineDiff) validateDiff(formats strfmt.Registry) error { } for i := 0; i < len(m.Diff); i++ { - if swag.IsZero(m.Diff[i]) { // not required + if typeutils.IsZero(m.Diff[i]) { // not required continue } @@ -163,7 +164,7 @@ func (m *PipelineDiff) contextValidateDiff(ctx context.Context, formats strfmt.R if m.Diff[i] != nil { - if swag.IsZero(m.Diff[i]) { // not required + if typeutils.IsZero(m.Diff[i]) { // not required return nil } @@ -191,13 +192,13 @@ func (m *PipelineDiff) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *PipelineDiff) UnmarshalBinary(b []byte) error { var res PipelineDiff - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/pipeline_diff_record.go b/client/models/pipeline_diff_record.go index 63f292ef..64ec7bd8 100644 --- a/client/models/pipeline_diff_record.go +++ b/client/models/pipeline_diff_record.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -73,13 +73,13 @@ func (m *PipelineDiffRecord) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *PipelineDiffRecord) UnmarshalBinary(b []byte) error { var res PipelineDiffRecord - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/pipeline_diffs.go b/client/models/pipeline_diffs.go index a0115e55..2dbf584e 100644 --- a/client/models/pipeline_diffs.go +++ b/client/models/pipeline_diffs.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" ) // PipelineDiffs PipelineDiffs @@ -59,12 +60,12 @@ func (m *PipelineDiffs) Validate(formats strfmt.Registry) error { } func (m *PipelineDiffs) validateGroups(formats strfmt.Registry) error { - if swag.IsZero(m.Groups) { // not required + if typeutils.IsZero(m.Groups) { // not required return nil } for i := 0; i < len(m.Groups); i++ { - if swag.IsZero(m.Groups[i]) { // not required + if typeutils.IsZero(m.Groups[i]) { // not required continue } @@ -89,12 +90,12 @@ func (m *PipelineDiffs) validateGroups(formats strfmt.Registry) error { } func (m *PipelineDiffs) validateJobs(formats strfmt.Registry) error { - if swag.IsZero(m.Jobs) { // not required + if typeutils.IsZero(m.Jobs) { // not required return nil } for i := 0; i < len(m.Jobs); i++ { - if swag.IsZero(m.Jobs[i]) { // not required + if typeutils.IsZero(m.Jobs[i]) { // not required continue } @@ -119,12 +120,12 @@ func (m *PipelineDiffs) validateJobs(formats strfmt.Registry) error { } func (m *PipelineDiffs) validateResourceTypes(formats strfmt.Registry) error { - if swag.IsZero(m.ResourceTypes) { // not required + if typeutils.IsZero(m.ResourceTypes) { // not required return nil } for i := 0; i < len(m.ResourceTypes); i++ { - if swag.IsZero(m.ResourceTypes[i]) { // not required + if typeutils.IsZero(m.ResourceTypes[i]) { // not required continue } @@ -149,12 +150,12 @@ func (m *PipelineDiffs) validateResourceTypes(formats strfmt.Registry) error { } func (m *PipelineDiffs) validateResources(formats strfmt.Registry) error { - if swag.IsZero(m.Resources) { // not required + if typeutils.IsZero(m.Resources) { // not required return nil } for i := 0; i < len(m.Resources); i++ { - if swag.IsZero(m.Resources[i]) { // not required + if typeutils.IsZero(m.Resources[i]) { // not required continue } @@ -210,7 +211,7 @@ func (m *PipelineDiffs) contextValidateGroups(ctx context.Context, formats strfm if m.Groups[i] != nil { - if swag.IsZero(m.Groups[i]) { // not required + if typeutils.IsZero(m.Groups[i]) { // not required return nil } @@ -239,7 +240,7 @@ func (m *PipelineDiffs) contextValidateJobs(ctx context.Context, formats strfmt. if m.Jobs[i] != nil { - if swag.IsZero(m.Jobs[i]) { // not required + if typeutils.IsZero(m.Jobs[i]) { // not required return nil } @@ -268,7 +269,7 @@ func (m *PipelineDiffs) contextValidateResourceTypes(ctx context.Context, format if m.ResourceTypes[i] != nil { - if swag.IsZero(m.ResourceTypes[i]) { // not required + if typeutils.IsZero(m.ResourceTypes[i]) { // not required return nil } @@ -297,7 +298,7 @@ func (m *PipelineDiffs) contextValidateResources(ctx context.Context, formats st if m.Resources[i] != nil { - if swag.IsZero(m.Resources[i]) { // not required + if typeutils.IsZero(m.Resources[i]) { // not required return nil } @@ -325,13 +326,13 @@ func (m *PipelineDiffs) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *PipelineDiffs) UnmarshalBinary(b []byte) error { var res PipelineDiffs - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/pipeline_status.go b/client/models/pipeline_status.go index 2d57e119..5090786b 100644 --- a/client/models/pipeline_status.go +++ b/client/models/pipeline_status.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -55,7 +56,7 @@ func (m *PipelineStatus) Validate(formats strfmt.Registry) error { } func (m *PipelineStatus) validateDiffs(formats strfmt.Registry) error { - if swag.IsZero(m.Diffs) { // not required + if typeutils.IsZero(m.Diffs) { // not required return nil } @@ -144,7 +145,7 @@ func (m *PipelineStatus) contextValidateDiffs(ctx context.Context, formats strfm if m.Diffs != nil { - if swag.IsZero(m.Diffs) { // not required + if typeutils.IsZero(m.Diffs) { // not required return nil } @@ -170,13 +171,13 @@ func (m *PipelineStatus) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *PipelineStatus) UnmarshalBinary(b []byte) error { var res PipelineStatus - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/pipeline_variables.go b/client/models/pipeline_variables.go index e4a1733e..0e52d669 100644 --- a/client/models/pipeline_variables.go +++ b/client/models/pipeline_variables.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -76,13 +76,13 @@ func (m *PipelineVariables) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *PipelineVariables) UnmarshalBinary(b []byte) error { var res PipelineVariables - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/plan.go b/client/models/plan.go index c5c5b709..e6f120ad 100644 --- a/client/models/plan.go +++ b/client/models/plan.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -116,12 +117,12 @@ func (m *Plan) Validate(formats strfmt.Registry) error { } func (m *Plan) validateDo(formats strfmt.Registry) error { - if swag.IsZero(m.Do) { // not required + if typeutils.IsZero(m.Do) { // not required return nil } for i := 0; i < len(m.Do); i++ { - if swag.IsZero(m.Do[i]) { // not required + if typeutils.IsZero(m.Do[i]) { // not required continue } @@ -146,7 +147,7 @@ func (m *Plan) validateDo(formats strfmt.Registry) error { } func (m *Plan) validateEnsure(formats strfmt.Registry) error { - if swag.IsZero(m.Ensure) { // not required + if typeutils.IsZero(m.Ensure) { // not required return nil } @@ -169,7 +170,7 @@ func (m *Plan) validateEnsure(formats strfmt.Registry) error { } func (m *Plan) validateGet(formats strfmt.Registry) error { - if swag.IsZero(m.Get) { // not required + if typeutils.IsZero(m.Get) { // not required return nil } @@ -201,7 +202,7 @@ func (m *Plan) validateID(formats strfmt.Registry) error { } func (m *Plan) validateOnFailure(formats strfmt.Registry) error { - if swag.IsZero(m.OnFailure) { // not required + if typeutils.IsZero(m.OnFailure) { // not required return nil } @@ -224,7 +225,7 @@ func (m *Plan) validateOnFailure(formats strfmt.Registry) error { } func (m *Plan) validateOnSuccess(formats strfmt.Registry) error { - if swag.IsZero(m.OnSuccess) { // not required + if typeutils.IsZero(m.OnSuccess) { // not required return nil } @@ -247,7 +248,7 @@ func (m *Plan) validateOnSuccess(formats strfmt.Registry) error { } func (m *Plan) validatePut(formats strfmt.Registry) error { - if swag.IsZero(m.Put) { // not required + if typeutils.IsZero(m.Put) { // not required return nil } @@ -270,12 +271,12 @@ func (m *Plan) validatePut(formats strfmt.Registry) error { } func (m *Plan) validateRetry(formats strfmt.Registry) error { - if swag.IsZero(m.Retry) { // not required + if typeutils.IsZero(m.Retry) { // not required return nil } for i := 0; i < len(m.Retry); i++ { - if swag.IsZero(m.Retry[i]) { // not required + if typeutils.IsZero(m.Retry[i]) { // not required continue } @@ -300,7 +301,7 @@ func (m *Plan) validateRetry(formats strfmt.Registry) error { } func (m *Plan) validateTask(formats strfmt.Registry) error { - if swag.IsZero(m.Task) { // not required + if typeutils.IsZero(m.Task) { // not required return nil } @@ -323,7 +324,7 @@ func (m *Plan) validateTask(formats strfmt.Registry) error { } func (m *Plan) validateTimeout(formats strfmt.Registry) error { - if swag.IsZero(m.Timeout) { // not required + if typeutils.IsZero(m.Timeout) { // not required return nil } @@ -346,7 +347,7 @@ func (m *Plan) validateTimeout(formats strfmt.Registry) error { } func (m *Plan) validateTry(formats strfmt.Registry) error { - if swag.IsZero(m.Try) { // not required + if typeutils.IsZero(m.Try) { // not required return nil } @@ -424,7 +425,7 @@ func (m *Plan) contextValidateDo(ctx context.Context, formats strfmt.Registry) e if m.Do[i] != nil { - if swag.IsZero(m.Do[i]) { // not required + if typeutils.IsZero(m.Do[i]) { // not required return nil } @@ -451,7 +452,7 @@ func (m *Plan) contextValidateEnsure(ctx context.Context, formats strfmt.Registr if m.Ensure != nil { - if swag.IsZero(m.Ensure) { // not required + if typeutils.IsZero(m.Ensure) { // not required return nil } @@ -476,7 +477,7 @@ func (m *Plan) contextValidateGet(ctx context.Context, formats strfmt.Registry) if m.Get != nil { - if swag.IsZero(m.Get) { // not required + if typeutils.IsZero(m.Get) { // not required return nil } @@ -501,7 +502,7 @@ func (m *Plan) contextValidateOnFailure(ctx context.Context, formats strfmt.Regi if m.OnFailure != nil { - if swag.IsZero(m.OnFailure) { // not required + if typeutils.IsZero(m.OnFailure) { // not required return nil } @@ -526,7 +527,7 @@ func (m *Plan) contextValidateOnSuccess(ctx context.Context, formats strfmt.Regi if m.OnSuccess != nil { - if swag.IsZero(m.OnSuccess) { // not required + if typeutils.IsZero(m.OnSuccess) { // not required return nil } @@ -551,7 +552,7 @@ func (m *Plan) contextValidatePut(ctx context.Context, formats strfmt.Registry) if m.Put != nil { - if swag.IsZero(m.Put) { // not required + if typeutils.IsZero(m.Put) { // not required return nil } @@ -578,7 +579,7 @@ func (m *Plan) contextValidateRetry(ctx context.Context, formats strfmt.Registry if m.Retry[i] != nil { - if swag.IsZero(m.Retry[i]) { // not required + if typeutils.IsZero(m.Retry[i]) { // not required return nil } @@ -605,7 +606,7 @@ func (m *Plan) contextValidateTask(ctx context.Context, formats strfmt.Registry) if m.Task != nil { - if swag.IsZero(m.Task) { // not required + if typeutils.IsZero(m.Task) { // not required return nil } @@ -630,7 +631,7 @@ func (m *Plan) contextValidateTimeout(ctx context.Context, formats strfmt.Regist if m.Timeout != nil { - if swag.IsZero(m.Timeout) { // not required + if typeutils.IsZero(m.Timeout) { // not required return nil } @@ -655,7 +656,7 @@ func (m *Plan) contextValidateTry(ctx context.Context, formats strfmt.Registry) if m.Try != nil { - if swag.IsZero(m.Try) { // not required + if typeutils.IsZero(m.Try) { // not required return nil } @@ -681,13 +682,13 @@ func (m *Plan) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *Plan) UnmarshalBinary(b []byte) error { var res Plan - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/plan_config.go b/client/models/plan_config.go index 0b344440..e879eb40 100644 --- a/client/models/plan_config.go +++ b/client/models/plan_config.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" ) // PlanConfig PlanConfig @@ -85,12 +86,12 @@ func (m *PlanConfig) Validate(formats strfmt.Registry) error { } func (m *PlanConfig) validateAggregate(formats strfmt.Registry) error { - if swag.IsZero(m.Aggregate) { // not required + if typeutils.IsZero(m.Aggregate) { // not required return nil } for i := 0; i < len(m.Aggregate); i++ { - if swag.IsZero(m.Aggregate[i]) { // not required + if typeutils.IsZero(m.Aggregate[i]) { // not required continue } @@ -115,12 +116,12 @@ func (m *PlanConfig) validateAggregate(formats strfmt.Registry) error { } func (m *PlanConfig) validateDo(formats strfmt.Registry) error { - if swag.IsZero(m.Do) { // not required + if typeutils.IsZero(m.Do) { // not required return nil } for i := 0; i < len(m.Do); i++ { - if swag.IsZero(m.Do[i]) { // not required + if typeutils.IsZero(m.Do[i]) { // not required continue } @@ -145,7 +146,7 @@ func (m *PlanConfig) validateDo(formats strfmt.Registry) error { } func (m *PlanConfig) validateTaskConfig(formats strfmt.Registry) error { - if swag.IsZero(m.TaskConfig) { // not required + if typeutils.IsZero(m.TaskConfig) { // not required return nil } @@ -195,7 +196,7 @@ func (m *PlanConfig) contextValidateAggregate(ctx context.Context, formats strfm if m.Aggregate[i] != nil { - if swag.IsZero(m.Aggregate[i]) { // not required + if typeutils.IsZero(m.Aggregate[i]) { // not required return nil } @@ -224,7 +225,7 @@ func (m *PlanConfig) contextValidateDo(ctx context.Context, formats strfmt.Regis if m.Do[i] != nil { - if swag.IsZero(m.Do[i]) { // not required + if typeutils.IsZero(m.Do[i]) { // not required return nil } @@ -251,7 +252,7 @@ func (m *PlanConfig) contextValidateTaskConfig(ctx context.Context, formats strf if m.TaskConfig != nil { - if swag.IsZero(m.TaskConfig) { // not required + if typeutils.IsZero(m.TaskConfig) { // not required return nil } @@ -277,13 +278,13 @@ func (m *PlanConfig) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *PlanConfig) UnmarshalBinary(b []byte) error { var res PlanConfig - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/plugin.go b/client/models/plugin.go index eb13692f..7cd379c8 100644 --- a/client/models/plugin.go +++ b/client/models/plugin.go @@ -8,7 +8,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -105,7 +106,7 @@ func (m *Plugin) validateID(formats strfmt.Registry) error { } func (m *Plugin) validateInstall(formats strfmt.Registry) error { - if swag.IsZero(m.Install) { // not required + if typeutils.IsZero(m.Install) { // not required return nil } @@ -128,7 +129,7 @@ func (m *Plugin) validateInstall(formats strfmt.Registry) error { } func (m *Plugin) validateLatest(formats strfmt.Registry) error { - if swag.IsZero(m.Latest) { // not required + if typeutils.IsZero(m.Latest) { // not required return nil } @@ -193,7 +194,7 @@ func (m *Plugin) validateRegistry(formats strfmt.Registry) error { } func (m *Plugin) validateRelation(formats strfmt.Registry) error { - if swag.IsZero(m.Relation) { // not required + if typeutils.IsZero(m.Relation) { // not required return nil } @@ -245,7 +246,7 @@ func (m *Plugin) contextValidateInstall(ctx context.Context, formats strfmt.Regi if m.Install != nil { - if swag.IsZero(m.Install) { // not required + if typeutils.IsZero(m.Install) { // not required return nil } @@ -270,7 +271,7 @@ func (m *Plugin) contextValidateLatest(ctx context.Context, formats strfmt.Regis if m.Latest != nil { - if swag.IsZero(m.Latest) { // not required + if typeutils.IsZero(m.Latest) { // not required return nil } @@ -316,7 +317,7 @@ func (m *Plugin) contextValidateRelation(ctx context.Context, formats strfmt.Reg if m.Relation != nil { - if swag.IsZero(m.Relation) { // not required + if typeutils.IsZero(m.Relation) { // not required return nil } @@ -342,13 +343,13 @@ func (m *Plugin) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *Plugin) UnmarshalBinary(b []byte) error { var res Plugin - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/plugin_install.go b/client/models/plugin_install.go index 89d7f7af..d4a6dfc0 100644 --- a/client/models/plugin_install.go +++ b/client/models/plugin_install.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -216,7 +217,7 @@ func (m *PluginInstall) validateUUID(formats strfmt.Registry) error { } func (m *PluginInstall) validateVersion(formats strfmt.Registry) error { - if swag.IsZero(m.Version) { // not required + if typeutils.IsZero(m.Version) { // not required return nil } @@ -256,7 +257,7 @@ func (m *PluginInstall) contextValidateVersion(ctx context.Context, formats strf if m.Version != nil { - if swag.IsZero(m.Version) { // not required + if typeutils.IsZero(m.Version) { // not required return nil } @@ -282,13 +283,13 @@ func (m *PluginInstall) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *PluginInstall) UnmarshalBinary(b []byte) error { var res PluginInstall - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/plugin_install_deployment_log.go b/client/models/plugin_install_deployment_log.go index 4f394036..03fc177e 100644 --- a/client/models/plugin_install_deployment_log.go +++ b/client/models/plugin_install_deployment_log.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -78,13 +78,13 @@ func (m *PluginInstallDeploymentLog) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *PluginInstallDeploymentLog) UnmarshalBinary(b []byte) error { var res PluginInstallDeploymentLog - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/plugin_install_runtime_log.go b/client/models/plugin_install_runtime_log.go index f6766273..63f4a065 100644 --- a/client/models/plugin_install_runtime_log.go +++ b/client/models/plugin_install_runtime_log.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -100,13 +100,13 @@ func (m *PluginInstallRuntimeLog) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *PluginInstallRuntimeLog) UnmarshalBinary(b []byte) error { var res PluginInstallRuntimeLog - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/plugin_logs.go b/client/models/plugin_logs.go index 037dfd01..355e0788 100644 --- a/client/models/plugin_logs.go +++ b/client/models/plugin_logs.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" ) // PluginLogs Plugin Logs @@ -45,12 +46,12 @@ func (m *PluginLogs) Validate(formats strfmt.Registry) error { } func (m *PluginLogs) validateInstallLogs(formats strfmt.Registry) error { - if swag.IsZero(m.InstallLogs) { // not required + if typeutils.IsZero(m.InstallLogs) { // not required return nil } for i := 0; i < len(m.InstallLogs); i++ { - if swag.IsZero(m.InstallLogs[i]) { // not required + if typeutils.IsZero(m.InstallLogs[i]) { // not required continue } @@ -75,12 +76,12 @@ func (m *PluginLogs) validateInstallLogs(formats strfmt.Registry) error { } func (m *PluginLogs) validateRuntimeLogs(formats strfmt.Registry) error { - if swag.IsZero(m.RuntimeLogs) { // not required + if typeutils.IsZero(m.RuntimeLogs) { // not required return nil } for i := 0; i < len(m.RuntimeLogs); i++ { - if swag.IsZero(m.RuntimeLogs[i]) { // not required + if typeutils.IsZero(m.RuntimeLogs[i]) { // not required continue } @@ -128,7 +129,7 @@ func (m *PluginLogs) contextValidateInstallLogs(ctx context.Context, formats str if m.InstallLogs[i] != nil { - if swag.IsZero(m.InstallLogs[i]) { // not required + if typeutils.IsZero(m.InstallLogs[i]) { // not required return nil } @@ -157,7 +158,7 @@ func (m *PluginLogs) contextValidateRuntimeLogs(ctx context.Context, formats str if m.RuntimeLogs[i] != nil { - if swag.IsZero(m.RuntimeLogs[i]) { // not required + if typeutils.IsZero(m.RuntimeLogs[i]) { // not required return nil } @@ -185,13 +186,13 @@ func (m *PluginLogs) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *PluginLogs) UnmarshalBinary(b []byte) error { var res PluginLogs - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/plugin_manager.go b/client/models/plugin_manager.go index ecde75da..04882c27 100644 --- a/client/models/plugin_manager.go +++ b/client/models/plugin_manager.go @@ -8,7 +8,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -249,13 +249,13 @@ func (m *PluginManager) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *PluginManager) UnmarshalBinary(b []byte) error { var res PluginManager - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/plugin_registry.go b/client/models/plugin_registry.go index 4a6a3354..4198d603 100644 --- a/client/models/plugin_registry.go +++ b/client/models/plugin_registry.go @@ -8,7 +8,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -214,13 +214,13 @@ func (m *PluginRegistry) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *PluginRegistry) UnmarshalBinary(b []byte) error { var res PluginRegistry - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/plugin_relation.go b/client/models/plugin_relation.go index 551ad60c..a26be1a3 100644 --- a/client/models/plugin_relation.go +++ b/client/models/plugin_relation.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -73,13 +73,13 @@ func (m *PluginRelation) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *PluginRelation) UnmarshalBinary(b []byte) error { var res PluginRelation - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/plugin_version.go b/client/models/plugin_version.go index b4b5deda..211903f2 100644 --- a/client/models/plugin_version.go +++ b/client/models/plugin_version.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -100,7 +101,7 @@ func (m *PluginVersion) Validate(formats strfmt.Registry) error { } func (m *PluginVersion) validateIcon(formats strfmt.Registry) error { - if swag.IsZero(m.Icon) { // not required + if typeutils.IsZero(m.Icon) { // not required return nil } @@ -125,7 +126,7 @@ func (m *PluginVersion) validateID(formats strfmt.Registry) error { } func (m *PluginVersion) validateImages(formats strfmt.Registry) error { - if swag.IsZero(m.Images) { // not required + if typeutils.IsZero(m.Images) { // not required return nil } @@ -221,13 +222,13 @@ func (m *PluginVersion) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *PluginVersion) UnmarshalBinary(b []byte) error { var res PluginVersion - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/plugin_version_log.go b/client/models/plugin_version_log.go index 8c4b0791..94dd22b8 100644 --- a/client/models/plugin_version_log.go +++ b/client/models/plugin_version_log.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -78,13 +78,13 @@ func (m *PluginVersionLog) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *PluginVersionLog) UnmarshalBinary(b []byte) error { var res PluginVersionLog - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/plugin_widget.go b/client/models/plugin_widget.go index 74a2d925..496be83c 100644 --- a/client/models/plugin_widget.go +++ b/client/models/plugin_widget.go @@ -4,10 +4,12 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -30,6 +32,9 @@ type PluginWidget struct { // Required: true Placement any `json:"placement"` + // relation + Relation *PluginRelation `json:"relation,omitempty"` + // Type of the widget // Required: true Type *string `json:"type"` @@ -55,6 +60,10 @@ func (m *PluginWidget) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateRelation(formats); err != nil { + res = append(res, err) + } + if err := m.validateType(formats); err != nil { res = append(res, err) } @@ -70,7 +79,7 @@ func (m *PluginWidget) Validate(formats strfmt.Registry) error { } func (m *PluginWidget) validateID(formats strfmt.Registry) error { - if swag.IsZero(m.ID) { // not required + if typeutils.IsZero(m.ID) { // not required return nil } @@ -99,6 +108,29 @@ func (m *PluginWidget) validatePlacement(formats strfmt.Registry) error { return nil } +func (m *PluginWidget) validateRelation(formats strfmt.Registry) error { + if typeutils.IsZero(m.Relation) { // not required + return nil + } + + if m.Relation != nil { + if err := m.Relation.Validate(formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("relation") + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("relation") + } + + return err + } + } + + return nil +} + func (m *PluginWidget) validateType(formats strfmt.Registry) error { if err := validate.Required("type", "body", m.Type); err != nil { @@ -117,8 +149,42 @@ func (m *PluginWidget) validateWidget(formats strfmt.Registry) error { return nil } -// ContextValidate validates this plugin widget based on context it is used +// ContextValidate validate this plugin widget based on the context it is used func (m *PluginWidget) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateRelation(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PluginWidget) contextValidateRelation(ctx context.Context, formats strfmt.Registry) error { + + if m.Relation != nil { + + if typeutils.IsZero(m.Relation) { // not required + return nil + } + + if err := m.Relation.ContextValidate(ctx, formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("relation") + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("relation") + } + + return err + } + } + return nil } @@ -127,13 +193,13 @@ func (m *PluginWidget) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *PluginWidget) UnmarshalBinary(b []byte) error { var res PluginWidget - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/plugin_widget_data.go b/client/models/plugin_widget_data.go index 3da79e88..c2dbf399 100644 --- a/client/models/plugin_widget_data.go +++ b/client/models/plugin_widget_data.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -56,13 +56,13 @@ func (m *PluginWidgetData) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *PluginWidgetData) UnmarshalBinary(b []byte) error { var res PluginWidgetData - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/policy.go b/client/models/policy.go index 1cc80979..473db1a1 100644 --- a/client/models/policy.go +++ b/client/models/policy.go @@ -7,7 +7,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -98,7 +99,7 @@ func (m *Policy) validateCode(formats strfmt.Registry) error { } func (m *Policy) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required + if typeutils.IsZero(m.CreatedAt) { // not required return nil } @@ -132,7 +133,7 @@ func (m *Policy) validateID(formats strfmt.Registry) error { } func (m *Policy) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required + if typeutils.IsZero(m.UpdatedAt) { // not required return nil } @@ -153,13 +154,13 @@ func (m *Policy) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *Policy) UnmarshalBinary(b []byte) error { var res Policy - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/preparation.go b/client/models/preparation.go index b8409c8a..dd1f46fe 100644 --- a/client/models/preparation.go +++ b/client/models/preparation.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -156,13 +156,13 @@ func (m *Preparation) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *Preparation) UnmarshalBinary(b []byte) error { var res Preparation - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/project.go b/client/models/project.go index a66aa040..c6485e33 100644 --- a/client/models/project.go +++ b/client/models/project.go @@ -10,7 +10,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -173,7 +174,7 @@ func (m *Project) validateColor(formats strfmt.Registry) error { } func (m *Project) validateConfigRepositoryCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.ConfigRepositoryCanonical) { // not required + if typeutils.IsZero(m.ConfigRepositoryCanonical) { // not required return nil } @@ -212,7 +213,7 @@ func (m *Project) validateEnvironments(formats strfmt.Registry) error { } for i := 0; i < len(m.Environments); i++ { - if swag.IsZero(m.Environments[i]) { // not required + if typeutils.IsZero(m.Environments[i]) { // not required continue } @@ -276,7 +277,7 @@ func (m *Project) validateName(formats strfmt.Registry) error { } func (m *Project) validateOwner(formats strfmt.Registry) error { - if swag.IsZero(m.Owner) { // not required + if typeutils.IsZero(m.Owner) { // not required return nil } @@ -331,7 +332,7 @@ func (m *Project) validateVersionStatusItemsEnum(path, location string, value st } func (m *Project) validateVersionStatus(formats strfmt.Registry) error { - if swag.IsZero(m.VersionStatus) { // not required + if typeutils.IsZero(m.VersionStatus) { // not required return nil } @@ -371,7 +372,7 @@ func (m *Project) contextValidateEnvironments(ctx context.Context, formats strfm if m.Environments[i] != nil { - if swag.IsZero(m.Environments[i]) { // not required + if typeutils.IsZero(m.Environments[i]) { // not required return nil } @@ -398,7 +399,7 @@ func (m *Project) contextValidateOwner(ctx context.Context, formats strfmt.Regis if m.Owner != nil { - if swag.IsZero(m.Owner) { // not required + if typeutils.IsZero(m.Owner) { // not required return nil } @@ -424,13 +425,13 @@ func (m *Project) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *Project) UnmarshalBinary(b []byte) error { var res Project - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/project_environment.go b/client/models/project_environment.go index 5f7e00e9..a4818ce2 100644 --- a/client/models/project_environment.go +++ b/client/models/project_environment.go @@ -10,7 +10,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -147,12 +148,12 @@ func (m *ProjectEnvironment) validateCanonical(formats strfmt.Registry) error { } func (m *ProjectEnvironment) validateCloudAccounts(formats strfmt.Registry) error { - if swag.IsZero(m.CloudAccounts) { // not required + if typeutils.IsZero(m.CloudAccounts) { // not required return nil } for i := 0; i < len(m.CloudAccounts); i++ { - if swag.IsZero(m.CloudAccounts[i]) { // not required + if typeutils.IsZero(m.CloudAccounts[i]) { // not required continue } @@ -177,12 +178,12 @@ func (m *ProjectEnvironment) validateCloudAccounts(formats strfmt.Registry) erro } func (m *ProjectEnvironment) validateComponents(formats strfmt.Registry) error { - if swag.IsZero(m.Components) { // not required + if typeutils.IsZero(m.Components) { // not required return nil } for i := 0; i < len(m.Components); i++ { - if swag.IsZero(m.Components[i]) { // not required + if typeutils.IsZero(m.Components[i]) { // not required continue } @@ -220,7 +221,7 @@ func (m *ProjectEnvironment) validateCreatedAt(formats strfmt.Registry) error { } func (m *ProjectEnvironment) validateDescription(formats strfmt.Registry) error { - if swag.IsZero(m.Description) { // not required + if typeutils.IsZero(m.Description) { // not required return nil } @@ -232,7 +233,7 @@ func (m *ProjectEnvironment) validateDescription(formats strfmt.Registry) error } func (m *ProjectEnvironment) validateEnvironmentType(formats strfmt.Registry) error { - if swag.IsZero(m.EnvironmentType) { // not required + if typeutils.IsZero(m.EnvironmentType) { // not required return nil } @@ -268,7 +269,7 @@ func (m *ProjectEnvironment) validateID(formats strfmt.Registry) error { } func (m *ProjectEnvironment) validateName(formats strfmt.Registry) error { - if swag.IsZero(m.Name) { // not required + if typeutils.IsZero(m.Name) { // not required return nil } @@ -284,7 +285,7 @@ func (m *ProjectEnvironment) validateName(formats strfmt.Registry) error { } func (m *ProjectEnvironment) validateOwner(formats strfmt.Registry) error { - if swag.IsZero(m.Owner) { // not required + if typeutils.IsZero(m.Owner) { // not required return nil } @@ -339,7 +340,7 @@ func (m *ProjectEnvironment) validateVersionStatusItemsEnum(path, location strin } func (m *ProjectEnvironment) validateVersionStatus(formats strfmt.Registry) error { - if swag.IsZero(m.VersionStatus) { // not required + if typeutils.IsZero(m.VersionStatus) { // not required return nil } @@ -387,7 +388,7 @@ func (m *ProjectEnvironment) contextValidateCloudAccounts(ctx context.Context, f if m.CloudAccounts[i] != nil { - if swag.IsZero(m.CloudAccounts[i]) { // not required + if typeutils.IsZero(m.CloudAccounts[i]) { // not required return nil } @@ -416,7 +417,7 @@ func (m *ProjectEnvironment) contextValidateComponents(ctx context.Context, form if m.Components[i] != nil { - if swag.IsZero(m.Components[i]) { // not required + if typeutils.IsZero(m.Components[i]) { // not required return nil } @@ -443,7 +444,7 @@ func (m *ProjectEnvironment) contextValidateEnvironmentType(ctx context.Context, if m.EnvironmentType != nil { - if swag.IsZero(m.EnvironmentType) { // not required + if typeutils.IsZero(m.EnvironmentType) { // not required return nil } @@ -468,7 +469,7 @@ func (m *ProjectEnvironment) contextValidateOwner(ctx context.Context, formats s if m.Owner != nil { - if swag.IsZero(m.Owner) { // not required + if typeutils.IsZero(m.Owner) { // not required return nil } @@ -494,13 +495,13 @@ func (m *ProjectEnvironment) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *ProjectEnvironment) UnmarshalBinary(b []byte) error { var res ProjectEnvironment - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/project_simple.go b/client/models/project_simple.go index 4ee4334e..d97a1904 100644 --- a/client/models/project_simple.go +++ b/client/models/project_simple.go @@ -8,7 +8,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -198,7 +199,7 @@ func (m *ProjectSimple) validateName(formats strfmt.Registry) error { } func (m *ProjectSimple) validateOwner(formats strfmt.Registry) error { - if swag.IsZero(m.Owner) { // not required + if typeutils.IsZero(m.Owner) { // not required return nil } @@ -251,7 +252,7 @@ func (m *ProjectSimple) contextValidateOwner(ctx context.Context, formats strfmt if m.Owner != nil { - if swag.IsZero(m.Owner) { // not required + if typeutils.IsZero(m.Owner) { // not required return nil } @@ -277,13 +278,13 @@ func (m *ProjectSimple) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *ProjectSimple) UnmarshalBinary(b []byte) error { var res ProjectSimple - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/public_build_input.go b/client/models/public_build_input.go index d768f9b7..8d8b01f9 100644 --- a/client/models/public_build_input.go +++ b/client/models/public_build_input.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -107,13 +107,13 @@ func (m *PublicBuildInput) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *PublicBuildInput) UnmarshalBinary(b []byte) error { var res PublicBuildInput - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/public_build_output.go b/client/models/public_build_output.go index a2aadf92..8cccad86 100644 --- a/client/models/public_build_output.go +++ b/client/models/public_build_output.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -73,13 +73,13 @@ func (m *PublicBuildOutput) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *PublicBuildOutput) UnmarshalBinary(b []byte) error { var res PublicBuildOutput - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/public_plan.go b/client/models/public_plan.go index 55bdbf48..68533410 100644 --- a/client/models/public_plan.go +++ b/client/models/public_plan.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -73,13 +73,13 @@ func (m *PublicPlan) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *PublicPlan) UnmarshalBinary(b []byte) error { var res PublicPlan - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/put_plan.go b/client/models/put_plan.go index cf9cc077..b4ad60d3 100644 --- a/client/models/put_plan.go +++ b/client/models/put_plan.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -107,12 +108,12 @@ func (m *PutPlan) validateType(formats strfmt.Registry) error { } func (m *PutPlan) validateVersionedResourceTypes(formats strfmt.Registry) error { - if swag.IsZero(m.VersionedResourceTypes) { // not required + if typeutils.IsZero(m.VersionedResourceTypes) { // not required return nil } for i := 0; i < len(m.VersionedResourceTypes); i++ { - if swag.IsZero(m.VersionedResourceTypes[i]) { // not required + if typeutils.IsZero(m.VersionedResourceTypes[i]) { // not required continue } @@ -156,7 +157,7 @@ func (m *PutPlan) contextValidateVersionedResourceTypes(ctx context.Context, for if m.VersionedResourceTypes[i] != nil { - if swag.IsZero(m.VersionedResourceTypes[i]) { // not required + if typeutils.IsZero(m.VersionedResourceTypes[i]) { // not required return nil } @@ -184,13 +185,13 @@ func (m *PutPlan) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *PutPlan) UnmarshalBinary(b []byte) error { var res PutPlan - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/resource.go b/client/models/resource.go index 11efdee7..f0729398 100644 --- a/client/models/resource.go +++ b/client/models/resource.go @@ -8,7 +8,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -78,7 +79,7 @@ func (m *Resource) Validate(formats strfmt.Registry) error { } func (m *Resource) validateBuild(formats strfmt.Registry) error { - if swag.IsZero(m.Build) { // not required + if typeutils.IsZero(m.Build) { // not required return nil } @@ -136,7 +137,7 @@ func (m *Resource) contextValidateBuild(ctx context.Context, formats strfmt.Regi if m.Build != nil { - if swag.IsZero(m.Build) { // not required + if typeutils.IsZero(m.Build) { // not required return nil } @@ -162,13 +163,13 @@ func (m *Resource) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *Resource) UnmarshalBinary(b []byte) error { var res Resource - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/resource_version.go b/client/models/resource_version.go index 2a89fb73..318f0f5b 100644 --- a/client/models/resource_version.go +++ b/client/models/resource_version.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -81,12 +82,12 @@ func (m *ResourceVersion) validateID(formats strfmt.Registry) error { } func (m *ResourceVersion) validateMetadata(formats strfmt.Registry) error { - if swag.IsZero(m.Metadata) { // not required + if typeutils.IsZero(m.Metadata) { // not required return nil } for i := 0; i < len(m.Metadata); i++ { - if swag.IsZero(m.Metadata[i]) { // not required + if typeutils.IsZero(m.Metadata[i]) { // not required continue } @@ -139,7 +140,7 @@ func (m *ResourceVersion) contextValidateMetadata(ctx context.Context, formats s if m.Metadata[i] != nil { - if swag.IsZero(m.Metadata[i]) { // not required + if typeutils.IsZero(m.Metadata[i]) { // not required return nil } @@ -167,13 +168,13 @@ func (m *ResourceVersion) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *ResourceVersion) UnmarshalBinary(b []byte) error { var res ResourceVersion - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/role.go b/client/models/role.go index c1123904..329abefe 100644 --- a/client/models/role.go +++ b/client/models/role.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -123,7 +124,7 @@ func (m *Role) validateCanonical(formats strfmt.Registry) error { } func (m *Role) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required + if typeutils.IsZero(m.CreatedAt) { // not required return nil } @@ -189,7 +190,7 @@ func (m *Role) validateRules(formats strfmt.Registry) error { } for i := 0; i < len(m.Rules); i++ { - if swag.IsZero(m.Rules[i]) { // not required + if typeutils.IsZero(m.Rules[i]) { // not required continue } @@ -214,7 +215,7 @@ func (m *Role) validateRules(formats strfmt.Registry) error { } func (m *Role) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required + if typeutils.IsZero(m.UpdatedAt) { // not required return nil } @@ -245,7 +246,7 @@ func (m *Role) contextValidateRules(ctx context.Context, formats strfmt.Registry if m.Rules[i] != nil { - if swag.IsZero(m.Rules[i]) { // not required + if typeutils.IsZero(m.Rules[i]) { // not required return nil } @@ -273,13 +274,13 @@ func (m *Role) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *Role) UnmarshalBinary(b []byte) error { var res Role - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/rule.go b/client/models/rule.go index 8779d931..cb183613 100644 --- a/client/models/rule.go +++ b/client/models/rule.go @@ -8,7 +8,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -131,13 +131,13 @@ func (m *Rule) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *Rule) UnmarshalBinary(b []byte) error { var res Rule - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/s_c_config.go b/client/models/s_c_config.go index 2999c138..7875884f 100644 --- a/client/models/s_c_config.go +++ b/client/models/s_c_config.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -46,7 +47,7 @@ func (m *SCConfig) validateConfigs(formats strfmt.Registry) error { } for i := 0; i < len(m.Configs); i++ { - if swag.IsZero(m.Configs[i]) { // not required + if typeutils.IsZero(m.Configs[i]) { // not required continue } @@ -90,7 +91,7 @@ func (m *SCConfig) contextValidateConfigs(ctx context.Context, formats strfmt.Re if m.Configs[i] != nil { - if swag.IsZero(m.Configs[i]) { // not required + if typeutils.IsZero(m.Configs[i]) { // not required return nil } @@ -118,13 +119,13 @@ func (m *SCConfig) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *SCConfig) UnmarshalBinary(b []byte) error { var res SCConfig - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/s_c_config_custom_config.go b/client/models/s_c_config_custom_config.go index 8503f8ef..906bbf21 100644 --- a/client/models/s_c_config_custom_config.go +++ b/client/models/s_c_config_custom_config.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -54,7 +55,7 @@ func (m *SCConfigCustomConfig) validateTemplates(formats strfmt.Registry) error } for i := 0; i < len(m.Templates); i++ { - if swag.IsZero(m.Templates[i]) { // not required + if typeutils.IsZero(m.Templates[i]) { // not required continue } @@ -107,7 +108,7 @@ func (m *SCConfigCustomConfig) contextValidateTemplates(ctx context.Context, for if m.Templates[i] != nil { - if swag.IsZero(m.Templates[i]) { // not required + if typeutils.IsZero(m.Templates[i]) { // not required return nil } @@ -135,13 +136,13 @@ func (m *SCConfigCustomConfig) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *SCConfigCustomConfig) UnmarshalBinary(b []byte) error { var res SCConfigCustomConfig - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/s_c_config_form_data.go b/client/models/s_c_config_form_data.go index bfe2f083..1a2944dd 100644 --- a/client/models/s_c_config_form_data.go +++ b/client/models/s_c_config_form_data.go @@ -9,7 +9,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -69,7 +69,7 @@ func (m SCConfigFormData) ContextValidate(ctx context.Context, formats strfmt.Re for i := 0; i < len(m[k][kk]); i++ { - if swag.IsZero(m[k][kk][i]) { // not required + if typeutils.IsZero(m[k][kk][i]) { // not required return nil } diff --git a/client/models/s_c_config_path_config.go b/client/models/s_c_config_path_config.go index b5ab2ba0..49d243bf 100644 --- a/client/models/s_c_config_path_config.go +++ b/client/models/s_c_config_path_config.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -73,13 +73,13 @@ func (m *SCConfigPathConfig) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *SCConfigPathConfig) UnmarshalBinary(b []byte) error { var res SCConfigPathConfig - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/s_c_config_path_dest_config.go b/client/models/s_c_config_path_dest_config.go index 49bdee97..d747b048 100644 --- a/client/models/s_c_config_path_dest_config.go +++ b/client/models/s_c_config_path_dest_config.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -90,13 +90,13 @@ func (m *SCConfigPathDestConfig) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *SCConfigPathDestConfig) UnmarshalBinary(b []byte) error { var res SCConfigPathDestConfig - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/s_c_config_pipeline_config.go b/client/models/s_c_config_pipeline_config.go index f15c2e7d..7121c9a5 100644 --- a/client/models/s_c_config_pipeline_config.go +++ b/client/models/s_c_config_pipeline_config.go @@ -8,7 +8,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -159,13 +159,13 @@ func (m *SCConfigPipelineConfig) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *SCConfigPipelineConfig) UnmarshalBinary(b []byte) error { var res SCConfigPipelineConfig - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/s_c_optional_template_config.go b/client/models/s_c_optional_template_config.go index 6b0c146f..a1a743c1 100644 --- a/client/models/s_c_optional_template_config.go +++ b/client/models/s_c_optional_template_config.go @@ -6,7 +6,7 @@ import ( "context" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" ) // SCOptionalTemplateConfig An optional configuration of a single template @@ -36,13 +36,13 @@ func (m *SCOptionalTemplateConfig) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *SCOptionalTemplateConfig) UnmarshalBinary(b []byte) error { var res SCOptionalTemplateConfig - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/s_c_template_config.go b/client/models/s_c_template_config.go index b220b4f8..e8fa6928 100644 --- a/client/models/s_c_template_config.go +++ b/client/models/s_c_template_config.go @@ -8,7 +8,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -68,7 +69,7 @@ func (m *SCTemplateConfig) Validate(formats strfmt.Registry) error { } func (m *SCTemplateConfig) validateConfig(formats strfmt.Registry) error { - if swag.IsZero(m.Config) { // not required + if typeutils.IsZero(m.Config) { // not required return nil } @@ -126,7 +127,7 @@ func (m *SCTemplateConfig) contextValidateConfig(ctx context.Context, formats st if m.Config != nil { - if swag.IsZero(m.Config) { // not required + if typeutils.IsZero(m.Config) { // not required return nil } @@ -152,13 +153,13 @@ func (m *SCTemplateConfig) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *SCTemplateConfig) UnmarshalBinary(b []byte) error { var res SCTemplateConfig - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/service_catalog.go b/client/models/service_catalog.go index 0f657a68..09fd50fd 100644 --- a/client/models/service_catalog.go +++ b/client/models/service_catalog.go @@ -4,13 +4,13 @@ package models import ( "context" - "encoding/json" stderrors "errors" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -68,10 +68,6 @@ type ServiceCatalog struct { // Format: uri Image strfmt.URI `json:"image,omitempty"` - // The import process status. - // Enum: ["succeeded","failed","importing"] - ImportStatus string `json:"import_status,omitempty"` - // keywords // Required: true Keywords []string `json:"keywords"` @@ -167,10 +163,6 @@ func (m *ServiceCatalog) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateImportStatus(formats); err != nil { - res = append(res, err) - } - if err := m.validateKeywords(formats); err != nil { res = append(res, err) } @@ -256,12 +248,12 @@ func (m *ServiceCatalog) validateCanonical(formats strfmt.Registry) error { } func (m *ServiceCatalog) validateCloudProviders(formats strfmt.Registry) error { - if swag.IsZero(m.CloudProviders) { // not required + if typeutils.IsZero(m.CloudProviders) { // not required return nil } for i := 0; i < len(m.CloudProviders); i++ { - if swag.IsZero(m.CloudProviders[i]) { // not required + if typeutils.IsZero(m.CloudProviders[i]) { // not required continue } @@ -286,7 +278,7 @@ func (m *ServiceCatalog) validateCloudProviders(formats strfmt.Registry) error { } func (m *ServiceCatalog) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required + if typeutils.IsZero(m.CreatedAt) { // not required return nil } @@ -298,12 +290,12 @@ func (m *ServiceCatalog) validateCreatedAt(formats strfmt.Registry) error { } func (m *ServiceCatalog) validateDependencies(formats strfmt.Registry) error { - if swag.IsZero(m.Dependencies) { // not required + if typeutils.IsZero(m.Dependencies) { // not required return nil } for i := 0; i < len(m.Dependencies); i++ { - if swag.IsZero(m.Dependencies[i]) { // not required + if typeutils.IsZero(m.Dependencies[i]) { // not required continue } @@ -359,7 +351,7 @@ func (m *ServiceCatalog) validateID(formats strfmt.Registry) error { } func (m *ServiceCatalog) validateImage(formats strfmt.Registry) error { - if swag.IsZero(m.Image) { // not required + if typeutils.IsZero(m.Image) { // not required return nil } @@ -370,51 +362,6 @@ func (m *ServiceCatalog) validateImage(formats strfmt.Registry) error { return nil } -var serviceCatalogTypeImportStatusPropEnum []any - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["succeeded","failed","importing"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - serviceCatalogTypeImportStatusPropEnum = append(serviceCatalogTypeImportStatusPropEnum, v) - } -} - -const ( - - // ServiceCatalogImportStatusSucceeded captures enum value "succeeded" - ServiceCatalogImportStatusSucceeded string = "succeeded" - - // ServiceCatalogImportStatusFailed captures enum value "failed" - ServiceCatalogImportStatusFailed string = "failed" - - // ServiceCatalogImportStatusImporting captures enum value "importing" - ServiceCatalogImportStatusImporting string = "importing" -) - -// prop value enum -func (m *ServiceCatalog) validateImportStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, serviceCatalogTypeImportStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *ServiceCatalog) validateImportStatus(formats strfmt.Registry) error { - if swag.IsZero(m.ImportStatus) { // not required - return nil - } - - // value enum - if err := m.validateImportStatusEnum("import_status", "body", m.ImportStatus); err != nil { - return err - } - - return nil -} - func (m *ServiceCatalog) validateKeywords(formats strfmt.Registry) error { if err := validate.Required("keywords", "body", m.Keywords); err != nil { @@ -473,7 +420,7 @@ func (m *ServiceCatalog) validateRef(formats strfmt.Registry) error { } func (m *ServiceCatalog) validateServiceCatalogSourceCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceCatalogSourceCanonical) { // not required + if typeutils.IsZero(m.ServiceCatalogSourceCanonical) { // not required return nil } @@ -493,7 +440,7 @@ func (m *ServiceCatalog) validateServiceCatalogSourceCanonical(formats strfmt.Re } func (m *ServiceCatalog) validateTeam(formats strfmt.Registry) error { - if swag.IsZero(m.Team) { // not required + if typeutils.IsZero(m.Team) { // not required return nil } @@ -516,12 +463,12 @@ func (m *ServiceCatalog) validateTeam(formats strfmt.Registry) error { } func (m *ServiceCatalog) validateTechnologies(formats strfmt.Registry) error { - if swag.IsZero(m.Technologies) { // not required + if typeutils.IsZero(m.Technologies) { // not required return nil } for i := 0; i < len(m.Technologies); i++ { - if swag.IsZero(m.Technologies[i]) { // not required + if typeutils.IsZero(m.Technologies[i]) { // not required continue } @@ -555,7 +502,7 @@ func (m *ServiceCatalog) validateTrusted(formats strfmt.Registry) error { } func (m *ServiceCatalog) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required + if typeutils.IsZero(m.UpdatedAt) { // not required return nil } @@ -616,7 +563,7 @@ func (m *ServiceCatalog) contextValidateCloudProviders(ctx context.Context, form if m.CloudProviders[i] != nil { - if swag.IsZero(m.CloudProviders[i]) { // not required + if typeutils.IsZero(m.CloudProviders[i]) { // not required return nil } @@ -645,7 +592,7 @@ func (m *ServiceCatalog) contextValidateDependencies(ctx context.Context, format if m.Dependencies[i] != nil { - if swag.IsZero(m.Dependencies[i]) { // not required + if typeutils.IsZero(m.Dependencies[i]) { // not required return nil } @@ -672,7 +619,7 @@ func (m *ServiceCatalog) contextValidateTeam(ctx context.Context, formats strfmt if m.Team != nil { - if swag.IsZero(m.Team) { // not required + if typeutils.IsZero(m.Team) { // not required return nil } @@ -699,7 +646,7 @@ func (m *ServiceCatalog) contextValidateTechnologies(ctx context.Context, format if m.Technologies[i] != nil { - if swag.IsZero(m.Technologies[i]) { // not required + if typeutils.IsZero(m.Technologies[i]) { // not required return nil } @@ -727,13 +674,13 @@ func (m *ServiceCatalog) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *ServiceCatalog) UnmarshalBinary(b []byte) error { var res ServiceCatalog - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/service_catalog_changes.go b/client/models/service_catalog_changes.go index 859309e7..82a984ce 100644 --- a/client/models/service_catalog_changes.go +++ b/client/models/service_catalog_changes.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -76,7 +77,7 @@ func (m *ServiceCatalogChanges) validateCreated(formats strfmt.Registry) error { } for i := 0; i < len(m.Created); i++ { - if swag.IsZero(m.Created[i]) { // not required + if typeutils.IsZero(m.Created[i]) { // not required continue } @@ -107,7 +108,7 @@ func (m *ServiceCatalogChanges) validateDeleted(formats strfmt.Registry) error { } for i := 0; i < len(m.Deleted); i++ { - if swag.IsZero(m.Deleted[i]) { // not required + if typeutils.IsZero(m.Deleted[i]) { // not required continue } @@ -132,12 +133,12 @@ func (m *ServiceCatalogChanges) validateDeleted(formats strfmt.Registry) error { } func (m *ServiceCatalogChanges) validateErrored(formats strfmt.Registry) error { - if swag.IsZero(m.Errored) { // not required + if typeutils.IsZero(m.Errored) { // not required return nil } for i := 0; i < len(m.Errored); i++ { - if swag.IsZero(m.Errored[i]) { // not required + if typeutils.IsZero(m.Errored[i]) { // not required continue } @@ -168,7 +169,7 @@ func (m *ServiceCatalogChanges) validateUpdated(formats strfmt.Registry) error { } for i := 0; i < len(m.Updated); i++ { - if swag.IsZero(m.Updated[i]) { // not required + if typeutils.IsZero(m.Updated[i]) { // not required continue } @@ -193,12 +194,12 @@ func (m *ServiceCatalogChanges) validateUpdated(formats strfmt.Registry) error { } func (m *ServiceCatalogChanges) validateVersions(formats strfmt.Registry) error { - if swag.IsZero(m.Versions) { // not required + if typeutils.IsZero(m.Versions) { // not required return nil } for i := 0; i < len(m.Versions); i++ { - if swag.IsZero(m.Versions[i]) { // not required + if typeutils.IsZero(m.Versions[i]) { // not required continue } @@ -258,7 +259,7 @@ func (m *ServiceCatalogChanges) contextValidateCreated(ctx context.Context, form if m.Created[i] != nil { - if swag.IsZero(m.Created[i]) { // not required + if typeutils.IsZero(m.Created[i]) { // not required return nil } @@ -287,7 +288,7 @@ func (m *ServiceCatalogChanges) contextValidateDeleted(ctx context.Context, form if m.Deleted[i] != nil { - if swag.IsZero(m.Deleted[i]) { // not required + if typeutils.IsZero(m.Deleted[i]) { // not required return nil } @@ -316,7 +317,7 @@ func (m *ServiceCatalogChanges) contextValidateErrored(ctx context.Context, form if m.Errored[i] != nil { - if swag.IsZero(m.Errored[i]) { // not required + if typeutils.IsZero(m.Errored[i]) { // not required return nil } @@ -345,7 +346,7 @@ func (m *ServiceCatalogChanges) contextValidateUpdated(ctx context.Context, form if m.Updated[i] != nil { - if swag.IsZero(m.Updated[i]) { // not required + if typeutils.IsZero(m.Updated[i]) { // not required return nil } @@ -374,7 +375,7 @@ func (m *ServiceCatalogChanges) contextValidateVersions(ctx context.Context, for if m.Versions[i] != nil { - if swag.IsZero(m.Versions[i]) { // not required + if typeutils.IsZero(m.Versions[i]) { // not required return nil } @@ -402,13 +403,13 @@ func (m *ServiceCatalogChanges) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *ServiceCatalogChanges) UnmarshalBinary(b []byte) error { var res ServiceCatalogChanges - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/service_catalog_config.go b/client/models/service_catalog_config.go index 59e5fd30..916b9244 100644 --- a/client/models/service_catalog_config.go +++ b/client/models/service_catalog_config.go @@ -8,7 +8,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -91,7 +92,7 @@ func (m *ServiceCatalogConfig) Validate(formats strfmt.Registry) error { } func (m *ServiceCatalogConfig) validateAnsible(formats strfmt.Registry) error { - if swag.IsZero(m.Ansible) { // not required + if typeutils.IsZero(m.Ansible) { // not required return nil } @@ -123,7 +124,7 @@ func (m *ServiceCatalogConfig) validateCloudProvider(formats strfmt.Registry) er } func (m *ServiceCatalogConfig) validateCustom(formats strfmt.Registry) error { - if swag.IsZero(m.Custom) { // not required + if typeutils.IsZero(m.Custom) { // not required return nil } @@ -155,7 +156,7 @@ func (m *ServiceCatalogConfig) validateDescription(formats strfmt.Registry) erro } func (m *ServiceCatalogConfig) validateForms(formats strfmt.Registry) error { - if swag.IsZero(m.Forms) { // not required + if typeutils.IsZero(m.Forms) { // not required return nil } @@ -211,7 +212,7 @@ func (m *ServiceCatalogConfig) validatePipeline(formats strfmt.Registry) error { } func (m *ServiceCatalogConfig) validateTerraform(formats strfmt.Registry) error { - if swag.IsZero(m.Terraform) { // not required + if typeutils.IsZero(m.Terraform) { // not required return nil } @@ -265,7 +266,7 @@ func (m *ServiceCatalogConfig) ContextValidate(ctx context.Context, formats strf func (m *ServiceCatalogConfig) contextValidateAnsible(ctx context.Context, formats strfmt.Registry) error { - if swag.IsZero(m.Ansible) { // not required + if typeutils.IsZero(m.Ansible) { // not required return nil } @@ -289,7 +290,7 @@ func (m *ServiceCatalogConfig) contextValidateCustom(ctx context.Context, format if m.Custom != nil { - if swag.IsZero(m.Custom) { // not required + if typeutils.IsZero(m.Custom) { // not required return nil } @@ -314,7 +315,7 @@ func (m *ServiceCatalogConfig) contextValidateForms(ctx context.Context, formats if m.Forms != nil { - if swag.IsZero(m.Forms) { // not required + if typeutils.IsZero(m.Forms) { // not required return nil } @@ -358,7 +359,7 @@ func (m *ServiceCatalogConfig) contextValidatePipeline(ctx context.Context, form func (m *ServiceCatalogConfig) contextValidateTerraform(ctx context.Context, formats strfmt.Registry) error { - if swag.IsZero(m.Terraform) { // not required + if typeutils.IsZero(m.Terraform) { // not required return nil } @@ -383,13 +384,13 @@ func (m *ServiceCatalogConfig) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *ServiceCatalogConfig) UnmarshalBinary(b []byte) error { var res ServiceCatalogConfig - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/service_catalog_dependencies_validation_result.go b/client/models/service_catalog_dependencies_validation_result.go index f9a9dc0d..13fb377f 100644 --- a/client/models/service_catalog_dependencies_validation_result.go +++ b/client/models/service_catalog_dependencies_validation_result.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -73,13 +73,13 @@ func (m *ServiceCatalogDependenciesValidationResult) MarshalBinary() ([]byte, er if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *ServiceCatalogDependenciesValidationResult) UnmarshalBinary(b []byte) error { var res ServiceCatalogDependenciesValidationResult - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/service_catalog_dependency.go b/client/models/service_catalog_dependency.go index ac47d70b..d5b1d6c1 100644 --- a/client/models/service_catalog_dependency.go +++ b/client/models/service_catalog_dependency.go @@ -6,7 +6,7 @@ import ( "context" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" ) // ServiceCatalogDependency ServiceCatalogDependency @@ -38,13 +38,13 @@ func (m *ServiceCatalogDependency) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *ServiceCatalogDependency) UnmarshalBinary(b []byte) error { var res ServiceCatalogDependency - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/service_catalog_source.go b/client/models/service_catalog_source.go index ec5b59cd..94c24c5a 100644 --- a/client/models/service_catalog_source.go +++ b/client/models/service_catalog_source.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -159,7 +160,7 @@ func (m *ServiceCatalogSource) validateCanonical(formats strfmt.Registry) error } func (m *ServiceCatalogSource) validateChanges(formats strfmt.Registry) error { - if swag.IsZero(m.Changes) { // not required + if typeutils.IsZero(m.Changes) { // not required return nil } @@ -182,7 +183,7 @@ func (m *ServiceCatalogSource) validateChanges(formats strfmt.Registry) error { } func (m *ServiceCatalogSource) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required + if typeutils.IsZero(m.CreatedAt) { // not required return nil } @@ -194,7 +195,7 @@ func (m *ServiceCatalogSource) validateCreatedAt(formats strfmt.Registry) error } func (m *ServiceCatalogSource) validateCredentialCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.CredentialCanonical) { // not required + if typeutils.IsZero(m.CredentialCanonical) { // not required return nil } @@ -260,7 +261,7 @@ func (m *ServiceCatalogSource) validateOwner(formats strfmt.Registry) error { } func (m *ServiceCatalogSource) validateRefreshedAt(formats strfmt.Registry) error { - if swag.IsZero(m.RefreshedAt) { // not required + if typeutils.IsZero(m.RefreshedAt) { // not required return nil } @@ -272,12 +273,12 @@ func (m *ServiceCatalogSource) validateRefreshedAt(formats strfmt.Registry) erro } func (m *ServiceCatalogSource) validateServiceCatalogs(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceCatalogs) { // not required + if typeutils.IsZero(m.ServiceCatalogs) { // not required return nil } for i := 0; i < len(m.ServiceCatalogs); i++ { - if swag.IsZero(m.ServiceCatalogs[i]) { // not required + if typeutils.IsZero(m.ServiceCatalogs[i]) { // not required continue } @@ -315,7 +316,7 @@ func (m *ServiceCatalogSource) validateStackCount(formats strfmt.Registry) error } func (m *ServiceCatalogSource) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required + if typeutils.IsZero(m.UpdatedAt) { // not required return nil } @@ -365,7 +366,7 @@ func (m *ServiceCatalogSource) contextValidateChanges(ctx context.Context, forma if m.Changes != nil { - if swag.IsZero(m.Changes) { // not required + if typeutils.IsZero(m.Changes) { // not required return nil } @@ -413,7 +414,7 @@ func (m *ServiceCatalogSource) contextValidateServiceCatalogs(ctx context.Contex if m.ServiceCatalogs[i] != nil { - if swag.IsZero(m.ServiceCatalogs[i]) { // not required + if typeutils.IsZero(m.ServiceCatalogs[i]) { // not required return nil } @@ -441,13 +442,13 @@ func (m *ServiceCatalogSource) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *ServiceCatalogSource) UnmarshalBinary(b []byte) error { var res ServiceCatalogSource - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/service_catalog_source_version.go b/client/models/service_catalog_source_version.go index 5b653fcb..f94a2883 100644 --- a/client/models/service_catalog_source_version.go +++ b/client/models/service_catalog_source_version.go @@ -8,7 +8,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -245,13 +245,13 @@ func (m *ServiceCatalogSourceVersion) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *ServiceCatalogSourceVersion) UnmarshalBinary(b []byte) error { var res ServiceCatalogSourceVersion - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/service_catalog_technology.go b/client/models/service_catalog_technology.go index 7baf8d85..d6fe82cc 100644 --- a/client/models/service_catalog_technology.go +++ b/client/models/service_catalog_technology.go @@ -6,7 +6,7 @@ import ( "context" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" ) // ServiceCatalogTechnology ServiceCatalogTechnology @@ -38,13 +38,13 @@ func (m *ServiceCatalogTechnology) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *ServiceCatalogTechnology) UnmarshalBinary(b []byte) error { var res ServiceCatalogTechnology - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/simple_member_org.go b/client/models/simple_member_org.go index b42d24a3..32ffaf01 100644 --- a/client/models/simple_member_org.go +++ b/client/models/simple_member_org.go @@ -7,7 +7,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -133,7 +134,7 @@ func (m *SimpleMemberOrg) validateID(formats strfmt.Registry) error { } func (m *SimpleMemberOrg) validateLastLoginAt(formats strfmt.Registry) error { - if swag.IsZero(m.LastLoginAt) { // not required + if typeutils.IsZero(m.LastLoginAt) { // not required return nil } @@ -145,7 +146,7 @@ func (m *SimpleMemberOrg) validateLastLoginAt(formats strfmt.Registry) error { } func (m *SimpleMemberOrg) validatePictureURL(formats strfmt.Registry) error { - if swag.IsZero(m.PictureURL) { // not required + if typeutils.IsZero(m.PictureURL) { // not required return nil } @@ -157,7 +158,7 @@ func (m *SimpleMemberOrg) validatePictureURL(formats strfmt.Registry) error { } func (m *SimpleMemberOrg) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required + if typeutils.IsZero(m.UpdatedAt) { // not required return nil } @@ -169,7 +170,7 @@ func (m *SimpleMemberOrg) validateUpdatedAt(formats strfmt.Registry) error { } func (m *SimpleMemberOrg) validateUsername(formats strfmt.Registry) error { - if swag.IsZero(m.Username) { // not required + if typeutils.IsZero(m.Username) { // not required return nil } @@ -198,13 +199,13 @@ func (m *SimpleMemberOrg) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *SimpleMemberOrg) UnmarshalBinary(b []byte) error { var res SimpleMemberOrg - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/simple_team.go b/client/models/simple_team.go index 3bd4be59..e0412d97 100644 --- a/client/models/simple_team.go +++ b/client/models/simple_team.go @@ -8,7 +8,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -148,7 +149,7 @@ func (m *SimpleTeam) validateName(formats strfmt.Registry) error { } func (m *SimpleTeam) validateOwner(formats strfmt.Registry) error { - if swag.IsZero(m.Owner) { // not required + if typeutils.IsZero(m.Owner) { // not required return nil } @@ -201,7 +202,7 @@ func (m *SimpleTeam) contextValidateOwner(ctx context.Context, formats strfmt.Re if m.Owner != nil { - if swag.IsZero(m.Owner) { // not required + if typeutils.IsZero(m.Owner) { // not required return nil } @@ -227,13 +228,13 @@ func (m *SimpleTeam) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *SimpleTeam) UnmarshalBinary(b []byte) error { var res SimpleTeam - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/stack_use_case.go b/client/models/stack_use_case.go index 8fdcb13c..995984af 100644 --- a/client/models/stack_use_case.go +++ b/client/models/stack_use_case.go @@ -7,7 +7,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -61,7 +62,7 @@ func (m *StackUseCase) Validate(formats strfmt.Registry) error { } func (m *StackUseCase) validateCloudProvider(formats strfmt.Registry) error { - if swag.IsZero(m.CloudProvider) { // not required + if typeutils.IsZero(m.CloudProvider) { // not required return nil } @@ -116,13 +117,13 @@ func (m *StackUseCase) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *StackUseCase) UnmarshalBinary(b []byte) error { var res StackUseCase - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/state.go b/client/models/state.go index 753c4d03..d13d3820 100644 --- a/client/models/state.go +++ b/client/models/state.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" ) // State State @@ -53,12 +54,12 @@ func (m *State) Validate(formats strfmt.Registry) error { } func (m *State) validateResources(formats strfmt.Registry) error { - if swag.IsZero(m.Resources) { // not required + if typeutils.IsZero(m.Resources) { // not required return nil } for i := 0; i < len(m.Resources); i++ { - if swag.IsZero(m.Resources[i]) { // not required + if typeutils.IsZero(m.Resources[i]) { // not required continue } @@ -102,7 +103,7 @@ func (m *State) contextValidateResources(ctx context.Context, formats strfmt.Reg if m.Resources[i] != nil { - if swag.IsZero(m.Resources[i]) { // not required + if typeutils.IsZero(m.Resources[i]) { // not required return nil } @@ -130,13 +131,13 @@ func (m *State) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *State) UnmarshalBinary(b []byte) error { var res State - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/state_lock.go b/client/models/state_lock.go index 6ef83586..f19e1cdd 100644 --- a/client/models/state_lock.go +++ b/client/models/state_lock.go @@ -6,7 +6,7 @@ import ( "context" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" ) // StateLock State Lock @@ -50,13 +50,13 @@ func (m *StateLock) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *StateLock) UnmarshalBinary(b []byte) error { var res StateLock - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/state_resource.go b/client/models/state_resource.go index b4cdc3e3..710fdc2f 100644 --- a/client/models/state_resource.go +++ b/client/models/state_resource.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -77,7 +78,7 @@ func (m *StateResource) Validate(formats strfmt.Registry) error { } func (m *StateResource) validateImage(formats strfmt.Registry) error { - if swag.IsZero(m.Image) { // not required + if typeutils.IsZero(m.Image) { // not required return nil } @@ -89,12 +90,12 @@ func (m *StateResource) validateImage(formats strfmt.Registry) error { } func (m *StateResource) validateInstances(formats strfmt.Registry) error { - if swag.IsZero(m.Instances) { // not required + if typeutils.IsZero(m.Instances) { // not required return nil } for i := 0; i < len(m.Instances); i++ { - if swag.IsZero(m.Instances[i]) { // not required + if typeutils.IsZero(m.Instances[i]) { // not required continue } @@ -138,7 +139,7 @@ func (m *StateResource) contextValidateInstances(ctx context.Context, formats st if m.Instances[i] != nil { - if swag.IsZero(m.Instances[i]) { // not required + if typeutils.IsZero(m.Instances[i]) { // not required return nil } @@ -166,13 +167,13 @@ func (m *StateResource) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *StateResource) UnmarshalBinary(b []byte) error { var res StateResource - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/state_resource_instances.go b/client/models/state_resource_instances.go index b5d092b7..4b223ea7 100644 --- a/client/models/state_resource_instances.go +++ b/client/models/state_resource_instances.go @@ -6,7 +6,7 @@ import ( "context" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" ) // StateResourceInstances State Resource Instances @@ -38,13 +38,13 @@ func (m *StateResourceInstances) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *StateResourceInstances) UnmarshalBinary(b []byte) error { var res StateResourceInstances - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/subscription.go b/client/models/subscription.go index 0cece71b..68978f56 100644 --- a/client/models/subscription.go +++ b/client/models/subscription.go @@ -8,7 +8,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -65,7 +66,7 @@ func (m *Subscription) Validate(formats strfmt.Registry) error { } func (m *Subscription) validateCurrentMembers(formats strfmt.Registry) error { - if swag.IsZero(m.CurrentMembers) { // not required + if typeutils.IsZero(m.CurrentMembers) { // not required return nil } @@ -90,7 +91,7 @@ func (m *Subscription) validateExpiresAt(formats strfmt.Registry) error { } func (m *Subscription) validateMembersCount(formats strfmt.Registry) error { - if swag.IsZero(m.MembersCount) { // not required + if typeutils.IsZero(m.MembersCount) { // not required return nil } @@ -165,13 +166,13 @@ func (m *Subscription) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *Subscription) UnmarshalBinary(b []byte) error { var res Subscription - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/subscription_plan.go b/client/models/subscription_plan.go index 3c7f1ae5..d4ef4be2 100644 --- a/client/models/subscription_plan.go +++ b/client/models/subscription_plan.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -93,13 +93,13 @@ func (m *SubscriptionPlan) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *SubscriptionPlan) UnmarshalBinary(b []byte) error { var res SubscriptionPlan - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/summary.go b/client/models/summary.go index a4e3802a..58c51342 100644 --- a/client/models/summary.go +++ b/client/models/summary.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -190,13 +190,13 @@ func (m *Summary) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *Summary) UnmarshalBinary(b []byte) error { var res Summary - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/swift_remote_t_f_state.go b/client/models/swift_remote_t_f_state.go index 6ca80198..40c8e3f0 100644 --- a/client/models/swift_remote_t_f_state.go +++ b/client/models/swift_remote_t_f_state.go @@ -9,7 +9,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -154,7 +154,7 @@ func (m SwiftRemoteTFState) MarshalJSON() ([]byte, error) { return nil, err } - return swag.ConcatJSON(b1, b2, b3), nil + return jsonutils.ConcatJSON(b1, b2, b3), nil } // Validate validates this swift remote t f state @@ -208,13 +208,13 @@ func (m *SwiftRemoteTFState) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *SwiftRemoteTFState) UnmarshalBinary(b []byte) error { var res SwiftRemoteTFState - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/swift_storage.go b/client/models/swift_storage.go index 1f4122fd..a39165f0 100644 --- a/client/models/swift_storage.go +++ b/client/models/swift_storage.go @@ -9,7 +9,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -156,7 +156,7 @@ func (m SwiftStorage) MarshalJSON() ([]byte, error) { return nil, err } - return swag.ConcatJSON(b1, b2, b3), nil + return jsonutils.ConcatJSON(b1, b2, b3), nil } // Validate validates this swift storage @@ -210,13 +210,13 @@ func (m *SwiftStorage) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *SwiftStorage) UnmarshalBinary(b []byte) error { var res SwiftStorage - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/tag.go b/client/models/tag.go index 00a9f209..9bd4067b 100644 --- a/client/models/tag.go +++ b/client/models/tag.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -93,13 +93,13 @@ func (m *Tag) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *Tag) UnmarshalBinary(b []byte) error { var res Tag - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/task_config.go b/client/models/task_config.go index e8ea8589..16466830 100644 --- a/client/models/task_config.go +++ b/client/models/task_config.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" ) // TaskConfig TaskConfig @@ -57,12 +58,12 @@ func (m *TaskConfig) Validate(formats strfmt.Registry) error { } func (m *TaskConfig) validateInputs(formats strfmt.Registry) error { - if swag.IsZero(m.Inputs) { // not required + if typeutils.IsZero(m.Inputs) { // not required return nil } for i := 0; i < len(m.Inputs); i++ { - if swag.IsZero(m.Inputs[i]) { // not required + if typeutils.IsZero(m.Inputs[i]) { // not required continue } @@ -87,7 +88,7 @@ func (m *TaskConfig) validateInputs(formats strfmt.Registry) error { } func (m *TaskConfig) validateRun(formats strfmt.Registry) error { - if swag.IsZero(m.Run) { // not required + if typeutils.IsZero(m.Run) { // not required return nil } @@ -133,7 +134,7 @@ func (m *TaskConfig) contextValidateInputs(ctx context.Context, formats strfmt.R if m.Inputs[i] != nil { - if swag.IsZero(m.Inputs[i]) { // not required + if typeutils.IsZero(m.Inputs[i]) { // not required return nil } @@ -160,7 +161,7 @@ func (m *TaskConfig) contextValidateRun(ctx context.Context, formats strfmt.Regi if m.Run != nil { - if swag.IsZero(m.Run) { // not required + if typeutils.IsZero(m.Run) { // not required return nil } @@ -186,13 +187,13 @@ func (m *TaskConfig) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *TaskConfig) UnmarshalBinary(b []byte) error { var res TaskConfig - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/task_input_config.go b/client/models/task_input_config.go index 2786ff5f..12375ac3 100644 --- a/client/models/task_input_config.go +++ b/client/models/task_input_config.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -59,13 +59,13 @@ func (m *TaskInputConfig) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *TaskInputConfig) UnmarshalBinary(b []byte) error { var res TaskInputConfig - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/task_plan.go b/client/models/task_plan.go index cbf664b8..c96fb7d5 100644 --- a/client/models/task_plan.go +++ b/client/models/task_plan.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -75,7 +76,7 @@ func (m *TaskPlan) Validate(formats strfmt.Registry) error { } func (m *TaskPlan) validateConfig(formats strfmt.Registry) error { - if swag.IsZero(m.Config) { // not required + if typeutils.IsZero(m.Config) { // not required return nil } @@ -107,12 +108,12 @@ func (m *TaskPlan) validatePrivileged(formats strfmt.Registry) error { } func (m *TaskPlan) validateVersionedResourceTypes(formats strfmt.Registry) error { - if swag.IsZero(m.VersionedResourceTypes) { // not required + if typeutils.IsZero(m.VersionedResourceTypes) { // not required return nil } for i := 0; i < len(m.VersionedResourceTypes); i++ { - if swag.IsZero(m.VersionedResourceTypes[i]) { // not required + if typeutils.IsZero(m.VersionedResourceTypes[i]) { // not required continue } @@ -158,7 +159,7 @@ func (m *TaskPlan) contextValidateConfig(ctx context.Context, formats strfmt.Reg if m.Config != nil { - if swag.IsZero(m.Config) { // not required + if typeutils.IsZero(m.Config) { // not required return nil } @@ -185,7 +186,7 @@ func (m *TaskPlan) contextValidateVersionedResourceTypes(ctx context.Context, fo if m.VersionedResourceTypes[i] != nil { - if swag.IsZero(m.VersionedResourceTypes[i]) { // not required + if typeutils.IsZero(m.VersionedResourceTypes[i]) { // not required return nil } @@ -213,13 +214,13 @@ func (m *TaskPlan) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *TaskPlan) UnmarshalBinary(b []byte) error { var res TaskPlan - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/task_run_config.go b/client/models/task_run_config.go index 25da74fb..c8ace9ef 100644 --- a/client/models/task_run_config.go +++ b/client/models/task_run_config.go @@ -7,7 +7,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -41,7 +42,7 @@ func (m *TaskRunConfig) Validate(formats strfmt.Registry) error { } func (m *TaskRunConfig) validatePath(formats strfmt.Registry) error { - if swag.IsZero(m.Path) { // not required + if typeutils.IsZero(m.Path) { // not required return nil } @@ -62,13 +63,13 @@ func (m *TaskRunConfig) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *TaskRunConfig) UnmarshalBinary(b []byte) error { var res TaskRunConfig - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/team.go b/client/models/team.go index 1b214452..117b7515 100644 --- a/client/models/team.go +++ b/client/models/team.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -183,7 +184,7 @@ func (m *Team) validateMembersPreview(formats strfmt.Registry) error { } for i := 0; i < len(m.MembersPreview); i++ { - if swag.IsZero(m.MembersPreview[i]) { // not required + if typeutils.IsZero(m.MembersPreview[i]) { // not required continue } @@ -221,7 +222,7 @@ func (m *Team) validateName(formats strfmt.Registry) error { } func (m *Team) validateOwner(formats strfmt.Registry) error { - if swag.IsZero(m.Owner) { // not required + if typeutils.IsZero(m.Owner) { // not required return nil } @@ -256,7 +257,7 @@ func (m *Team) validateRoles(formats strfmt.Registry) error { } for i := 0; i < len(m.Roles); i++ { - if swag.IsZero(m.Roles[i]) { // not required + if typeutils.IsZero(m.Roles[i]) { // not required continue } @@ -321,7 +322,7 @@ func (m *Team) contextValidateMembersPreview(ctx context.Context, formats strfmt if m.MembersPreview[i] != nil { - if swag.IsZero(m.MembersPreview[i]) { // not required + if typeutils.IsZero(m.MembersPreview[i]) { // not required return nil } @@ -348,7 +349,7 @@ func (m *Team) contextValidateOwner(ctx context.Context, formats strfmt.Registry if m.Owner != nil { - if swag.IsZero(m.Owner) { // not required + if typeutils.IsZero(m.Owner) { // not required return nil } @@ -375,7 +376,7 @@ func (m *Team) contextValidateRoles(ctx context.Context, formats strfmt.Registry if m.Roles[i] != nil { - if swag.IsZero(m.Roles[i]) { // not required + if typeutils.IsZero(m.Roles[i]) { // not required return nil } @@ -403,13 +404,13 @@ func (m *Team) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *Team) UnmarshalBinary(b []byte) error { var res Team - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/terraform_h_c_l_config.go b/client/models/terraform_h_c_l_config.go index 1fd9c006..4123b502 100644 --- a/client/models/terraform_h_c_l_config.go +++ b/client/models/terraform_h_c_l_config.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -56,13 +56,13 @@ func (m *TerraformHCLConfig) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *TerraformHCLConfig) UnmarshalBinary(b []byte) error { var res TerraformHCLConfig - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/terraform_image.go b/client/models/terraform_image.go index 8bea3cc1..8788a360 100644 --- a/client/models/terraform_image.go +++ b/client/models/terraform_image.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -57,13 +57,13 @@ func (m *TerraformImage) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *TerraformImage) UnmarshalBinary(b []byte) error { var res TerraformImage - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/terraform_json_config.go b/client/models/terraform_json_config.go index c581f6ef..0b363ed7 100644 --- a/client/models/terraform_json_config.go +++ b/client/models/terraform_json_config.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" ) // TerraformJSONConfig TerraformJSONConfig @@ -55,13 +55,13 @@ func (m *TerraformJSONConfig) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *TerraformJSONConfig) UnmarshalBinary(b []byte) error { var res TerraformJSONConfig - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/terraform_plan_input.go b/client/models/terraform_plan_input.go index 6f7139ea..3b98b85e 100644 --- a/client/models/terraform_plan_input.go +++ b/client/models/terraform_plan_input.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -56,13 +56,13 @@ func (m *TerraformPlanInput) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *TerraformPlanInput) UnmarshalBinary(b []byte) error { var res TerraformPlanInput - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/terraform_provider.go b/client/models/terraform_provider.go index f0905035..b92208bd 100644 --- a/client/models/terraform_provider.go +++ b/client/models/terraform_provider.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -134,13 +134,13 @@ func (m *TerraformProvider) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *TerraformProvider) UnmarshalBinary(b []byte) error { var res TerraformProvider - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/terraform_provider_resource.go b/client/models/terraform_provider_resource.go index a40f3e76..df15dcd0 100644 --- a/client/models/terraform_provider_resource.go +++ b/client/models/terraform_provider_resource.go @@ -8,7 +8,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -172,7 +173,7 @@ func (m *TerraformProviderResource) validateDescription(formats strfmt.Registry) } func (m *TerraformProviderResource) validateImage(formats strfmt.Registry) error { - if swag.IsZero(m.Image) { // not required + if typeutils.IsZero(m.Image) { // not required return nil } @@ -268,13 +269,13 @@ func (m *TerraformProviderResource) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *TerraformProviderResource) UnmarshalBinary(b []byte) error { var res TerraformProviderResource - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/terraform_provider_resource_attributes.go b/client/models/terraform_provider_resource_attributes.go index c9c3a84d..7188303c 100644 --- a/client/models/terraform_provider_resource_attributes.go +++ b/client/models/terraform_provider_resource_attributes.go @@ -6,7 +6,7 @@ import ( "context" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" ) // TerraformProviderResourceAttributes ResourceAttributes @@ -41,13 +41,13 @@ func (m *TerraformProviderResourceAttributes) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *TerraformProviderResourceAttributes) UnmarshalBinary(b []byte) error { var res TerraformProviderResourceAttributes - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/terraform_provider_resource_simple.go b/client/models/terraform_provider_resource_simple.go index b97a67b4..decd959d 100644 --- a/client/models/terraform_provider_resource_simple.go +++ b/client/models/terraform_provider_resource_simple.go @@ -8,7 +8,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -164,7 +165,7 @@ func (m *TerraformProviderResourceSimple) validateDescription(formats strfmt.Reg } func (m *TerraformProviderResourceSimple) validateImage(formats strfmt.Registry) error { - if swag.IsZero(m.Image) { // not required + if typeutils.IsZero(m.Image) { // not required return nil } @@ -251,13 +252,13 @@ func (m *TerraformProviderResourceSimple) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *TerraformProviderResourceSimple) UnmarshalBinary(b []byte) error { var res TerraformProviderResourceSimple - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/terraform_provider_simple.go b/client/models/terraform_provider_simple.go index 992a74b1..557438d2 100644 --- a/client/models/terraform_provider_simple.go +++ b/client/models/terraform_provider_simple.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -117,13 +117,13 @@ func (m *TerraformProviderSimple) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *TerraformProviderSimple) UnmarshalBinary(b []byte) error { var res TerraformProviderSimple - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/terraform_validation_result.go b/client/models/terraform_validation_result.go index cb895aa4..7a66bfe7 100644 --- a/client/models/terraform_validation_result.go +++ b/client/models/terraform_validation_result.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -56,13 +56,13 @@ func (m *TerraformValidationResult) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *TerraformValidationResult) UnmarshalBinary(b []byte) error { var res TerraformValidationResult - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/test_connection_credential.go b/client/models/test_connection_credential.go index 47222ecc..2972195c 100644 --- a/client/models/test_connection_credential.go +++ b/client/models/test_connection_credential.go @@ -9,7 +9,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -173,13 +173,13 @@ func (m *TestConnectionCredential) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *TestConnectionCredential) UnmarshalBinary(b []byte) error { var res TestConnectionCredential - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/test_external_backend_connection_input.go b/client/models/test_external_backend_connection_input.go index 196ebe48..17829b1c 100644 --- a/client/models/test_external_backend_connection_input.go +++ b/client/models/test_external_backend_connection_input.go @@ -12,7 +12,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -109,7 +109,7 @@ func (m TestExternalBackendConnectionInput) MarshalJSON() ([]byte, error) { return nil, err } - return swag.ConcatJSON(b1, b2, b3), nil + return jsonutils.ConcatJSON(b1, b2, b3), nil } // Validate validates this test external backend connection input @@ -288,13 +288,13 @@ func (m *TestExternalBackendConnectionInput) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *TestExternalBackendConnectionInput) UnmarshalBinary(b []byte) error { var res TestExternalBackendConnectionInput - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/timeout_plan.go b/client/models/timeout_plan.go index 81098776..c94868fe 100644 --- a/client/models/timeout_plan.go +++ b/client/models/timeout_plan.go @@ -8,7 +8,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -159,13 +159,13 @@ func (m *TimeoutPlan) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *TimeoutPlan) UnmarshalBinary(b []byte) error { var res TimeoutPlan - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/try_plan.go b/client/models/try_plan.go index 15e75e1c..0ae2d57f 100644 --- a/client/models/try_plan.go +++ b/client/models/try_plan.go @@ -8,7 +8,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -159,13 +159,13 @@ func (m *TryPlan) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *TryPlan) UnmarshalBinary(b []byte) error { var res TryPlan - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/update_api_key.go b/client/models/update_api_key.go index 8ef6bdc5..6b322e7f 100644 --- a/client/models/update_api_key.go +++ b/client/models/update_api_key.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -71,13 +71,13 @@ func (m *UpdateAPIKey) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *UpdateAPIKey) UnmarshalBinary(b []byte) error { var res UpdateAPIKey - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/update_cloud_account.go b/client/models/update_cloud_account.go index 74760da7..9f44eff7 100644 --- a/client/models/update_cloud_account.go +++ b/client/models/update_cloud_account.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -101,13 +101,13 @@ func (m *UpdateCloudAccount) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *UpdateCloudAccount) UnmarshalBinary(b []byte) error { var res UpdateCloudAccount - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/update_cloud_account_finops.go b/client/models/update_cloud_account_finops.go index 1e9b82ec..3abf6bb8 100644 --- a/client/models/update_cloud_account_finops.go +++ b/client/models/update_cloud_account_finops.go @@ -8,7 +8,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -53,7 +54,7 @@ func (m *UpdateCloudAccountFinops) Validate(formats strfmt.Registry) error { } func (m *UpdateCloudAccountFinops) validateFinopsConfig(formats strfmt.Registry) error { - if swag.IsZero(m.FinopsConfig) { // not required + if typeutils.IsZero(m.FinopsConfig) { // not required return nil } @@ -76,7 +77,7 @@ func (m *UpdateCloudAccountFinops) validateFinopsConfig(formats strfmt.Registry) } func (m *UpdateCloudAccountFinops) validateFinopsCredential(formats strfmt.Registry) error { - if swag.IsZero(m.FinopsCredential) { // not required + if typeutils.IsZero(m.FinopsCredential) { // not required return nil } @@ -129,7 +130,7 @@ func (m *UpdateCloudAccountFinops) contextValidateFinopsConfig(ctx context.Conte if m.FinopsConfig != nil { - if swag.IsZero(m.FinopsConfig) { // not required + if typeutils.IsZero(m.FinopsConfig) { // not required return nil } @@ -154,7 +155,7 @@ func (m *UpdateCloudAccountFinops) contextValidateFinopsCredential(ctx context.C if m.FinopsCredential != nil { - if swag.IsZero(m.FinopsCredential) { // not required + if typeutils.IsZero(m.FinopsCredential) { // not required return nil } @@ -180,13 +181,13 @@ func (m *UpdateCloudAccountFinops) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *UpdateCloudAccountFinops) UnmarshalBinary(b []byte) error { var res UpdateCloudAccountFinops - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/update_cloud_cost_management_account.go b/client/models/update_cloud_cost_management_account.go index 8a814d09..112b9dfd 100644 --- a/client/models/update_cloud_cost_management_account.go +++ b/client/models/update_cloud_cost_management_account.go @@ -8,7 +8,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -105,13 +105,13 @@ func (m *UpdateCloudCostManagementAccount) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *UpdateCloudCostManagementAccount) UnmarshalBinary(b []byte) error { var res UpdateCloudCostManagementAccount - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/update_cloud_cost_management_linked_account.go b/client/models/update_cloud_cost_management_linked_account.go index 2f61935b..280d5988 100644 --- a/client/models/update_cloud_cost_management_linked_account.go +++ b/client/models/update_cloud_cost_management_linked_account.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -56,13 +56,13 @@ func (m *UpdateCloudCostManagementLinkedAccount) MarshalBinary() ([]byte, error) if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *UpdateCloudCostManagementLinkedAccount) UnmarshalBinary(b []byte) error { var res UpdateCloudCostManagementLinkedAccount - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/update_cloud_cost_management_tag_mapping.go b/client/models/update_cloud_cost_management_tag_mapping.go index 1f8e4779..ab1ca665 100644 --- a/client/models/update_cloud_cost_management_tag_mapping.go +++ b/client/models/update_cloud_cost_management_tag_mapping.go @@ -6,7 +6,7 @@ import ( "context" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" ) // UpdateCloudCostManagementTagMapping Create or Update CloudCostManagementTagMapping @@ -50,13 +50,13 @@ func (m *UpdateCloudCostManagementTagMapping) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *UpdateCloudCostManagementTagMapping) UnmarshalBinary(b []byte) error { var res UpdateCloudCostManagementTagMapping - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/update_component.go b/client/models/update_component.go index 7ac68b3e..3913bd59 100644 --- a/client/models/update_component.go +++ b/client/models/update_component.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -64,13 +64,13 @@ func (m *UpdateComponent) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *UpdateComponent) UnmarshalBinary(b []byte) error { var res UpdateComponent - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/update_config_repository.go b/client/models/update_config_repository.go index 5ccacc25..5b622ab6 100644 --- a/client/models/update_config_repository.go +++ b/client/models/update_config_repository.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -142,13 +142,13 @@ func (m *UpdateConfigRepository) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *UpdateConfigRepository) UnmarshalBinary(b []byte) error { var res UpdateConfigRepository - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/update_credential.go b/client/models/update_credential.go index 800baa55..33d600d6 100644 --- a/client/models/update_credential.go +++ b/client/models/update_credential.go @@ -9,7 +9,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -255,13 +255,13 @@ func (m *UpdateCredential) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *UpdateCredential) UnmarshalBinary(b []byte) error { var res UpdateCredential - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/update_environment.go b/client/models/update_environment.go index 8f580a77..82013e77 100644 --- a/client/models/update_environment.go +++ b/client/models/update_environment.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -79,7 +80,7 @@ func (m *UpdateEnvironment) Validate(formats strfmt.Registry) error { } func (m *UpdateEnvironment) validateCloudAccountCanonicals(formats strfmt.Registry) error { - if swag.IsZero(m.CloudAccountCanonicals) { // not required + if typeutils.IsZero(m.CloudAccountCanonicals) { // not required return nil } @@ -99,7 +100,7 @@ func (m *UpdateEnvironment) validateCloudAccountCanonicals(formats strfmt.Regist } func (m *UpdateEnvironment) validateDescription(formats strfmt.Registry) error { - if swag.IsZero(m.Description) { // not required + if typeutils.IsZero(m.Description) { // not required return nil } @@ -137,12 +138,12 @@ func (m *UpdateEnvironment) validateType(formats strfmt.Registry) error { } func (m *UpdateEnvironment) validateVariables(formats strfmt.Registry) error { - if swag.IsZero(m.Variables) { // not required + if typeutils.IsZero(m.Variables) { // not required return nil } for i := 0; i < len(m.Variables); i++ { - if swag.IsZero(m.Variables[i]) { // not required + if typeutils.IsZero(m.Variables[i]) { // not required continue } @@ -186,7 +187,7 @@ func (m *UpdateEnvironment) contextValidateVariables(ctx context.Context, format if m.Variables[i] != nil { - if swag.IsZero(m.Variables[i]) { // not required + if typeutils.IsZero(m.Variables[i]) { // not required return nil } @@ -214,13 +215,13 @@ func (m *UpdateEnvironment) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *UpdateEnvironment) UnmarshalBinary(b []byte) error { var res UpdateEnvironment - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/update_environment_type.go b/client/models/update_environment_type.go index f2d08c7c..8a448857 100644 --- a/client/models/update_environment_type.go +++ b/client/models/update_environment_type.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -88,13 +88,13 @@ func (m *UpdateEnvironmentType) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *UpdateEnvironmentType) UnmarshalBinary(b []byte) error { var res UpdateEnvironmentType - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/update_external_backend.go b/client/models/update_external_backend.go index 5972305c..bc6af344 100644 --- a/client/models/update_external_backend.go +++ b/client/models/update_external_backend.go @@ -12,7 +12,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -183,7 +184,7 @@ func (m UpdateExternalBackend) MarshalJSON() ([]byte, error) { return nil, err } - return swag.ConcatJSON(b1, b2, b3), nil + return jsonutils.ConcatJSON(b1, b2, b3), nil } // Validate validates this update external backend @@ -225,7 +226,7 @@ func (m *UpdateExternalBackend) Validate(formats strfmt.Registry) error { } func (m *UpdateExternalBackend) validateComponentCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.ComponentCanonical) { // not required + if typeutils.IsZero(m.ComponentCanonical) { // not required return nil } @@ -267,7 +268,7 @@ func (m *UpdateExternalBackend) validateConfiguration(formats strfmt.Registry) e } func (m *UpdateExternalBackend) validateCredentialCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.CredentialCanonical) { // not required + if typeutils.IsZero(m.CredentialCanonical) { // not required return nil } @@ -287,7 +288,7 @@ func (m *UpdateExternalBackend) validateCredentialCanonical(formats strfmt.Regis } func (m *UpdateExternalBackend) validateEnvironmentCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.EnvironmentCanonical) { // not required + if typeutils.IsZero(m.EnvironmentCanonical) { // not required return nil } @@ -307,7 +308,7 @@ func (m *UpdateExternalBackend) validateEnvironmentCanonical(formats strfmt.Regi } func (m *UpdateExternalBackend) validateID(formats strfmt.Registry) error { - if swag.IsZero(m.ID) { // not required + if typeutils.IsZero(m.ID) { // not required return nil } @@ -319,7 +320,7 @@ func (m *UpdateExternalBackend) validateID(formats strfmt.Registry) error { } func (m *UpdateExternalBackend) validateProjectCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.ProjectCanonical) { // not required + if typeutils.IsZero(m.ProjectCanonical) { // not required return nil } @@ -424,13 +425,13 @@ func (m *UpdateExternalBackend) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *UpdateExternalBackend) UnmarshalBinary(b []byte) error { var res UpdateExternalBackend - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/update_infra_policy.go b/client/models/update_infra_policy.go index 65cc96c6..be7d48f3 100644 --- a/client/models/update_infra_policy.go +++ b/client/models/update_infra_policy.go @@ -8,7 +8,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -194,13 +194,13 @@ func (m *UpdateInfraPolicy) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *UpdateInfraPolicy) UnmarshalBinary(b []byte) error { var res UpdateInfraPolicy - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/update_o_id_c_organization_settings.go b/client/models/update_o_id_c_organization_settings.go new file mode 100644 index 00000000..4c6f1703 --- /dev/null +++ b/client/models/update_o_id_c_organization_settings.go @@ -0,0 +1,154 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" + "github.com/go-openapi/validate" +) + +// UpdateOIDCOrganizationSettings UpdateOIDCOrganizationSettings +// +// The per-organization OIDC settings to create or update. 'eject' requires oidc_managed=true. +// +// swagger:model UpdateOIDCOrganizationSettings +type UpdateOIDCOrganizationSettings struct { + + // The canonical of the org-level role granted on OIDC provisioning. Empty clears it. + // Max Length: 100 + // Min Length: 3 + // Pattern: ^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$ + DefaultRoleCanonical string `json:"default_role_canonical,omitempty"` + + // When true, local member/team/invite edits are disabled (strict mode). + // Required: true + OidcManaged *bool `json:"oidc_managed"` + + // The policy applied when no group mapping matches on login. 'eject' requires oidc_managed=true. + // Required: true + // Enum: ["keep_membership","eject"] + OidcNoMatchPolicy *string `json:"oidc_no_match_policy"` +} + +// Validate validates this update o ID c organization settings +func (m *UpdateOIDCOrganizationSettings) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDefaultRoleCanonical(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOidcManaged(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOidcNoMatchPolicy(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateOIDCOrganizationSettings) validateDefaultRoleCanonical(formats strfmt.Registry) error { + if typeutils.IsZero(m.DefaultRoleCanonical) { // not required + return nil + } + + if err := validate.MinLength("default_role_canonical", "body", m.DefaultRoleCanonical, 3); err != nil { + return err + } + + if err := validate.MaxLength("default_role_canonical", "body", m.DefaultRoleCanonical, 100); err != nil { + return err + } + + if err := validate.Pattern("default_role_canonical", "body", m.DefaultRoleCanonical, `^[a-z0-9]+[a-z0-9\-_]+[a-z0-9]+$`); err != nil { + return err + } + + return nil +} + +func (m *UpdateOIDCOrganizationSettings) validateOidcManaged(formats strfmt.Registry) error { + + if err := validate.Required("oidc_managed", "body", m.OidcManaged); err != nil { + return err + } + + return nil +} + +var updateOIdCOrganizationSettingsTypeOidcNoMatchPolicyPropEnum []any + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["keep_membership","eject"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + updateOIdCOrganizationSettingsTypeOidcNoMatchPolicyPropEnum = append(updateOIdCOrganizationSettingsTypeOidcNoMatchPolicyPropEnum, v) + } +} + +const ( + + // UpdateOIDCOrganizationSettingsOidcNoMatchPolicyKeepMembership captures enum value "keep_membership" + UpdateOIDCOrganizationSettingsOidcNoMatchPolicyKeepMembership string = "keep_membership" + + // UpdateOIDCOrganizationSettingsOidcNoMatchPolicyEject captures enum value "eject" + UpdateOIDCOrganizationSettingsOidcNoMatchPolicyEject string = "eject" +) + +// prop value enum +func (m *UpdateOIDCOrganizationSettings) validateOidcNoMatchPolicyEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, updateOIdCOrganizationSettingsTypeOidcNoMatchPolicyPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *UpdateOIDCOrganizationSettings) validateOidcNoMatchPolicy(formats strfmt.Registry) error { + + if err := validate.Required("oidc_no_match_policy", "body", m.OidcNoMatchPolicy); err != nil { + return err + } + + // value enum + if err := m.validateOidcNoMatchPolicyEnum("oidc_no_match_policy", "body", *m.OidcNoMatchPolicy); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update o ID c organization settings based on context it is used +func (m *UpdateOIDCOrganizationSettings) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateOIDCOrganizationSettings) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return jsonutils.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateOIDCOrganizationSettings) UnmarshalBinary(b []byte) error { + var res UpdateOIDCOrganizationSettings + if err := jsonutils.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/client/models/update_organization.go b/client/models/update_organization.go index ce13f534..4aaebb63 100644 --- a/client/models/update_organization.go +++ b/client/models/update_organization.go @@ -4,10 +4,12 @@ package models import ( "context" + "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -40,6 +42,14 @@ type UpdateOrganization struct { // When true, SSO users can only join the organization if they have been explicitly invited SsoInviteOnly *bool `json:"sso_invite_only,omitempty"` + + // Glob patterns (filepath.Match syntax). Versions matching any of these are hidden from non-team-member users. Omitting this field or sending null preserves the current value. Send an empty array [] to clear all patterns. + // Max Items: 50 + StackBranchExcludePatterns []string `json:"stack_branch_exclude_patterns"` + + // Glob patterns (filepath.Match syntax). When set, only versions whose name matches at least one pattern are shown to non-team-member users. Empty means show all. Omitting this field or sending null preserves the current value. Send an empty array [] to clear all patterns. + // Max Items: 50 + StackBranchIncludePatterns []string `json:"stack_branch_include_patterns"` } // Validate validates this update organization @@ -50,6 +60,14 @@ func (m *UpdateOrganization) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateStackBranchExcludePatterns(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStackBranchIncludePatterns(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -69,6 +87,50 @@ func (m *UpdateOrganization) validateName(formats strfmt.Registry) error { return nil } +func (m *UpdateOrganization) validateStackBranchExcludePatterns(formats strfmt.Registry) error { + if typeutils.IsZero(m.StackBranchExcludePatterns) { // not required + return nil + } + + iStackBranchExcludePatternsSize := int64(len(m.StackBranchExcludePatterns)) + + if err := validate.MaxItems("stack_branch_exclude_patterns", "body", iStackBranchExcludePatternsSize, 50); err != nil { + return err + } + + for i := 0; i < len(m.StackBranchExcludePatterns); i++ { + + if err := validate.MaxLength("stack_branch_exclude_patterns"+"."+strconv.Itoa(i), "body", m.StackBranchExcludePatterns[i], 200); err != nil { + return err + } + + } + + return nil +} + +func (m *UpdateOrganization) validateStackBranchIncludePatterns(formats strfmt.Registry) error { + if typeutils.IsZero(m.StackBranchIncludePatterns) { // not required + return nil + } + + iStackBranchIncludePatternsSize := int64(len(m.StackBranchIncludePatterns)) + + if err := validate.MaxItems("stack_branch_include_patterns", "body", iStackBranchIncludePatternsSize, 50); err != nil { + return err + } + + for i := 0; i < len(m.StackBranchIncludePatterns); i++ { + + if err := validate.MaxLength("stack_branch_include_patterns"+"."+strconv.Itoa(i), "body", m.StackBranchIncludePatterns[i], 200); err != nil { + return err + } + + } + + return nil +} + // ContextValidate validates this update organization based on context it is used func (m *UpdateOrganization) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil @@ -79,13 +141,13 @@ func (m *UpdateOrganization) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *UpdateOrganization) UnmarshalBinary(b []byte) error { var res UpdateOrganization - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/update_organization_messages.go b/client/models/update_organization_messages.go index f9ec374f..5d5bafa5 100644 --- a/client/models/update_organization_messages.go +++ b/client/models/update_organization_messages.go @@ -6,7 +6,7 @@ import ( "context" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" ) // UpdateOrganizationMessages update organization messages @@ -33,13 +33,13 @@ func (m *UpdateOrganizationMessages) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *UpdateOrganizationMessages) UnmarshalBinary(b []byte) error { var res UpdateOrganizationMessages - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/update_organization_naming_rules.go b/client/models/update_organization_naming_rules.go index 72a2537c..f2c7e0f5 100644 --- a/client/models/update_organization_naming_rules.go +++ b/client/models/update_organization_naming_rules.go @@ -7,7 +7,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -78,7 +79,7 @@ func (m *UpdateOrganizationNamingRules) Validate(formats strfmt.Registry) error } func (m *UpdateOrganizationNamingRules) validateComponentMessage(formats strfmt.Registry) error { - if swag.IsZero(m.ComponentMessage) { // not required + if typeutils.IsZero(m.ComponentMessage) { // not required return nil } @@ -90,7 +91,7 @@ func (m *UpdateOrganizationNamingRules) validateComponentMessage(formats strfmt. } func (m *UpdateOrganizationNamingRules) validateComponentRegex(formats strfmt.Registry) error { - if swag.IsZero(m.ComponentRegex) { // not required + if typeutils.IsZero(m.ComponentRegex) { // not required return nil } @@ -102,7 +103,7 @@ func (m *UpdateOrganizationNamingRules) validateComponentRegex(formats strfmt.Re } func (m *UpdateOrganizationNamingRules) validateEnvMessage(formats strfmt.Registry) error { - if swag.IsZero(m.EnvMessage) { // not required + if typeutils.IsZero(m.EnvMessage) { // not required return nil } @@ -114,7 +115,7 @@ func (m *UpdateOrganizationNamingRules) validateEnvMessage(formats strfmt.Regist } func (m *UpdateOrganizationNamingRules) validateEnvRegex(formats strfmt.Registry) error { - if swag.IsZero(m.EnvRegex) { // not required + if typeutils.IsZero(m.EnvRegex) { // not required return nil } @@ -126,7 +127,7 @@ func (m *UpdateOrganizationNamingRules) validateEnvRegex(formats strfmt.Registry } func (m *UpdateOrganizationNamingRules) validateProjectMessage(formats strfmt.Registry) error { - if swag.IsZero(m.ProjectMessage) { // not required + if typeutils.IsZero(m.ProjectMessage) { // not required return nil } @@ -138,7 +139,7 @@ func (m *UpdateOrganizationNamingRules) validateProjectMessage(formats strfmt.Re } func (m *UpdateOrganizationNamingRules) validateProjectRegex(formats strfmt.Registry) error { - if swag.IsZero(m.ProjectRegex) { // not required + if typeutils.IsZero(m.ProjectRegex) { // not required return nil } @@ -159,13 +160,13 @@ func (m *UpdateOrganizationNamingRules) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *UpdateOrganizationNamingRules) UnmarshalBinary(b []byte) error { var res UpdateOrganizationNamingRules - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/update_pipeline.go b/client/models/update_pipeline.go index 8b840b81..7764c0f3 100644 --- a/client/models/update_pipeline.go +++ b/client/models/update_pipeline.go @@ -6,7 +6,7 @@ import ( "context" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" ) // UpdatePipeline Update Pipeline @@ -50,13 +50,13 @@ func (m *UpdatePipeline) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *UpdatePipeline) UnmarshalBinary(b []byte) error { var res UpdatePipeline - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/update_plugin.go b/client/models/update_plugin.go index 0fc046d6..d5c24c98 100644 --- a/client/models/update_plugin.go +++ b/client/models/update_plugin.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -56,13 +56,13 @@ func (m *UpdatePlugin) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *UpdatePlugin) UnmarshalBinary(b []byte) error { var res UpdatePlugin - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/update_plugin_install.go b/client/models/update_plugin_install.go index 6cd12c94..96f0d72a 100644 --- a/client/models/update_plugin_install.go +++ b/client/models/update_plugin_install.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -78,13 +78,13 @@ func (m *UpdatePluginInstall) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *UpdatePluginInstall) UnmarshalBinary(b []byte) error { var res UpdatePluginInstall - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/update_plugin_manager.go b/client/models/update_plugin_manager.go index c3a90fe7..a949ee61 100644 --- a/client/models/update_plugin_manager.go +++ b/client/models/update_plugin_manager.go @@ -8,7 +8,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -92,13 +92,13 @@ func (m *UpdatePluginManager) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *UpdatePluginManager) UnmarshalBinary(b []byte) error { var res UpdatePluginManager - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/update_plugin_registry.go b/client/models/update_plugin_registry.go index 371469e9..8f0e931c 100644 --- a/client/models/update_plugin_registry.go +++ b/client/models/update_plugin_registry.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -56,13 +56,13 @@ func (m *UpdatePluginRegistry) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *UpdatePluginRegistry) UnmarshalBinary(b []byte) error { var res UpdatePluginRegistry - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/update_project.go b/client/models/update_project.go index cdd121fb..4bfa4588 100644 --- a/client/models/update_project.go +++ b/client/models/update_project.go @@ -8,7 +8,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -136,7 +137,7 @@ func (m *UpdateProject) validateCloudProviderEnum(path, location string, value s } func (m *UpdateProject) validateCloudProvider(formats strfmt.Registry) error { - if swag.IsZero(m.CloudProvider) { // not required + if typeutils.IsZero(m.CloudProvider) { // not required return nil } @@ -149,7 +150,7 @@ func (m *UpdateProject) validateCloudProvider(formats strfmt.Registry) error { } func (m *UpdateProject) validateColor(formats strfmt.Registry) error { - if swag.IsZero(m.Color) { // not required + if typeutils.IsZero(m.Color) { // not required return nil } @@ -161,7 +162,7 @@ func (m *UpdateProject) validateColor(formats strfmt.Registry) error { } func (m *UpdateProject) validateConfigRepositoryCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.ConfigRepositoryCanonical) { // not required + if typeutils.IsZero(m.ConfigRepositoryCanonical) { // not required return nil } @@ -181,7 +182,7 @@ func (m *UpdateProject) validateConfigRepositoryCanonical(formats strfmt.Registr } func (m *UpdateProject) validateIcon(formats strfmt.Registry) error { - if swag.IsZero(m.Icon) { // not required + if typeutils.IsZero(m.Icon) { // not required return nil } @@ -215,13 +216,13 @@ func (m *UpdateProject) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *UpdateProject) UnmarshalBinary(b []byte) error { var res UpdateProject - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/update_service_catalog.go b/client/models/update_service_catalog.go index 4df9fa9a..9acc57d3 100644 --- a/client/models/update_service_catalog.go +++ b/client/models/update_service_catalog.go @@ -7,7 +7,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -49,7 +50,7 @@ func (m *UpdateServiceCatalog) Validate(formats strfmt.Registry) error { } func (m *UpdateServiceCatalog) validateTeamCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.TeamCanonical) { // not required + if typeutils.IsZero(m.TeamCanonical) { // not required return nil } @@ -87,13 +88,13 @@ func (m *UpdateServiceCatalog) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *UpdateServiceCatalog) UnmarshalBinary(b []byte) error { var res UpdateServiceCatalog - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/update_service_catalog_source.go b/client/models/update_service_catalog_source.go index 336d71fd..141c589d 100644 --- a/client/models/update_service_catalog_source.go +++ b/client/models/update_service_catalog_source.go @@ -7,7 +7,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -64,7 +65,7 @@ func (m *UpdateServiceCatalogSource) Validate(formats strfmt.Registry) error { } func (m *UpdateServiceCatalogSource) validateCredentialCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.CredentialCanonical) { // not required + if typeutils.IsZero(m.CredentialCanonical) { // not required return nil } @@ -115,13 +116,13 @@ func (m *UpdateServiceCatalogSource) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *UpdateServiceCatalogSource) UnmarshalBinary(b []byte) error { var res UpdateServiceCatalogSource - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/update_team.go b/client/models/update_team.go index e639077b..88340ee7 100644 --- a/client/models/update_team.go +++ b/client/models/update_team.go @@ -8,7 +8,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -133,13 +133,13 @@ func (m *UpdateTeam) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *UpdateTeam) UnmarshalBinary(b []byte) error { var res UpdateTeam - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/update_user_account.go b/client/models/update_user_account.go index d03e4ab0..7e2e277f 100644 --- a/client/models/update_user_account.go +++ b/client/models/update_user_account.go @@ -10,7 +10,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -102,7 +103,7 @@ func (m *UpdateUserAccount) Validate(formats strfmt.Registry) error { } func (m *UpdateUserAccount) validateCountryCode(formats strfmt.Registry) error { - if swag.IsZero(m.CountryCode) { // not required + if typeutils.IsZero(m.CountryCode) { // not required return nil } @@ -114,7 +115,7 @@ func (m *UpdateUserAccount) validateCountryCode(formats strfmt.Registry) error { } func (m *UpdateUserAccount) validateEmails(formats strfmt.Registry) error { - if swag.IsZero(m.Emails) { // not required + if typeutils.IsZero(m.Emails) { // not required return nil } @@ -125,7 +126,7 @@ func (m *UpdateUserAccount) validateEmails(formats strfmt.Registry) error { } for i := 0; i < len(m.Emails); i++ { - if swag.IsZero(m.Emails[i]) { // not required + if typeutils.IsZero(m.Emails[i]) { // not required continue } @@ -222,7 +223,7 @@ func (m *UpdateUserAccount) validateMfaEnabled(formats strfmt.Registry) error { } func (m *UpdateUserAccount) validatePasswordUpdate(formats strfmt.Registry) error { - if swag.IsZero(m.PasswordUpdate) { // not required + if typeutils.IsZero(m.PasswordUpdate) { // not required return nil } @@ -245,7 +246,7 @@ func (m *UpdateUserAccount) validatePasswordUpdate(formats strfmt.Registry) erro } func (m *UpdateUserAccount) validatePictureURL(formats strfmt.Registry) error { - if swag.IsZero(m.PictureURL) { // not required + if typeutils.IsZero(m.PictureURL) { // not required return nil } @@ -301,7 +302,7 @@ func (m *UpdateUserAccount) contextValidateEmails(ctx context.Context, formats s if m.Emails[i] != nil { - if swag.IsZero(m.Emails[i]) { // not required + if typeutils.IsZero(m.Emails[i]) { // not required return nil } @@ -328,7 +329,7 @@ func (m *UpdateUserAccount) contextValidatePasswordUpdate(ctx context.Context, f if m.PasswordUpdate != nil { - if swag.IsZero(m.PasswordUpdate) { // not required + if typeutils.IsZero(m.PasswordUpdate) { // not required return nil } @@ -354,13 +355,13 @@ func (m *UpdateUserAccount) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *UpdateUserAccount) UnmarshalBinary(b []byte) error { var res UpdateUserAccount - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res @@ -447,13 +448,13 @@ func (m *UpdateUserAccountPasswordUpdate) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *UpdateUserAccountPasswordUpdate) UnmarshalBinary(b []byte) error { var res UpdateUserAccountPasswordUpdate - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/update_user_account_email.go b/client/models/update_user_account_email.go index 37f9c3f3..6c479723 100644 --- a/client/models/update_user_account_email.go +++ b/client/models/update_user_account_email.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -78,13 +78,13 @@ func (m *UpdateUserAccountEmail) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *UpdateUserAccountEmail) UnmarshalBinary(b []byte) error { var res UpdateUserAccountEmail - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/update_watch_rule.go b/client/models/update_watch_rule.go index f104688b..6132921d 100644 --- a/client/models/update_watch_rule.go +++ b/client/models/update_watch_rule.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -56,12 +57,12 @@ func (m *UpdateWatchRule) Validate(formats strfmt.Registry) error { } func (m *UpdateWatchRule) validateFilters(formats strfmt.Registry) error { - if swag.IsZero(m.Filters) { // not required + if typeutils.IsZero(m.Filters) { // not required return nil } for i := 0; i < len(m.Filters); i++ { - if swag.IsZero(m.Filters[i]) { // not required + if typeutils.IsZero(m.Filters[i]) { // not required continue } @@ -127,7 +128,7 @@ func (m *UpdateWatchRule) contextValidateFilters(ctx context.Context, formats st if m.Filters[i] != nil { - if swag.IsZero(m.Filters[i]) { // not required + if typeutils.IsZero(m.Filters[i]) { // not required return nil } @@ -155,13 +156,13 @@ func (m *UpdateWatchRule) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *UpdateWatchRule) UnmarshalBinary(b []byte) error { var res UpdateWatchRule - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/user.go b/client/models/user.go index f62c9091..80533873 100644 --- a/client/models/user.go +++ b/client/models/user.go @@ -7,7 +7,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -125,7 +126,7 @@ func (m *User) Validate(formats strfmt.Registry) error { } func (m *User) validateCountryCode(formats strfmt.Registry) error { - if swag.IsZero(m.CountryCode) { // not required + if typeutils.IsZero(m.CountryCode) { // not required return nil } @@ -185,7 +186,7 @@ func (m *User) validateID(formats strfmt.Registry) error { } func (m *User) validateLastLoginAt(formats strfmt.Registry) error { - if swag.IsZero(m.LastLoginAt) { // not required + if typeutils.IsZero(m.LastLoginAt) { // not required return nil } @@ -219,7 +220,7 @@ func (m *User) validateMfaEnabled(formats strfmt.Registry) error { } func (m *User) validatePictureURL(formats strfmt.Registry) error { - if swag.IsZero(m.PictureURL) { // not required + if typeutils.IsZero(m.PictureURL) { // not required return nil } @@ -231,7 +232,7 @@ func (m *User) validatePictureURL(formats strfmt.Registry) error { } func (m *User) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required + if typeutils.IsZero(m.UpdatedAt) { // not required return nil } @@ -273,13 +274,13 @@ func (m *User) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *User) UnmarshalBinary(b []byte) error { var res User - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/user_account.go b/client/models/user_account.go index 286ab049..57fec22d 100644 --- a/client/models/user_account.go +++ b/client/models/user_account.go @@ -10,7 +10,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -125,7 +126,7 @@ func (m *UserAccount) Validate(formats strfmt.Registry) error { } func (m *UserAccount) validateCountry(formats strfmt.Registry) error { - if swag.IsZero(m.Country) { // not required + if typeutils.IsZero(m.Country) { // not required return nil } @@ -173,7 +174,7 @@ func (m *UserAccount) validateEmails(formats strfmt.Registry) error { } for i := 0; i < len(m.Emails); i++ { - if swag.IsZero(m.Emails[i]) { // not required + if typeutils.IsZero(m.Emails[i]) { // not required continue } @@ -283,7 +284,7 @@ func (m *UserAccount) validateMfaEnabled(formats strfmt.Registry) error { } func (m *UserAccount) validatePictureURL(formats strfmt.Registry) error { - if swag.IsZero(m.PictureURL) { // not required + if typeutils.IsZero(m.PictureURL) { // not required return nil } @@ -350,7 +351,7 @@ func (m *UserAccount) contextValidateCountry(ctx context.Context, formats strfmt if m.Country != nil { - if swag.IsZero(m.Country) { // not required + if typeutils.IsZero(m.Country) { // not required return nil } @@ -377,7 +378,7 @@ func (m *UserAccount) contextValidateEmails(ctx context.Context, formats strfmt. if m.Emails[i] != nil { - if swag.IsZero(m.Emails[i]) { // not required + if typeutils.IsZero(m.Emails[i]) { // not required return nil } @@ -405,13 +406,13 @@ func (m *UserAccount) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *UserAccount) UnmarshalBinary(b []byte) error { var res UserAccount - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/user_account_email.go b/client/models/user_account_email.go index 49edcc6a..fdca3834 100644 --- a/client/models/user_account_email.go +++ b/client/models/user_account_email.go @@ -7,7 +7,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -63,7 +64,7 @@ func (m *UserAccountEmail) Validate(formats strfmt.Registry) error { } func (m *UserAccountEmail) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required + if typeutils.IsZero(m.CreatedAt) { // not required return nil } @@ -115,13 +116,13 @@ func (m *UserAccountEmail) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *UserAccountEmail) UnmarshalBinary(b []byte) error { var res UserAccountEmail - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/user_email.go b/client/models/user_email.go index 92cfc6be..15a92807 100644 --- a/client/models/user_email.go +++ b/client/models/user_email.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -61,13 +61,13 @@ func (m *UserEmail) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *UserEmail) UnmarshalBinary(b []byte) error { var res UserEmail - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/user_login.go b/client/models/user_login.go index 5827ea9e..935af276 100644 --- a/client/models/user_login.go +++ b/client/models/user_login.go @@ -7,7 +7,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -72,7 +73,7 @@ func (m *UserLogin) validateEmail(formats strfmt.Registry) error { } func (m *UserLogin) validateOrganizationCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.OrganizationCanonical) { // not required + if typeutils.IsZero(m.OrganizationCanonical) { // not required return nil } @@ -118,13 +119,13 @@ func (m *UserLogin) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *UserLogin) UnmarshalBinary(b []byte) error { var res UserLogin - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/user_o_auth.go b/client/models/user_o_auth.go index 233c9a44..9eb9221d 100644 --- a/client/models/user_o_auth.go +++ b/client/models/user_o_auth.go @@ -8,7 +8,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" ) // UserOAuth User's OAuth information @@ -18,6 +19,9 @@ import ( // swagger:model UserOAuth type UserOAuth struct { + // OIDC group names whose mapped team could not be applied during a partial-apply login (the team did not resolve in the login organization). The login still succeeds with the valid teams applied; the frontend surfaces these as a non-blocking banner (FE-1435). Empty or absent when every mapped team applied cleanly. + OidcPartialFailureGroups []string `json:"oidc_partial_failure_groups"` + // Is the JWT of the platform user Token string `json:"token,omitempty"` @@ -40,7 +44,7 @@ func (m *UserOAuth) Validate(formats strfmt.Registry) error { } func (m *UserOAuth) validateUser(formats strfmt.Registry) error { - if swag.IsZero(m.User) { // not required + if typeutils.IsZero(m.User) { // not required return nil } @@ -80,7 +84,7 @@ func (m *UserOAuth) contextValidateUser(ctx context.Context, formats strfmt.Regi if m.User != nil { - if swag.IsZero(m.User) { // not required + if typeutils.IsZero(m.User) { // not required return nil } @@ -106,13 +110,13 @@ func (m *UserOAuth) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *UserOAuth) UnmarshalBinary(b []byte) error { var res UserOAuth - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/user_password_reset_req.go b/client/models/user_password_reset_req.go index 83de50ee..f9153538 100644 --- a/client/models/user_password_reset_req.go +++ b/client/models/user_password_reset_req.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -61,13 +61,13 @@ func (m *UserPasswordResetReq) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *UserPasswordResetReq) UnmarshalBinary(b []byte) error { var res UserPasswordResetReq - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/user_password_reset_update.go b/client/models/user_password_reset_update.go index 508683ed..fe820ced 100644 --- a/client/models/user_password_reset_update.go +++ b/client/models/user_password_reset_update.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -88,13 +88,13 @@ func (m *UserPasswordResetUpdate) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *UserPasswordResetUpdate) UnmarshalBinary(b []byte) error { var res UserPasswordResetUpdate - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/user_session.go b/client/models/user_session.go index fa6037e5..4f200359 100644 --- a/client/models/user_session.go +++ b/client/models/user_session.go @@ -8,7 +8,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -141,13 +141,13 @@ func (m *UserSession) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *UserSession) UnmarshalBinary(b []byte) error { var res UserSession - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/v_mware_vsphere.go b/client/models/v_mware_vsphere.go index 52c76f3e..a7493c56 100644 --- a/client/models/v_mware_vsphere.go +++ b/client/models/v_mware_vsphere.go @@ -9,7 +9,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" ) // VMwareVsphere Representation of VMwareVsphere external backend. @@ -116,7 +116,7 @@ func (m VMwareVsphere) MarshalJSON() ([]byte, error) { return nil, err } - return swag.ConcatJSON(b1, b2, b3), nil + return jsonutils.ConcatJSON(b1, b2, b3), nil } // Validate validates this v mware vsphere @@ -144,13 +144,13 @@ func (m *VMwareVsphere) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *VMwareVsphere) UnmarshalBinary(b []byte) error { var res VMwareVsphere - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/version_config.go b/client/models/version_config.go index ccff8e95..68e56c84 100644 --- a/client/models/version_config.go +++ b/client/models/version_config.go @@ -6,7 +6,7 @@ import ( "context" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" ) // VersionConfig VersionConfig @@ -41,13 +41,13 @@ func (m *VersionConfig) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *VersionConfig) UnmarshalBinary(b []byte) error { var res VersionConfig - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/versioned_resource_type.go b/client/models/versioned_resource_type.go index c66e43fc..fda60083 100644 --- a/client/models/versioned_resource_type.go +++ b/client/models/versioned_resource_type.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -166,13 +166,13 @@ func (m *VersionedResourceType) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *VersionedResourceType) UnmarshalBinary(b []byte) error { var res VersionedResourceType - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/watch_rule.go b/client/models/watch_rule.go index b9293c90..755e4e4f 100644 --- a/client/models/watch_rule.go +++ b/client/models/watch_rule.go @@ -9,7 +9,8 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" + "github.com/go-openapi/swag/typeutils" "github.com/go-openapi/validate" ) @@ -150,7 +151,7 @@ func (m *WatchRule) validateFilters(formats strfmt.Registry) error { } for i := 0; i < len(m.Filters); i++ { - if swag.IsZero(m.Filters[i]) { // not required + if typeutils.IsZero(m.Filters[i]) { // not required continue } @@ -231,7 +232,7 @@ func (m *WatchRule) validateOrganizationCanonical(formats strfmt.Registry) error } func (m *WatchRule) validateProjectCanonical(formats strfmt.Registry) error { - if swag.IsZero(m.ProjectCanonical) { // not required + if typeutils.IsZero(m.ProjectCanonical) { // not required return nil } @@ -279,7 +280,7 @@ func (m *WatchRule) contextValidateFilters(ctx context.Context, formats strfmt.R if m.Filters[i] != nil { - if swag.IsZero(m.Filters[i]) { // not required + if typeutils.IsZero(m.Filters[i]) { // not required return nil } @@ -307,13 +308,13 @@ func (m *WatchRule) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *WatchRule) UnmarshalBinary(b []byte) error { var res WatchRule - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/watch_rule_filter.go b/client/models/watch_rule_filter.go index f3b9b41f..c7485048 100644 --- a/client/models/watch_rule_filter.go +++ b/client/models/watch_rule_filter.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -129,13 +129,13 @@ func (m *WatchRuleFilter) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *WatchRuleFilter) UnmarshalBinary(b []byte) error { var res WatchRuleFilter - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/models/worker.go b/client/models/worker.go index dbf082c2..8e6c4f00 100644 --- a/client/models/worker.go +++ b/client/models/worker.go @@ -7,7 +7,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/validate" ) @@ -181,13 +181,13 @@ func (m *Worker) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } - return swag.WriteJSON(m) + return jsonutils.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *Worker) UnmarshalBinary(b []byte) error { var res Worker - if err := swag.ReadJSON(b, &res); err != nil { + if err := jsonutils.ReadJSON(b, &res); err != nil { return err } *m = res diff --git a/client/version b/client/version index ffad31c9..e62579c0 100644 --- a/client/version +++ b/client/version @@ -1 +1 @@ -v6.10.25 +v6.10.128