github.com/cloudwan/edgelq-sdk@v1.15.4/iam/client/v1/service_projects_management/service_projects_management_custom.pb.validate.go (about)

     1  // Code generated by protoc-gen-goten-validate
     2  // File: edgelq/iam/proto/v1/service_projects_management_custom.proto
     3  // DO NOT EDIT!!!
     4  
     5  package service_projects_management_client
     6  
     7  import (
     8  	"bytes"
     9  	"errors"
    10  	"fmt"
    11  	"net"
    12  	"net/url"
    13  	"regexp"
    14  	"strings"
    15  	"time"
    16  	"unicode/utf8"
    17  
    18  	gotenvalidate "github.com/cloudwan/goten-sdk/runtime/validate"
    19  )
    20  
    21  // proto imports
    22  import (
    23  	api "github.com/cloudwan/edgelq-sdk/common/api"
    24  	iam_common "github.com/cloudwan/edgelq-sdk/iam/resources/v1/common"
    25  	organization "github.com/cloudwan/edgelq-sdk/iam/resources/v1/organization"
    26  	project "github.com/cloudwan/edgelq-sdk/iam/resources/v1/project"
    27  	role "github.com/cloudwan/edgelq-sdk/iam/resources/v1/role"
    28  	service_account "github.com/cloudwan/edgelq-sdk/iam/resources/v1/service_account"
    29  	service_account_key "github.com/cloudwan/edgelq-sdk/iam/resources/v1/service_account_key"
    30  	meta_service "github.com/cloudwan/goten-sdk/meta-service/resources/v1/service"
    31  	multi_region_policy "github.com/cloudwan/goten-sdk/types/multi_region_policy"
    32  	fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb"
    33  )
    34  
    35  var (
    36  	_ = bytes.Equal
    37  	_ = errors.New
    38  	_ = fmt.Errorf
    39  	_ = net.ParseIP
    40  	_ = regexp.Match
    41  	_ = strings.Split
    42  	_ = time.Now
    43  	_ = utf8.RuneCountInString
    44  	_ = url.Parse
    45  	_ = gotenvalidate.NewValidationError
    46  )
    47  
    48  // make sure we're using proto imports
    49  var (
    50  	_ = &api.Account{}
    51  	_ = &iam_common.PCR{}
    52  	_ = &organization.Organization{}
    53  	_ = &project.Project{}
    54  	_ = &role.Role{}
    55  	_ = &service_account.ServiceAccount{}
    56  	_ = &service_account_key.ServiceAccountKey{}
    57  	_ = &fieldmaskpb.FieldMask{}
    58  	_ = &meta_service.Service{}
    59  	_ = &multi_region_policy.MultiRegionPolicy{}
    60  )
    61  
    62  func (obj *ListMyServiceProjectsRequest) GotenValidate() error {
    63  	if obj == nil {
    64  		return nil
    65  	}
    66  	if !(obj.PageSize >= 0) {
    67  		return gotenvalidate.NewValidationError("ListMyServiceProjectsRequest", "pageSize", obj.PageSize, "field must be greater or equal to 0", nil)
    68  	}
    69  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
    70  		return cvobj.GotenCustomValidate()
    71  	}
    72  	return nil
    73  }
    74  func (obj *ListMyServiceProjectsResponse) GotenValidate() error {
    75  	if obj == nil {
    76  		return nil
    77  	}
    78  	for idx, elem := range obj.Projects {
    79  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
    80  			if err := subobj.GotenValidate(); err != nil {
    81  				return gotenvalidate.NewValidationError("ListMyServiceProjectsResponse", "projects", obj.Projects[idx], "nested object validation failed", err)
    82  			}
    83  		}
    84  	}
    85  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
    86  		return cvobj.GotenCustomValidate()
    87  	}
    88  	return nil
    89  }
    90  func (obj *SetupServiceProjectRequest) GotenValidate() error {
    91  	if obj == nil {
    92  		return nil
    93  	}
    94  	if obj.Title == "" {
    95  		return gotenvalidate.NewValidationError("SetupServiceProjectRequest", "title", obj.Title, "field is required", nil)
    96  	}
    97  	if obj.MultiRegionPolicy == nil {
    98  		return gotenvalidate.NewValidationError("SetupServiceProjectRequest", "multiRegionPolicy", obj.MultiRegionPolicy, "field is required", nil)
    99  	}
   100  	if subobj, ok := interface{}(obj.MultiRegionPolicy).(gotenvalidate.Validator); ok {
   101  		if err := subobj.GotenValidate(); err != nil {
   102  			return gotenvalidate.NewValidationError("SetupServiceProjectRequest", "multiRegionPolicy", obj.MultiRegionPolicy, "nested object validation failed", err)
   103  		}
   104  	}
   105  	{
   106  		rlen := utf8.RuneCountInString(obj.Description)
   107  		if rlen > 256 {
   108  			return gotenvalidate.NewValidationError("SetupServiceProjectRequest", "description", obj.Description, "field must contain at most 256 characters", nil)
   109  		}
   110  	}
   111  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   112  		return cvobj.GotenCustomValidate()
   113  	}
   114  	return nil
   115  }
   116  func (obj *ReserveServiceNameRequest) GotenValidate() error {
   117  	if obj == nil {
   118  		return nil
   119  	}
   120  	if subobj, ok := interface{}(obj.AdminKey).(gotenvalidate.Validator); ok {
   121  		if err := subobj.GotenValidate(); err != nil {
   122  			return gotenvalidate.NewValidationError("ReserveServiceNameRequest", "adminKey", obj.AdminKey, "nested object validation failed", err)
   123  		}
   124  	}
   125  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   126  		return cvobj.GotenCustomValidate()
   127  	}
   128  	return nil
   129  }
   130  func (obj *ReserveServiceNameResponse) GotenValidate() error {
   131  	if obj == nil {
   132  		return nil
   133  	}
   134  	if subobj, ok := interface{}(obj.NttAdminCredentials).(gotenvalidate.Validator); ok {
   135  		if err := subobj.GotenValidate(); err != nil {
   136  			return gotenvalidate.NewValidationError("ReserveServiceNameResponse", "nttAdminCredentials", obj.NttAdminCredentials, "nested object validation failed", err)
   137  		}
   138  	}
   139  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   140  		return cvobj.GotenCustomValidate()
   141  	}
   142  	return nil
   143  }
   144  func (obj *DeleteServiceReservationRequest) GotenValidate() error {
   145  	if obj == nil {
   146  		return nil
   147  	}
   148  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   149  		return cvobj.GotenCustomValidate()
   150  	}
   151  	return nil
   152  }
   153  func (obj *ListServiceReservationsRequest) GotenValidate() error {
   154  	if obj == nil {
   155  		return nil
   156  	}
   157  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   158  		return cvobj.GotenCustomValidate()
   159  	}
   160  	return nil
   161  }
   162  func (obj *ListServiceReservationsResponse) GotenValidate() error {
   163  	if obj == nil {
   164  		return nil
   165  	}
   166  	for idx, elem := range obj.Reservations {
   167  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
   168  			if err := subobj.GotenValidate(); err != nil {
   169  				return gotenvalidate.NewValidationError("ListServiceReservationsResponse", "reservations", obj.Reservations[idx], "nested object validation failed", err)
   170  			}
   171  		}
   172  	}
   173  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   174  		return cvobj.GotenCustomValidate()
   175  	}
   176  	return nil
   177  }
   178  func (obj *ListServiceReservationsResponse_Reservation) GotenValidate() error {
   179  	if obj == nil {
   180  		return nil
   181  	}
   182  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   183  		return cvobj.GotenCustomValidate()
   184  	}
   185  	return nil
   186  }
   187  func (obj *ListProjectServicesRequest) GotenValidate() error {
   188  	if obj == nil {
   189  		return nil
   190  	}
   191  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   192  		return cvobj.GotenCustomValidate()
   193  	}
   194  	return nil
   195  }
   196  func (obj *ListProjectServicesResponse) GotenValidate() error {
   197  	if obj == nil {
   198  		return nil
   199  	}
   200  	for idx, elem := range obj.Services {
   201  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
   202  			if err := subobj.GotenValidate(); err != nil {
   203  				return gotenvalidate.NewValidationError("ListProjectServicesResponse", "services", obj.Services[idx], "nested object validation failed", err)
   204  			}
   205  		}
   206  	}
   207  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   208  		return cvobj.GotenCustomValidate()
   209  	}
   210  	return nil
   211  }
   212  func (obj *AddRegionalAdminAccountForServicesRequest) GotenValidate() error {
   213  	if obj == nil {
   214  		return nil
   215  	}
   216  	if subobj, ok := interface{}(obj.AdminKey).(gotenvalidate.Validator); ok {
   217  		if err := subobj.GotenValidate(); err != nil {
   218  			return gotenvalidate.NewValidationError("AddRegionalAdminAccountForServicesRequest", "adminKey", obj.AdminKey, "nested object validation failed", err)
   219  		}
   220  	}
   221  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   222  		return cvobj.GotenCustomValidate()
   223  	}
   224  	return nil
   225  }
   226  func (obj *AddRegionalAdminAccountForServicesResponse) GotenValidate() error {
   227  	if obj == nil {
   228  		return nil
   229  	}
   230  	if subobj, ok := interface{}(obj.NttAdminCredentials).(gotenvalidate.Validator); ok {
   231  		if err := subobj.GotenValidate(); err != nil {
   232  			return gotenvalidate.NewValidationError("AddRegionalAdminAccountForServicesResponse", "nttAdminCredentials", obj.NttAdminCredentials, "nested object validation failed", err)
   233  		}
   234  	}
   235  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   236  		return cvobj.GotenCustomValidate()
   237  	}
   238  	return nil
   239  }