(modelID string, filename string, revision string, allowPatterns, ignorePatterns []string)
| 48 | } |
| 49 | |
| 50 | func (w *ModelWrapper) ModelSourceWithModelID(modelID string, filename string, revision string, allowPatterns, ignorePatterns []string) *ModelWrapper { |
| 51 | if modelID != "" { |
| 52 | if w.Spec.Source.ModelHub == nil { |
| 53 | w.Spec.Source.ModelHub = &coreapi.ModelHub{} |
| 54 | } |
| 55 | w.Spec.Source.ModelHub.ModelID = modelID |
| 56 | |
| 57 | if filename != "" { |
| 58 | w.Spec.Source.ModelHub.Filename = &filename |
| 59 | } |
| 60 | |
| 61 | if revision != "" { |
| 62 | w.Spec.Source.ModelHub.Revision = &revision |
| 63 | } |
| 64 | |
| 65 | if allowPatterns != nil { |
| 66 | w.Spec.Source.ModelHub.AllowPatterns = allowPatterns |
| 67 | } |
| 68 | |
| 69 | if ignorePatterns != nil { |
| 70 | w.Spec.Source.ModelHub.IgnorePatterns = ignorePatterns |
| 71 | } |
| 72 | } |
| 73 | return w |
| 74 | } |
| 75 | |
| 76 | func (w *ModelWrapper) ModelSourceWithModelHub(modelHub string) *ModelWrapper { |
| 77 | if modelHub != "" { |
no outgoing calls