// Code generated by go-swagger; DO NOT EDIT.

package models

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"context"
	"strconv"

	"github.com/go-openapi/errors"
	"github.com/go-openapi/strfmt"
	"github.com/go-openapi/swag"
)

// SecretServiceCreateIntegrationBody secret service create integration body
//
// swagger:model SecretServiceCreateIntegrationBody
type SecretServiceCreateIntegrationBody struct {

	// aws access keys
	AwsAccessKeys *Secrets20231128AwsAccessKeysRequest `json:"aws_access_keys,omitempty"`

	// aws federated workload identity
	AwsFederatedWorkloadIdentity *Secrets20231128AwsFederatedWorkloadIdentityRequest `json:"aws_federated_workload_identity,omitempty"`

	// azure client secret
	AzureClientSecret *Secrets20231128AzureClientSecretRequest `json:"azure_client_secret,omitempty"`

	// azure federated workload identity
	AzureFederatedWorkloadIdentity *Secrets20231128AzureFederatedWorkloadIdentityRequest `json:"azure_federated_workload_identity,omitempty"`

	// capabilities
	Capabilities []*Secrets20231128Capability `json:"capabilities"`

	// confluent static credentials
	ConfluentStaticCredentials *Secrets20231128ConfluentStaticCredentialsRequest `json:"confluent_static_credentials,omitempty"`

	// gateway pool id
	GatewayPoolID string `json:"gateway_pool_id,omitempty"`

	// gcp federated workload identity
	GcpFederatedWorkloadIdentity *Secrets20231128GcpFederatedWorkloadIdentityRequest `json:"gcp_federated_workload_identity,omitempty"`

	// gcp service account key
	GcpServiceAccountKey *Secrets20231128GcpServiceAccountKeyRequest `json:"gcp_service_account_key,omitempty"`

	// gitlab access token
	GitlabAccessToken *Secrets20231128GitlabAccessTokenRequest `json:"gitlab_access_token,omitempty"`

	// hcp terraform api token
	HcpTerraformAPIToken *Secrets20231128HcpTerraformAPITokenRequest `json:"hcp_terraform_api_token,omitempty"`

	// mongo db atlas static credentials
	MongoDbAtlasStaticCredentials *Secrets20231128MongoDBAtlasStaticCredentialsRequest `json:"mongo_db_atlas_static_credentials,omitempty"`

	// mssql static credentials
	MssqlStaticCredentials *Secrets20231128MssqlStaticCredentialsRequest `json:"mssql_static_credentials,omitempty"`

	// mysql static credentials
	MysqlStaticCredentials *Secrets20231128MysqlStaticCredentialsRequest `json:"mysql_static_credentials,omitempty"`

	// name
	Name string `json:"name,omitempty"`

	// postgres static credentials
	PostgresStaticCredentials *Secrets20231128PostgresStaticCredentialsRequest `json:"postgres_static_credentials,omitempty"`

	// provider
	Provider string `json:"provider,omitempty"`

	// twilio static credentials
	TwilioStaticCredentials *Secrets20231128TwilioStaticCredentialsRequest `json:"twilio_static_credentials,omitempty"`
}

// Validate validates this secret service create integration body
func (m *SecretServiceCreateIntegrationBody) Validate(formats strfmt.Registry) error {
	var res []error

	if err := m.validateAwsAccessKeys(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateAwsFederatedWorkloadIdentity(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateAzureClientSecret(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateAzureFederatedWorkloadIdentity(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateCapabilities(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateConfluentStaticCredentials(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateGcpFederatedWorkloadIdentity(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateGcpServiceAccountKey(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateGitlabAccessToken(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateHcpTerraformAPIToken(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateMongoDbAtlasStaticCredentials(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateMssqlStaticCredentials(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateMysqlStaticCredentials(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validatePostgresStaticCredentials(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateTwilioStaticCredentials(formats); err != nil {
		res = append(res, err)
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}

func (m *SecretServiceCreateIntegrationBody) validateAwsAccessKeys(formats strfmt.Registry) error {
	if swag.IsZero(m.AwsAccessKeys) { // not required
		return nil
	}

	if m.AwsAccessKeys != nil {
		if err := m.AwsAccessKeys.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("aws_access_keys")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("aws_access_keys")
			}
			return err
		}
	}

	return nil
}

func (m *SecretServiceCreateIntegrationBody) validateAwsFederatedWorkloadIdentity(formats strfmt.Registry) error {
	if swag.IsZero(m.AwsFederatedWorkloadIdentity) { // not required
		return nil
	}

	if m.AwsFederatedWorkloadIdentity != nil {
		if err := m.AwsFederatedWorkloadIdentity.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("aws_federated_workload_identity")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("aws_federated_workload_identity")
			}
			return err
		}
	}

	return nil
}

func (m *SecretServiceCreateIntegrationBody) validateAzureClientSecret(formats strfmt.Registry) error {
	if swag.IsZero(m.AzureClientSecret) { // not required
		return nil
	}

	if m.AzureClientSecret != nil {
		if err := m.AzureClientSecret.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("azure_client_secret")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("azure_client_secret")
			}
			return err
		}
	}

	return nil
}

func (m *SecretServiceCreateIntegrationBody) validateAzureFederatedWorkloadIdentity(formats strfmt.Registry) error {
	if swag.IsZero(m.AzureFederatedWorkloadIdentity) { // not required
		return nil
	}

	if m.AzureFederatedWorkloadIdentity != nil {
		if err := m.AzureFederatedWorkloadIdentity.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("azure_federated_workload_identity")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("azure_federated_workload_identity")
			}
			return err
		}
	}

	return nil
}

func (m *SecretServiceCreateIntegrationBody) validateCapabilities(formats strfmt.Registry) error {
	if swag.IsZero(m.Capabilities) { // not required
		return nil
	}

	for i := 0; i < len(m.Capabilities); i++ {
		if swag.IsZero(m.Capabilities[i]) { // not required
			continue
		}

		if m.Capabilities[i] != nil {
			if err := m.Capabilities[i].Validate(formats); err != nil {
				if ve, ok := err.(*errors.Validation); ok {
					return ve.ValidateName("capabilities" + "." + strconv.Itoa(i))
				} else if ce, ok := err.(*errors.CompositeError); ok {
					return ce.ValidateName("capabilities" + "." + strconv.Itoa(i))
				}
				return err
			}
		}

	}

	return nil
}

func (m *SecretServiceCreateIntegrationBody) validateConfluentStaticCredentials(formats strfmt.Registry) error {
	if swag.IsZero(m.ConfluentStaticCredentials) { // not required
		return nil
	}

	if m.ConfluentStaticCredentials != nil {
		if err := m.ConfluentStaticCredentials.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("confluent_static_credentials")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("confluent_static_credentials")
			}
			return err
		}
	}

	return nil
}

func (m *SecretServiceCreateIntegrationBody) validateGcpFederatedWorkloadIdentity(formats strfmt.Registry) error {
	if swag.IsZero(m.GcpFederatedWorkloadIdentity) { // not required
		return nil
	}

	if m.GcpFederatedWorkloadIdentity != nil {
		if err := m.GcpFederatedWorkloadIdentity.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("gcp_federated_workload_identity")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("gcp_federated_workload_identity")
			}
			return err
		}
	}

	return nil
}

func (m *SecretServiceCreateIntegrationBody) validateGcpServiceAccountKey(formats strfmt.Registry) error {
	if swag.IsZero(m.GcpServiceAccountKey) { // not required
		return nil
	}

	if m.GcpServiceAccountKey != nil {
		if err := m.GcpServiceAccountKey.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("gcp_service_account_key")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("gcp_service_account_key")
			}
			return err
		}
	}

	return nil
}

func (m *SecretServiceCreateIntegrationBody) validateGitlabAccessToken(formats strfmt.Registry) error {
	if swag.IsZero(m.GitlabAccessToken) { // not required
		return nil
	}

	if m.GitlabAccessToken != nil {
		if err := m.GitlabAccessToken.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("gitlab_access_token")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("gitlab_access_token")
			}
			return err
		}
	}

	return nil
}

func (m *SecretServiceCreateIntegrationBody) validateHcpTerraformAPIToken(formats strfmt.Registry) error {
	if swag.IsZero(m.HcpTerraformAPIToken) { // not required
		return nil
	}

	if m.HcpTerraformAPIToken != nil {
		if err := m.HcpTerraformAPIToken.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("hcp_terraform_api_token")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("hcp_terraform_api_token")
			}
			return err
		}
	}

	return nil
}

func (m *SecretServiceCreateIntegrationBody) validateMongoDbAtlasStaticCredentials(formats strfmt.Registry) error {
	if swag.IsZero(m.MongoDbAtlasStaticCredentials) { // not required
		return nil
	}

	if m.MongoDbAtlasStaticCredentials != nil {
		if err := m.MongoDbAtlasStaticCredentials.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("mongo_db_atlas_static_credentials")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("mongo_db_atlas_static_credentials")
			}
			return err
		}
	}

	return nil
}

func (m *SecretServiceCreateIntegrationBody) validateMssqlStaticCredentials(formats strfmt.Registry) error {
	if swag.IsZero(m.MssqlStaticCredentials) { // not required
		return nil
	}

	if m.MssqlStaticCredentials != nil {
		if err := m.MssqlStaticCredentials.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("mssql_static_credentials")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("mssql_static_credentials")
			}
			return err
		}
	}

	return nil
}

func (m *SecretServiceCreateIntegrationBody) validateMysqlStaticCredentials(formats strfmt.Registry) error {
	if swag.IsZero(m.MysqlStaticCredentials) { // not required
		return nil
	}

	if m.MysqlStaticCredentials != nil {
		if err := m.MysqlStaticCredentials.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("mysql_static_credentials")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("mysql_static_credentials")
			}
			return err
		}
	}

	return nil
}

func (m *SecretServiceCreateIntegrationBody) validatePostgresStaticCredentials(formats strfmt.Registry) error {
	if swag.IsZero(m.PostgresStaticCredentials) { // not required
		return nil
	}

	if m.PostgresStaticCredentials != nil {
		if err := m.PostgresStaticCredentials.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("postgres_static_credentials")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("postgres_static_credentials")
			}
			return err
		}
	}

	return nil
}

func (m *SecretServiceCreateIntegrationBody) validateTwilioStaticCredentials(formats strfmt.Registry) error {
	if swag.IsZero(m.TwilioStaticCredentials) { // not required
		return nil
	}

	if m.TwilioStaticCredentials != nil {
		if err := m.TwilioStaticCredentials.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("twilio_static_credentials")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("twilio_static_credentials")
			}
			return err
		}
	}

	return nil
}

// ContextValidate validate this secret service create integration body based on the context it is used
func (m *SecretServiceCreateIntegrationBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	var res []error

	if err := m.contextValidateAwsAccessKeys(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := m.contextValidateAwsFederatedWorkloadIdentity(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := m.contextValidateAzureClientSecret(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := m.contextValidateAzureFederatedWorkloadIdentity(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := m.contextValidateCapabilities(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := m.contextValidateConfluentStaticCredentials(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := m.contextValidateGcpFederatedWorkloadIdentity(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := m.contextValidateGcpServiceAccountKey(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := m.contextValidateGitlabAccessToken(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := m.contextValidateHcpTerraformAPIToken(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := m.contextValidateMongoDbAtlasStaticCredentials(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := m.contextValidateMssqlStaticCredentials(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := m.contextValidateMysqlStaticCredentials(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := m.contextValidatePostgresStaticCredentials(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := m.contextValidateTwilioStaticCredentials(ctx, formats); err != nil {
		res = append(res, err)
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}

func (m *SecretServiceCreateIntegrationBody) contextValidateAwsAccessKeys(ctx context.Context, formats strfmt.Registry) error {

	if m.AwsAccessKeys != nil {

		if swag.IsZero(m.AwsAccessKeys) { // not required
			return nil
		}

		if err := m.AwsAccessKeys.ContextValidate(ctx, formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("aws_access_keys")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("aws_access_keys")
			}
			return err
		}
	}

	return nil
}

func (m *SecretServiceCreateIntegrationBody) contextValidateAwsFederatedWorkloadIdentity(ctx context.Context, formats strfmt.Registry) error {

	if m.AwsFederatedWorkloadIdentity != nil {

		if swag.IsZero(m.AwsFederatedWorkloadIdentity) { // not required
			return nil
		}

		if err := m.AwsFederatedWorkloadIdentity.ContextValidate(ctx, formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("aws_federated_workload_identity")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("aws_federated_workload_identity")
			}
			return err
		}
	}

	return nil
}

func (m *SecretServiceCreateIntegrationBody) contextValidateAzureClientSecret(ctx context.Context, formats strfmt.Registry) error {

	if m.AzureClientSecret != nil {

		if swag.IsZero(m.AzureClientSecret) { // not required
			return nil
		}

		if err := m.AzureClientSecret.ContextValidate(ctx, formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("azure_client_secret")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("azure_client_secret")
			}
			return err
		}
	}

	return nil
}

func (m *SecretServiceCreateIntegrationBody) contextValidateAzureFederatedWorkloadIdentity(ctx context.Context, formats strfmt.Registry) error {

	if m.AzureFederatedWorkloadIdentity != nil {

		if swag.IsZero(m.AzureFederatedWorkloadIdentity) { // not required
			return nil
		}

		if err := m.AzureFederatedWorkloadIdentity.ContextValidate(ctx, formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("azure_federated_workload_identity")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("azure_federated_workload_identity")
			}
			return err
		}
	}

	return nil
}

func (m *SecretServiceCreateIntegrationBody) contextValidateCapabilities(ctx context.Context, formats strfmt.Registry) error {

	for i := 0; i < len(m.Capabilities); i++ {

		if m.Capabilities[i] != nil {

			if swag.IsZero(m.Capabilities[i]) { // not required
				return nil
			}

			if err := m.Capabilities[i].ContextValidate(ctx, formats); err != nil {
				if ve, ok := err.(*errors.Validation); ok {
					return ve.ValidateName("capabilities" + "." + strconv.Itoa(i))
				} else if ce, ok := err.(*errors.CompositeError); ok {
					return ce.ValidateName("capabilities" + "." + strconv.Itoa(i))
				}
				return err
			}
		}

	}

	return nil
}

func (m *SecretServiceCreateIntegrationBody) contextValidateConfluentStaticCredentials(ctx context.Context, formats strfmt.Registry) error {

	if m.ConfluentStaticCredentials != nil {

		if swag.IsZero(m.ConfluentStaticCredentials) { // not required
			return nil
		}

		if err := m.ConfluentStaticCredentials.ContextValidate(ctx, formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("confluent_static_credentials")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("confluent_static_credentials")
			}
			return err
		}
	}

	return nil
}

func (m *SecretServiceCreateIntegrationBody) contextValidateGcpFederatedWorkloadIdentity(ctx context.Context, formats strfmt.Registry) error {

	if m.GcpFederatedWorkloadIdentity != nil {

		if swag.IsZero(m.GcpFederatedWorkloadIdentity) { // not required
			return nil
		}

		if err := m.GcpFederatedWorkloadIdentity.ContextValidate(ctx, formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("gcp_federated_workload_identity")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("gcp_federated_workload_identity")
			}
			return err
		}
	}

	return nil
}

func (m *SecretServiceCreateIntegrationBody) contextValidateGcpServiceAccountKey(ctx context.Context, formats strfmt.Registry) error {

	if m.GcpServiceAccountKey != nil {

		if swag.IsZero(m.GcpServiceAccountKey) { // not required
			return nil
		}

		if err := m.GcpServiceAccountKey.ContextValidate(ctx, formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("gcp_service_account_key")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("gcp_service_account_key")
			}
			return err
		}
	}

	return nil
}

func (m *SecretServiceCreateIntegrationBody) contextValidateGitlabAccessToken(ctx context.Context, formats strfmt.Registry) error {

	if m.GitlabAccessToken != nil {

		if swag.IsZero(m.GitlabAccessToken) { // not required
			return nil
		}

		if err := m.GitlabAccessToken.ContextValidate(ctx, formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("gitlab_access_token")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("gitlab_access_token")
			}
			return err
		}
	}

	return nil
}

func (m *SecretServiceCreateIntegrationBody) contextValidateHcpTerraformAPIToken(ctx context.Context, formats strfmt.Registry) error {

	if m.HcpTerraformAPIToken != nil {

		if swag.IsZero(m.HcpTerraformAPIToken) { // not required
			return nil
		}

		if err := m.HcpTerraformAPIToken.ContextValidate(ctx, formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("hcp_terraform_api_token")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("hcp_terraform_api_token")
			}
			return err
		}
	}

	return nil
}

func (m *SecretServiceCreateIntegrationBody) contextValidateMongoDbAtlasStaticCredentials(ctx context.Context, formats strfmt.Registry) error {

	if m.MongoDbAtlasStaticCredentials != nil {

		if swag.IsZero(m.MongoDbAtlasStaticCredentials) { // not required
			return nil
		}

		if err := m.MongoDbAtlasStaticCredentials.ContextValidate(ctx, formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("mongo_db_atlas_static_credentials")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("mongo_db_atlas_static_credentials")
			}
			return err
		}
	}

	return nil
}

func (m *SecretServiceCreateIntegrationBody) contextValidateMssqlStaticCredentials(ctx context.Context, formats strfmt.Registry) error {

	if m.MssqlStaticCredentials != nil {

		if swag.IsZero(m.MssqlStaticCredentials) { // not required
			return nil
		}

		if err := m.MssqlStaticCredentials.ContextValidate(ctx, formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("mssql_static_credentials")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("mssql_static_credentials")
			}
			return err
		}
	}

	return nil
}

func (m *SecretServiceCreateIntegrationBody) contextValidateMysqlStaticCredentials(ctx context.Context, formats strfmt.Registry) error {

	if m.MysqlStaticCredentials != nil {

		if swag.IsZero(m.MysqlStaticCredentials) { // not required
			return nil
		}

		if err := m.MysqlStaticCredentials.ContextValidate(ctx, formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("mysql_static_credentials")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("mysql_static_credentials")
			}
			return err
		}
	}

	return nil
}

func (m *SecretServiceCreateIntegrationBody) contextValidatePostgresStaticCredentials(ctx context.Context, formats strfmt.Registry) error {

	if m.PostgresStaticCredentials != nil {

		if swag.IsZero(m.PostgresStaticCredentials) { // not required
			return nil
		}

		if err := m.PostgresStaticCredentials.ContextValidate(ctx, formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("postgres_static_credentials")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("postgres_static_credentials")
			}
			return err
		}
	}

	return nil
}

func (m *SecretServiceCreateIntegrationBody) contextValidateTwilioStaticCredentials(ctx context.Context, formats strfmt.Registry) error {

	if m.TwilioStaticCredentials != nil {

		if swag.IsZero(m.TwilioStaticCredentials) { // not required
			return nil
		}

		if err := m.TwilioStaticCredentials.ContextValidate(ctx, formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("twilio_static_credentials")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("twilio_static_credentials")
			}
			return err
		}
	}

	return nil
}

// MarshalBinary interface implementation
func (m *SecretServiceCreateIntegrationBody) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}

// UnmarshalBinary interface implementation
func (m *SecretServiceCreateIntegrationBody) UnmarshalBinary(b []byte) error {
	var res SecretServiceCreateIntegrationBody
	if err := swag.ReadJSON(b, &res); err != nil {
		return err
	}
	*m = res
	return nil
}
