From 6079f4dd1a20a6363de96af24b7334700d087cc8 Mon Sep 17 00:00:00 2001 From: ci_volc_sdk_gen Date: Fri, 15 Nov 2024 10:14:03 +0800 Subject: [PATCH 1/2] feat: auto generate for vmp-Golang-2021-03-03-online-777-2024_11_15_10_13_42 --- meta.json | 4 +- service/vmp/api_create_workspace.go | 294 +++++++++++++++ service/vmp/api_delete_workspace.go | 204 +++++++++++ service/vmp/api_list_workspace_status.go | 344 +++++++++++++++++ service/vmp/api_list_workspaces.go | 446 +++++++++++++++++++++++ service/vmp/api_update_workspace.go | 244 +++++++++++++ service/vmp/interface_vmp.go | 74 ++++ service/vmp/service_vmp.go | 89 +++++ volcengine/version.go | 2 +- 9 files changed, 1698 insertions(+), 3 deletions(-) create mode 100644 service/vmp/api_create_workspace.go create mode 100644 service/vmp/api_delete_workspace.go create mode 100644 service/vmp/api_list_workspace_status.go create mode 100644 service/vmp/api_list_workspaces.go create mode 100644 service/vmp/api_update_workspace.go create mode 100644 service/vmp/interface_vmp.go create mode 100644 service/vmp/service_vmp.go diff --git a/meta.json b/meta.json index b152934f..97ffdfba 100755 --- a/meta.json +++ b/meta.json @@ -1,4 +1,4 @@ { - "lasted": "1.0.165", - "meta_commit": "24e44f8a4bc274836f63006431a2f5289f0e4b95" + "lasted": "1.0.166", + "meta_commit": "31603cfa49ebab8022ed0aa72c9ed42cd7cd20ab" } \ No newline at end of file diff --git a/service/vmp/api_create_workspace.go b/service/vmp/api_create_workspace.go new file mode 100644 index 00000000..2d8fbb84 --- /dev/null +++ b/service/vmp/api_create_workspace.go @@ -0,0 +1,294 @@ +// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. + +package vmp + +import ( + "github.com/volcengine/volcengine-go-sdk/volcengine" + "github.com/volcengine/volcengine-go-sdk/volcengine/request" + "github.com/volcengine/volcengine-go-sdk/volcengine/response" + "github.com/volcengine/volcengine-go-sdk/volcengine/volcengineutil" +) + +const opCreateWorkspaceCommon = "CreateWorkspace" + +// CreateWorkspaceCommonRequest generates a "volcengine/request.Request" representing the +// client's request for the CreateWorkspaceCommon operation. The "output" return +// value will be populated with the CreateWorkspaceCommon request's response once the request completes +// successfully. +// +// Use "Send" method on the returned CreateWorkspaceCommon Request to send the API call to the service. +// the "output" return value is not valid until after CreateWorkspaceCommon Send returns without error. +// +// See CreateWorkspaceCommon for more information on using the CreateWorkspaceCommon +// API call, and error handling. +// +// // Example sending a request using the CreateWorkspaceCommonRequest method. +// req, resp := client.CreateWorkspaceCommonRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +func (c *VMP) CreateWorkspaceCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { + op := &request.Operation{ + Name: opCreateWorkspaceCommon, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &map[string]interface{}{} + } + + output = &map[string]interface{}{} + req = c.newRequest(op, input, output) + + req.HTTPRequest.Header.Set("Content-Type", "application/json; charset=utf-8") + + return +} + +// CreateWorkspaceCommon API operation for VMP. +// +// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions +// with volcengineerr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the VOLCENGINE API reference guide for VMP's +// API operation CreateWorkspaceCommon for usage and error information. +func (c *VMP) CreateWorkspaceCommon(input *map[string]interface{}) (*map[string]interface{}, error) { + req, out := c.CreateWorkspaceCommonRequest(input) + return out, req.Send() +} + +// CreateWorkspaceCommonWithContext is the same as CreateWorkspaceCommon with the addition of +// the ability to pass a context and additional request options. +// +// See CreateWorkspaceCommon for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. +// In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *VMP) CreateWorkspaceCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { + req, out := c.CreateWorkspaceCommonRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateWorkspace = "CreateWorkspace" + +// CreateWorkspaceRequest generates a "volcengine/request.Request" representing the +// client's request for the CreateWorkspace operation. The "output" return +// value will be populated with the CreateWorkspaceCommon request's response once the request completes +// successfully. +// +// Use "Send" method on the returned CreateWorkspaceCommon Request to send the API call to the service. +// the "output" return value is not valid until after CreateWorkspaceCommon Send returns without error. +// +// See CreateWorkspace for more information on using the CreateWorkspace +// API call, and error handling. +// +// // Example sending a request using the CreateWorkspaceRequest method. +// req, resp := client.CreateWorkspaceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +func (c *VMP) CreateWorkspaceRequest(input *CreateWorkspaceInput) (req *request.Request, output *CreateWorkspaceOutput) { + op := &request.Operation{ + Name: opCreateWorkspace, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateWorkspaceInput{} + } + + output = &CreateWorkspaceOutput{} + req = c.newRequest(op, input, output) + + req.HTTPRequest.Header.Set("Content-Type", "application/json; charset=utf-8") + + return +} + +// CreateWorkspace API operation for VMP. +// +// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions +// with volcengineerr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the VOLCENGINE API reference guide for VMP's +// API operation CreateWorkspace for usage and error information. +func (c *VMP) CreateWorkspace(input *CreateWorkspaceInput) (*CreateWorkspaceOutput, error) { + req, out := c.CreateWorkspaceRequest(input) + return out, req.Send() +} + +// CreateWorkspaceWithContext is the same as CreateWorkspace with the addition of +// the ability to pass a context and additional request options. +// +// See CreateWorkspace for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. Ifthe context is nil a panic will occur. +// In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *VMP) CreateWorkspaceWithContext(ctx volcengine.Context, input *CreateWorkspaceInput, opts ...request.Option) (*CreateWorkspaceOutput, error) { + req, out := c.CreateWorkspaceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +type CreateWorkspaceInput struct { + _ struct{} `type:"structure" json:",omitempty"` + + DeleteProtectionEnabled *bool `type:"boolean" json:",omitempty"` + + Description *string `type:"string" json:",omitempty"` + + // InstanceTypeId is a required field + InstanceTypeId *string `type:"string" json:",omitempty" required:"true"` + + // Name is a required field + Name *string `type:"string" json:",omitempty" required:"true"` + + Password *string `type:"string" json:",omitempty"` + + ProjectName *string `type:"string" json:",omitempty"` + + Tags []*TagForCreateWorkspaceInput `type:"list" json:",omitempty"` + + Username *string `type:"string" json:",omitempty"` +} + +// String returns the string representation +func (s CreateWorkspaceInput) String() string { + return volcengineutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateWorkspaceInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateWorkspaceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateWorkspaceInput"} + if s.InstanceTypeId == nil { + invalidParams.Add(request.NewErrParamRequired("InstanceTypeId")) + } + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDeleteProtectionEnabled sets the DeleteProtectionEnabled field's value. +func (s *CreateWorkspaceInput) SetDeleteProtectionEnabled(v bool) *CreateWorkspaceInput { + s.DeleteProtectionEnabled = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *CreateWorkspaceInput) SetDescription(v string) *CreateWorkspaceInput { + s.Description = &v + return s +} + +// SetInstanceTypeId sets the InstanceTypeId field's value. +func (s *CreateWorkspaceInput) SetInstanceTypeId(v string) *CreateWorkspaceInput { + s.InstanceTypeId = &v + return s +} + +// SetName sets the Name field's value. +func (s *CreateWorkspaceInput) SetName(v string) *CreateWorkspaceInput { + s.Name = &v + return s +} + +// SetPassword sets the Password field's value. +func (s *CreateWorkspaceInput) SetPassword(v string) *CreateWorkspaceInput { + s.Password = &v + return s +} + +// SetProjectName sets the ProjectName field's value. +func (s *CreateWorkspaceInput) SetProjectName(v string) *CreateWorkspaceInput { + s.ProjectName = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateWorkspaceInput) SetTags(v []*TagForCreateWorkspaceInput) *CreateWorkspaceInput { + s.Tags = v + return s +} + +// SetUsername sets the Username field's value. +func (s *CreateWorkspaceInput) SetUsername(v string) *CreateWorkspaceInput { + s.Username = &v + return s +} + +type CreateWorkspaceOutput struct { + _ struct{} `type:"structure" json:",omitempty"` + + Metadata *response.ResponseMetadata + + Id *string `type:"string" json:",omitempty"` +} + +// String returns the string representation +func (s CreateWorkspaceOutput) String() string { + return volcengineutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateWorkspaceOutput) GoString() string { + return s.String() +} + +// SetId sets the Id field's value. +func (s *CreateWorkspaceOutput) SetId(v string) *CreateWorkspaceOutput { + s.Id = &v + return s +} + +type TagForCreateWorkspaceInput struct { + _ struct{} `type:"structure" json:",omitempty"` + + Key *string `type:"string" json:",omitempty"` + + Value *string `type:"string" json:",omitempty"` +} + +// String returns the string representation +func (s TagForCreateWorkspaceInput) String() string { + return volcengineutil.Prettify(s) +} + +// GoString returns the string representation +func (s TagForCreateWorkspaceInput) GoString() string { + return s.String() +} + +// SetKey sets the Key field's value. +func (s *TagForCreateWorkspaceInput) SetKey(v string) *TagForCreateWorkspaceInput { + s.Key = &v + return s +} + +// SetValue sets the Value field's value. +func (s *TagForCreateWorkspaceInput) SetValue(v string) *TagForCreateWorkspaceInput { + s.Value = &v + return s +} diff --git a/service/vmp/api_delete_workspace.go b/service/vmp/api_delete_workspace.go new file mode 100644 index 00000000..4c87d8ef --- /dev/null +++ b/service/vmp/api_delete_workspace.go @@ -0,0 +1,204 @@ +// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. + +package vmp + +import ( + "github.com/volcengine/volcengine-go-sdk/volcengine" + "github.com/volcengine/volcengine-go-sdk/volcengine/request" + "github.com/volcengine/volcengine-go-sdk/volcengine/response" + "github.com/volcengine/volcengine-go-sdk/volcengine/volcengineutil" +) + +const opDeleteWorkspaceCommon = "DeleteWorkspace" + +// DeleteWorkspaceCommonRequest generates a "volcengine/request.Request" representing the +// client's request for the DeleteWorkspaceCommon operation. The "output" return +// value will be populated with the DeleteWorkspaceCommon request's response once the request completes +// successfully. +// +// Use "Send" method on the returned DeleteWorkspaceCommon Request to send the API call to the service. +// the "output" return value is not valid until after DeleteWorkspaceCommon Send returns without error. +// +// See DeleteWorkspaceCommon for more information on using the DeleteWorkspaceCommon +// API call, and error handling. +// +// // Example sending a request using the DeleteWorkspaceCommonRequest method. +// req, resp := client.DeleteWorkspaceCommonRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +func (c *VMP) DeleteWorkspaceCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { + op := &request.Operation{ + Name: opDeleteWorkspaceCommon, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &map[string]interface{}{} + } + + output = &map[string]interface{}{} + req = c.newRequest(op, input, output) + + req.HTTPRequest.Header.Set("Content-Type", "application/json; charset=utf-8") + + return +} + +// DeleteWorkspaceCommon API operation for VMP. +// +// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions +// with volcengineerr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the VOLCENGINE API reference guide for VMP's +// API operation DeleteWorkspaceCommon for usage and error information. +func (c *VMP) DeleteWorkspaceCommon(input *map[string]interface{}) (*map[string]interface{}, error) { + req, out := c.DeleteWorkspaceCommonRequest(input) + return out, req.Send() +} + +// DeleteWorkspaceCommonWithContext is the same as DeleteWorkspaceCommon with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteWorkspaceCommon for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. +// In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *VMP) DeleteWorkspaceCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { + req, out := c.DeleteWorkspaceCommonRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteWorkspace = "DeleteWorkspace" + +// DeleteWorkspaceRequest generates a "volcengine/request.Request" representing the +// client's request for the DeleteWorkspace operation. The "output" return +// value will be populated with the DeleteWorkspaceCommon request's response once the request completes +// successfully. +// +// Use "Send" method on the returned DeleteWorkspaceCommon Request to send the API call to the service. +// the "output" return value is not valid until after DeleteWorkspaceCommon Send returns without error. +// +// See DeleteWorkspace for more information on using the DeleteWorkspace +// API call, and error handling. +// +// // Example sending a request using the DeleteWorkspaceRequest method. +// req, resp := client.DeleteWorkspaceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +func (c *VMP) DeleteWorkspaceRequest(input *DeleteWorkspaceInput) (req *request.Request, output *DeleteWorkspaceOutput) { + op := &request.Operation{ + Name: opDeleteWorkspace, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteWorkspaceInput{} + } + + output = &DeleteWorkspaceOutput{} + req = c.newRequest(op, input, output) + + req.HTTPRequest.Header.Set("Content-Type", "application/json; charset=utf-8") + + return +} + +// DeleteWorkspace API operation for VMP. +// +// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions +// with volcengineerr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the VOLCENGINE API reference guide for VMP's +// API operation DeleteWorkspace for usage and error information. +func (c *VMP) DeleteWorkspace(input *DeleteWorkspaceInput) (*DeleteWorkspaceOutput, error) { + req, out := c.DeleteWorkspaceRequest(input) + return out, req.Send() +} + +// DeleteWorkspaceWithContext is the same as DeleteWorkspace with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteWorkspace for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. Ifthe context is nil a panic will occur. +// In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *VMP) DeleteWorkspaceWithContext(ctx volcengine.Context, input *DeleteWorkspaceInput, opts ...request.Option) (*DeleteWorkspaceOutput, error) { + req, out := c.DeleteWorkspaceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +type DeleteWorkspaceInput struct { + _ struct{} `type:"structure" json:",omitempty"` + + // Id is a required field + Id *string `type:"string" json:",omitempty" required:"true"` +} + +// String returns the string representation +func (s DeleteWorkspaceInput) String() string { + return volcengineutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteWorkspaceInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteWorkspaceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteWorkspaceInput"} + if s.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetId sets the Id field's value. +func (s *DeleteWorkspaceInput) SetId(v string) *DeleteWorkspaceInput { + s.Id = &v + return s +} + +type DeleteWorkspaceOutput struct { + _ struct{} `type:"structure" json:",omitempty"` + + Metadata *response.ResponseMetadata + + Id *string `type:"string" json:",omitempty"` +} + +// String returns the string representation +func (s DeleteWorkspaceOutput) String() string { + return volcengineutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteWorkspaceOutput) GoString() string { + return s.String() +} + +// SetId sets the Id field's value. +func (s *DeleteWorkspaceOutput) SetId(v string) *DeleteWorkspaceOutput { + s.Id = &v + return s +} diff --git a/service/vmp/api_list_workspace_status.go b/service/vmp/api_list_workspace_status.go new file mode 100644 index 00000000..4b5214a0 --- /dev/null +++ b/service/vmp/api_list_workspace_status.go @@ -0,0 +1,344 @@ +// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. + +package vmp + +import ( + "github.com/volcengine/volcengine-go-sdk/volcengine" + "github.com/volcengine/volcengine-go-sdk/volcengine/request" + "github.com/volcengine/volcengine-go-sdk/volcengine/response" + "github.com/volcengine/volcengine-go-sdk/volcengine/volcengineutil" +) + +const opListWorkspaceStatusCommon = "ListWorkspaceStatus" + +// ListWorkspaceStatusCommonRequest generates a "volcengine/request.Request" representing the +// client's request for the ListWorkspaceStatusCommon operation. The "output" return +// value will be populated with the ListWorkspaceStatusCommon request's response once the request completes +// successfully. +// +// Use "Send" method on the returned ListWorkspaceStatusCommon Request to send the API call to the service. +// the "output" return value is not valid until after ListWorkspaceStatusCommon Send returns without error. +// +// See ListWorkspaceStatusCommon for more information on using the ListWorkspaceStatusCommon +// API call, and error handling. +// +// // Example sending a request using the ListWorkspaceStatusCommonRequest method. +// req, resp := client.ListWorkspaceStatusCommonRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +func (c *VMP) ListWorkspaceStatusCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { + op := &request.Operation{ + Name: opListWorkspaceStatusCommon, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &map[string]interface{}{} + } + + output = &map[string]interface{}{} + req = c.newRequest(op, input, output) + + req.HTTPRequest.Header.Set("Content-Type", "application/json; charset=utf-8") + + return +} + +// ListWorkspaceStatusCommon API operation for VMP. +// +// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions +// with volcengineerr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the VOLCENGINE API reference guide for VMP's +// API operation ListWorkspaceStatusCommon for usage and error information. +func (c *VMP) ListWorkspaceStatusCommon(input *map[string]interface{}) (*map[string]interface{}, error) { + req, out := c.ListWorkspaceStatusCommonRequest(input) + return out, req.Send() +} + +// ListWorkspaceStatusCommonWithContext is the same as ListWorkspaceStatusCommon with the addition of +// the ability to pass a context and additional request options. +// +// See ListWorkspaceStatusCommon for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. +// In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *VMP) ListWorkspaceStatusCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { + req, out := c.ListWorkspaceStatusCommonRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListWorkspaceStatus = "ListWorkspaceStatus" + +// ListWorkspaceStatusRequest generates a "volcengine/request.Request" representing the +// client's request for the ListWorkspaceStatus operation. The "output" return +// value will be populated with the ListWorkspaceStatusCommon request's response once the request completes +// successfully. +// +// Use "Send" method on the returned ListWorkspaceStatusCommon Request to send the API call to the service. +// the "output" return value is not valid until after ListWorkspaceStatusCommon Send returns without error. +// +// See ListWorkspaceStatus for more information on using the ListWorkspaceStatus +// API call, and error handling. +// +// // Example sending a request using the ListWorkspaceStatusRequest method. +// req, resp := client.ListWorkspaceStatusRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +func (c *VMP) ListWorkspaceStatusRequest(input *ListWorkspaceStatusInput) (req *request.Request, output *ListWorkspaceStatusOutput) { + op := &request.Operation{ + Name: opListWorkspaceStatus, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ListWorkspaceStatusInput{} + } + + output = &ListWorkspaceStatusOutput{} + req = c.newRequest(op, input, output) + + req.HTTPRequest.Header.Set("Content-Type", "application/json; charset=utf-8") + + return +} + +// ListWorkspaceStatus API operation for VMP. +// +// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions +// with volcengineerr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the VOLCENGINE API reference guide for VMP's +// API operation ListWorkspaceStatus for usage and error information. +func (c *VMP) ListWorkspaceStatus(input *ListWorkspaceStatusInput) (*ListWorkspaceStatusOutput, error) { + req, out := c.ListWorkspaceStatusRequest(input) + return out, req.Send() +} + +// ListWorkspaceStatusWithContext is the same as ListWorkspaceStatus with the addition of +// the ability to pass a context and additional request options. +// +// See ListWorkspaceStatus for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. Ifthe context is nil a panic will occur. +// In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *VMP) ListWorkspaceStatusWithContext(ctx volcengine.Context, input *ListWorkspaceStatusInput, opts ...request.Option) (*ListWorkspaceStatusOutput, error) { + req, out := c.ListWorkspaceStatusRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +type FiltersForListWorkspaceStatusInput struct { + _ struct{} `type:"structure" json:",omitempty"` + + Ids []*string `type:"list" json:",omitempty"` + + InstanceTypeIds []*string `type:"list" json:",omitempty"` + + Name *string `type:"string" json:",omitempty"` +} + +// String returns the string representation +func (s FiltersForListWorkspaceStatusInput) String() string { + return volcengineutil.Prettify(s) +} + +// GoString returns the string representation +func (s FiltersForListWorkspaceStatusInput) GoString() string { + return s.String() +} + +// SetIds sets the Ids field's value. +func (s *FiltersForListWorkspaceStatusInput) SetIds(v []*string) *FiltersForListWorkspaceStatusInput { + s.Ids = v + return s +} + +// SetInstanceTypeIds sets the InstanceTypeIds field's value. +func (s *FiltersForListWorkspaceStatusInput) SetInstanceTypeIds(v []*string) *FiltersForListWorkspaceStatusInput { + s.InstanceTypeIds = v + return s +} + +// SetName sets the Name field's value. +func (s *FiltersForListWorkspaceStatusInput) SetName(v string) *FiltersForListWorkspaceStatusInput { + s.Name = &v + return s +} + +type ItemForListWorkspaceStatusOutput struct { + _ struct{} `type:"structure" json:",omitempty"` + + Id *string `type:"string" json:",omitempty"` + + InstanceTypeId *string `type:"string" json:",omitempty"` + + Name *string `type:"string" json:",omitempty"` + + Status *string `type:"string" json:",omitempty"` + + Usage *UsageForListWorkspaceStatusOutput `type:"structure" json:",omitempty"` +} + +// String returns the string representation +func (s ItemForListWorkspaceStatusOutput) String() string { + return volcengineutil.Prettify(s) +} + +// GoString returns the string representation +func (s ItemForListWorkspaceStatusOutput) GoString() string { + return s.String() +} + +// SetId sets the Id field's value. +func (s *ItemForListWorkspaceStatusOutput) SetId(v string) *ItemForListWorkspaceStatusOutput { + s.Id = &v + return s +} + +// SetInstanceTypeId sets the InstanceTypeId field's value. +func (s *ItemForListWorkspaceStatusOutput) SetInstanceTypeId(v string) *ItemForListWorkspaceStatusOutput { + s.InstanceTypeId = &v + return s +} + +// SetName sets the Name field's value. +func (s *ItemForListWorkspaceStatusOutput) SetName(v string) *ItemForListWorkspaceStatusOutput { + s.Name = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *ItemForListWorkspaceStatusOutput) SetStatus(v string) *ItemForListWorkspaceStatusOutput { + s.Status = &v + return s +} + +// SetUsage sets the Usage field's value. +func (s *ItemForListWorkspaceStatusOutput) SetUsage(v *UsageForListWorkspaceStatusOutput) *ItemForListWorkspaceStatusOutput { + s.Usage = v + return s +} + +type ListWorkspaceStatusInput struct { + _ struct{} `type:"structure" json:",omitempty"` + + Filters *FiltersForListWorkspaceStatusInput `type:"structure" json:",omitempty"` + + PageNumber *int64 `type:"int64" json:",omitempty"` + + PageSize *int64 `type:"int64" json:",omitempty"` + + ProjectName *string `type:"string" json:",omitempty"` +} + +// String returns the string representation +func (s ListWorkspaceStatusInput) String() string { + return volcengineutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListWorkspaceStatusInput) GoString() string { + return s.String() +} + +// SetFilters sets the Filters field's value. +func (s *ListWorkspaceStatusInput) SetFilters(v *FiltersForListWorkspaceStatusInput) *ListWorkspaceStatusInput { + s.Filters = v + return s +} + +// SetPageNumber sets the PageNumber field's value. +func (s *ListWorkspaceStatusInput) SetPageNumber(v int64) *ListWorkspaceStatusInput { + s.PageNumber = &v + return s +} + +// SetPageSize sets the PageSize field's value. +func (s *ListWorkspaceStatusInput) SetPageSize(v int64) *ListWorkspaceStatusInput { + s.PageSize = &v + return s +} + +// SetProjectName sets the ProjectName field's value. +func (s *ListWorkspaceStatusInput) SetProjectName(v string) *ListWorkspaceStatusInput { + s.ProjectName = &v + return s +} + +type ListWorkspaceStatusOutput struct { + _ struct{} `type:"structure" json:",omitempty"` + + Metadata *response.ResponseMetadata + + Items []*ItemForListWorkspaceStatusOutput `type:"list" json:",omitempty"` + + Total *int64 `type:"int64" json:",omitempty"` +} + +// String returns the string representation +func (s ListWorkspaceStatusOutput) String() string { + return volcengineutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListWorkspaceStatusOutput) GoString() string { + return s.String() +} + +// SetItems sets the Items field's value. +func (s *ListWorkspaceStatusOutput) SetItems(v []*ItemForListWorkspaceStatusOutput) *ListWorkspaceStatusOutput { + s.Items = v + return s +} + +// SetTotal sets the Total field's value. +func (s *ListWorkspaceStatusOutput) SetTotal(v int64) *ListWorkspaceStatusOutput { + s.Total = &v + return s +} + +type UsageForListWorkspaceStatusOutput struct { + _ struct{} `type:"structure" json:",omitempty"` + + ActiveSeries *int64 `type:"int64" json:",omitempty"` + + IngestedSamplesPerSecond *float64 `type:"double" json:",omitempty"` +} + +// String returns the string representation +func (s UsageForListWorkspaceStatusOutput) String() string { + return volcengineutil.Prettify(s) +} + +// GoString returns the string representation +func (s UsageForListWorkspaceStatusOutput) GoString() string { + return s.String() +} + +// SetActiveSeries sets the ActiveSeries field's value. +func (s *UsageForListWorkspaceStatusOutput) SetActiveSeries(v int64) *UsageForListWorkspaceStatusOutput { + s.ActiveSeries = &v + return s +} + +// SetIngestedSamplesPerSecond sets the IngestedSamplesPerSecond field's value. +func (s *UsageForListWorkspaceStatusOutput) SetIngestedSamplesPerSecond(v float64) *UsageForListWorkspaceStatusOutput { + s.IngestedSamplesPerSecond = &v + return s +} diff --git a/service/vmp/api_list_workspaces.go b/service/vmp/api_list_workspaces.go new file mode 100644 index 00000000..3b5bbfa0 --- /dev/null +++ b/service/vmp/api_list_workspaces.go @@ -0,0 +1,446 @@ +// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. + +package vmp + +import ( + "github.com/volcengine/volcengine-go-sdk/volcengine" + "github.com/volcengine/volcengine-go-sdk/volcengine/request" + "github.com/volcengine/volcengine-go-sdk/volcengine/response" + "github.com/volcengine/volcengine-go-sdk/volcengine/volcengineutil" +) + +const opListWorkspacesCommon = "ListWorkspaces" + +// ListWorkspacesCommonRequest generates a "volcengine/request.Request" representing the +// client's request for the ListWorkspacesCommon operation. The "output" return +// value will be populated with the ListWorkspacesCommon request's response once the request completes +// successfully. +// +// Use "Send" method on the returned ListWorkspacesCommon Request to send the API call to the service. +// the "output" return value is not valid until after ListWorkspacesCommon Send returns without error. +// +// See ListWorkspacesCommon for more information on using the ListWorkspacesCommon +// API call, and error handling. +// +// // Example sending a request using the ListWorkspacesCommonRequest method. +// req, resp := client.ListWorkspacesCommonRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +func (c *VMP) ListWorkspacesCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { + op := &request.Operation{ + Name: opListWorkspacesCommon, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &map[string]interface{}{} + } + + output = &map[string]interface{}{} + req = c.newRequest(op, input, output) + + req.HTTPRequest.Header.Set("Content-Type", "application/json; charset=utf-8") + + return +} + +// ListWorkspacesCommon API operation for VMP. +// +// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions +// with volcengineerr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the VOLCENGINE API reference guide for VMP's +// API operation ListWorkspacesCommon for usage and error information. +func (c *VMP) ListWorkspacesCommon(input *map[string]interface{}) (*map[string]interface{}, error) { + req, out := c.ListWorkspacesCommonRequest(input) + return out, req.Send() +} + +// ListWorkspacesCommonWithContext is the same as ListWorkspacesCommon with the addition of +// the ability to pass a context and additional request options. +// +// See ListWorkspacesCommon for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. +// In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *VMP) ListWorkspacesCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { + req, out := c.ListWorkspacesCommonRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListWorkspaces = "ListWorkspaces" + +// ListWorkspacesRequest generates a "volcengine/request.Request" representing the +// client's request for the ListWorkspaces operation. The "output" return +// value will be populated with the ListWorkspacesCommon request's response once the request completes +// successfully. +// +// Use "Send" method on the returned ListWorkspacesCommon Request to send the API call to the service. +// the "output" return value is not valid until after ListWorkspacesCommon Send returns without error. +// +// See ListWorkspaces for more information on using the ListWorkspaces +// API call, and error handling. +// +// // Example sending a request using the ListWorkspacesRequest method. +// req, resp := client.ListWorkspacesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +func (c *VMP) ListWorkspacesRequest(input *ListWorkspacesInput) (req *request.Request, output *ListWorkspacesOutput) { + op := &request.Operation{ + Name: opListWorkspaces, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ListWorkspacesInput{} + } + + output = &ListWorkspacesOutput{} + req = c.newRequest(op, input, output) + + req.HTTPRequest.Header.Set("Content-Type", "application/json; charset=utf-8") + + return +} + +// ListWorkspaces API operation for VMP. +// +// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions +// with volcengineerr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the VOLCENGINE API reference guide for VMP's +// API operation ListWorkspaces for usage and error information. +func (c *VMP) ListWorkspaces(input *ListWorkspacesInput) (*ListWorkspacesOutput, error) { + req, out := c.ListWorkspacesRequest(input) + return out, req.Send() +} + +// ListWorkspacesWithContext is the same as ListWorkspaces with the addition of +// the ability to pass a context and additional request options. +// +// See ListWorkspaces for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. Ifthe context is nil a panic will occur. +// In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *VMP) ListWorkspacesWithContext(ctx volcengine.Context, input *ListWorkspacesInput, opts ...request.Option) (*ListWorkspacesOutput, error) { + req, out := c.ListWorkspacesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +type FiltersForListWorkspacesInput struct { + _ struct{} `type:"structure" json:",omitempty"` + + Ids []*string `type:"list" json:",omitempty"` + + InstanceTypeIds []*string `type:"list" json:",omitempty"` + + Name *string `type:"string" json:",omitempty"` +} + +// String returns the string representation +func (s FiltersForListWorkspacesInput) String() string { + return volcengineutil.Prettify(s) +} + +// GoString returns the string representation +func (s FiltersForListWorkspacesInput) GoString() string { + return s.String() +} + +// SetIds sets the Ids field's value. +func (s *FiltersForListWorkspacesInput) SetIds(v []*string) *FiltersForListWorkspacesInput { + s.Ids = v + return s +} + +// SetInstanceTypeIds sets the InstanceTypeIds field's value. +func (s *FiltersForListWorkspacesInput) SetInstanceTypeIds(v []*string) *FiltersForListWorkspacesInput { + s.InstanceTypeIds = v + return s +} + +// SetName sets the Name field's value. +func (s *FiltersForListWorkspacesInput) SetName(v string) *FiltersForListWorkspacesInput { + s.Name = &v + return s +} + +type ItemForListWorkspacesOutput struct { + _ struct{} `type:"structure" json:",omitempty"` + + CreateTime *string `type:"string" json:",omitempty"` + + DeleteProtectionEnabled *bool `type:"boolean" json:",omitempty"` + + Description *string `type:"string" json:",omitempty"` + + Id *string `type:"string" json:",omitempty"` + + InstanceTypeId *string `type:"string" json:",omitempty"` + + Name *string `type:"string" json:",omitempty"` + + OverdueReclaimTime *string `type:"string" json:",omitempty"` + + ProjectName *string `type:"string" json:",omitempty"` + + PrometheusQueryIntranetEndpoint *string `type:"string" json:",omitempty"` + + PrometheusWriteIntranetEndpoint *string `type:"string" json:",omitempty"` + + Status *string `type:"string" json:",omitempty"` + + Tags []*TagForListWorkspacesOutput `type:"list" json:",omitempty"` + + Username *string `type:"string" json:",omitempty"` +} + +// String returns the string representation +func (s ItemForListWorkspacesOutput) String() string { + return volcengineutil.Prettify(s) +} + +// GoString returns the string representation +func (s ItemForListWorkspacesOutput) GoString() string { + return s.String() +} + +// SetCreateTime sets the CreateTime field's value. +func (s *ItemForListWorkspacesOutput) SetCreateTime(v string) *ItemForListWorkspacesOutput { + s.CreateTime = &v + return s +} + +// SetDeleteProtectionEnabled sets the DeleteProtectionEnabled field's value. +func (s *ItemForListWorkspacesOutput) SetDeleteProtectionEnabled(v bool) *ItemForListWorkspacesOutput { + s.DeleteProtectionEnabled = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *ItemForListWorkspacesOutput) SetDescription(v string) *ItemForListWorkspacesOutput { + s.Description = &v + return s +} + +// SetId sets the Id field's value. +func (s *ItemForListWorkspacesOutput) SetId(v string) *ItemForListWorkspacesOutput { + s.Id = &v + return s +} + +// SetInstanceTypeId sets the InstanceTypeId field's value. +func (s *ItemForListWorkspacesOutput) SetInstanceTypeId(v string) *ItemForListWorkspacesOutput { + s.InstanceTypeId = &v + return s +} + +// SetName sets the Name field's value. +func (s *ItemForListWorkspacesOutput) SetName(v string) *ItemForListWorkspacesOutput { + s.Name = &v + return s +} + +// SetOverdueReclaimTime sets the OverdueReclaimTime field's value. +func (s *ItemForListWorkspacesOutput) SetOverdueReclaimTime(v string) *ItemForListWorkspacesOutput { + s.OverdueReclaimTime = &v + return s +} + +// SetProjectName sets the ProjectName field's value. +func (s *ItemForListWorkspacesOutput) SetProjectName(v string) *ItemForListWorkspacesOutput { + s.ProjectName = &v + return s +} + +// SetPrometheusQueryIntranetEndpoint sets the PrometheusQueryIntranetEndpoint field's value. +func (s *ItemForListWorkspacesOutput) SetPrometheusQueryIntranetEndpoint(v string) *ItemForListWorkspacesOutput { + s.PrometheusQueryIntranetEndpoint = &v + return s +} + +// SetPrometheusWriteIntranetEndpoint sets the PrometheusWriteIntranetEndpoint field's value. +func (s *ItemForListWorkspacesOutput) SetPrometheusWriteIntranetEndpoint(v string) *ItemForListWorkspacesOutput { + s.PrometheusWriteIntranetEndpoint = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *ItemForListWorkspacesOutput) SetStatus(v string) *ItemForListWorkspacesOutput { + s.Status = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *ItemForListWorkspacesOutput) SetTags(v []*TagForListWorkspacesOutput) *ItemForListWorkspacesOutput { + s.Tags = v + return s +} + +// SetUsername sets the Username field's value. +func (s *ItemForListWorkspacesOutput) SetUsername(v string) *ItemForListWorkspacesOutput { + s.Username = &v + return s +} + +type ListWorkspacesInput struct { + _ struct{} `type:"structure" json:",omitempty"` + + Filters *FiltersForListWorkspacesInput `type:"structure" json:",omitempty"` + + PageNumber *int64 `type:"int64" json:",omitempty"` + + PageSize *int64 `type:"int64" json:",omitempty"` + + ProjectName *string `type:"string" json:",omitempty"` + + TagFilters []*TagFilterForListWorkspacesInput `type:"list" json:",omitempty"` +} + +// String returns the string representation +func (s ListWorkspacesInput) String() string { + return volcengineutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListWorkspacesInput) GoString() string { + return s.String() +} + +// SetFilters sets the Filters field's value. +func (s *ListWorkspacesInput) SetFilters(v *FiltersForListWorkspacesInput) *ListWorkspacesInput { + s.Filters = v + return s +} + +// SetPageNumber sets the PageNumber field's value. +func (s *ListWorkspacesInput) SetPageNumber(v int64) *ListWorkspacesInput { + s.PageNumber = &v + return s +} + +// SetPageSize sets the PageSize field's value. +func (s *ListWorkspacesInput) SetPageSize(v int64) *ListWorkspacesInput { + s.PageSize = &v + return s +} + +// SetProjectName sets the ProjectName field's value. +func (s *ListWorkspacesInput) SetProjectName(v string) *ListWorkspacesInput { + s.ProjectName = &v + return s +} + +// SetTagFilters sets the TagFilters field's value. +func (s *ListWorkspacesInput) SetTagFilters(v []*TagFilterForListWorkspacesInput) *ListWorkspacesInput { + s.TagFilters = v + return s +} + +type ListWorkspacesOutput struct { + _ struct{} `type:"structure" json:",omitempty"` + + Metadata *response.ResponseMetadata + + Items []*ItemForListWorkspacesOutput `type:"list" json:",omitempty"` + + Total *int64 `type:"int64" json:",omitempty"` +} + +// String returns the string representation +func (s ListWorkspacesOutput) String() string { + return volcengineutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListWorkspacesOutput) GoString() string { + return s.String() +} + +// SetItems sets the Items field's value. +func (s *ListWorkspacesOutput) SetItems(v []*ItemForListWorkspacesOutput) *ListWorkspacesOutput { + s.Items = v + return s +} + +// SetTotal sets the Total field's value. +func (s *ListWorkspacesOutput) SetTotal(v int64) *ListWorkspacesOutput { + s.Total = &v + return s +} + +type TagFilterForListWorkspacesInput struct { + _ struct{} `type:"structure" json:",omitempty"` + + Key *string `type:"string" json:",omitempty"` + + Values []*string `type:"list" json:",omitempty"` +} + +// String returns the string representation +func (s TagFilterForListWorkspacesInput) String() string { + return volcengineutil.Prettify(s) +} + +// GoString returns the string representation +func (s TagFilterForListWorkspacesInput) GoString() string { + return s.String() +} + +// SetKey sets the Key field's value. +func (s *TagFilterForListWorkspacesInput) SetKey(v string) *TagFilterForListWorkspacesInput { + s.Key = &v + return s +} + +// SetValues sets the Values field's value. +func (s *TagFilterForListWorkspacesInput) SetValues(v []*string) *TagFilterForListWorkspacesInput { + s.Values = v + return s +} + +type TagForListWorkspacesOutput struct { + _ struct{} `type:"structure" json:",omitempty"` + + Key *string `type:"string" json:",omitempty"` + + Value *string `type:"string" json:",omitempty"` +} + +// String returns the string representation +func (s TagForListWorkspacesOutput) String() string { + return volcengineutil.Prettify(s) +} + +// GoString returns the string representation +func (s TagForListWorkspacesOutput) GoString() string { + return s.String() +} + +// SetKey sets the Key field's value. +func (s *TagForListWorkspacesOutput) SetKey(v string) *TagForListWorkspacesOutput { + s.Key = &v + return s +} + +// SetValue sets the Value field's value. +func (s *TagForListWorkspacesOutput) SetValue(v string) *TagForListWorkspacesOutput { + s.Value = &v + return s +} diff --git a/service/vmp/api_update_workspace.go b/service/vmp/api_update_workspace.go new file mode 100644 index 00000000..d61a9a93 --- /dev/null +++ b/service/vmp/api_update_workspace.go @@ -0,0 +1,244 @@ +// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. + +package vmp + +import ( + "github.com/volcengine/volcengine-go-sdk/volcengine" + "github.com/volcengine/volcengine-go-sdk/volcengine/request" + "github.com/volcengine/volcengine-go-sdk/volcengine/response" + "github.com/volcengine/volcengine-go-sdk/volcengine/volcengineutil" +) + +const opUpdateWorkspaceCommon = "UpdateWorkspace" + +// UpdateWorkspaceCommonRequest generates a "volcengine/request.Request" representing the +// client's request for the UpdateWorkspaceCommon operation. The "output" return +// value will be populated with the UpdateWorkspaceCommon request's response once the request completes +// successfully. +// +// Use "Send" method on the returned UpdateWorkspaceCommon Request to send the API call to the service. +// the "output" return value is not valid until after UpdateWorkspaceCommon Send returns without error. +// +// See UpdateWorkspaceCommon for more information on using the UpdateWorkspaceCommon +// API call, and error handling. +// +// // Example sending a request using the UpdateWorkspaceCommonRequest method. +// req, resp := client.UpdateWorkspaceCommonRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +func (c *VMP) UpdateWorkspaceCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { + op := &request.Operation{ + Name: opUpdateWorkspaceCommon, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &map[string]interface{}{} + } + + output = &map[string]interface{}{} + req = c.newRequest(op, input, output) + + req.HTTPRequest.Header.Set("Content-Type", "application/json; charset=utf-8") + + return +} + +// UpdateWorkspaceCommon API operation for VMP. +// +// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions +// with volcengineerr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the VOLCENGINE API reference guide for VMP's +// API operation UpdateWorkspaceCommon for usage and error information. +func (c *VMP) UpdateWorkspaceCommon(input *map[string]interface{}) (*map[string]interface{}, error) { + req, out := c.UpdateWorkspaceCommonRequest(input) + return out, req.Send() +} + +// UpdateWorkspaceCommonWithContext is the same as UpdateWorkspaceCommon with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateWorkspaceCommon for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. +// In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *VMP) UpdateWorkspaceCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { + req, out := c.UpdateWorkspaceCommonRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateWorkspace = "UpdateWorkspace" + +// UpdateWorkspaceRequest generates a "volcengine/request.Request" representing the +// client's request for the UpdateWorkspace operation. The "output" return +// value will be populated with the UpdateWorkspaceCommon request's response once the request completes +// successfully. +// +// Use "Send" method on the returned UpdateWorkspaceCommon Request to send the API call to the service. +// the "output" return value is not valid until after UpdateWorkspaceCommon Send returns without error. +// +// See UpdateWorkspace for more information on using the UpdateWorkspace +// API call, and error handling. +// +// // Example sending a request using the UpdateWorkspaceRequest method. +// req, resp := client.UpdateWorkspaceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +func (c *VMP) UpdateWorkspaceRequest(input *UpdateWorkspaceInput) (req *request.Request, output *UpdateWorkspaceOutput) { + op := &request.Operation{ + Name: opUpdateWorkspace, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateWorkspaceInput{} + } + + output = &UpdateWorkspaceOutput{} + req = c.newRequest(op, input, output) + + req.HTTPRequest.Header.Set("Content-Type", "application/json; charset=utf-8") + + return +} + +// UpdateWorkspace API operation for VMP. +// +// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions +// with volcengineerr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the VOLCENGINE API reference guide for VMP's +// API operation UpdateWorkspace for usage and error information. +func (c *VMP) UpdateWorkspace(input *UpdateWorkspaceInput) (*UpdateWorkspaceOutput, error) { + req, out := c.UpdateWorkspaceRequest(input) + return out, req.Send() +} + +// UpdateWorkspaceWithContext is the same as UpdateWorkspace with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateWorkspace for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. Ifthe context is nil a panic will occur. +// In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *VMP) UpdateWorkspaceWithContext(ctx volcengine.Context, input *UpdateWorkspaceInput, opts ...request.Option) (*UpdateWorkspaceOutput, error) { + req, out := c.UpdateWorkspaceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +type UpdateWorkspaceInput struct { + _ struct{} `type:"structure" json:",omitempty"` + + DeleteProtectionEnabled *bool `type:"boolean" json:",omitempty"` + + Description *string `type:"string" json:",omitempty"` + + // Id is a required field + Id *string `type:"string" json:",omitempty" required:"true"` + + Name *string `type:"string" json:",omitempty"` + + Password *string `type:"string" json:",omitempty"` + + Username *string `type:"string" json:",omitempty"` +} + +// String returns the string representation +func (s UpdateWorkspaceInput) String() string { + return volcengineutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateWorkspaceInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateWorkspaceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateWorkspaceInput"} + if s.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDeleteProtectionEnabled sets the DeleteProtectionEnabled field's value. +func (s *UpdateWorkspaceInput) SetDeleteProtectionEnabled(v bool) *UpdateWorkspaceInput { + s.DeleteProtectionEnabled = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *UpdateWorkspaceInput) SetDescription(v string) *UpdateWorkspaceInput { + s.Description = &v + return s +} + +// SetId sets the Id field's value. +func (s *UpdateWorkspaceInput) SetId(v string) *UpdateWorkspaceInput { + s.Id = &v + return s +} + +// SetName sets the Name field's value. +func (s *UpdateWorkspaceInput) SetName(v string) *UpdateWorkspaceInput { + s.Name = &v + return s +} + +// SetPassword sets the Password field's value. +func (s *UpdateWorkspaceInput) SetPassword(v string) *UpdateWorkspaceInput { + s.Password = &v + return s +} + +// SetUsername sets the Username field's value. +func (s *UpdateWorkspaceInput) SetUsername(v string) *UpdateWorkspaceInput { + s.Username = &v + return s +} + +type UpdateWorkspaceOutput struct { + _ struct{} `type:"structure" json:",omitempty"` + + Metadata *response.ResponseMetadata + + Id *string `type:"string" json:",omitempty"` +} + +// String returns the string representation +func (s UpdateWorkspaceOutput) String() string { + return volcengineutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateWorkspaceOutput) GoString() string { + return s.String() +} + +// SetId sets the Id field's value. +func (s *UpdateWorkspaceOutput) SetId(v string) *UpdateWorkspaceOutput { + s.Id = &v + return s +} diff --git a/service/vmp/interface_vmp.go b/service/vmp/interface_vmp.go new file mode 100644 index 00000000..12421f9b --- /dev/null +++ b/service/vmp/interface_vmp.go @@ -0,0 +1,74 @@ +// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. + +// Package vmpiface provides an interface to enable mocking the VMP service client +// for testing your code. +// +// It is important to note that this interface will have breaking changes +// when the service model is updated and adds new API operations, paginators, +// and waiters. +package vmp + +import ( + "github.com/volcengine/volcengine-go-sdk/volcengine" + "github.com/volcengine/volcengine-go-sdk/volcengine/request" +) + +// VMPAPI provides an interface to enable mocking the +// vmp.VMP service client's API operation, +// +// // volcengine sdk func uses an SDK service client to make a request to +// // VMP. +// func myFunc(svc VMPAPI) bool { +// // Make svc.CreateWorkspace request +// } +// +// func main() { +// sess := session.New() +// svc := vmp.New(sess) +// +// myFunc(svc) +// } +// +type VMPAPI interface { + CreateWorkspaceCommon(*map[string]interface{}) (*map[string]interface{}, error) + CreateWorkspaceCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) + CreateWorkspaceCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) + + CreateWorkspace(*CreateWorkspaceInput) (*CreateWorkspaceOutput, error) + CreateWorkspaceWithContext(volcengine.Context, *CreateWorkspaceInput, ...request.Option) (*CreateWorkspaceOutput, error) + CreateWorkspaceRequest(*CreateWorkspaceInput) (*request.Request, *CreateWorkspaceOutput) + + DeleteWorkspaceCommon(*map[string]interface{}) (*map[string]interface{}, error) + DeleteWorkspaceCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) + DeleteWorkspaceCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) + + DeleteWorkspace(*DeleteWorkspaceInput) (*DeleteWorkspaceOutput, error) + DeleteWorkspaceWithContext(volcengine.Context, *DeleteWorkspaceInput, ...request.Option) (*DeleteWorkspaceOutput, error) + DeleteWorkspaceRequest(*DeleteWorkspaceInput) (*request.Request, *DeleteWorkspaceOutput) + + ListWorkspaceStatusCommon(*map[string]interface{}) (*map[string]interface{}, error) + ListWorkspaceStatusCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) + ListWorkspaceStatusCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) + + ListWorkspaceStatus(*ListWorkspaceStatusInput) (*ListWorkspaceStatusOutput, error) + ListWorkspaceStatusWithContext(volcengine.Context, *ListWorkspaceStatusInput, ...request.Option) (*ListWorkspaceStatusOutput, error) + ListWorkspaceStatusRequest(*ListWorkspaceStatusInput) (*request.Request, *ListWorkspaceStatusOutput) + + ListWorkspacesCommon(*map[string]interface{}) (*map[string]interface{}, error) + ListWorkspacesCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) + ListWorkspacesCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) + + ListWorkspaces(*ListWorkspacesInput) (*ListWorkspacesOutput, error) + ListWorkspacesWithContext(volcengine.Context, *ListWorkspacesInput, ...request.Option) (*ListWorkspacesOutput, error) + ListWorkspacesRequest(*ListWorkspacesInput) (*request.Request, *ListWorkspacesOutput) + + UpdateWorkspaceCommon(*map[string]interface{}) (*map[string]interface{}, error) + UpdateWorkspaceCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) + UpdateWorkspaceCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) + + UpdateWorkspace(*UpdateWorkspaceInput) (*UpdateWorkspaceOutput, error) + UpdateWorkspaceWithContext(volcengine.Context, *UpdateWorkspaceInput, ...request.Option) (*UpdateWorkspaceOutput, error) + UpdateWorkspaceRequest(*UpdateWorkspaceInput) (*request.Request, *UpdateWorkspaceOutput) +} + +var _ VMPAPI = (*VMP)(nil) diff --git a/service/vmp/service_vmp.go b/service/vmp/service_vmp.go new file mode 100644 index 00000000..b31945ef --- /dev/null +++ b/service/vmp/service_vmp.go @@ -0,0 +1,89 @@ +// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. + +package vmp + +import ( + "github.com/volcengine/volcengine-go-sdk/volcengine" + "github.com/volcengine/volcengine-go-sdk/volcengine/client" + "github.com/volcengine/volcengine-go-sdk/volcengine/client/metadata" + "github.com/volcengine/volcengine-go-sdk/volcengine/corehandlers" + "github.com/volcengine/volcengine-go-sdk/volcengine/request" + "github.com/volcengine/volcengine-go-sdk/volcengine/signer/volc" + "github.com/volcengine/volcengine-go-sdk/volcengine/volcenginequery" +) + +// VMP provides the API operation methods for making requests to +// VMP. See this package's package overview docs +// for details on the service. +// +// VMP methods are safe to use concurrently. It is not safe to +// modify mutate any of the struct's properties though. +type VMP struct { + *client.Client +} + +// Used for custom client initialization logic +var initClient func(*client.Client) + +// Used for custom request initialization logic +var initRequest func(*request.Request) + +// Service information constants +const ( + ServiceName = "vmp" // Name of service. + EndpointsID = ServiceName // ID to lookup a service endpoint with. + ServiceID = "vmp" // ServiceID is a unique identifer of a specific service. +) + +// New create int can support ssl or region locate set +func New(p client.ConfigProvider, cfgs ...*volcengine.Config) *VMP { + c := p.ClientConfig(EndpointsID, cfgs...) + return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) +} + +// newClient creates, initializes and returns a new service client instance. +func newClient(cfg volcengine.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *VMP { + svc := &VMP{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: ServiceName, + ServiceID: ServiceID, + SigningName: signingName, + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "2021-03-03", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Build.PushBackNamed(corehandlers.SDKVersionUserAgentHandler) + svc.Handlers.Build.PushBackNamed(corehandlers.AddHostExecEnvUserAgentHandler) + svc.Handlers.Sign.PushBackNamed(volc.SignRequestHandler) + svc.Handlers.Build.PushBackNamed(volcenginequery.BuildHandler) + svc.Handlers.Unmarshal.PushBackNamed(volcenginequery.UnmarshalHandler) + svc.Handlers.UnmarshalMeta.PushBackNamed(volcenginequery.UnmarshalMetaHandler) + svc.Handlers.UnmarshalError.PushBackNamed(volcenginequery.UnmarshalErrorHandler) + + // Run custom client initialization if present + if initClient != nil { + initClient(svc.Client) + } + + return svc +} + +// newRequest creates a new request for a VMP operation and runs any +// custom request initialization. +func (c *VMP) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + // Run custom request initialization if present + if initRequest != nil { + initRequest(req) + } + + return req +} diff --git a/volcengine/version.go b/volcengine/version.go index 446d0a8c..e9b44677 100644 --- a/volcengine/version.go +++ b/volcengine/version.go @@ -8,4 +8,4 @@ package volcengine const SDKName = "volcengine-go-sdk" // SDKVersion is the version of this SDK -const SDKVersion = "1.0.165" +const SDKVersion = "1.0.166" From 6740d85a6cb8c4b206615b5b8561f0c283d02af2 Mon Sep 17 00:00:00 2001 From: "xiujie.1" Date: Thu, 21 Nov 2024 19:33:01 +0800 Subject: [PATCH 2/2] update version and commitId --- meta.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta.json b/meta.json index 97ffdfba..d40aa15f 100755 --- a/meta.json +++ b/meta.json @@ -1,4 +1,4 @@ { "lasted": "1.0.166", - "meta_commit": "31603cfa49ebab8022ed0aa72c9ed42cd7cd20ab" + "meta_commit": "99e0488271facdd20c490b2fed527d0cea8d71c0" } \ No newline at end of file