jkawamoto/roadie

View on GitHub
cloud/azure/resource/models/deployment_operation.go

Summary

Maintainability
A
1 hr
Test Coverage
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 (
    strfmt "github.com/go-openapi/strfmt"

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

// DeploymentOperation Deployment operation information.
// swagger:model DeploymentOperation
type DeploymentOperation struct {

    // Full deployment operation ID.
    // Read Only: true
    ID string `json:"id,omitempty"`

    // Deployment operation ID.
    // Read Only: true
    OperationID string `json:"operationId,omitempty"`

    // Deployment properties.
    Properties *DeploymentOperationProperties `json:"properties,omitempty"`
}

// Validate validates this deployment operation
func (m *DeploymentOperation) Validate(formats strfmt.Registry) error {
    var res []error

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

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

func (m *DeploymentOperation) validateProperties(formats strfmt.Registry) error {

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

    if m.Properties != nil {

        if err := m.Properties.Validate(formats); err != nil {
            if ve, ok := err.(*errors.Validation); ok {
                return ve.ValidateName("properties")
            }
            return err
        }
    }

    return nil
}