Skip to content

Commit af5665f

Browse files
committed
Support API DeleteProject.
1 parent 707bd4d commit af5665f

File tree

6 files changed

+290
-0
lines changed

6 files changed

+290
-0
lines changed

ChangeLog.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2025-11-06 Version: v3.1.0
2+
- Support API DeleteProject.
3+
4+
15
2025-10-31 Version: v3.0.2
26
- Update API GetProject: add request parameters withQuotaProductType.
37
- Update API GetProject: add request parameters withStorageTierInfo.

client/client.go

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -944,6 +944,72 @@ func (client *Client) DeleteMmsJob(sourceId *string, jobId *string) (_result *De
944944
return _result, _err
945945
}
946946

947+
// Summary:
948+
//
949+
// Deletes a MaxCompute project.
950+
//
951+
// @param request - DeleteProjectRequest
952+
//
953+
// @param headers - map
954+
//
955+
// @param runtime - runtime options for this request RuntimeOptions
956+
//
957+
// @return DeleteProjectResponse
958+
func (client *Client) DeleteProjectWithOptions(projectName *string, request *DeleteProjectRequest, headers map[string]*string, runtime *dara.RuntimeOptions) (_result *DeleteProjectResponse, _err error) {
959+
if dara.BoolValue(client.EnableValidate) == true {
960+
_err = request.Validate()
961+
if _err != nil {
962+
return _result, _err
963+
}
964+
}
965+
query := map[string]interface{}{}
966+
if !dara.IsNil(request.IsLogical) {
967+
query["isLogical"] = request.IsLogical
968+
}
969+
970+
req := &openapiutil.OpenApiRequest{
971+
Headers: headers,
972+
Query: openapiutil.Query(query),
973+
}
974+
params := &openapiutil.Params{
975+
Action: dara.String("DeleteProject"),
976+
Version: dara.String("2022-01-04"),
977+
Protocol: dara.String("HTTPS"),
978+
Pathname: dara.String("/api/v1/projects/" + dara.PercentEncode(dara.StringValue(projectName))),
979+
Method: dara.String("DELETE"),
980+
AuthType: dara.String("AK"),
981+
Style: dara.String("ROA"),
982+
ReqBodyType: dara.String("json"),
983+
BodyType: dara.String("json"),
984+
}
985+
_result = &DeleteProjectResponse{}
986+
_body, _err := client.CallApi(params, req, runtime)
987+
if _err != nil {
988+
return _result, _err
989+
}
990+
_err = dara.Convert(_body, &_result)
991+
return _result, _err
992+
}
993+
994+
// Summary:
995+
//
996+
// Deletes a MaxCompute project.
997+
//
998+
// @param request - DeleteProjectRequest
999+
//
1000+
// @return DeleteProjectResponse
1001+
func (client *Client) DeleteProject(projectName *string, request *DeleteProjectRequest) (_result *DeleteProjectResponse, _err error) {
1002+
runtime := &dara.RuntimeOptions{}
1003+
headers := make(map[string]*string)
1004+
_result = &DeleteProjectResponse{}
1005+
_body, _err := client.DeleteProjectWithOptions(projectName, request, headers, runtime)
1006+
if _err != nil {
1007+
return _result, _err
1008+
}
1009+
_result = _body
1010+
return _result, _err
1011+
}
1012+
9471013
// Summary:
9481014
//
9491015
// Deletes a quota plan.

client/client_context_func.go

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,53 @@ func (client *Client) DeleteMmsJobWithContext(ctx context.Context, sourceId *str
609609
return _result, _err
610610
}
611611

612+
// Summary:
613+
//
614+
// Deletes a MaxCompute project.
615+
//
616+
// @param request - DeleteProjectRequest
617+
//
618+
// @param headers - map
619+
//
620+
// @param runtime - runtime options for this request RuntimeOptions
621+
//
622+
// @return DeleteProjectResponse
623+
func (client *Client) DeleteProjectWithContext(ctx context.Context, projectName *string, request *DeleteProjectRequest, headers map[string]*string, runtime *dara.RuntimeOptions) (_result *DeleteProjectResponse, _err error) {
624+
if dara.BoolValue(client.EnableValidate) == true {
625+
_err = request.Validate()
626+
if _err != nil {
627+
return _result, _err
628+
}
629+
}
630+
query := map[string]interface{}{}
631+
if !dara.IsNil(request.IsLogical) {
632+
query["isLogical"] = request.IsLogical
633+
}
634+
635+
req := &openapiutil.OpenApiRequest{
636+
Headers: headers,
637+
Query: openapiutil.Query(query),
638+
}
639+
params := &openapiutil.Params{
640+
Action: dara.String("DeleteProject"),
641+
Version: dara.String("2022-01-04"),
642+
Protocol: dara.String("HTTPS"),
643+
Pathname: dara.String("/api/v1/projects/" + dara.PercentEncode(dara.StringValue(projectName))),
644+
Method: dara.String("DELETE"),
645+
AuthType: dara.String("AK"),
646+
Style: dara.String("ROA"),
647+
ReqBodyType: dara.String("json"),
648+
BodyType: dara.String("json"),
649+
}
650+
_result = &DeleteProjectResponse{}
651+
_body, _err := client.CallApiWithCtx(ctx, params, req, runtime)
652+
if _err != nil {
653+
return _result, _err
654+
}
655+
_err = dara.Convert(_body, &_result)
656+
return _result, _err
657+
}
658+
612659
// Summary:
613660
//
614661
// Deletes a quota plan.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// This file is auto-generated, don't edit it. Thanks.
2+
package client
3+
4+
import (
5+
"github.com/alibabacloud-go/tea/dara"
6+
)
7+
8+
type iDeleteProjectRequest interface {
9+
dara.Model
10+
String() string
11+
GoString() string
12+
SetIsLogical(v bool) *DeleteProjectRequest
13+
GetIsLogical() *bool
14+
}
15+
16+
type DeleteProjectRequest struct {
17+
// Specifies whether to logically delete the project. Valid values: true and false. Default value: true. The value false indicates that the project is physically deleted.
18+
//
19+
// example:
20+
//
21+
// true
22+
IsLogical *bool `json:"isLogical,omitempty" xml:"isLogical,omitempty"`
23+
}
24+
25+
func (s DeleteProjectRequest) String() string {
26+
return dara.Prettify(s)
27+
}
28+
29+
func (s DeleteProjectRequest) GoString() string {
30+
return s.String()
31+
}
32+
33+
func (s *DeleteProjectRequest) GetIsLogical() *bool {
34+
return s.IsLogical
35+
}
36+
37+
func (s *DeleteProjectRequest) SetIsLogical(v bool) *DeleteProjectRequest {
38+
s.IsLogical = &v
39+
return s
40+
}
41+
42+
func (s *DeleteProjectRequest) Validate() error {
43+
return dara.Validate(s)
44+
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
// This file is auto-generated, don't edit it. Thanks.
2+
package client
3+
4+
import (
5+
"github.com/alibabacloud-go/tea/dara"
6+
)
7+
8+
type iDeleteProjectResponseBody interface {
9+
dara.Model
10+
String() string
11+
GoString() string
12+
SetData(v string) *DeleteProjectResponseBody
13+
GetData() *string
14+
SetRequestId(v string) *DeleteProjectResponseBody
15+
GetRequestId() *string
16+
}
17+
18+
type DeleteProjectResponseBody struct {
19+
// The returned data.
20+
//
21+
// example:
22+
//
23+
// success
24+
Data *string `json:"data,omitempty" xml:"data,omitempty"`
25+
// The ID of the request.
26+
//
27+
// example:
28+
//
29+
// 0be3e0aa16667684362147582e038f
30+
RequestId *string `json:"requestId,omitempty" xml:"requestId,omitempty"`
31+
}
32+
33+
func (s DeleteProjectResponseBody) String() string {
34+
return dara.Prettify(s)
35+
}
36+
37+
func (s DeleteProjectResponseBody) GoString() string {
38+
return s.String()
39+
}
40+
41+
func (s *DeleteProjectResponseBody) GetData() *string {
42+
return s.Data
43+
}
44+
45+
func (s *DeleteProjectResponseBody) GetRequestId() *string {
46+
return s.RequestId
47+
}
48+
49+
func (s *DeleteProjectResponseBody) SetData(v string) *DeleteProjectResponseBody {
50+
s.Data = &v
51+
return s
52+
}
53+
54+
func (s *DeleteProjectResponseBody) SetRequestId(v string) *DeleteProjectResponseBody {
55+
s.RequestId = &v
56+
return s
57+
}
58+
59+
func (s *DeleteProjectResponseBody) Validate() error {
60+
return dara.Validate(s)
61+
}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
// This file is auto-generated, don't edit it. Thanks.
2+
package client
3+
4+
import (
5+
"github.com/alibabacloud-go/tea/dara"
6+
)
7+
8+
type iDeleteProjectResponse interface {
9+
dara.Model
10+
String() string
11+
GoString() string
12+
SetHeaders(v map[string]*string) *DeleteProjectResponse
13+
GetHeaders() map[string]*string
14+
SetStatusCode(v int32) *DeleteProjectResponse
15+
GetStatusCode() *int32
16+
SetBody(v *DeleteProjectResponseBody) *DeleteProjectResponse
17+
GetBody() *DeleteProjectResponseBody
18+
}
19+
20+
type DeleteProjectResponse struct {
21+
Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty"`
22+
StatusCode *int32 `json:"statusCode,omitempty" xml:"statusCode,omitempty"`
23+
Body *DeleteProjectResponseBody `json:"body,omitempty" xml:"body,omitempty"`
24+
}
25+
26+
func (s DeleteProjectResponse) String() string {
27+
return dara.Prettify(s)
28+
}
29+
30+
func (s DeleteProjectResponse) GoString() string {
31+
return s.String()
32+
}
33+
34+
func (s *DeleteProjectResponse) GetHeaders() map[string]*string {
35+
return s.Headers
36+
}
37+
38+
func (s *DeleteProjectResponse) GetStatusCode() *int32 {
39+
return s.StatusCode
40+
}
41+
42+
func (s *DeleteProjectResponse) GetBody() *DeleteProjectResponseBody {
43+
return s.Body
44+
}
45+
46+
func (s *DeleteProjectResponse) SetHeaders(v map[string]*string) *DeleteProjectResponse {
47+
s.Headers = v
48+
return s
49+
}
50+
51+
func (s *DeleteProjectResponse) SetStatusCode(v int32) *DeleteProjectResponse {
52+
s.StatusCode = &v
53+
return s
54+
}
55+
56+
func (s *DeleteProjectResponse) SetBody(v *DeleteProjectResponseBody) *DeleteProjectResponse {
57+
s.Body = v
58+
return s
59+
}
60+
61+
func (s *DeleteProjectResponse) Validate() error {
62+
if s.Body != nil {
63+
if err := s.Body.Validate(); err != nil {
64+
return err
65+
}
66+
}
67+
return nil
68+
}

0 commit comments

Comments
 (0)