浏览代码

merge master

Signed-off-by: gaort <rutong.grt@alibaba-inc.com>
gaort 7 年之前
父节点
当前提交
4f138e3eff

+ 3 - 0
ChangeLog.txt

@@ -1,3 +1,6 @@
+2018-02-02 Version: 0.11.2
+1, this version is new of captcha management and nvc analyze
+
 2018-01-31 Version: 0.11.1
 1. Fixed bugs that could cause signature errors while a ROA request contains lots of special symbols
 2. Optimization of the serverError.Error() interface

+ 7 - 1
sdk/auth/roa_signature_composer.go

@@ -31,6 +31,8 @@ func signRoaRequest(request requests.AcsRequest, signer Signer, regionId string)
 }
 
 func completeROASignParams(request requests.AcsRequest, signer Signer, regionId string) {
+	headerParams := request.GetHeaders()
+
 	// complete query params
 	queryParams := request.GetQueryParams()
 	if _, ok := queryParams["RegionId"]; !ok {
@@ -38,12 +40,16 @@ func completeROASignParams(request requests.AcsRequest, signer Signer, regionId
 	}
 	if extraParam := signer.GetExtraParam(); extraParam != nil {
 		for key, value := range extraParam {
+			if key == "SecurityToken" {
+				headerParams["x-acs-security-token"] = value
+				continue
+			}
+
 			queryParams[key] = value
 		}
 	}
 
 	// complete header params
-	headerParams := request.GetHeaders()
 	headerParams["Date"] = utils.GetTimeInFormatRFC2616()
 	headerParams["x-acs-signature-method"] = signer.GetName()
 	headerParams["x-acs-signature-version"] = signer.GetVersion()

+ 95 - 0
services/afs/analyze_nvc.go

@@ -0,0 +1,95 @@
+package afs
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+func (client *Client) AnalyzeNvc(request *AnalyzeNvcRequest) (response *AnalyzeNvcResponse, err error) {
+	response = CreateAnalyzeNvcResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+func (client *Client) AnalyzeNvcWithChan(request *AnalyzeNvcRequest) (<-chan *AnalyzeNvcResponse, <-chan error) {
+	responseChan := make(chan *AnalyzeNvcResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.AnalyzeNvc(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+func (client *Client) AnalyzeNvcWithCallback(request *AnalyzeNvcRequest, callback func(response *AnalyzeNvcResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *AnalyzeNvcResponse
+		var err error
+		defer close(result)
+		response, err = client.AnalyzeNvc(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+type AnalyzeNvcRequest struct {
+	*requests.RpcRequest
+	ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"`
+	SourceIp        string           `position:"Query" name:"SourceIp"`
+	Data            string           `position:"Query" name:"Data"`
+	ScoreJsonStr    string           `position:"Query" name:"ScoreJsonStr"`
+}
+
+type AnalyzeNvcResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+	BizCode   string `json:"BizCode" xml:"BizCode"`
+}
+
+func CreateAnalyzeNvcRequest() (request *AnalyzeNvcRequest) {
+	request = &AnalyzeNvcRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("afs", "2018-01-12", "AnalyzeNvc", "", "")
+	return
+}
+
+func CreateAnalyzeNvcResponse() (response *AnalyzeNvcResponse) {
+	response = &AnalyzeNvcResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 102 - 0
services/afs/authenticate_sig.go

@@ -0,0 +1,102 @@
+package afs
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+func (client *Client) AuthenticateSig(request *AuthenticateSigRequest) (response *AuthenticateSigResponse, err error) {
+	response = CreateAuthenticateSigResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+func (client *Client) AuthenticateSigWithChan(request *AuthenticateSigRequest) (<-chan *AuthenticateSigResponse, <-chan error) {
+	responseChan := make(chan *AuthenticateSigResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.AuthenticateSig(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+func (client *Client) AuthenticateSigWithCallback(request *AuthenticateSigRequest, callback func(response *AuthenticateSigResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *AuthenticateSigResponse
+		var err error
+		defer close(result)
+		response, err = client.AuthenticateSig(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+type AuthenticateSigRequest struct {
+	*requests.RpcRequest
+	Sig             string           `position:"Query" name:"Sig"`
+	ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"`
+	RemoteIp        string           `position:"Query" name:"RemoteIp"`
+	SourceIp        string           `position:"Query" name:"SourceIp"`
+	AppKey          string           `position:"Query" name:"AppKey"`
+	SessionId       string           `position:"Query" name:"SessionId"`
+	Token           string           `position:"Query" name:"Token"`
+	Scene           string           `position:"Query" name:"Scene"`
+}
+
+type AuthenticateSigResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+	Code      int    `json:"Code" xml:"Code"`
+	Msg       string `json:"Msg" xml:"Msg"`
+	RiskLevel string `json:"RiskLevel" xml:"RiskLevel"`
+	Detail    string `json:"Detail" xml:"Detail"`
+}
+
+func CreateAuthenticateSigRequest() (request *AuthenticateSigRequest) {
+	request = &AuthenticateSigRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("afs", "2018-01-12", "AuthenticateSig", "", "")
+	return
+}
+
+func CreateAuthenticateSigResponse() (response *AuthenticateSigResponse) {
+	response = &AuthenticateSigResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 67 - 0
services/afs/client.go

@@ -0,0 +1,67 @@
+package afs
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth"
+)
+
+type Client struct {
+	sdk.Client
+}
+
+func NewClient() (client *Client, err error) {
+	client = &Client{}
+	err = client.Init()
+	return
+}
+
+func NewClientWithOptions(regionId string, config *sdk.Config, credential auth.Credential) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithOptions(regionId, config, credential)
+	return
+}
+
+func NewClientWithAccessKey(regionId, accessKeyId, accessKeySecret string) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithAccessKey(regionId, accessKeyId, accessKeySecret)
+	return
+}
+
+func NewClientWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken string) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken)
+	return
+}
+
+func NewClientWithRamRoleArn(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithRamRoleArn(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName)
+	return
+}
+
+func NewClientWithEcsRamRole(regionId string, roleName string) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithEcsRamRole(regionId, roleName)
+	return
+}
+
+func NewClientWithRsaKeyPair(regionId string, publicKeyId, privateKey string, sessionExpiration int) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithRsaKeyPair(regionId, publicKeyId, privateKey, sessionExpiration)
+	return
+}

+ 104 - 0
services/afs/configuration_style.go

@@ -0,0 +1,104 @@
+package afs
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+func (client *Client) ConfigurationStyle(request *ConfigurationStyleRequest) (response *ConfigurationStyleResponse, err error) {
+	response = CreateConfigurationStyleResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+func (client *Client) ConfigurationStyleWithChan(request *ConfigurationStyleRequest) (<-chan *ConfigurationStyleResponse, <-chan error) {
+	responseChan := make(chan *ConfigurationStyleResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.ConfigurationStyle(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+func (client *Client) ConfigurationStyleWithCallback(request *ConfigurationStyleRequest, callback func(response *ConfigurationStyleResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *ConfigurationStyleResponse
+		var err error
+		defer close(result)
+		response, err = client.ConfigurationStyle(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+type ConfigurationStyleRequest struct {
+	*requests.RpcRequest
+	ResourceOwnerId     requests.Integer `position:"Query" name:"ResourceOwnerId"`
+	SourceIp            string           `position:"Query" name:"SourceIp"`
+	ConfigurationMethod string           `position:"Query" name:"ConfigurationMethod"`
+	ApplyType           string           `position:"Query" name:"ApplyType"`
+	Scene               string           `position:"Query" name:"Scene"`
+}
+
+type ConfigurationStyleResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+	BizCode   string `json:"BizCode" xml:"BizCode"`
+	CodeData  struct {
+		Html   string `json:"Html" xml:"Html"`
+		Net    string `json:"Net" xml:"Net"`
+		Php    string `json:"Php" xml:"Php"`
+		Python string `json:"Python" xml:"Python"`
+		Java   string `json:"Java" xml:"Java"`
+		NodeJs string `json:"NodeJs" xml:"NodeJs"`
+	} `json:"CodeData" xml:"CodeData"`
+}
+
+func CreateConfigurationStyleRequest() (request *ConfigurationStyleRequest) {
+	request = &ConfigurationStyleRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("afs", "2018-01-12", "ConfigurationStyle", "", "")
+	return
+}
+
+func CreateConfigurationStyleResponse() (response *ConfigurationStyleResponse) {
+	response = &ConfigurationStyleResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 98 - 0
services/afs/create_configuration.go

@@ -0,0 +1,98 @@
+package afs
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+func (client *Client) CreateConfiguration(request *CreateConfigurationRequest) (response *CreateConfigurationResponse, err error) {
+	response = CreateCreateConfigurationResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+func (client *Client) CreateConfigurationWithChan(request *CreateConfigurationRequest) (<-chan *CreateConfigurationResponse, <-chan error) {
+	responseChan := make(chan *CreateConfigurationResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.CreateConfiguration(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+func (client *Client) CreateConfigurationWithCallback(request *CreateConfigurationRequest, callback func(response *CreateConfigurationResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *CreateConfigurationResponse
+		var err error
+		defer close(result)
+		response, err = client.CreateConfiguration(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+type CreateConfigurationRequest struct {
+	*requests.RpcRequest
+	ResourceOwnerId     requests.Integer `position:"Query" name:"ResourceOwnerId"`
+	SourceIp            string           `position:"Query" name:"SourceIp"`
+	ConfigurationName   string           `position:"Query" name:"ConfigurationName"`
+	MaxPV               string           `position:"Query" name:"MaxPV"`
+	ConfigurationMethod string           `position:"Query" name:"ConfigurationMethod"`
+	ApplyType           string           `position:"Query" name:"ApplyType"`
+	Scene               string           `position:"Query" name:"Scene"`
+}
+
+type CreateConfigurationResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+	BizCode   string `json:"BizCode" xml:"BizCode"`
+}
+
+func CreateCreateConfigurationRequest() (request *CreateConfigurationRequest) {
+	request = &CreateConfigurationRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("afs", "2018-01-12", "CreateConfiguration", "", "")
+	return
+}
+
+func CreateCreateConfigurationResponse() (response *CreateConfigurationResponse) {
+	response = &CreateConfigurationResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 108 - 0
services/afs/describe_captcha_day.go

@@ -0,0 +1,108 @@
+package afs
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+func (client *Client) DescribeCaptchaDay(request *DescribeCaptchaDayRequest) (response *DescribeCaptchaDayResponse, err error) {
+	response = CreateDescribeCaptchaDayResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+func (client *Client) DescribeCaptchaDayWithChan(request *DescribeCaptchaDayRequest) (<-chan *DescribeCaptchaDayResponse, <-chan error) {
+	responseChan := make(chan *DescribeCaptchaDayResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.DescribeCaptchaDay(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+func (client *Client) DescribeCaptchaDayWithCallback(request *DescribeCaptchaDayRequest, callback func(response *DescribeCaptchaDayResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *DescribeCaptchaDayResponse
+		var err error
+		defer close(result)
+		response, err = client.DescribeCaptchaDay(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+type DescribeCaptchaDayRequest struct {
+	*requests.RpcRequest
+	ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"`
+	SourceIp        string           `position:"Query" name:"SourceIp"`
+	ConfigName      string           `position:"Query" name:"ConfigName"`
+	Time            string           `position:"Query" name:"Time"`
+	Type            string           `position:"Query" name:"Type"`
+}
+
+type DescribeCaptchaDayResponse struct {
+	*responses.BaseResponse
+	RequestId  string `json:"RequestId" xml:"RequestId"`
+	BizCode    string `json:"BizCode" xml:"BizCode"`
+	HasData    bool   `json:"HasData" xml:"HasData"`
+	CaptchaDay struct {
+		Init                        int `json:"Init" xml:"Init"`
+		AskForVerify                int `json:"AskForVerify" xml:"AskForVerify"`
+		DirecetStrategyInterception int `json:"DirecetStrategyInterception" xml:"DirecetStrategyInterception"`
+		TwiceVerify                 int `json:"TwiceVerify" xml:"TwiceVerify"`
+		Pass                        int `json:"Pass" xml:"Pass"`
+		CheckTested                 int `json:"CheckTested" xml:"CheckTested"`
+		UncheckTested               int `json:"UncheckTested" xml:"UncheckTested"`
+		LegalSign                   int `json:"LegalSign" xml:"LegalSign"`
+		MaliciousFlow               int `json:"MaliciousFlow" xml:"MaliciousFlow"`
+	} `json:"CaptchaDay" xml:"CaptchaDay"`
+}
+
+func CreateDescribeCaptchaDayRequest() (request *DescribeCaptchaDayRequest) {
+	request = &DescribeCaptchaDayRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("afs", "2018-01-12", "DescribeCaptchaDay", "", "")
+	return
+}
+
+func CreateDescribeCaptchaDayResponse() (response *DescribeCaptchaDayResponse) {
+	response = &DescribeCaptchaDayResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 107 - 0
services/afs/describe_captcha_ip_city.go

@@ -0,0 +1,107 @@
+package afs
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+func (client *Client) DescribeCaptchaIpCity(request *DescribeCaptchaIpCityRequest) (response *DescribeCaptchaIpCityResponse, err error) {
+	response = CreateDescribeCaptchaIpCityResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+func (client *Client) DescribeCaptchaIpCityWithChan(request *DescribeCaptchaIpCityRequest) (<-chan *DescribeCaptchaIpCityResponse, <-chan error) {
+	responseChan := make(chan *DescribeCaptchaIpCityResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.DescribeCaptchaIpCity(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+func (client *Client) DescribeCaptchaIpCityWithCallback(request *DescribeCaptchaIpCityRequest, callback func(response *DescribeCaptchaIpCityResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *DescribeCaptchaIpCityResponse
+		var err error
+		defer close(result)
+		response, err = client.DescribeCaptchaIpCity(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+type DescribeCaptchaIpCityRequest struct {
+	*requests.RpcRequest
+	ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"`
+	SourceIp        string           `position:"Query" name:"SourceIp"`
+	ConfigName      string           `position:"Query" name:"ConfigName"`
+	Time            string           `position:"Query" name:"Time"`
+	Type            string           `position:"Query" name:"Type"`
+}
+
+type DescribeCaptchaIpCityResponse struct {
+	*responses.BaseResponse
+	RequestId     string `json:"RequestId" xml:"RequestId"`
+	BizCode       string `json:"BizCode" xml:"BizCode"`
+	HasData       bool   `json:"HasData" xml:"HasData"`
+	CaptchaCities []struct {
+		Location string `json:"Location" xml:"Location"`
+		Lat      string `json:"Lat" xml:"Lat"`
+		Lng      string `json:"Lng" xml:"Lng"`
+		Pv       int    `json:"Pv" xml:"Pv"`
+	} `json:"CaptchaCities" xml:"CaptchaCities"`
+	CaptchaIps []struct {
+		Ip    string `json:"Ip" xml:"Ip"`
+		Value int    `json:"Value" xml:"Value"`
+	} `json:"CaptchaIps" xml:"CaptchaIps"`
+}
+
+func CreateDescribeCaptchaIpCityRequest() (request *DescribeCaptchaIpCityRequest) {
+	request = &DescribeCaptchaIpCityRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("afs", "2018-01-12", "DescribeCaptchaIpCity", "", "")
+	return
+}
+
+func CreateDescribeCaptchaIpCityResponse() (response *DescribeCaptchaIpCityResponse) {
+	response = &DescribeCaptchaIpCityResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 102 - 0
services/afs/describe_captcha_min.go

@@ -0,0 +1,102 @@
+package afs
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+func (client *Client) DescribeCaptchaMin(request *DescribeCaptchaMinRequest) (response *DescribeCaptchaMinResponse, err error) {
+	response = CreateDescribeCaptchaMinResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+func (client *Client) DescribeCaptchaMinWithChan(request *DescribeCaptchaMinRequest) (<-chan *DescribeCaptchaMinResponse, <-chan error) {
+	responseChan := make(chan *DescribeCaptchaMinResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.DescribeCaptchaMin(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+func (client *Client) DescribeCaptchaMinWithCallback(request *DescribeCaptchaMinRequest, callback func(response *DescribeCaptchaMinResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *DescribeCaptchaMinResponse
+		var err error
+		defer close(result)
+		response, err = client.DescribeCaptchaMin(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+type DescribeCaptchaMinRequest struct {
+	*requests.RpcRequest
+	ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"`
+	SourceIp        string           `position:"Query" name:"SourceIp"`
+	ConfigName      string           `position:"Query" name:"ConfigName"`
+	Time            string           `position:"Query" name:"Time"`
+	Type            string           `position:"Query" name:"Type"`
+}
+
+type DescribeCaptchaMinResponse struct {
+	*responses.BaseResponse
+	RequestId   string `json:"RequestId" xml:"RequestId"`
+	BizCode     string `json:"BizCode" xml:"BizCode"`
+	HasData     bool   `json:"HasData" xml:"HasData"`
+	CaptchaMins []struct {
+		Time         string `json:"Time" xml:"Time"`
+		Pass         string `json:"Pass" xml:"Pass"`
+		Interception string `json:"Interception" xml:"Interception"`
+	} `json:"CaptchaMins" xml:"CaptchaMins"`
+}
+
+func CreateDescribeCaptchaMinRequest() (request *DescribeCaptchaMinRequest) {
+	request = &DescribeCaptchaMinRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("afs", "2018-01-12", "DescribeCaptchaMin", "", "")
+	return
+}
+
+func CreateDescribeCaptchaMinResponse() (response *DescribeCaptchaMinResponse) {
+	response = &DescribeCaptchaMinResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 98 - 0
services/afs/describe_captcha_risk.go

@@ -0,0 +1,98 @@
+package afs
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+func (client *Client) DescribeCaptchaRisk(request *DescribeCaptchaRiskRequest) (response *DescribeCaptchaRiskResponse, err error) {
+	response = CreateDescribeCaptchaRiskResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+func (client *Client) DescribeCaptchaRiskWithChan(request *DescribeCaptchaRiskRequest) (<-chan *DescribeCaptchaRiskResponse, <-chan error) {
+	responseChan := make(chan *DescribeCaptchaRiskResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.DescribeCaptchaRisk(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+func (client *Client) DescribeCaptchaRiskWithCallback(request *DescribeCaptchaRiskRequest, callback func(response *DescribeCaptchaRiskResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *DescribeCaptchaRiskResponse
+		var err error
+		defer close(result)
+		response, err = client.DescribeCaptchaRisk(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+type DescribeCaptchaRiskRequest struct {
+	*requests.RpcRequest
+	ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"`
+	SourceIp        string           `position:"Query" name:"SourceIp"`
+	ConfigName      string           `position:"Query" name:"ConfigName"`
+	Time            string           `position:"Query" name:"Time"`
+}
+
+type DescribeCaptchaRiskResponse struct {
+	*responses.BaseResponse
+	RequestId      string `json:"RequestId" xml:"RequestId"`
+	BizCode        string `json:"BizCode" xml:"BizCode"`
+	NumOfThisMonth int    `json:"NumOfThisMonth" xml:"NumOfThisMonth"`
+	NumOfLastMonth int    `json:"NumOfLastMonth" xml:"NumOfLastMonth"`
+	RiskLevel      string `json:"RiskLevel" xml:"RiskLevel"`
+}
+
+func CreateDescribeCaptchaRiskRequest() (request *DescribeCaptchaRiskRequest) {
+	request = &DescribeCaptchaRiskRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("afs", "2018-01-12", "DescribeCaptchaRisk", "", "")
+	return
+}
+
+func CreateDescribeCaptchaRiskResponse() (response *DescribeCaptchaRiskResponse) {
+	response = &DescribeCaptchaRiskResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 95 - 0
services/afs/describe_config_name.go

@@ -0,0 +1,95 @@
+package afs
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+func (client *Client) DescribeConfigName(request *DescribeConfigNameRequest) (response *DescribeConfigNameResponse, err error) {
+	response = CreateDescribeConfigNameResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+func (client *Client) DescribeConfigNameWithChan(request *DescribeConfigNameRequest) (<-chan *DescribeConfigNameResponse, <-chan error) {
+	responseChan := make(chan *DescribeConfigNameResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.DescribeConfigName(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+func (client *Client) DescribeConfigNameWithCallback(request *DescribeConfigNameRequest, callback func(response *DescribeConfigNameResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *DescribeConfigNameResponse
+		var err error
+		defer close(result)
+		response, err = client.DescribeConfigName(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+type DescribeConfigNameRequest struct {
+	*requests.RpcRequest
+	ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"`
+	SourceIp        string           `position:"Query" name:"SourceIp"`
+}
+
+type DescribeConfigNameResponse struct {
+	*responses.BaseResponse
+	RequestId   string `json:"RequestId" xml:"RequestId"`
+	HasConfig   bool   `json:"HasConfig" xml:"HasConfig"`
+	ConfigNames string `json:"ConfigNames" xml:"ConfigNames"`
+	BizCode     string `json:"BizCode" xml:"BizCode"`
+}
+
+func CreateDescribeConfigNameRequest() (request *DescribeConfigNameRequest) {
+	request = &DescribeConfigNameRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("afs", "2018-01-12", "DescribeConfigName", "", "")
+	return
+}
+
+func CreateDescribeConfigNameResponse() (response *DescribeConfigNameResponse) {
+	response = &DescribeConfigNameResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 104 - 0
services/afs/describe_early_warning.go

@@ -0,0 +1,104 @@
+package afs
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+func (client *Client) DescribeEarlyWarning(request *DescribeEarlyWarningRequest) (response *DescribeEarlyWarningResponse, err error) {
+	response = CreateDescribeEarlyWarningResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+func (client *Client) DescribeEarlyWarningWithChan(request *DescribeEarlyWarningRequest) (<-chan *DescribeEarlyWarningResponse, <-chan error) {
+	responseChan := make(chan *DescribeEarlyWarningResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.DescribeEarlyWarning(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+func (client *Client) DescribeEarlyWarningWithCallback(request *DescribeEarlyWarningRequest, callback func(response *DescribeEarlyWarningResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *DescribeEarlyWarningResponse
+		var err error
+		defer close(result)
+		response, err = client.DescribeEarlyWarning(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+type DescribeEarlyWarningRequest struct {
+	*requests.RpcRequest
+	ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"`
+	SourceIp        string           `position:"Query" name:"SourceIp"`
+}
+
+type DescribeEarlyWarningResponse struct {
+	*responses.BaseResponse
+	RequestId     string `json:"RequestId" xml:"RequestId"`
+	HasWarning    bool   `json:"HasWarning" xml:"HasWarning"`
+	BizCode       string `json:"BizCode" xml:"BizCode"`
+	EarlyWarnings []struct {
+		WarnOpen  bool   `json:"WarnOpen" xml:"WarnOpen"`
+		Title     string `json:"Title" xml:"Title"`
+		Content   string `json:"Content" xml:"Content"`
+		Frequency string `json:"Frequency" xml:"Frequency"`
+		TimeOpen  bool   `json:"TimeOpen" xml:"TimeOpen"`
+		TimeBegin string `json:"TimeBegin" xml:"TimeBegin"`
+		TimeEnd   string `json:"TimeEnd" xml:"TimeEnd"`
+		Channel   string `json:"Channel" xml:"Channel"`
+	} `json:"EarlyWarnings" xml:"EarlyWarnings"`
+}
+
+func CreateDescribeEarlyWarningRequest() (request *DescribeEarlyWarningRequest) {
+	request = &DescribeEarlyWarningRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("afs", "2018-01-12", "DescribeEarlyWarning", "", "")
+	return
+}
+
+func CreateDescribeEarlyWarningResponse() (response *DescribeEarlyWarningResponse) {
+	response = &DescribeEarlyWarningResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 104 - 0
services/afs/describe_person_machine_list.go

@@ -0,0 +1,104 @@
+package afs
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+func (client *Client) DescribePersonMachineList(request *DescribePersonMachineListRequest) (response *DescribePersonMachineListResponse, err error) {
+	response = CreateDescribePersonMachineListResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+func (client *Client) DescribePersonMachineListWithChan(request *DescribePersonMachineListRequest) (<-chan *DescribePersonMachineListResponse, <-chan error) {
+	responseChan := make(chan *DescribePersonMachineListResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.DescribePersonMachineList(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+func (client *Client) DescribePersonMachineListWithCallback(request *DescribePersonMachineListRequest, callback func(response *DescribePersonMachineListResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *DescribePersonMachineListResponse
+		var err error
+		defer close(result)
+		response, err = client.DescribePersonMachineList(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+type DescribePersonMachineListRequest struct {
+	*requests.RpcRequest
+	ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"`
+	SourceIp        string           `position:"Query" name:"SourceIp"`
+}
+
+type DescribePersonMachineListResponse struct {
+	*responses.BaseResponse
+	RequestId        string `json:"RequestId" xml:"RequestId"`
+	BizCode          string `json:"BizCode" xml:"BizCode"`
+	PersonMachineRes struct {
+		HasConfiguration string `json:"HasConfiguration" xml:"HasConfiguration"`
+		PersonMachines   []struct {
+			ConfigurationName   string `json:"ConfigurationName" xml:"ConfigurationName"`
+			Appkey              string `json:"Appkey" xml:"Appkey"`
+			ConfigurationMethod string `json:"ConfigurationMethod" xml:"ConfigurationMethod"`
+			ApplyType           string `json:"ApplyType" xml:"ApplyType"`
+			Scene               string `json:"Scene" xml:"Scene"`
+			LastUpdate          string `json:"LastUpdate" xml:"LastUpdate"`
+		} `json:"PersonMachines" xml:"PersonMachines"`
+	} `json:"PersonMachineRes" xml:"PersonMachineRes"`
+}
+
+func CreateDescribePersonMachineListRequest() (request *DescribePersonMachineListRequest) {
+	request = &DescribePersonMachineListRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("afs", "2018-01-12", "DescribePersonMachineList", "", "")
+	return
+}
+
+func CreateDescribePersonMachineListResponse() (response *DescribePersonMachineListResponse) {
+	response = &DescribePersonMachineListResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 100 - 0
services/afs/set_early_warning.go

@@ -0,0 +1,100 @@
+package afs
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+func (client *Client) SetEarlyWarning(request *SetEarlyWarningRequest) (response *SetEarlyWarningResponse, err error) {
+	response = CreateSetEarlyWarningResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+func (client *Client) SetEarlyWarningWithChan(request *SetEarlyWarningRequest) (<-chan *SetEarlyWarningResponse, <-chan error) {
+	responseChan := make(chan *SetEarlyWarningResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.SetEarlyWarning(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+func (client *Client) SetEarlyWarningWithCallback(request *SetEarlyWarningRequest, callback func(response *SetEarlyWarningResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *SetEarlyWarningResponse
+		var err error
+		defer close(result)
+		response, err = client.SetEarlyWarning(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+type SetEarlyWarningRequest struct {
+	*requests.RpcRequest
+	TimeEnd         string           `position:"Query" name:"TimeEnd"`
+	ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"`
+	WarnOpen        requests.Boolean `position:"Query" name:"WarnOpen"`
+	SourceIp        string           `position:"Query" name:"SourceIp"`
+	Channel         string           `position:"Query" name:"Channel"`
+	Title           string           `position:"Query" name:"Title"`
+	TimeOpen        requests.Boolean `position:"Query" name:"TimeOpen"`
+	TimeBegin       string           `position:"Query" name:"TimeBegin"`
+	Frequency       string           `position:"Query" name:"Frequency"`
+}
+
+type SetEarlyWarningResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+	BizCode   string `json:"BizCode" xml:"BizCode"`
+}
+
+func CreateSetEarlyWarningRequest() (request *SetEarlyWarningRequest) {
+	request = &SetEarlyWarningRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("afs", "2018-01-12", "SetEarlyWarning", "", "")
+	return
+}
+
+func CreateSetEarlyWarningResponse() (response *SetEarlyWarningResponse) {
+	response = &SetEarlyWarningResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}