diff --git a/dto/input/query/getRecipeInfo.go b/dto/input/query/getRecipeInfo.go index b806544..895e649 100644 --- a/dto/input/query/getRecipeInfo.go +++ b/dto/input/query/getRecipeInfo.go @@ -7,5 +7,6 @@ import ( ) type GetRecipeInfo struct { - Url types.String + Url types.String + Invalidate types.StringNull } diff --git a/dto/output/getRecipeInfo.go b/dto/output/getRecipeInfo.go deleted file mode 100644 index d88b7ad..0000000 --- a/dto/output/getRecipeInfo.go +++ /dev/null @@ -1,46 +0,0 @@ -// Generated ZEROPS sdk - -package output - -import ( - "encoding/json" - "strconv" - - "github.com/zeropsio/zerops-go/types" -) - -var _ strconv.NumError - -type GetRecipeInfo struct { - Url types.String `json:"url"` - ReadmeMd GetRecipeInfoReadmeMd `json:"readmeMd"` - ZeropsYaml GetRecipeInfoZeropsYaml `json:"zeropsYaml"` - ZeropsImportYaml GetRecipeInfoZeropsImportYaml `json:"zeropsImportYaml"` -} - -type GetRecipeInfoReadmeMd []GetRecipeInfoItem - -func (dto GetRecipeInfoReadmeMd) MarshalJSON() ([]byte, error) { - if dto == nil { - return []byte("[]"), nil - } - return json.Marshal([]GetRecipeInfoItem(dto)) -} - -type GetRecipeInfoZeropsYaml []GetRecipeInfoItem - -func (dto GetRecipeInfoZeropsYaml) MarshalJSON() ([]byte, error) { - if dto == nil { - return []byte("[]"), nil - } - return json.Marshal([]GetRecipeInfoItem(dto)) -} - -type GetRecipeInfoZeropsImportYaml []GetRecipeInfoItem - -func (dto GetRecipeInfoZeropsImportYaml) MarshalJSON() ([]byte, error) { - if dto == nil { - return []byte("[]"), nil - } - return json.Marshal([]GetRecipeInfoItem(dto)) -} diff --git a/dto/output/getRecipeInfoItem.go b/dto/output/getRecipeInfoItem.go deleted file mode 100644 index 30885ba..0000000 --- a/dto/output/getRecipeInfoItem.go +++ /dev/null @@ -1,17 +0,0 @@ -// Generated ZEROPS sdk - -package output - -import ( - "strconv" - - "github.com/zeropsio/zerops-go/types" -) - -var _ strconv.NumError - -type GetRecipeInfoItem struct { - Name types.String `json:"name"` - Url types.String `json:"url"` - Content types.Text `json:"content"` -} diff --git a/sdk/GetRecipeInfo.go b/sdk/GetRecipeInfo.go index 2af0280..d6b495c 100644 --- a/sdk/GetRecipeInfo.go +++ b/sdk/GetRecipeInfo.go @@ -22,7 +22,7 @@ import ( var _ strconv.NumError type GetRecipeInfoResponse struct { - success output.GetRecipeInfo + success output.GetRecipeData err error responseHeaders http.Header responseStatusCode int @@ -32,7 +32,7 @@ func (r GetRecipeInfoResponse) OutputInterface() (output interface{}, err error) return r.success, r.err } -func (r GetRecipeInfoResponse) Output() (output output.GetRecipeInfo, err error) { +func (r GetRecipeInfoResponse) Output() (output output.GetRecipeData, err error) { return r.success, r.err } @@ -55,6 +55,9 @@ func (h Handler) GetRecipeInfo(ctx context.Context, inputDtoQuery query.GetRecip param := inputDtoQuery.Url.Native() queryParams = append(queryParams, "url="+url.QueryEscape(param)) } + if param, ok := inputDtoQuery.Invalidate.Get(); ok { + queryParams = append(queryParams, "invalidate="+url.QueryEscape(param.Native())) + } if len(queryParams) > 0 { u += "?" + strings.Join(queryParams, "&")