當前位置: 首頁>>代碼示例>>Golang>>正文


Golang codepipeline.New函數代碼示例

本文整理匯總了Golang中github.com/aws/aws-sdk-go/service/codepipeline.New函數的典型用法代碼示例。如果您正苦於以下問題:Golang New函數的具體用法?Golang New怎麽用?Golang New使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了New函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: ExampleCodePipeline_PollForThirdPartyJobs

func ExampleCodePipeline_PollForThirdPartyJobs() {
	svc := codepipeline.New(nil)

	params := &codepipeline.PollForThirdPartyJobsInput{
		ActionTypeID: &codepipeline.ActionTypeID{ // Required
			Category: aws.String("ActionCategory"), // Required
			Owner:    aws.String("ActionOwner"),    // Required
			Provider: aws.String("ActionProvider"), // Required
			Version:  aws.String("Version"),        // Required
		},
		MaxBatchSize: aws.Int64(1),
	}
	resp, err := svc.PollForThirdPartyJobs(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:Talos208,項目名稱:aws-sdk-go,代碼行數:32,代碼來源:examples_test.go

示例2: ExampleCodePipeline_PutActionRevision

func ExampleCodePipeline_PutActionRevision() {
	svc := codepipeline.New(nil)

	params := &codepipeline.PutActionRevisionInput{
		ActionName: aws.String("ActionName"), // Required
		ActionRevision: &codepipeline.ActionRevision{ // Required
			Created:          aws.Time(time.Now()),     // Required
			RevisionID:       aws.String("RevisionId"), // Required
			RevisionChangeID: aws.String("RevisionChangeId"),
		},
		PipelineName: aws.String("PipelineName"), // Required
		StageName:    aws.String("StageName"),    // Required
	}
	resp, err := svc.PutActionRevision(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:marciol,項目名稱:aws-sdk-go,代碼行數:33,代碼來源:examples_test.go

示例3: ExampleCodePipeline_PutThirdPartyJobFailureResult

func ExampleCodePipeline_PutThirdPartyJobFailureResult() {
	svc := codepipeline.New(nil)

	params := &codepipeline.PutThirdPartyJobFailureResultInput{
		ClientToken: aws.String("ClientToken"), // Required
		FailureDetails: &codepipeline.FailureDetails{ // Required
			Type:                aws.String("FailureType"), // Required
			ExternalExecutionID: aws.String("ExecutionId"),
			Message:             aws.String("Message"),
		},
		JobID: aws.String("ThirdPartyJobId"), // Required
	}
	resp, err := svc.PutThirdPartyJobFailureResult(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:Talos208,項目名稱:aws-sdk-go,代碼行數:32,代碼來源:examples_test.go

示例4: ExampleCodePipeline_AcknowledgeThirdPartyJob

func ExampleCodePipeline_AcknowledgeThirdPartyJob() {
	svc := codepipeline.New(nil)

	params := &codepipeline.AcknowledgeThirdPartyJobInput{
		ClientToken: aws.String("ClientToken"),     // Required
		JobID:       aws.String("ThirdPartyJobId"), // Required
		Nonce:       aws.String("Nonce"),           // Required
	}
	resp, err := svc.AcknowledgeThirdPartyJob(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:marciol,項目名稱:aws-sdk-go,代碼行數:28,代碼來源:examples_test.go

示例5: ExampleCodePipeline_PutThirdPartyJobSuccessResult

func ExampleCodePipeline_PutThirdPartyJobSuccessResult() {
	svc := codepipeline.New(session.New())

	params := &codepipeline.PutThirdPartyJobSuccessResultInput{
		ClientToken:       aws.String("ClientToken"),     // Required
		JobId:             aws.String("ThirdPartyJobId"), // Required
		ContinuationToken: aws.String("ContinuationToken"),
		CurrentRevision: &codepipeline.CurrentRevision{
			ChangeIdentifier: aws.String("RevisionChangeIdentifier"), // Required
			Revision:         aws.String("Revision"),                 // Required
		},
		ExecutionDetails: &codepipeline.ExecutionDetails{
			ExternalExecutionId: aws.String("ExecutionId"),
			PercentComplete:     aws.Int64(1),
			Summary:             aws.String("ExecutionSummary"),
		},
	}
	resp, err := svc.PutThirdPartyJobSuccessResult(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,代碼行數:29,代碼來源:examples_test.go

示例6: ExampleCodePipeline_DeleteCustomActionType

func ExampleCodePipeline_DeleteCustomActionType() {
	svc := codepipeline.New(nil)

	params := &codepipeline.DeleteCustomActionTypeInput{
		Category: aws.String("ActionCategory"), // Required
		Provider: aws.String("ActionProvider"), // Required
		Version:  aws.String("Version"),        // Required
	}
	resp, err := svc.DeleteCustomActionType(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:marciol,項目名稱:aws-sdk-go,代碼行數:28,代碼來源:examples_test.go

示例7: ExampleCodePipeline_GetPipeline

func ExampleCodePipeline_GetPipeline() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := codepipeline.New(sess)

	params := &codepipeline.GetPipelineInput{
		Name:    aws.String("PipelineName"), // Required
		Version: aws.Int64(1),
	}
	resp, err := svc.GetPipeline(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

示例8: ExampleCodePipeline_DeleteCustomActionType

func ExampleCodePipeline_DeleteCustomActionType() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := codepipeline.New(sess)

	params := &codepipeline.DeleteCustomActionTypeInput{
		Category: aws.String("ActionCategory"), // Required
		Provider: aws.String("ActionProvider"), // Required
		Version:  aws.String("Version"),        // Required
	}
	resp, err := svc.DeleteCustomActionType(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

示例9: ExampleCodePipeline_StartPipelineExecution

func ExampleCodePipeline_StartPipelineExecution() {
	svc := codepipeline.New(nil)

	params := &codepipeline.StartPipelineExecutionInput{
		Name: aws.String("PipelineName"), // Required
	}
	resp, err := svc.StartPipelineExecution(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:Talos208,項目名稱:aws-sdk-go,代碼行數:26,代碼來源:examples_test.go

示例10: ExampleCodePipeline_ListActionTypes

func ExampleCodePipeline_ListActionTypes() {
	svc := codepipeline.New(nil)

	params := &codepipeline.ListActionTypesInput{
		ActionOwnerFilter: aws.String("ActionOwner"),
		NextToken:         aws.String("NextToken"),
	}
	resp, err := svc.ListActionTypes(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:marciol,項目名稱:aws-sdk-go,代碼行數:27,代碼來源:examples_test.go

示例11: ExampleCodePipeline_RetryStageExecution

func ExampleCodePipeline_RetryStageExecution() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := codepipeline.New(sess)

	params := &codepipeline.RetryStageExecutionInput{
		PipelineExecutionId: aws.String("PipelineExecutionId"), // Required
		PipelineName:        aws.String("PipelineName"),        // Required
		RetryMode:           aws.String("StageRetryMode"),      // Required
		StageName:           aws.String("StageName"),           // Required
	}
	resp, err := svc.RetryStageExecution(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

示例12: ExampleCodePipeline_PollForJobs

func ExampleCodePipeline_PollForJobs() {
	svc := codepipeline.New(session.New())

	params := &codepipeline.PollForJobsInput{
		ActionTypeId: &codepipeline.ActionTypeId{ // Required
			Category: aws.String("ActionCategory"), // Required
			Owner:    aws.String("ActionOwner"),    // Required
			Provider: aws.String("ActionProvider"), // Required
			Version:  aws.String("Version"),        // Required
		},
		MaxBatchSize: aws.Int64(1),
		QueryParam: map[string]*string{
			"Key": aws.String("ActionConfigurationQueryableValue"), // Required
			// More values...
		},
	}
	resp, err := svc.PollForJobs(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,代碼行數:28,代碼來源:examples_test.go

示例13: ExampleCodePipeline_ListActionTypes

func ExampleCodePipeline_ListActionTypes() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := codepipeline.New(sess)

	params := &codepipeline.ListActionTypesInput{
		ActionOwnerFilter: aws.String("ActionOwner"),
		NextToken:         aws.String("NextToken"),
	}
	resp, err := svc.ListActionTypes(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

示例14: ExampleCodePipeline_PutActionRevision

func ExampleCodePipeline_PutActionRevision() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := codepipeline.New(sess)

	params := &codepipeline.PutActionRevisionInput{
		ActionName: aws.String("ActionName"), // Required
		ActionRevision: &codepipeline.ActionRevision{ // Required
			Created:          aws.Time(time.Now()),                   // Required
			RevisionChangeId: aws.String("RevisionChangeIdentifier"), // Required
			RevisionId:       aws.String("Revision"),                 // Required
		},
		PipelineName: aws.String("PipelineName"), // Required
		StageName:    aws.String("StageName"),    // Required
	}
	resp, err := svc.PutActionRevision(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,代碼行數:31,代碼來源:examples_test.go

示例15: ExampleCodePipeline_PollForThirdPartyJobs

func ExampleCodePipeline_PollForThirdPartyJobs() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := codepipeline.New(sess)

	params := &codepipeline.PollForThirdPartyJobsInput{
		ActionTypeId: &codepipeline.ActionTypeId{ // Required
			Category: aws.String("ActionCategory"), // Required
			Owner:    aws.String("ActionOwner"),    // Required
			Provider: aws.String("ActionProvider"), // Required
			Version:  aws.String("Version"),        // Required
		},
		MaxBatchSize: aws.Int64(1),
	}
	resp, err := svc.PollForThirdPartyJobs(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


注:本文中的github.com/aws/aws-sdk-go/service/codepipeline.New函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。