-
Notifications
You must be signed in to change notification settings - Fork 3
/
api_op_ExecuteScript.go
127 lines (98 loc) · 3.21 KB
/
api_op_ExecuteScript.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package script
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/nifcloud/nifcloud-sdk-go/internal/nifcloudutil"
)
type ExecuteScriptInput struct {
_ struct{} `type:"structure"`
Body *string `locationName:"Body" type:"string"`
Header *string `locationName:"Header" type:"string"`
// Method is a required field
Method *string `locationName:"Method" type:"string" required:"true"`
Query *string `locationName:"Query" type:"string"`
// ScriptIdentifier is a required field
ScriptIdentifier *string `locationName:"ScriptIdentifier" type:"string" required:"true"`
}
// String returns the string representation
func (s ExecuteScriptInput) String() string {
return nifcloudutil.Prettify(s)
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ExecuteScriptInput) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "ExecuteScriptInput"}
if s.Method == nil {
invalidParams.Add(aws.NewErrParamRequired("Method"))
}
if s.ScriptIdentifier == nil {
invalidParams.Add(aws.NewErrParamRequired("ScriptIdentifier"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type ExecuteScriptOutput struct {
_ struct{} `type:"structure"`
Result *Result `type:"structure"`
}
// String returns the string representation
func (s ExecuteScriptOutput) String() string {
return nifcloudutil.Prettify(s)
}
const opExecuteScript = "ExecuteScript"
// ExecuteScriptRequest returns a request value for making API operation for
// NIFCLOUD Script.
//
// // Example sending a request using ExecuteScriptRequest.
// req := client.ExecuteScriptRequest(params)
// resp, err := req.Send(context.TODO())
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://pfs.nifcloud.com/api/script/ExecuteScript.htm
func (c *Client) ExecuteScriptRequest(input *ExecuteScriptInput) ExecuteScriptRequest {
op := &aws.Operation{
Name: opExecuteScript,
HTTPMethod: "POST",
HTTPPath: "/2015-09-01/",
}
if input == nil {
input = &ExecuteScriptInput{}
}
req := c.newRequest(op, input, &ExecuteScriptOutput{})
return ExecuteScriptRequest{Request: req, Input: input, Copy: c.ExecuteScriptRequest}
}
// ExecuteScriptRequest is the request type for the
// ExecuteScript API operation.
type ExecuteScriptRequest struct {
*aws.Request
Input *ExecuteScriptInput
Copy func(*ExecuteScriptInput) ExecuteScriptRequest
}
// Send marshals and sends the ExecuteScript API request.
func (r ExecuteScriptRequest) Send(ctx context.Context) (*ExecuteScriptResponse, error) {
r.Request.SetContext(ctx)
err := r.Request.Send()
if err != nil {
return nil, err
}
resp := &ExecuteScriptResponse{
ExecuteScriptOutput: r.Request.Data.(*ExecuteScriptOutput),
response: &aws.Response{Request: r.Request},
}
return resp, nil
}
// ExecuteScriptResponse is the response type for the
// ExecuteScript API operation.
type ExecuteScriptResponse struct {
*ExecuteScriptOutput
response *aws.Response
}
// SDKResponseMetdata returns the response metadata for the
// ExecuteScript request.
func (r *ExecuteScriptResponse) SDKResponseMetdata() *aws.Response {
return r.response
}