Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

Commit

Permalink
scan estimation orchestrator
Browse files Browse the repository at this point in the history
  • Loading branch information
fishkerez committed Aug 16, 2023
1 parent f97cc0c commit fed5680
Show file tree
Hide file tree
Showing 24 changed files with 5,245 additions and 451 deletions.
2,703 changes: 2,358 additions & 345 deletions api/client/client.gen.go

Large diffs are not rendered by default.

113 changes: 113 additions & 0 deletions api/models/assetscanestimation.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
// Copyright © 2023 Cisco Systems, Inc. and its affiliates.
// All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package models

func (r *AssetScanEstimation) GetState() (AssetScanEstimationStateState, bool) {
var state AssetScanEstimationStateState
var ok bool

if r.State != nil {
state, ok = r.State.GetState()
}

return state, ok
}

func (r *AssetScanEstimation) GetGeneralErrors() []string {
var errs []string

if r.State != nil {
errs = r.State.GetGeneralErrors()
}

return errs
}

func (r *AssetScanEstimation) GetID() (string, bool) {
var id string
var ok bool

if r.Id != nil {
id, ok = *r.Id, true
}

return id, ok
}

func (r *AssetScanEstimation) GetScanEstimationID() (string, bool) {
var scanEstimationID string
var ok bool

if r.ScanEstimation != nil && r.ScanEstimation.Id != nil {
scanEstimationID, ok = *r.ScanEstimation.Id, true
}

return scanEstimationID, ok
}

func (r *AssetScanEstimation) GetAssetID() (string, bool) {
var assetID string
var ok bool

if r.Asset != nil && r.Asset.Id != nil {
assetID, ok = *r.Asset.Id, true
}

return assetID, ok
}

func (r *AssetScanEstimation) IsDone() (bool, bool) {
var done bool
var ok bool
var state AssetScanEstimationStateState

if state, ok = r.GetState(); ok && state == AssetScanEstimationStateStateDone {
done = true
}

return done, ok
}

func (r *AssetScanEstimation) HasErrors() bool {
var has bool

if errs := r.GetGeneralErrors(); len(errs) > 0 {
has = true
}

return has
}

func (s *AssetScanEstimationState) GetState() (AssetScanEstimationStateState, bool) {
var state AssetScanEstimationStateState
var ok bool

if s.State != nil {
state, ok = *s.State, true
}

return state, ok
}

func (s *AssetScanEstimationState) GetGeneralErrors() []string {
var errs []string

if s.Errors != nil {
errs = *s.Errors
}

return errs
}
Loading

0 comments on commit fed5680

Please sign in to comment.