From 416b8d0bcf81262ef5e29c3e8edab001028658f3 Mon Sep 17 00:00:00 2001 From: FABRIC8 CD autobot Date: Wed, 6 Feb 2019 05:04:07 +0000 Subject: [PATCH] chore: update client version to 02d1e04b4a0c0c39278c59e91a014ae76fc863d1 --- env/user_types.go | 58 +++++++++++++++++++++++++++++++++++++++----- source_commit.txt | 2 +- tool/cli/commands.go | 6 ++--- 3 files changed, 56 insertions(+), 10 deletions(-) diff --git a/env/user_types.go b/env/user_types.go index ca05923..8e95ccf 100644 --- a/env/user_types.go +++ b/env/user_types.go @@ -79,6 +79,11 @@ func (ut *environment) Validate() (err error) { if ut.Attributes == nil { err = goa.MergeErrors(err, goa.MissingAttributeError(`request`, "attributes")) } + if ut.Attributes != nil { + if err2 := ut.Attributes.Validate(); err2 != nil { + err = goa.MergeErrors(err, err2) + } + } if ut.Type != nil { if !(*ut.Type == "environments") { err = goa.MergeErrors(err, goa.InvalidEnumValueError(`request.type`, *ut.Type, []interface{}{"environments"})) @@ -122,6 +127,11 @@ func (ut *Environment) Validate() (err error) { if ut.Attributes == nil { err = goa.MergeErrors(err, goa.MissingAttributeError(`type`, "attributes")) } + if ut.Attributes != nil { + if err2 := ut.Attributes.Validate(); err2 != nil { + err = goa.MergeErrors(err, err2) + } + } if !(ut.Type == "environments") { err = goa.MergeErrors(err, goa.InvalidEnumValueError(`type.type`, ut.Type, []interface{}{"environments"})) } @@ -140,20 +150,39 @@ type environmentAttributes struct { Type *string `form:"type,omitempty" json:"type,omitempty" xml:"type,omitempty"` } +// Validate validates the environmentAttributes type instance. +func (ut *environmentAttributes) Validate() (err error) { + if ut.Name == nil { + err = goa.MergeErrors(err, goa.MissingAttributeError(`request`, "name")) + } + if ut.Type == nil { + err = goa.MergeErrors(err, goa.MissingAttributeError(`request`, "type")) + } + if ut.ClusterURL == nil { + err = goa.MergeErrors(err, goa.MissingAttributeError(`request`, "cluster-url")) + } + if ut.Type != nil { + if !(*ut.Type == "dev" || *ut.Type == "build" || *ut.Type == "stage" || *ut.Type == "run") { + err = goa.MergeErrors(err, goa.InvalidEnumValueError(`request.type`, *ut.Type, []interface{}{"dev", "build", "stage", "run"})) + } + } + return +} + // Publicize creates EnvironmentAttributes from environmentAttributes func (ut *environmentAttributes) Publicize() *EnvironmentAttributes { var pub EnvironmentAttributes if ut.ClusterURL != nil { - pub.ClusterURL = ut.ClusterURL + pub.ClusterURL = *ut.ClusterURL } if ut.Name != nil { - pub.Name = ut.Name + pub.Name = *ut.Name } if ut.NamespaceName != nil { pub.NamespaceName = ut.NamespaceName } if ut.Type != nil { - pub.Type = ut.Type + pub.Type = *ut.Type } return &pub } @@ -161,13 +190,30 @@ func (ut *environmentAttributes) Publicize() *EnvironmentAttributes { // JSONAPI store for all the "attributes" of environment. type EnvironmentAttributes struct { // The cluster url - ClusterURL *string `form:"cluster-url,omitempty" json:"cluster-url,omitempty" xml:"cluster-url,omitempty"` + ClusterURL string `form:"cluster-url" json:"cluster-url" xml:"cluster-url"` // The environment name - Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"` + Name string `form:"name" json:"name" xml:"name"` // The namespace name NamespaceName *string `form:"namespaceName,omitempty" json:"namespaceName,omitempty" xml:"namespaceName,omitempty"` // The environment type - Type *string `form:"type,omitempty" json:"type,omitempty" xml:"type,omitempty"` + Type string `form:"type" json:"type" xml:"type"` +} + +// Validate validates the EnvironmentAttributes type instance. +func (ut *EnvironmentAttributes) Validate() (err error) { + if ut.Name == "" { + err = goa.MergeErrors(err, goa.MissingAttributeError(`type`, "name")) + } + if ut.Type == "" { + err = goa.MergeErrors(err, goa.MissingAttributeError(`type`, "type")) + } + if ut.ClusterURL == "" { + err = goa.MergeErrors(err, goa.MissingAttributeError(`type`, "cluster-url")) + } + if !(ut.Type == "dev" || ut.Type == "build" || ut.Type == "stage" || ut.Type == "run") { + err = goa.MergeErrors(err, goa.InvalidEnumValueError(`type.type`, ut.Type, []interface{}{"dev", "build", "stage", "run"})) + } + return } // environmentListMeta user type. diff --git a/source_commit.txt b/source_commit.txt index eda7ec5..0771b58 100644 --- a/source_commit.txt +++ b/source_commit.txt @@ -1 +1 @@ -0c4a56e48fe134264607bb2948dc1eaacf0b5afb +02d1e04b4a0c0c39278c59e91a014ae76fc863d1 diff --git a/tool/cli/commands.go b/tool/cli/commands.go index 7313aeb..4a3ee92 100644 --- a/tool/cli/commands.go +++ b/tool/cli/commands.go @@ -78,12 +78,12 @@ Payload example: "cluster-url": "https://api.starter-us-east-2a.openshift.com", "name": "myapp-stage", "namespaceName": "myapp-stage", - "type": "stage" + "type": "dev" }, "id": "40bbdd3d-8b5d-4fd6-ac90-7236b669af04", "links": { "meta": { - "Ipsam non nesciunt.": false + "Non nesciunt.": false }, "related": "Fugiat dolorem nostrum voluptas libero.", "self": "Sint optio et adipisci vero fugiat." @@ -91,7 +91,7 @@ Payload example: "type": "environments" }, "included": [ - "dfee74cb-9986-4135-a70d-4688967f57c3" + "66e696a2-7758-431f-ba8f-24cf253d9c69" ] }`, RunE: func(cmd *cobra.Command, args []string) error { return tmp1.Run(c, args) },