本文整理汇总了Golang中github.com/aws/aws-sdk-go/service/cognitosync.New函数的典型用法代码示例。如果您正苦于以下问题:Golang New函数的具体用法?Golang New怎么用?Golang New使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了New函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: ExampleCognitoSync_ListIdentityPoolUsage
func ExampleCognitoSync_ListIdentityPoolUsage() {
svc := cognitosync.New(nil)
params := &cognitosync.ListIdentityPoolUsageInput{
MaxResults: aws.Long(1),
NextToken: aws.String("String"),
}
resp, err := svc.ListIdentityPoolUsage(params)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS Error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, the SDK should always return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
开发者ID:jasonmoo,项目名称:aws-sdk-go,代码行数:27,代码来源:examples_test.go
示例2: ExampleCognitoSync_SetCognitoEvents
func ExampleCognitoSync_SetCognitoEvents() {
svc := cognitosync.New(nil)
params := &cognitosync.SetCognitoEventsInput{
Events: map[string]*string{ // Required
"Key": aws.String("LambdaFunctionArn"), // Required
// More values...
},
IdentityPoolID: aws.String("IdentityPoolId"), // Required
}
resp, err := svc.SetCognitoEvents(params)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS Error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, the SDK should always return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
开发者ID:jasonmoo,项目名称:aws-sdk-go,代码行数:30,代码来源:examples_test.go
示例3: ExampleCognitoSync_SetIdentityPoolConfiguration
func ExampleCognitoSync_SetIdentityPoolConfiguration() {
svc := cognitosync.New(nil)
params := &cognitosync.SetIdentityPoolConfigurationInput{
IdentityPoolId: aws.String("IdentityPoolId"), // Required
CognitoStreams: &cognitosync.CognitoStreams{
RoleArn: aws.String("AssumeRoleArn"),
StreamName: aws.String("StreamName"),
StreamingStatus: aws.String("StreamingStatus"),
},
PushSync: &cognitosync.PushSync{
ApplicationArns: []*string{
aws.String("ApplicationArn"), // Required
// More values...
},
RoleArn: aws.String("AssumeRoleArn"),
},
}
resp, err := svc.SetIdentityPoolConfiguration(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)
}
开发者ID:jloper3,项目名称:amazon-ecs-cli,代码行数:30,代码来源:examples_test.go
示例4: ExampleCognitoSync_ListIdentityPoolUsage
func ExampleCognitoSync_ListIdentityPoolUsage() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
svc := cognitosync.New(sess)
params := &cognitosync.ListIdentityPoolUsageInput{
MaxResults: aws.Int64(1),
NextToken: aws.String("String"),
}
resp, err := svc.ListIdentityPoolUsage(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)
}
开发者ID:acquia,项目名称:fifo2kinesis,代码行数:25,代码来源:examples_test.go
示例5: ExampleCognitoSync_ListRecords
func ExampleCognitoSync_ListRecords() {
svc := cognitosync.New(nil)
params := &cognitosync.ListRecordsInput{
DatasetName: aws.String("DatasetName"), // Required
IdentityId: aws.String("IdentityId"), // Required
IdentityPoolId: aws.String("IdentityPoolId"), // Required
LastSyncCount: aws.Int64(1),
MaxResults: aws.Int64(1),
NextToken: aws.String("String"),
SyncSessionToken: aws.String("SyncSessionToken"),
}
resp, err := svc.ListRecords(params)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, the SDK should always return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.Prettify(resp))
}
开发者ID:strife25,项目名称:aws-sdk-go,代码行数:32,代码来源:examples_test.go
示例6: ExampleCognitoSync_RegisterDevice
func ExampleCognitoSync_RegisterDevice() {
svc := cognitosync.New(nil)
params := &cognitosync.RegisterDeviceInput{
IdentityId: aws.String("IdentityId"), // Required
IdentityPoolId: aws.String("IdentityPoolId"), // Required
Platform: aws.String("Platform"), // Required
Token: aws.String("PushToken"), // Required
}
resp, err := svc.RegisterDevice(params)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, the SDK should always return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.Prettify(resp))
}
开发者ID:strife25,项目名称:aws-sdk-go,代码行数:29,代码来源:examples_test.go
示例7: ExampleCognitoSync_DescribeDataset
func ExampleCognitoSync_DescribeDataset() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
svc := cognitosync.New(sess)
params := &cognitosync.DescribeDatasetInput{
DatasetName: aws.String("DatasetName"), // Required
IdentityId: aws.String("IdentityId"), // Required
IdentityPoolId: aws.String("IdentityPoolId"), // Required
}
resp, err := svc.DescribeDataset(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)
}
开发者ID:acquia,项目名称:fifo2kinesis,代码行数:26,代码来源:examples_test.go
示例8: ExampleCognitoSync_UpdateRecords
func ExampleCognitoSync_UpdateRecords() {
svc := cognitosync.New(nil)
params := &cognitosync.UpdateRecordsInput{
DatasetName: aws.String("DatasetName"), // Required
IdentityId: aws.String("IdentityId"), // Required
IdentityPoolId: aws.String("IdentityPoolId"), // Required
SyncSessionToken: aws.String("SyncSessionToken"), // Required
ClientContext: aws.String("ClientContext"),
DeviceId: aws.String("DeviceId"),
RecordPatches: []*cognitosync.RecordPatch{
{ // Required
Key: aws.String("RecordKey"), // Required
Op: aws.String("Operation"), // Required
SyncCount: aws.Int64(1), // Required
DeviceLastModifiedDate: aws.Time(time.Now()),
Value: aws.String("RecordValue"),
},
// More values...
},
}
resp, err := svc.UpdateRecords(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)
}
开发者ID:jloper3,项目名称:amazon-ecs-cli,代码行数:33,代码来源:examples_test.go
示例9: ExampleCognitoSync_SetCognitoEvents
func ExampleCognitoSync_SetCognitoEvents() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
svc := cognitosync.New(sess)
params := &cognitosync.SetCognitoEventsInput{
Events: map[string]*string{ // Required
"Key": aws.String("LambdaFunctionArn"), // Required
// More values...
},
IdentityPoolId: aws.String("IdentityPoolId"), // Required
}
resp, err := svc.SetCognitoEvents(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)
}
开发者ID:acquia,项目名称:fifo2kinesis,代码行数:28,代码来源:examples_test.go
示例10: ExampleCognitoSync_RegisterDevice
func ExampleCognitoSync_RegisterDevice() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
svc := cognitosync.New(sess)
params := &cognitosync.RegisterDeviceInput{
IdentityId: aws.String("IdentityId"), // Required
IdentityPoolId: aws.String("IdentityPoolId"), // Required
Platform: aws.String("Platform"), // Required
Token: aws.String("PushToken"), // Required
}
resp, err := svc.RegisterDevice(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)
}
开发者ID:acquia,项目名称:fifo2kinesis,代码行数:27,代码来源:examples_test.go
示例11: ExampleCognitoSync_ListRecords
func ExampleCognitoSync_ListRecords() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
svc := cognitosync.New(sess)
params := &cognitosync.ListRecordsInput{
DatasetName: aws.String("DatasetName"), // Required
IdentityId: aws.String("IdentityId"), // Required
IdentityPoolId: aws.String("IdentityPoolId"), // Required
LastSyncCount: aws.Int64(1),
MaxResults: aws.Int64(1),
NextToken: aws.String("String"),
SyncSessionToken: aws.String("SyncSessionToken"),
}
resp, err := svc.ListRecords(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)
}
开发者ID:acquia,项目名称:fifo2kinesis,代码行数:30,代码来源:examples_test.go
示例12: ExampleCognitoSync_DescribeDataset
func ExampleCognitoSync_DescribeDataset() {
svc := cognitosync.New(nil)
params := &cognitosync.DescribeDatasetInput{
DatasetName: aws.String("DatasetName"), // Required
IdentityID: aws.String("IdentityId"), // Required
IdentityPoolID: aws.String("IdentityPoolId"), // Required
}
resp, err := svc.DescribeDataset(params)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS Error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, the SDK should always return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
开发者ID:jasonmoo,项目名称:aws-sdk-go,代码行数:28,代码来源:examples_test.go
示例13: ExampleCognitoSync_DescribeIdentityPoolUsage
func ExampleCognitoSync_DescribeIdentityPoolUsage() {
svc := cognitosync.New(nil)
params := &cognitosync.DescribeIdentityPoolUsageInput{
IdentityPoolId: aws.String("IdentityPoolId"), // Required
}
resp, err := svc.DescribeIdentityPoolUsage(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)
}
开发者ID:jloper3,项目名称:amazon-ecs-cli,代码行数:18,代码来源:examples_test.go
示例14: ExampleCognitoSync_GetIdentityPoolConfiguration
func ExampleCognitoSync_GetIdentityPoolConfiguration() {
svc := cognitosync.New(session.New())
params := &cognitosync.GetIdentityPoolConfigurationInput{
IdentityPoolId: aws.String("IdentityPoolId"), // Required
}
resp, err := svc.GetIdentityPoolConfiguration(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)
}
开发者ID:ColourboxDevelopment,项目名称:aws-sdk-go,代码行数:18,代码来源:examples_test.go
示例15: ExampleCognitoSync_UpdateRecords
func ExampleCognitoSync_UpdateRecords() {
svc := cognitosync.New(nil)
params := &cognitosync.UpdateRecordsInput{
DatasetName: aws.String("DatasetName"), // Required
IdentityID: aws.String("IdentityId"), // Required
IdentityPoolID: aws.String("IdentityPoolId"), // Required
SyncSessionToken: aws.String("SyncSessionToken"), // Required
ClientContext: aws.String("ClientContext"),
DeviceID: aws.String("DeviceId"),
RecordPatches: []*cognitosync.RecordPatch{
{ // Required
Key: aws.String("RecordKey"), // Required
Op: aws.String("Operation"), // Required
SyncCount: aws.Long(1), // Required
DeviceLastModifiedDate: aws.Time(time.Now()),
Value: aws.String("RecordValue"),
},
// More values...
},
}
resp, err := svc.UpdateRecords(params)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS Error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, the SDK should always return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
开发者ID:jasonmoo,项目名称:aws-sdk-go,代码行数:41,代码来源:examples_test.go
示例16: ExampleCognitoSync_UnsubscribeFromDataset
func ExampleCognitoSync_UnsubscribeFromDataset() {
svc := cognitosync.New(nil)
params := &cognitosync.UnsubscribeFromDatasetInput{
DatasetName: aws.String("DatasetName"), // Required
DeviceId: aws.String("DeviceId"), // Required
IdentityId: aws.String("IdentityId"), // Required
IdentityPoolId: aws.String("IdentityPoolId"), // Required
}
resp, err := svc.UnsubscribeFromDataset(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)
}
开发者ID:jloper3,项目名称:amazon-ecs-cli,代码行数:21,代码来源:examples_test.go
示例17: ExampleCognitoSync_ListDatasets
func ExampleCognitoSync_ListDatasets() {
svc := cognitosync.New(nil)
params := &cognitosync.ListDatasetsInput{
IdentityId: aws.String("IdentityId"), // Required
IdentityPoolId: aws.String("IdentityPoolId"), // Required
MaxResults: aws.Int64(1),
NextToken: aws.String("String"),
}
resp, err := svc.ListDatasets(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)
}
开发者ID:jloper3,项目名称:amazon-ecs-cli,代码行数:21,代码来源:examples_test.go
示例18: ExampleCognitoSync_SetIdentityPoolConfiguration
func ExampleCognitoSync_SetIdentityPoolConfiguration() {
svc := cognitosync.New(nil)
params := &cognitosync.SetIdentityPoolConfigurationInput{
IdentityPoolID: aws.String("IdentityPoolId"), // Required
CognitoStreams: &cognitosync.CognitoStreams{
RoleARN: aws.String("AssumeRoleArn"),
StreamName: aws.String("StreamName"),
StreamingStatus: aws.String("StreamingStatus"),
},
PushSync: &cognitosync.PushSync{
ApplicationARNs: []*string{
aws.String("ApplicationArn"), // Required
// More values...
},
RoleARN: aws.String("AssumeRoleArn"),
},
}
resp, err := svc.SetIdentityPoolConfiguration(params)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS Error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, the SDK should always return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
开发者ID:jasonmoo,项目名称:aws-sdk-go,代码行数:38,代码来源:examples_test.go
示例19: init
func init() {
gucumber.Before("@cognitosync", func() {
gucumber.World["client"] = cognitosync.New(smoke.Session)
})
}
开发者ID:ColourboxDevelopment,项目名称:aws-sdk-go,代码行数:5,代码来源:client.go
示例20: init
func init() {
Before("@cognitosync", func() {
World["client"] = cognitosync.New(nil)
})
}
开发者ID:jloper3,项目名称:amazon-ecs-cli,代码行数:5,代码来源:client.go
注:本文中的github.com/aws/aws-sdk-go/service/cognitosync.New函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论