github.com/hashicorp/hcp-sdk-go@v0.94.0/clients/cloud-vault-secrets/preview/2023-11-28/models/secrets20231128_sync_status.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  package models
     4  
     5  // This file was generated by the swagger tool.
     6  // Editing this file might prove futile when you re-run the swagger generate command
     7  
     8  import (
     9  	"context"
    10  
    11  	"github.com/go-openapi/errors"
    12  	"github.com/go-openapi/strfmt"
    13  	"github.com/go-openapi/swag"
    14  	"github.com/go-openapi/validate"
    15  )
    16  
    17  // Secrets20231128SyncStatus secrets 20231128 sync status
    18  //
    19  // swagger:model secrets_20231128SyncStatus
    20  type Secrets20231128SyncStatus struct {
    21  
    22  	// last error code
    23  	LastErrorCode string `json:"last_error_code,omitempty"`
    24  
    25  	// status
    26  	Status string `json:"status,omitempty"`
    27  
    28  	// updated at
    29  	// Format: date-time
    30  	UpdatedAt strfmt.DateTime `json:"updated_at,omitempty"`
    31  }
    32  
    33  // Validate validates this secrets 20231128 sync status
    34  func (m *Secrets20231128SyncStatus) Validate(formats strfmt.Registry) error {
    35  	var res []error
    36  
    37  	if err := m.validateUpdatedAt(formats); err != nil {
    38  		res = append(res, err)
    39  	}
    40  
    41  	if len(res) > 0 {
    42  		return errors.CompositeValidationError(res...)
    43  	}
    44  	return nil
    45  }
    46  
    47  func (m *Secrets20231128SyncStatus) validateUpdatedAt(formats strfmt.Registry) error {
    48  	if swag.IsZero(m.UpdatedAt) { // not required
    49  		return nil
    50  	}
    51  
    52  	if err := validate.FormatOf("updated_at", "body", "date-time", m.UpdatedAt.String(), formats); err != nil {
    53  		return err
    54  	}
    55  
    56  	return nil
    57  }
    58  
    59  // ContextValidate validates this secrets 20231128 sync status based on context it is used
    60  func (m *Secrets20231128SyncStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
    61  	return nil
    62  }
    63  
    64  // MarshalBinary interface implementation
    65  func (m *Secrets20231128SyncStatus) MarshalBinary() ([]byte, error) {
    66  	if m == nil {
    67  		return nil, nil
    68  	}
    69  	return swag.WriteJSON(m)
    70  }
    71  
    72  // UnmarshalBinary interface implementation
    73  func (m *Secrets20231128SyncStatus) UnmarshalBinary(b []byte) error {
    74  	var res Secrets20231128SyncStatus
    75  	if err := swag.ReadJSON(b, &res); err != nil {
    76  		return err
    77  	}
    78  	*m = res
    79  	return nil
    80  }