github.com/cloudwan/edgelq-sdk@v1.15.4/monitoring/resources/v4/alerting_condition/alerting_condition.pb.query.go (about)

     1  // Code generated by protoc-gen-goten-resource
     2  // Resource: AlertingCondition
     3  // DO NOT EDIT!!!
     4  
     5  package alerting_condition
     6  
     7  import (
     8  	"google.golang.org/protobuf/types/known/timestamppb"
     9  
    10  	"github.com/cloudwan/goten-sdk/runtime/goten"
    11  	gotenobject "github.com/cloudwan/goten-sdk/runtime/object"
    12  	gotenresource "github.com/cloudwan/goten-sdk/runtime/resource"
    13  	"github.com/cloudwan/goten-sdk/types/watch_type"
    14  )
    15  
    16  // ensure the imports are used
    17  var (
    18  	_ = &timestamppb.Timestamp{}
    19  	_ = watch_type.WatchType_STATELESS
    20  	_ = new(goten.GotenMessage)
    21  	_ = new(gotenobject.FieldMask)
    22  	_ = new(gotenresource.ListQuery)
    23  )
    24  
    25  type GetQuery struct {
    26  	Reference *Reference
    27  	Mask      *AlertingCondition_FieldMask
    28  }
    29  
    30  func (q *GetQuery) GotenQuery() {}
    31  
    32  func (q *GetQuery) String() string {
    33  	return gotenresource.MakeSQLGetString(q)
    34  }
    35  
    36  func (q *GetQuery) GetResourceDescriptor() gotenresource.Descriptor {
    37  	return descriptor
    38  }
    39  
    40  func (q *GetQuery) GetReference() gotenresource.Reference {
    41  	return q.Reference
    42  }
    43  
    44  func (q *GetQuery) GetFieldMask() gotenobject.FieldMask {
    45  	return q.Mask
    46  }
    47  
    48  func (q *GetQuery) SetReference(ref gotenresource.Reference) {
    49  	if ref != nil {
    50  		q.Reference = ref.(*Reference)
    51  	} else {
    52  		q.Reference = nil
    53  	}
    54  }
    55  
    56  func (q *GetQuery) SetFieldMask(mask gotenobject.FieldMask) {
    57  	if mask != nil {
    58  		q.Mask = mask.(*AlertingCondition_FieldMask)
    59  	} else {
    60  		q.Mask = nil
    61  	}
    62  }
    63  
    64  type ListQuery struct {
    65  	Filter         *Filter
    66  	Pager          *PagerQuery
    67  	Mask           *AlertingCondition_FieldMask
    68  	WithPagingInfo bool
    69  }
    70  
    71  func (q *ListQuery) GotenQuery() {}
    72  
    73  func (q *ListQuery) String() string {
    74  	return gotenresource.MakeSQLListString(q)
    75  }
    76  
    77  func (q *ListQuery) GetResourceDescriptor() gotenresource.Descriptor {
    78  	return descriptor
    79  }
    80  
    81  func (q *ListQuery) GetFilter() gotenresource.Filter {
    82  	return q.Filter
    83  }
    84  
    85  func (q *ListQuery) GetPager() gotenresource.PagerQuery {
    86  	return q.Pager
    87  }
    88  
    89  func (q *ListQuery) GetFieldMask() gotenobject.FieldMask {
    90  	return q.Mask
    91  }
    92  
    93  func (q *ListQuery) GetWithPagingInfo() bool {
    94  	return q.WithPagingInfo
    95  }
    96  
    97  func (q *ListQuery) SetFilter(filter gotenresource.Filter) {
    98  	if filter != nil {
    99  		q.Filter = filter.(*Filter)
   100  	} else {
   101  		q.Filter = nil
   102  	}
   103  }
   104  
   105  func (q *ListQuery) SetPager(pager gotenresource.PagerQuery) {
   106  	if pager != nil {
   107  		q.Pager = pager.(*PagerQuery)
   108  	} else {
   109  		q.Pager = nil
   110  	}
   111  }
   112  
   113  func (q *ListQuery) SetFieldMask(mask gotenobject.FieldMask) {
   114  	if mask != nil {
   115  		q.Mask = mask.(*AlertingCondition_FieldMask)
   116  	} else {
   117  		q.Mask = nil
   118  	}
   119  }
   120  
   121  func (q *ListQuery) SetWithPagingInfo(with bool) {
   122  	q.WithPagingInfo = with
   123  }
   124  
   125  type WatchQuery struct {
   126  	ListQuery
   127  	WatchType    watch_type.WatchType
   128  	ChunkSize    int
   129  	ResumeToken  string
   130  	StartingTime *timestamppb.Timestamp
   131  }
   132  
   133  func (q *WatchQuery) String() string {
   134  	return gotenresource.MakeSQLWatchString(q)
   135  }
   136  
   137  func (q *WatchQuery) GetWatchType() watch_type.WatchType {
   138  	return q.WatchType
   139  }
   140  
   141  func (q *WatchQuery) GetMaximumChunkSize() int {
   142  	return q.ChunkSize
   143  }
   144  
   145  func (q *WatchQuery) GetResumeToken() string {
   146  	return q.ResumeToken
   147  }
   148  
   149  func (q *WatchQuery) GetStartingTime() *timestamppb.Timestamp {
   150  	return q.StartingTime
   151  }
   152  
   153  func (q *WatchQuery) SetWatchType(watchType watch_type.WatchType) {
   154  	q.WatchType = watchType
   155  }
   156  
   157  func (q *WatchQuery) SetMaximumChunkSize(chunkSize int) {
   158  	q.ChunkSize = chunkSize
   159  }
   160  
   161  func (q *WatchQuery) SetResumeToken(token string) {
   162  	q.ResumeToken = token
   163  }
   164  
   165  func (q *WatchQuery) SetStartingTime(startingTime *timestamppb.Timestamp) {
   166  	q.StartingTime = startingTime
   167  }
   168  
   169  type SearchQuery struct {
   170  	ListQuery
   171  	Phrase string
   172  }
   173  
   174  func (q *SearchQuery) String() string {
   175  	return gotenresource.MakeSQLSearchString(q)
   176  }
   177  
   178  func (q *SearchQuery) GetPhrase() string {
   179  	return q.Phrase
   180  }
   181  
   182  func (q *SearchQuery) SetPhrase(phrase string) {
   183  	q.Phrase = phrase
   184  }
   185  
   186  func (q *SearchQuery) GetWithPagingInfo() bool {
   187  	return true
   188  }
   189  
   190  type QueryResultSnapshot struct {
   191  	AlertingConditions []*AlertingCondition
   192  	PrevPageCursor     *PagerCursor
   193  	NextPageCursor     *PagerCursor
   194  	TotalResultsCount  int32
   195  	CurrentOffset      int32
   196  }
   197  
   198  func (qr *QueryResultSnapshot) GetResults() gotenresource.ResourceList {
   199  	return AlertingConditionList(qr.AlertingConditions)
   200  }
   201  
   202  func (qr *QueryResultSnapshot) GetNextPageCursor() gotenresource.Cursor {
   203  	return qr.NextPageCursor
   204  }
   205  
   206  func (qr *QueryResultSnapshot) GetPrevPageCursor() gotenresource.Cursor {
   207  	return qr.PrevPageCursor
   208  }
   209  
   210  func (qr *QueryResultSnapshot) GetPagingInfo() (totalCount, offset int32) {
   211  	return qr.TotalResultsCount, qr.CurrentOffset
   212  }
   213  
   214  func (qr *QueryResultSnapshot) SetResults(results gotenresource.ResourceList) {
   215  	if results != nil {
   216  		qr.AlertingConditions = results.(AlertingConditionList)
   217  	} else {
   218  		qr.AlertingConditions = nil
   219  	}
   220  }
   221  
   222  func (qr *QueryResultSnapshot) SetCursors(nextPageCursor, prevPageCursor gotenresource.Cursor) {
   223  	if nextPageCursor != nil {
   224  		qr.NextPageCursor = nextPageCursor.(*PagerCursor)
   225  	} else {
   226  		qr.NextPageCursor = nil
   227  	}
   228  	if prevPageCursor != nil {
   229  		qr.PrevPageCursor = prevPageCursor.(*PagerCursor)
   230  	} else {
   231  		qr.PrevPageCursor = nil
   232  	}
   233  }
   234  
   235  func (qr *QueryResultSnapshot) SetPagingInfo(totalCount, offset int32) {
   236  	qr.TotalResultsCount = totalCount
   237  	qr.CurrentOffset = offset
   238  }
   239  
   240  type QueryResultChange struct {
   241  	Changes        []*AlertingConditionChange
   242  	PrevPageCursor *PagerCursor
   243  	NextPageCursor *PagerCursor
   244  	ResumeToken    string
   245  	IsCurrent      bool
   246  	IsHardReset    bool
   247  	IsSoftReset    bool
   248  	SnapshotSize   int64
   249  }
   250  
   251  func (qr *QueryResultChange) GetResults() gotenresource.ResourceChangeList {
   252  	return AlertingConditionChangeList(qr.Changes)
   253  }
   254  
   255  func (qr *QueryResultChange) GetNextPageCursor() gotenresource.Cursor {
   256  	return qr.NextPageCursor
   257  }
   258  
   259  func (qr *QueryResultChange) GetPrevPageCursor() gotenresource.Cursor {
   260  	return qr.PrevPageCursor
   261  }
   262  
   263  func (qr *QueryResultChange) GetIsCurrent() bool {
   264  	return qr.IsCurrent
   265  }
   266  
   267  func (qr *QueryResultChange) GetIsHardReset() bool {
   268  	return qr.IsHardReset
   269  }
   270  
   271  func (qr *QueryResultChange) GetIsSoftReset() bool {
   272  	return qr.IsSoftReset
   273  }
   274  
   275  func (qr *QueryResultChange) GetSnapshotSize() int64 {
   276  	return qr.SnapshotSize
   277  }
   278  
   279  func (qr *QueryResultChange) GetResumeToken() string {
   280  	return qr.ResumeToken
   281  }
   282  
   283  func (qr *QueryResultChange) SetResults(results gotenresource.ResourceChangeList) {
   284  	if results != nil {
   285  		qr.Changes = results.(AlertingConditionChangeList)
   286  	} else {
   287  		qr.Changes = nil
   288  	}
   289  }
   290  
   291  func (qr *QueryResultChange) SetCursors(nextPageCursor, prevPageCursor gotenresource.Cursor) {
   292  	if nextPageCursor != nil {
   293  		qr.NextPageCursor = nextPageCursor.(*PagerCursor)
   294  	} else {
   295  		qr.NextPageCursor = nil
   296  	}
   297  	if prevPageCursor != nil {
   298  		qr.PrevPageCursor = prevPageCursor.(*PagerCursor)
   299  	} else {
   300  		qr.PrevPageCursor = nil
   301  	}
   302  }
   303  
   304  func (qr *QueryResultChange) SetIsCurrent() {
   305  	qr.IsCurrent = true
   306  }
   307  
   308  func (qr *QueryResultChange) SetIsSoftReset() {
   309  	qr.IsSoftReset = true
   310  }
   311  
   312  func (qr *QueryResultChange) SetIsHardReset() {
   313  	qr.IsHardReset = true
   314  }
   315  
   316  func (qr *QueryResultChange) SetSnapshotSize(size int64) {
   317  	qr.SnapshotSize = size
   318  }
   319  
   320  func (qr *QueryResultChange) SetResumeToken(token string) {
   321  	qr.ResumeToken = token
   322  }