jkawamoto/roadie

View on GitHub
cloud/azure/batch/models/pool_evaluate_auto_scale_parameter.go

Summary

Maintainability
A
2 hrs
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/validate"
)

// PoolEvaluateAutoScaleParameter Options for evaluating an automatic scaling formula on a pool.
// swagger:model PoolEvaluateAutoScaleParameter
type PoolEvaluateAutoScaleParameter struct {

    // The formula for the desired number of compute nodes in the pool.
    //
    // The formula is validated and its results calculated, but it is not applied to the pool. To apply the formula to the pool, 'Enable automatic scaling on a pool'. For more information about specifying this formula, see Automatically scale compute nodes in an Azure Batch pool (https://azure.microsoft.com/en-us/documentation/articles/batch-automatic-scaling).
    // Required: true
    AutoScaleFormula *string `json:"autoScaleFormula"`
}

// Validate validates this pool evaluate auto scale parameter
func (m *PoolEvaluateAutoScaleParameter) Validate(formats strfmt.Registry) error {
    var res []error

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

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

func (m *PoolEvaluateAutoScaleParameter) validateAutoScaleFormula(formats strfmt.Registry) error {

    if err := validate.Required("autoScaleFormula", "body", m.AutoScaleFormula); err != nil {
        return err
    }

    return nil
}