本文整理匯總了Golang中github.com/bluet-deps/aws-sdk-go/service/apigateway.New函數的典型用法代碼示例。如果您正苦於以下問題:Golang New函數的具體用法?Golang New怎麽用?Golang New使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了New函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: 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)
}
示例2: 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)
}
示例3: 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)
}
示例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_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)
}
示例6: 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)
}
示例7: ExampleAPIGateway_GetRestApi
func ExampleAPIGateway_GetRestApi() {
svc := apigateway.New(session.New())
params := &apigateway.GetRestApiInput{
RestApiId: aws.String("String"), // Required
}
resp, err := svc.GetRestApi(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_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)
}
示例9: ExampleAPIGateway_GetRestApis
func ExampleAPIGateway_GetRestApis() {
svc := apigateway.New(session.New())
params := &apigateway.GetRestApisInput{
Limit: aws.Int64(1),
Position: aws.String("String"),
}
resp, err := svc.GetRestApis(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_DeleteBasePathMapping
func ExampleAPIGateway_DeleteBasePathMapping() {
svc := apigateway.New(session.New())
params := &apigateway.DeleteBasePathMappingInput{
BasePath: aws.String("String"), // Required
DomainName: aws.String("String"), // Required
}
resp, err := svc.DeleteBasePathMapping(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_DeleteIntegration
func ExampleAPIGateway_DeleteIntegration() {
svc := apigateway.New(session.New())
params := &apigateway.DeleteIntegrationInput{
HttpMethod: aws.String("String"), // Required
ResourceId: aws.String("String"), // Required
RestApiId: aws.String("String"), // Required
}
resp, err := svc.DeleteIntegration(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_CreateDomainName
func ExampleAPIGateway_CreateDomainName() {
svc := apigateway.New(session.New())
params := &apigateway.CreateDomainNameInput{
CertificateBody: aws.String("String"), // Required
CertificateChain: aws.String("String"), // Required
CertificateName: aws.String("String"), // Required
CertificatePrivateKey: aws.String("String"), // Required
DomainName: aws.String("String"), // Required
}
resp, err := svc.CreateDomainName(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_CreateModel
func ExampleAPIGateway_CreateModel() {
svc := apigateway.New(session.New())
params := &apigateway.CreateModelInput{
ContentType: aws.String("String"), // Required
Name: aws.String("String"), // Required
RestApiId: aws.String("String"), // Required
Description: aws.String("String"),
Schema: aws.String("String"),
}
resp, err := svc.CreateModel(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_PutIntegration
func ExampleAPIGateway_PutIntegration() {
svc := apigateway.New(session.New())
params := &apigateway.PutIntegrationInput{
HttpMethod: aws.String("String"), // Required
ResourceId: aws.String("String"), // Required
RestApiId: aws.String("String"), // Required
Type: aws.String("IntegrationType"), // Required
CacheKeyParameters: []*string{
aws.String("String"), // Required
// More values...
},
CacheNamespace: aws.String("String"),
Credentials: aws.String("String"),
IntegrationHttpMethod: aws.String("String"),
RequestParameters: map[string]*string{
"Key": aws.String("String"), // Required
// More values...
},
RequestTemplates: map[string]*string{
"Key": aws.String("String"), // Required
// More values...
},
Uri: aws.String("String"),
}
resp, err := svc.PutIntegration(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_GetSdk
func ExampleAPIGateway_GetSdk() {
svc := apigateway.New(session.New())
params := &apigateway.GetSdkInput{
RestApiId: aws.String("String"), // Required
SdkType: aws.String("String"), // Required
StageName: aws.String("String"), // Required
Parameters: map[string]*string{
"Key": aws.String("String"), // Required
// More values...
},
}
resp, err := svc.GetSdk(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)
}