本文整理汇总了Golang中github.com/aws/aws-sdk-go/service/apigateway.New函数的典型用法代码示例。如果您正苦于以下问题:Golang New函数的具体用法?Golang New怎么用?Golang New使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了New函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: ExampleAPIGateway_CreateDeployment
func ExampleAPIGateway_CreateDeployment() {
svc := apigateway.New(session.New())
params := &apigateway.CreateDeploymentInput{
RestApiId: aws.String("String"), // Required
StageName: aws.String("String"), // Required
CacheClusterEnabled: aws.Bool(true),
CacheClusterSize: aws.String("CacheClusterSize"),
Description: aws.String("String"),
StageDescription: aws.String("String"),
Variables: map[string]*string{
"Key": aws.String("String"), // Required
// More values...
},
}
resp, err := svc.CreateDeployment(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例2: ExampleAPIGateway_UpdateStage
func ExampleAPIGateway_UpdateStage() {
svc := apigateway.New(session.New())
params := &apigateway.UpdateStageInput{
RestApiId: aws.String("String"), // Required
StageName: aws.String("String"), // Required
PatchOperations: []*apigateway.PatchOperation{
{ // Required
From: aws.String("String"),
Op: aws.String("op"),
Path: aws.String("String"),
Value: aws.String("String"),
},
// More values...
},
}
resp, err := svc.UpdateStage(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例3: ExampleAPIGateway_PutMethodResponse
func ExampleAPIGateway_PutMethodResponse() {
svc := apigateway.New(session.New())
params := &apigateway.PutMethodResponseInput{
HttpMethod: aws.String("String"), // Required
ResourceId: aws.String("String"), // Required
RestApiId: aws.String("String"), // Required
StatusCode: aws.String("StatusCode"), // Required
ResponseModels: map[string]*string{
"Key": aws.String("String"), // Required
// More values...
},
ResponseParameters: map[string]*bool{
"Key": aws.Bool(true), // Required
// More values...
},
}
resp, err := svc.PutMethodResponse(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例4: ExampleAPIGateway_TestInvokeMethod
func ExampleAPIGateway_TestInvokeMethod() {
svc := apigateway.New(session.New())
params := &apigateway.TestInvokeMethodInput{
HttpMethod: aws.String("String"), // Required
ResourceId: aws.String("String"), // Required
RestApiId: aws.String("String"), // Required
Body: aws.String("String"),
ClientCertificateId: aws.String("String"),
Headers: map[string]*string{
"Key": aws.String("String"), // Required
// More values...
},
PathWithQueryString: aws.String("String"),
StageVariables: map[string]*string{
"Key": aws.String("String"), // Required
// More values...
},
}
resp, err := svc.TestInvokeMethod(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例5: ExampleAPIGateway_CreateApiKey
func ExampleAPIGateway_CreateApiKey() {
svc := apigateway.New(session.New())
params := &apigateway.CreateApiKeyInput{
Description: aws.String("String"),
Enabled: aws.Bool(true),
Name: aws.String("String"),
StageKeys: []*apigateway.StageKey{
{ // Required
RestApiId: aws.String("String"),
StageName: aws.String("String"),
},
// More values...
},
}
resp, err := svc.CreateApiKey(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例6: ExampleAPIGateway_CreateAuthorizer
func ExampleAPIGateway_CreateAuthorizer() {
svc := apigateway.New(session.New())
params := &apigateway.CreateAuthorizerInput{
IdentitySource: aws.String("String"), // Required
Name: aws.String("String"), // Required
RestApiId: aws.String("String"), // Required
Type: aws.String("AuthorizerType"), // Required
AuthType: aws.String("String"),
AuthorizerCredentials: aws.String("String"),
AuthorizerResultTtlInSeconds: aws.Int64(1),
AuthorizerUri: aws.String("String"),
IdentityValidationExpression: aws.String("String"),
ProviderARNs: []*string{
aws.String("ProviderARN"), // Required
// More values...
},
}
resp, err := svc.CreateAuthorizer(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例7: ExampleAPIGateway_GetExport
func ExampleAPIGateway_GetExport() {
svc := apigateway.New(session.New())
params := &apigateway.GetExportInput{
ExportType: aws.String("String"), // Required
RestApiId: aws.String("String"), // Required
StageName: aws.String("String"), // Required
Accepts: aws.String("String"),
Parameters: map[string]*string{
"Key": aws.String("String"), // Required
// More values...
},
}
resp, err := svc.GetExport(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例8: ExampleAPIGateway_PutRestApi
func ExampleAPIGateway_PutRestApi() {
svc := apigateway.New(session.New())
params := &apigateway.PutRestApiInput{
Body: []byte("PAYLOAD"), // Required
RestApiId: aws.String("String"), // Required
FailOnWarnings: aws.Bool(true),
Mode: aws.String("PutMode"),
Parameters: map[string]*string{
"Key": aws.String("String"), // Required
// More values...
},
}
resp, err := svc.PutRestApi(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例9: ExampleAPIGateway_GetAccount
func ExampleAPIGateway_GetAccount() {
svc := apigateway.New(session.New())
var params *apigateway.GetAccountInput
resp, err := svc.GetAccount(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例10: ExampleAPIGateway_GetDomainName
func ExampleAPIGateway_GetDomainName() {
svc := apigateway.New(session.New())
params := &apigateway.GetDomainNameInput{
DomainName: aws.String("String"), // Required
}
resp, err := svc.GetDomainName(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例11: ExampleAPIGateway_GenerateClientCertificate
func ExampleAPIGateway_GenerateClientCertificate() {
svc := apigateway.New(session.New())
params := &apigateway.GenerateClientCertificateInput{
Description: aws.String("String"),
}
resp, err := svc.GenerateClientCertificate(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例12: ExampleAPIGateway_DeleteRestApi
func ExampleAPIGateway_DeleteRestApi() {
svc := apigateway.New(nil)
params := &apigateway.DeleteRestApiInput{
RestApiId: aws.String("String"), // Required
}
resp, err := svc.DeleteRestApi(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例13: ExampleAPIGateway_FlushStageAuthorizersCache
func ExampleAPIGateway_FlushStageAuthorizersCache() {
svc := apigateway.New(session.New())
params := &apigateway.FlushStageAuthorizersCacheInput{
RestApiId: aws.String("String"), // Required
StageName: aws.String("String"), // Required
}
resp, err := svc.FlushStageAuthorizersCache(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例14: ExampleAPIGateway_GetApiKeys
func ExampleAPIGateway_GetApiKeys() {
svc := apigateway.New(session.New())
params := &apigateway.GetApiKeysInput{
Limit: aws.Int64(1),
Position: aws.String("String"),
}
resp, err := svc.GetApiKeys(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例15: ExampleAPIGateway_CreateResource
func ExampleAPIGateway_CreateResource() {
svc := apigateway.New(session.New())
params := &apigateway.CreateResourceInput{
ParentId: aws.String("String"), // Required
PathPart: aws.String("String"), // Required
RestApiId: aws.String("String"), // Required
}
resp, err := svc.CreateResource(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}