diff --git a/power/models/i_k_e_policy_authentications.go b/power/models/i_k_e_policy_authentications.go deleted file mode 100644 index 930a3d61..00000000 --- a/power/models/i_k_e_policy_authentications.go +++ /dev/null @@ -1,28 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" -) - -// IKEPolicyAuthentications i k e policy authentications -// Example: ["sha-256","sha-384","sha1","none"] -// -// swagger:model IKEPolicyAuthentications -type IKEPolicyAuthentications []string - -// Validate validates this i k e policy authentications -func (m IKEPolicyAuthentications) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this i k e policy authentications based on context it is used -func (m IKEPolicyAuthentications) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/power/models/i_k_e_policy_dh_groups.go b/power/models/i_k_e_policy_dh_groups.go deleted file mode 100644 index a41c32d0..00000000 --- a/power/models/i_k_e_policy_dh_groups.go +++ /dev/null @@ -1,28 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" -) - -// IKEPolicyDhGroups i k e policy dh groups -// Example: [1,2,5,14,19,20,24] -// -// swagger:model IKEPolicyDhGroups -type IKEPolicyDhGroups []float64 - -// Validate validates this i k e policy dh groups -func (m IKEPolicyDhGroups) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this i k e policy dh groups based on context it is used -func (m IKEPolicyDhGroups) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/power/models/i_k_e_policy_encryptions.go b/power/models/i_k_e_policy_encryptions.go deleted file mode 100644 index e4642753..00000000 --- a/power/models/i_k_e_policy_encryptions.go +++ /dev/null @@ -1,28 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" -) - -// IKEPolicyEncryptions i k e policy encryptions -// Example: ["aes-256-cbc","aes-192-cbc","aes-128-cbc","aes-256-gcm","aes-128-gcm","3des-cbc"] -// -// swagger:model IKEPolicyEncryptions -type IKEPolicyEncryptions []string - -// Validate validates this i k e policy encryptions -func (m IKEPolicyEncryptions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this i k e policy encryptions based on context it is used -func (m IKEPolicyEncryptions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/power/models/i_k_e_policy_options.go b/power/models/i_k_e_policy_options.go deleted file mode 100644 index 20103eec..00000000 --- a/power/models/i_k_e_policy_options.go +++ /dev/null @@ -1,235 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// IKEPolicyOptions i k e policy options -// -// swagger:model IKEPolicyOptions -type IKEPolicyOptions struct { - - // authentications - // Required: true - Authentications IKEPolicyAuthentications `json:"authentications"` - - // dh groups - // Required: true - DhGroups IKEPolicyDhGroups `json:"dhGroups"` - - // encryptions - // Required: true - Encryptions IKEPolicyEncryptions `json:"encryptions"` - - // versions - // Required: true - Versions PolicyVersions `json:"versions"` -} - -// Validate validates this i k e policy options -func (m *IKEPolicyOptions) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAuthentications(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDhGroups(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEncryptions(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVersions(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IKEPolicyOptions) validateAuthentications(formats strfmt.Registry) error { - - if err := validate.Required("authentications", "body", m.Authentications); err != nil { - return err - } - - if err := m.Authentications.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("authentications") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("authentications") - } - return err - } - - return nil -} - -func (m *IKEPolicyOptions) validateDhGroups(formats strfmt.Registry) error { - - if err := validate.Required("dhGroups", "body", m.DhGroups); err != nil { - return err - } - - if err := m.DhGroups.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("dhGroups") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("dhGroups") - } - return err - } - - return nil -} - -func (m *IKEPolicyOptions) validateEncryptions(formats strfmt.Registry) error { - - if err := validate.Required("encryptions", "body", m.Encryptions); err != nil { - return err - } - - if err := m.Encryptions.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("encryptions") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("encryptions") - } - return err - } - - return nil -} - -func (m *IKEPolicyOptions) validateVersions(formats strfmt.Registry) error { - - if err := validate.Required("versions", "body", m.Versions); err != nil { - return err - } - - if err := m.Versions.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("versions") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("versions") - } - return err - } - - return nil -} - -// ContextValidate validate this i k e policy options based on the context it is used -func (m *IKEPolicyOptions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAuthentications(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDhGroups(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateEncryptions(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateVersions(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IKEPolicyOptions) contextValidateAuthentications(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Authentications.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("authentications") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("authentications") - } - return err - } - - return nil -} - -func (m *IKEPolicyOptions) contextValidateDhGroups(ctx context.Context, formats strfmt.Registry) error { - - if err := m.DhGroups.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("dhGroups") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("dhGroups") - } - return err - } - - return nil -} - -func (m *IKEPolicyOptions) contextValidateEncryptions(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Encryptions.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("encryptions") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("encryptions") - } - return err - } - - return nil -} - -func (m *IKEPolicyOptions) contextValidateVersions(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Versions.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("versions") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("versions") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *IKEPolicyOptions) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IKEPolicyOptions) UnmarshalBinary(b []byte) error { - var res IKEPolicyOptions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/i_k_e_policy_template.go b/power/models/i_k_e_policy_template.go deleted file mode 100644 index afcf73e6..00000000 --- a/power/models/i_k_e_policy_template.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// IKEPolicyTemplate i k e policy template -// -// swagger:model IKEPolicyTemplate -type IKEPolicyTemplate struct { - - // ikePolicy Authentication default value - // Example: sha256 - // Required: true - Authentication *string `json:"authentication"` - - // ikePolicy DHGroup default value - // Example: 2 - // Required: true - DhGroup *int64 `json:"dhGroup"` - - // ikePolicy Encryption default value - // Example: aes-256-cbc - // Required: true - Encryption *string `json:"encryption"` - - // key lifetime - // Required: true - KeyLifetime *KeyLifetime `json:"keyLifetime"` - - // ikePolicy Version default value - // Example: 2 - // Required: true - Version *float64 `json:"version"` -} - -// Validate validates this i k e policy template -func (m *IKEPolicyTemplate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAuthentication(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDhGroup(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEncryption(formats); err != nil { - res = append(res, err) - } - - if err := m.validateKeyLifetime(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVersion(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IKEPolicyTemplate) validateAuthentication(formats strfmt.Registry) error { - - if err := validate.Required("authentication", "body", m.Authentication); err != nil { - return err - } - - return nil -} - -func (m *IKEPolicyTemplate) validateDhGroup(formats strfmt.Registry) error { - - if err := validate.Required("dhGroup", "body", m.DhGroup); err != nil { - return err - } - - return nil -} - -func (m *IKEPolicyTemplate) validateEncryption(formats strfmt.Registry) error { - - if err := validate.Required("encryption", "body", m.Encryption); err != nil { - return err - } - - return nil -} - -func (m *IKEPolicyTemplate) validateKeyLifetime(formats strfmt.Registry) error { - - if err := validate.Required("keyLifetime", "body", m.KeyLifetime); err != nil { - return err - } - - if err := validate.Required("keyLifetime", "body", m.KeyLifetime); err != nil { - return err - } - - if m.KeyLifetime != nil { - if err := m.KeyLifetime.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("keyLifetime") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("keyLifetime") - } - return err - } - } - - return nil -} - -func (m *IKEPolicyTemplate) validateVersion(formats strfmt.Registry) error { - - if err := validate.Required("version", "body", m.Version); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this i k e policy template based on the context it is used -func (m *IKEPolicyTemplate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateKeyLifetime(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IKEPolicyTemplate) contextValidateKeyLifetime(ctx context.Context, formats strfmt.Registry) error { - - if m.KeyLifetime != nil { - - if err := m.KeyLifetime.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("keyLifetime") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("keyLifetime") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *IKEPolicyTemplate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IKEPolicyTemplate) UnmarshalBinary(b []byte) error { - var res IKEPolicyTemplate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/ip_s_e_c_policy_authentications.go b/power/models/ip_s_e_c_policy_authentications.go deleted file mode 100644 index e7d49a6b..00000000 --- a/power/models/ip_s_e_c_policy_authentications.go +++ /dev/null @@ -1,28 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" -) - -// IPSECPolicyAuthentications IP s e c policy authentications -// Example: ["hmac-sha-256-128","hmac-sha1-96","none"] -// -// swagger:model IPSECPolicyAuthentications -type IPSECPolicyAuthentications []string - -// Validate validates this IP s e c policy authentications -func (m IPSECPolicyAuthentications) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this IP s e c policy authentications based on context it is used -func (m IPSECPolicyAuthentications) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/power/models/ip_s_e_c_policy_dh_groups.go b/power/models/ip_s_e_c_policy_dh_groups.go deleted file mode 100644 index 3db313e5..00000000 --- a/power/models/ip_s_e_c_policy_dh_groups.go +++ /dev/null @@ -1,28 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" -) - -// IPSECPolicyDhGroups IP s e c policy dh groups -// Example: [1,2,5,14,19,20] -// -// swagger:model IPSECPolicyDhGroups -type IPSECPolicyDhGroups []float64 - -// Validate validates this IP s e c policy dh groups -func (m IPSECPolicyDhGroups) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this IP s e c policy dh groups based on context it is used -func (m IPSECPolicyDhGroups) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/power/models/ip_s_e_c_policy_encryptions.go b/power/models/ip_s_e_c_policy_encryptions.go deleted file mode 100644 index be20e38f..00000000 --- a/power/models/ip_s_e_c_policy_encryptions.go +++ /dev/null @@ -1,28 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" -) - -// IPSECPolicyEncryptions IP s e c policy encryptions -// Example: ["aes-256-cbc","aes-192-cbc","aes-128-cbc","aes-256-gcm","aes-128-gcm","3des-cbc"] -// -// swagger:model IPSECPolicyEncryptions -type IPSECPolicyEncryptions []string - -// Validate validates this IP s e c policy encryptions -func (m IPSECPolicyEncryptions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this IP s e c policy encryptions based on context it is used -func (m IPSECPolicyEncryptions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/power/models/ip_sec_policy_options.go b/power/models/ip_sec_policy_options.go deleted file mode 100644 index 07841dff..00000000 --- a/power/models/ip_sec_policy_options.go +++ /dev/null @@ -1,191 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// IPSecPolicyOptions IP sec policy options -// -// swagger:model IPSecPolicyOptions -type IPSecPolicyOptions struct { - - // authentications - // Required: true - Authentications IPSECPolicyAuthentications `json:"authentications"` - - // dh groups - // Required: true - DhGroups IPSECPolicyDhGroups `json:"dhGroups"` - - // encryptions - // Required: true - Encryptions IPSECPolicyEncryptions `json:"encryptions"` -} - -// Validate validates this IP sec policy options -func (m *IPSecPolicyOptions) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAuthentications(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDhGroups(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEncryptions(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IPSecPolicyOptions) validateAuthentications(formats strfmt.Registry) error { - - if err := validate.Required("authentications", "body", m.Authentications); err != nil { - return err - } - - if err := m.Authentications.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("authentications") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("authentications") - } - return err - } - - return nil -} - -func (m *IPSecPolicyOptions) validateDhGroups(formats strfmt.Registry) error { - - if err := validate.Required("dhGroups", "body", m.DhGroups); err != nil { - return err - } - - if err := m.DhGroups.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("dhGroups") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("dhGroups") - } - return err - } - - return nil -} - -func (m *IPSecPolicyOptions) validateEncryptions(formats strfmt.Registry) error { - - if err := validate.Required("encryptions", "body", m.Encryptions); err != nil { - return err - } - - if err := m.Encryptions.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("encryptions") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("encryptions") - } - return err - } - - return nil -} - -// ContextValidate validate this IP sec policy options based on the context it is used -func (m *IPSecPolicyOptions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAuthentications(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDhGroups(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateEncryptions(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IPSecPolicyOptions) contextValidateAuthentications(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Authentications.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("authentications") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("authentications") - } - return err - } - - return nil -} - -func (m *IPSecPolicyOptions) contextValidateDhGroups(ctx context.Context, formats strfmt.Registry) error { - - if err := m.DhGroups.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("dhGroups") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("dhGroups") - } - return err - } - - return nil -} - -func (m *IPSecPolicyOptions) contextValidateEncryptions(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Encryptions.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("encryptions") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("encryptions") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *IPSecPolicyOptions) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IPSecPolicyOptions) UnmarshalBinary(b []byte) error { - var res IPSecPolicyOptions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/ip_sec_policy_template.go b/power/models/ip_sec_policy_template.go deleted file mode 100644 index e854608c..00000000 --- a/power/models/ip_sec_policy_template.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// IPSecPolicyTemplate IP sec policy template -// -// swagger:model IPSecPolicyTemplate -type IPSecPolicyTemplate struct { - - // ipSecPolicy Authentication default value - // Example: sha256 - // Required: true - Authentication *string `json:"authentication"` - - // ipSecPolicy DHGroup default value - // Example: 2 - // Required: true - DhGroup *int64 `json:"dhGroup"` - - // ipSecPolicy Encryption default value - // Example: aes-256-cbc - // Required: true - Encryption *string `json:"encryption"` - - // key lifetime - // Required: true - KeyLifetime *KeyLifetime `json:"keyLifetime"` -} - -// Validate validates this IP sec policy template -func (m *IPSecPolicyTemplate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAuthentication(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDhGroup(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEncryption(formats); err != nil { - res = append(res, err) - } - - if err := m.validateKeyLifetime(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IPSecPolicyTemplate) validateAuthentication(formats strfmt.Registry) error { - - if err := validate.Required("authentication", "body", m.Authentication); err != nil { - return err - } - - return nil -} - -func (m *IPSecPolicyTemplate) validateDhGroup(formats strfmt.Registry) error { - - if err := validate.Required("dhGroup", "body", m.DhGroup); err != nil { - return err - } - - return nil -} - -func (m *IPSecPolicyTemplate) validateEncryption(formats strfmt.Registry) error { - - if err := validate.Required("encryption", "body", m.Encryption); err != nil { - return err - } - - return nil -} - -func (m *IPSecPolicyTemplate) validateKeyLifetime(formats strfmt.Registry) error { - - if err := validate.Required("keyLifetime", "body", m.KeyLifetime); err != nil { - return err - } - - if err := validate.Required("keyLifetime", "body", m.KeyLifetime); err != nil { - return err - } - - if m.KeyLifetime != nil { - if err := m.KeyLifetime.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("keyLifetime") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("keyLifetime") - } - return err - } - } - - return nil -} - -// ContextValidate validate this IP sec policy template based on the context it is used -func (m *IPSecPolicyTemplate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateKeyLifetime(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IPSecPolicyTemplate) contextValidateKeyLifetime(ctx context.Context, formats strfmt.Registry) error { - - if m.KeyLifetime != nil { - - if err := m.KeyLifetime.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("keyLifetime") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("keyLifetime") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *IPSecPolicyTemplate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IPSecPolicyTemplate) UnmarshalBinary(b []byte) error { - var res IPSecPolicyTemplate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/network_security_group_rule_protocol.go b/power/models/network_security_group_rule_protocol.go index f55e1272..3cb7cd17 100644 --- a/power/models/network_security_group_rule_protocol.go +++ b/power/models/network_security_group_rule_protocol.go @@ -21,8 +21,9 @@ import ( // swagger:model NetworkSecurityGroupRuleProtocol type NetworkSecurityGroupRuleProtocol struct { - // If icmp type, the list of ICMP packet types (by numbers) affected by ICMP rules and if not present then all types are matched - IcmpTypes []int64 `json:"icmpTypes"` + // If icmp type, a ICMP packet type affected by ICMP rules and if not present then all types are matched + // Enum: ["all","echo","echo-reply","source-quench","time-exceeded","destination-unreach"] + IcmpType *string `json:"icmpType,omitempty"` // If tcp type, the list of TCP flags and if not present then all flags are matched TCPFlags []*NetworkSecurityGroupRuleProtocolTCPFlag `json:"tcpFlags"` @@ -36,6 +37,10 @@ type NetworkSecurityGroupRuleProtocol struct { func (m *NetworkSecurityGroupRuleProtocol) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateIcmpType(formats); err != nil { + res = append(res, err) + } + if err := m.validateTCPFlags(formats); err != nil { res = append(res, err) } @@ -50,6 +55,60 @@ func (m *NetworkSecurityGroupRuleProtocol) Validate(formats strfmt.Registry) err return nil } +var networkSecurityGroupRuleProtocolTypeIcmpTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["all","echo","echo-reply","source-quench","time-exceeded","destination-unreach"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + networkSecurityGroupRuleProtocolTypeIcmpTypePropEnum = append(networkSecurityGroupRuleProtocolTypeIcmpTypePropEnum, v) + } +} + +const ( + + // NetworkSecurityGroupRuleProtocolIcmpTypeAll captures enum value "all" + NetworkSecurityGroupRuleProtocolIcmpTypeAll string = "all" + + // NetworkSecurityGroupRuleProtocolIcmpTypeEcho captures enum value "echo" + NetworkSecurityGroupRuleProtocolIcmpTypeEcho string = "echo" + + // NetworkSecurityGroupRuleProtocolIcmpTypeEchoDashReply captures enum value "echo-reply" + NetworkSecurityGroupRuleProtocolIcmpTypeEchoDashReply string = "echo-reply" + + // NetworkSecurityGroupRuleProtocolIcmpTypeSourceDashQuench captures enum value "source-quench" + NetworkSecurityGroupRuleProtocolIcmpTypeSourceDashQuench string = "source-quench" + + // NetworkSecurityGroupRuleProtocolIcmpTypeTimeDashExceeded captures enum value "time-exceeded" + NetworkSecurityGroupRuleProtocolIcmpTypeTimeDashExceeded string = "time-exceeded" + + // NetworkSecurityGroupRuleProtocolIcmpTypeDestinationDashUnreach captures enum value "destination-unreach" + NetworkSecurityGroupRuleProtocolIcmpTypeDestinationDashUnreach string = "destination-unreach" +) + +// prop value enum +func (m *NetworkSecurityGroupRuleProtocol) validateIcmpTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, networkSecurityGroupRuleProtocolTypeIcmpTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *NetworkSecurityGroupRuleProtocol) validateIcmpType(formats strfmt.Registry) error { + if swag.IsZero(m.IcmpType) { // not required + return nil + } + + // value enum + if err := m.validateIcmpTypeEnum("icmpType", "body", *m.IcmpType); err != nil { + return err + } + + return nil +} + func (m *NetworkSecurityGroupRuleProtocol) validateTCPFlags(formats strfmt.Registry) error { if swag.IsZero(m.TCPFlags) { // not required return nil diff --git a/power/models/options.go b/power/models/options.go deleted file mode 100644 index 19f536f0..00000000 --- a/power/models/options.go +++ /dev/null @@ -1,108 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Options options -// -// swagger:model Options -type Options struct { - - // vpnaas options - // Required: true - VpnaasOptions *VPNaaSOptions `json:"vpnaasOptions"` -} - -// Validate validates this options -func (m *Options) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateVpnaasOptions(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Options) validateVpnaasOptions(formats strfmt.Registry) error { - - if err := validate.Required("vpnaasOptions", "body", m.VpnaasOptions); err != nil { - return err - } - - if m.VpnaasOptions != nil { - if err := m.VpnaasOptions.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vpnaasOptions") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("vpnaasOptions") - } - return err - } - } - - return nil -} - -// ContextValidate validate this options based on the context it is used -func (m *Options) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateVpnaasOptions(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Options) contextValidateVpnaasOptions(ctx context.Context, formats strfmt.Registry) error { - - if m.VpnaasOptions != nil { - - if err := m.VpnaasOptions.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("vpnaasOptions") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("vpnaasOptions") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Options) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Options) UnmarshalBinary(b []byte) error { - var res Options - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/p_vm_instance_address.go b/power/models/p_vm_instance_address.go deleted file mode 100644 index 48dee66d..00000000 --- a/power/models/p_vm_instance_address.go +++ /dev/null @@ -1,75 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// PVMInstanceAddress deprecated - replaced by PVMInstanceNetwork -// -// swagger:model PVMInstanceAddress -type PVMInstanceAddress struct { - PVMInstanceNetwork -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *PVMInstanceAddress) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 PVMInstanceNetwork - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.PVMInstanceNetwork = aO0 - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m PVMInstanceAddress) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 1) - - aO0, err := swag.WriteJSON(m.PVMInstanceNetwork) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this p VM instance address -func (m *PVMInstanceAddress) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with PVMInstanceNetwork - if err := m.PVMInstanceNetwork.Validate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this p VM instance address based on the context it is used -func (m *PVMInstanceAddress) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with PVMInstanceNetwork - if err := m.PVMInstanceNetwork.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/models/policy_versions.go b/power/models/policy_versions.go deleted file mode 100644 index fa426855..00000000 --- a/power/models/policy_versions.go +++ /dev/null @@ -1,28 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" -) - -// PolicyVersions policy versions -// Example: [1,2] -// -// swagger:model PolicyVersions -type PolicyVersions []float64 - -// Validate validates this policy versions -func (m PolicyVersions) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this policy versions based on context it is used -func (m PolicyVersions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/power/models/storage_tiers.go b/power/models/storage_tiers.go deleted file mode 100644 index 7a8a46ec..00000000 --- a/power/models/storage_tiers.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// StorageTiers A map of an array of storage tiers supported in a region -// -// swagger:model StorageTiers -type StorageTiers map[string]RegionStorageTiers - -// Validate validates this storage tiers -func (m StorageTiers) Validate(formats strfmt.Registry) error { - var res []error - - for k := range m { - - if err := validate.Required(k, "body", m[k]); err != nil { - return err - } - - if err := m[k].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(k) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(k) - } - return err - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this storage tiers based on the context it is used -func (m StorageTiers) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for k := range m { - - if err := m[k].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(k) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(k) - } - return err - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/models/v_p_naa_s_options.go b/power/models/v_p_naa_s_options.go deleted file mode 100644 index 220ee9c2..00000000 --- a/power/models/v_p_naa_s_options.go +++ /dev/null @@ -1,304 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VPNaaSOptions v p naa s options -// -// swagger:model VPNaaSOptions -type VPNaaSOptions struct { - - // dead peer detection - // Required: true - DeadPeerDetection *DeadPeerDetection `json:"deadPeerDetection"` - - // ike policy options - // Required: true - IkePolicyOptions *IKEPolicyOptions `json:"ikePolicyOptions"` - - // ike policy template - // Required: true - IkePolicyTemplate *IKEPolicyTemplate `json:"ikePolicyTemplate"` - - // ip sec policy options - // Required: true - IPSecPolicyOptions *IPSecPolicyOptions `json:"ipSecPolicyOptions"` - - // ip sec policy template - // Required: true - IPSecPolicyTemplate *IPSecPolicyTemplate `json:"ipSecPolicyTemplate"` -} - -// Validate validates this v p naa s options -func (m *VPNaaSOptions) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDeadPeerDetection(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIkePolicyOptions(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIkePolicyTemplate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIPSecPolicyOptions(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIPSecPolicyTemplate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VPNaaSOptions) validateDeadPeerDetection(formats strfmt.Registry) error { - - if err := validate.Required("deadPeerDetection", "body", m.DeadPeerDetection); err != nil { - return err - } - - if m.DeadPeerDetection != nil { - if err := m.DeadPeerDetection.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("deadPeerDetection") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("deadPeerDetection") - } - return err - } - } - - return nil -} - -func (m *VPNaaSOptions) validateIkePolicyOptions(formats strfmt.Registry) error { - - if err := validate.Required("ikePolicyOptions", "body", m.IkePolicyOptions); err != nil { - return err - } - - if m.IkePolicyOptions != nil { - if err := m.IkePolicyOptions.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ikePolicyOptions") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ikePolicyOptions") - } - return err - } - } - - return nil -} - -func (m *VPNaaSOptions) validateIkePolicyTemplate(formats strfmt.Registry) error { - - if err := validate.Required("ikePolicyTemplate", "body", m.IkePolicyTemplate); err != nil { - return err - } - - if m.IkePolicyTemplate != nil { - if err := m.IkePolicyTemplate.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ikePolicyTemplate") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ikePolicyTemplate") - } - return err - } - } - - return nil -} - -func (m *VPNaaSOptions) validateIPSecPolicyOptions(formats strfmt.Registry) error { - - if err := validate.Required("ipSecPolicyOptions", "body", m.IPSecPolicyOptions); err != nil { - return err - } - - if m.IPSecPolicyOptions != nil { - if err := m.IPSecPolicyOptions.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ipSecPolicyOptions") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ipSecPolicyOptions") - } - return err - } - } - - return nil -} - -func (m *VPNaaSOptions) validateIPSecPolicyTemplate(formats strfmt.Registry) error { - - if err := validate.Required("ipSecPolicyTemplate", "body", m.IPSecPolicyTemplate); err != nil { - return err - } - - if m.IPSecPolicyTemplate != nil { - if err := m.IPSecPolicyTemplate.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ipSecPolicyTemplate") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ipSecPolicyTemplate") - } - return err - } - } - - return nil -} - -// ContextValidate validate this v p naa s options based on the context it is used -func (m *VPNaaSOptions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDeadPeerDetection(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateIkePolicyOptions(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateIkePolicyTemplate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateIPSecPolicyOptions(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateIPSecPolicyTemplate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VPNaaSOptions) contextValidateDeadPeerDetection(ctx context.Context, formats strfmt.Registry) error { - - if m.DeadPeerDetection != nil { - - if err := m.DeadPeerDetection.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("deadPeerDetection") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("deadPeerDetection") - } - return err - } - } - - return nil -} - -func (m *VPNaaSOptions) contextValidateIkePolicyOptions(ctx context.Context, formats strfmt.Registry) error { - - if m.IkePolicyOptions != nil { - - if err := m.IkePolicyOptions.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ikePolicyOptions") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ikePolicyOptions") - } - return err - } - } - - return nil -} - -func (m *VPNaaSOptions) contextValidateIkePolicyTemplate(ctx context.Context, formats strfmt.Registry) error { - - if m.IkePolicyTemplate != nil { - - if err := m.IkePolicyTemplate.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ikePolicyTemplate") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ikePolicyTemplate") - } - return err - } - } - - return nil -} - -func (m *VPNaaSOptions) contextValidateIPSecPolicyOptions(ctx context.Context, formats strfmt.Registry) error { - - if m.IPSecPolicyOptions != nil { - - if err := m.IPSecPolicyOptions.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ipSecPolicyOptions") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ipSecPolicyOptions") - } - return err - } - } - - return nil -} - -func (m *VPNaaSOptions) contextValidateIPSecPolicyTemplate(ctx context.Context, formats strfmt.Registry) error { - - if m.IPSecPolicyTemplate != nil { - - if err := m.IPSecPolicyTemplate.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ipSecPolicyTemplate") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ipSecPolicyTemplate") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *VPNaaSOptions) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VPNaaSOptions) UnmarshalBinary(b []byte) error { - var res VPNaaSOptions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -}