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

package model

// 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"
)

// PrivateAWS Message for AWS PrivateLink information.
//
// swagger:model PrivateAWS
type PrivateAWS struct {

	// Output_only. The availability zones that the service is available in.
	// Read Only: true
	AvailabilityZone []string `json:"availabilityZone"`

	// Output_only. The AWS service name for private access.
	// Read Only: true
	ServiceName string `json:"serviceName,omitempty"`
}

// Validate validates this private a w s
func (m *PrivateAWS) Validate(formats strfmt.Registry) error {
	return nil
}

// ContextValidate validate this private a w s based on the context it is used
func (m *PrivateAWS) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	var res []error

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

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

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

func (m *PrivateAWS) contextValidateAvailabilityZone(ctx context.Context, formats strfmt.Registry) error {

	if err := validate.ReadOnly(ctx, "availabilityZone", "body", []string(m.AvailabilityZone)); err != nil {
		return err
	}

	return nil
}

func (m *PrivateAWS) contextValidateServiceName(ctx context.Context, formats strfmt.Registry) error {

	if err := validate.ReadOnly(ctx, "serviceName", "body", string(m.ServiceName)); err != nil {
		return err
	}

	return nil
}

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

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