mirror of
https://github.com/rclone/rclone.git
synced 2025-01-05 22:09:34 +01:00
359 lines
8.4 KiB
Go
359 lines
8.4 KiB
Go
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
|
|
|
package codestar_test
|
|
|
|
import (
|
|
"bytes"
|
|
"fmt"
|
|
"time"
|
|
|
|
"github.com/aws/aws-sdk-go/aws"
|
|
"github.com/aws/aws-sdk-go/aws/session"
|
|
"github.com/aws/aws-sdk-go/service/codestar"
|
|
)
|
|
|
|
var _ time.Duration
|
|
var _ bytes.Buffer
|
|
|
|
func ExampleCodeStar_AssociateTeamMember() {
|
|
sess := session.Must(session.NewSession())
|
|
|
|
svc := codestar.New(sess)
|
|
|
|
params := &codestar.AssociateTeamMemberInput{
|
|
ProjectId: aws.String("ProjectId"), // Required
|
|
ProjectRole: aws.String("Role"), // Required
|
|
UserArn: aws.String("UserArn"), // Required
|
|
ClientRequestToken: aws.String("ClientRequestToken"),
|
|
RemoteAccessAllowed: aws.Bool(true),
|
|
}
|
|
resp, err := svc.AssociateTeamMember(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)
|
|
}
|
|
|
|
func ExampleCodeStar_CreateProject() {
|
|
sess := session.Must(session.NewSession())
|
|
|
|
svc := codestar.New(sess)
|
|
|
|
params := &codestar.CreateProjectInput{
|
|
Id: aws.String("ProjectId"), // Required
|
|
Name: aws.String("ProjectName"), // Required
|
|
ClientRequestToken: aws.String("ClientRequestToken"),
|
|
Description: aws.String("ProjectDescription"),
|
|
}
|
|
resp, err := svc.CreateProject(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)
|
|
}
|
|
|
|
func ExampleCodeStar_CreateUserProfile() {
|
|
sess := session.Must(session.NewSession())
|
|
|
|
svc := codestar.New(sess)
|
|
|
|
params := &codestar.CreateUserProfileInput{
|
|
DisplayName: aws.String("UserProfileDisplayName"), // Required
|
|
EmailAddress: aws.String("Email"), // Required
|
|
UserArn: aws.String("UserArn"), // Required
|
|
SshPublicKey: aws.String("SshPublicKey"),
|
|
}
|
|
resp, err := svc.CreateUserProfile(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)
|
|
}
|
|
|
|
func ExampleCodeStar_DeleteProject() {
|
|
sess := session.Must(session.NewSession())
|
|
|
|
svc := codestar.New(sess)
|
|
|
|
params := &codestar.DeleteProjectInput{
|
|
Id: aws.String("ProjectId"), // Required
|
|
ClientRequestToken: aws.String("ClientRequestToken"),
|
|
DeleteStack: aws.Bool(true),
|
|
}
|
|
resp, err := svc.DeleteProject(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)
|
|
}
|
|
|
|
func ExampleCodeStar_DeleteUserProfile() {
|
|
sess := session.Must(session.NewSession())
|
|
|
|
svc := codestar.New(sess)
|
|
|
|
params := &codestar.DeleteUserProfileInput{
|
|
UserArn: aws.String("UserArn"), // Required
|
|
}
|
|
resp, err := svc.DeleteUserProfile(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)
|
|
}
|
|
|
|
func ExampleCodeStar_DescribeProject() {
|
|
sess := session.Must(session.NewSession())
|
|
|
|
svc := codestar.New(sess)
|
|
|
|
params := &codestar.DescribeProjectInput{
|
|
Id: aws.String("ProjectId"), // Required
|
|
}
|
|
resp, err := svc.DescribeProject(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)
|
|
}
|
|
|
|
func ExampleCodeStar_DescribeUserProfile() {
|
|
sess := session.Must(session.NewSession())
|
|
|
|
svc := codestar.New(sess)
|
|
|
|
params := &codestar.DescribeUserProfileInput{
|
|
UserArn: aws.String("UserArn"), // Required
|
|
}
|
|
resp, err := svc.DescribeUserProfile(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)
|
|
}
|
|
|
|
func ExampleCodeStar_DisassociateTeamMember() {
|
|
sess := session.Must(session.NewSession())
|
|
|
|
svc := codestar.New(sess)
|
|
|
|
params := &codestar.DisassociateTeamMemberInput{
|
|
ProjectId: aws.String("ProjectId"), // Required
|
|
UserArn: aws.String("UserArn"), // Required
|
|
}
|
|
resp, err := svc.DisassociateTeamMember(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)
|
|
}
|
|
|
|
func ExampleCodeStar_ListProjects() {
|
|
sess := session.Must(session.NewSession())
|
|
|
|
svc := codestar.New(sess)
|
|
|
|
params := &codestar.ListProjectsInput{
|
|
MaxResults: aws.Int64(1),
|
|
NextToken: aws.String("PaginationToken"),
|
|
}
|
|
resp, err := svc.ListProjects(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)
|
|
}
|
|
|
|
func ExampleCodeStar_ListResources() {
|
|
sess := session.Must(session.NewSession())
|
|
|
|
svc := codestar.New(sess)
|
|
|
|
params := &codestar.ListResourcesInput{
|
|
ProjectId: aws.String("ProjectId"), // Required
|
|
MaxResults: aws.Int64(1),
|
|
NextToken: aws.String("PaginationToken"),
|
|
}
|
|
resp, err := svc.ListResources(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)
|
|
}
|
|
|
|
func ExampleCodeStar_ListTeamMembers() {
|
|
sess := session.Must(session.NewSession())
|
|
|
|
svc := codestar.New(sess)
|
|
|
|
params := &codestar.ListTeamMembersInput{
|
|
ProjectId: aws.String("ProjectId"), // Required
|
|
MaxResults: aws.Int64(1),
|
|
NextToken: aws.String("PaginationToken"),
|
|
}
|
|
resp, err := svc.ListTeamMembers(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)
|
|
}
|
|
|
|
func ExampleCodeStar_ListUserProfiles() {
|
|
sess := session.Must(session.NewSession())
|
|
|
|
svc := codestar.New(sess)
|
|
|
|
params := &codestar.ListUserProfilesInput{
|
|
MaxResults: aws.Int64(1),
|
|
NextToken: aws.String("PaginationToken"),
|
|
}
|
|
resp, err := svc.ListUserProfiles(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)
|
|
}
|
|
|
|
func ExampleCodeStar_UpdateProject() {
|
|
sess := session.Must(session.NewSession())
|
|
|
|
svc := codestar.New(sess)
|
|
|
|
params := &codestar.UpdateProjectInput{
|
|
Id: aws.String("ProjectId"), // Required
|
|
Description: aws.String("ProjectDescription"),
|
|
Name: aws.String("ProjectName"),
|
|
}
|
|
resp, err := svc.UpdateProject(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)
|
|
}
|
|
|
|
func ExampleCodeStar_UpdateTeamMember() {
|
|
sess := session.Must(session.NewSession())
|
|
|
|
svc := codestar.New(sess)
|
|
|
|
params := &codestar.UpdateTeamMemberInput{
|
|
ProjectId: aws.String("ProjectId"), // Required
|
|
UserArn: aws.String("UserArn"), // Required
|
|
ProjectRole: aws.String("Role"),
|
|
RemoteAccessAllowed: aws.Bool(true),
|
|
}
|
|
resp, err := svc.UpdateTeamMember(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)
|
|
}
|
|
|
|
func ExampleCodeStar_UpdateUserProfile() {
|
|
sess := session.Must(session.NewSession())
|
|
|
|
svc := codestar.New(sess)
|
|
|
|
params := &codestar.UpdateUserProfileInput{
|
|
UserArn: aws.String("UserArn"), // Required
|
|
DisplayName: aws.String("UserProfileDisplayName"),
|
|
EmailAddress: aws.String("Email"),
|
|
SshPublicKey: aws.String("SshPublicKey"),
|
|
}
|
|
resp, err := svc.UpdateUserProfile(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)
|
|
}
|