github.com/minio/console@v1.4.1/models/update_service_account_request.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  // This file is part of MinIO Console Server
     4  // Copyright (c) 2023 MinIO, Inc.
     5  //
     6  // This program is free software: you can redistribute it and/or modify
     7  // it under the terms of the GNU Affero General Public License as published by
     8  // the Free Software Foundation, either version 3 of the License, or
     9  // (at your option) any later version.
    10  //
    11  // This program is distributed in the hope that it will be useful,
    12  // but WITHOUT ANY WARRANTY; without even the implied warranty of
    13  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    14  // GNU Affero General Public License for more details.
    15  //
    16  // You should have received a copy of the GNU Affero General Public License
    17  // along with this program.  If not, see <http://www.gnu.org/licenses/>.
    18  //
    19  
    20  package models
    21  
    22  // This file was generated by the swagger tool.
    23  // Editing this file might prove futile when you re-run the swagger generate command
    24  
    25  import (
    26  	"context"
    27  
    28  	"github.com/go-openapi/errors"
    29  	"github.com/go-openapi/strfmt"
    30  	"github.com/go-openapi/swag"
    31  	"github.com/go-openapi/validate"
    32  )
    33  
    34  // UpdateServiceAccountRequest update service account request
    35  //
    36  // swagger:model updateServiceAccountRequest
    37  type UpdateServiceAccountRequest struct {
    38  
    39  	// description
    40  	Description string `json:"description,omitempty"`
    41  
    42  	// expiry
    43  	Expiry string `json:"expiry,omitempty"`
    44  
    45  	// name
    46  	Name string `json:"name,omitempty"`
    47  
    48  	// policy
    49  	// Required: true
    50  	Policy *string `json:"policy"`
    51  
    52  	// secret key
    53  	SecretKey string `json:"secretKey,omitempty"`
    54  
    55  	// status
    56  	Status string `json:"status,omitempty"`
    57  }
    58  
    59  // Validate validates this update service account request
    60  func (m *UpdateServiceAccountRequest) Validate(formats strfmt.Registry) error {
    61  	var res []error
    62  
    63  	if err := m.validatePolicy(formats); err != nil {
    64  		res = append(res, err)
    65  	}
    66  
    67  	if len(res) > 0 {
    68  		return errors.CompositeValidationError(res...)
    69  	}
    70  	return nil
    71  }
    72  
    73  func (m *UpdateServiceAccountRequest) validatePolicy(formats strfmt.Registry) error {
    74  
    75  	if err := validate.Required("policy", "body", m.Policy); err != nil {
    76  		return err
    77  	}
    78  
    79  	return nil
    80  }
    81  
    82  // ContextValidate validates this update service account request based on context it is used
    83  func (m *UpdateServiceAccountRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
    84  	return nil
    85  }
    86  
    87  // MarshalBinary interface implementation
    88  func (m *UpdateServiceAccountRequest) MarshalBinary() ([]byte, error) {
    89  	if m == nil {
    90  		return nil, nil
    91  	}
    92  	return swag.WriteJSON(m)
    93  }
    94  
    95  // UnmarshalBinary interface implementation
    96  func (m *UpdateServiceAccountRequest) UnmarshalBinary(b []byte) error {
    97  	var res UpdateServiceAccountRequest
    98  	if err := swag.ReadJSON(b, &res); err != nil {
    99  		return err
   100  	}
   101  	*m = res
   102  	return nil
   103  }