1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182
|
// Code generated by smithy-go-codegen DO NOT EDIT.
package elastictranscoder
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/elastictranscoder/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// When you create a job, Elastic Transcoder returns JSON data that includes the
// values that you specified plus information about the job that is created. If you
// have specified more than one output for your jobs (for example, one output for
// the Kindle Fire and another output for the Apple iPhone 4s), you currently must
// use the Elastic Transcoder API to list the jobs (as opposed to the AWS Console).
func (c *Client) CreateJob(ctx context.Context, params *CreateJobInput, optFns ...func(*Options)) (*CreateJobOutput, error) {
if params == nil {
params = &CreateJobInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateJob", params, optFns, c.addOperationCreateJobMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateJobOutput)
out.ResultMetadata = metadata
return out, nil
}
// The CreateJobRequest structure.
type CreateJobInput struct {
// The Id of the pipeline that you want Elastic Transcoder to use for transcoding.
// The pipeline determines several settings, including the Amazon S3 bucket from
// which Elastic Transcoder gets the files to transcode and the bucket into which
// Elastic Transcoder puts the transcoded files.
//
// This member is required.
PipelineId *string
// A section of the request body that provides information about the file that is
// being transcoded.
Input *types.JobInput
// A section of the request body that provides information about the files that
// are being transcoded.
Inputs []types.JobInput
// A section of the request body that provides information about the transcoded
// (target) file. We strongly recommend that you use the Outputs syntax instead of
// the Output syntax.
Output *types.CreateJobOutput
// The value, if any, that you want Elastic Transcoder to prepend to the names of
// all files that this job creates, including output files, thumbnails, and
// playlists.
OutputKeyPrefix *string
// A section of the request body that provides information about the transcoded
// (target) files. We recommend that you use the Outputs syntax instead of the
// Output syntax.
Outputs []types.CreateJobOutput
// If you specify a preset in PresetId for which the value of Container is fmp4
// (Fragmented MP4) or ts (MPEG-TS), Playlists contains information about the
// master playlists that you want Elastic Transcoder to create. The maximum number
// of master playlists in a job is 30.
Playlists []types.CreateJobPlaylist
// User-defined metadata that you want to associate with an Elastic Transcoder
// job. You specify metadata in key/value pairs, and you can add up to 10 key/value
// pairs per job. Elastic Transcoder does not guarantee that key/value pairs are
// returned in the same order in which you specify them.
UserMetadata map[string]string
noSmithyDocumentSerde
}
// The CreateJobResponse structure.
type CreateJobOutput struct {
// A section of the response body that provides information about the job that is
// created.
Job *types.Job
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateJobMiddlewares(stack *middleware.Stack, options Options) (err error) {
if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
return err
}
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateJob{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateJob{}, middleware.After)
if err != nil {
return err
}
if err := addProtocolFinalizerMiddlewares(stack, options, "CreateJob"); err != nil {
return fmt.Errorf("add protocol finalizers: %v", err)
}
if err = addlegacyEndpointContextSetter(stack, options); err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addOpCreateJobValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateJob(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateJob(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
OperationName: "CreateJob",
}
}
|