1// Code generated by smithy-go-codegen DO NOT EDIT. 2 3package mediaconvert 4 5import ( 6 "context" 7 awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" 8 "github.com/aws/aws-sdk-go-v2/aws/signer/v4" 9 "github.com/aws/aws-sdk-go-v2/service/mediaconvert/types" 10 "github.com/aws/smithy-go/middleware" 11 smithyhttp "github.com/aws/smithy-go/transport/http" 12) 13 14// Create a new transcoding queue. For information about queues, see Working With 15// Queues in the User Guide at 16// https://docs.aws.amazon.com/mediaconvert/latest/ug/working-with-queues.html 17func (c *Client) CreateQueue(ctx context.Context, params *CreateQueueInput, optFns ...func(*Options)) (*CreateQueueOutput, error) { 18 if params == nil { 19 params = &CreateQueueInput{} 20 } 21 22 result, metadata, err := c.invokeOperation(ctx, "CreateQueue", params, optFns, c.addOperationCreateQueueMiddlewares) 23 if err != nil { 24 return nil, err 25 } 26 27 out := result.(*CreateQueueOutput) 28 out.ResultMetadata = metadata 29 return out, nil 30} 31 32type CreateQueueInput struct { 33 34 // The name of the queue that you are creating. 35 // 36 // This member is required. 37 Name *string 38 39 // Optional. A description of the queue that you are creating. 40 Description *string 41 42 // Specifies whether the pricing plan for the queue is on-demand or reserved. For 43 // on-demand, you pay per minute, billed in increments of .01 minute. For reserved, 44 // you pay for the transcoding capacity of the entire queue, regardless of how much 45 // or how little you use it. Reserved pricing requires a 12-month commitment. When 46 // you use the API to create a queue, the default is on-demand. 47 PricingPlan types.PricingPlan 48 49 // Details about the pricing plan for your reserved queue. Required for reserved 50 // queues and not applicable to on-demand queues. 51 ReservationPlanSettings *types.ReservationPlanSettings 52 53 // Initial state of the queue. If you create a paused queue, then jobs in that 54 // queue won't begin. 55 Status types.QueueStatus 56 57 // The tags that you want to add to the resource. You can tag resources with a 58 // key-value pair or with only a key. 59 Tags map[string]string 60 61 noSmithyDocumentSerde 62} 63 64type CreateQueueOutput struct { 65 66 // You can use queues to manage the resources that are available to your AWS 67 // account for running multiple transcoding jobs at the same time. If you don't 68 // specify a queue, the service sends all jobs through the default queue. For more 69 // information, see 70 // https://docs.aws.amazon.com/mediaconvert/latest/ug/working-with-queues.html. 71 Queue *types.Queue 72 73 // Metadata pertaining to the operation's result. 74 ResultMetadata middleware.Metadata 75 76 noSmithyDocumentSerde 77} 78 79func (c *Client) addOperationCreateQueueMiddlewares(stack *middleware.Stack, options Options) (err error) { 80 err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateQueue{}, middleware.After) 81 if err != nil { 82 return err 83 } 84 err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateQueue{}, middleware.After) 85 if err != nil { 86 return err 87 } 88 if err = addSetLoggerMiddleware(stack, options); err != nil { 89 return err 90 } 91 if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { 92 return err 93 } 94 if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { 95 return err 96 } 97 if err = addResolveEndpointMiddleware(stack, options); err != nil { 98 return err 99 } 100 if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { 101 return err 102 } 103 if err = addRetryMiddlewares(stack, options); err != nil { 104 return err 105 } 106 if err = addHTTPSignerV4Middleware(stack, options); err != nil { 107 return err 108 } 109 if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { 110 return err 111 } 112 if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { 113 return err 114 } 115 if err = addClientUserAgent(stack); err != nil { 116 return err 117 } 118 if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { 119 return err 120 } 121 if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { 122 return err 123 } 124 if err = addOpCreateQueueValidationMiddleware(stack); err != nil { 125 return err 126 } 127 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateQueue(options.Region), middleware.Before); err != nil { 128 return err 129 } 130 if err = addRequestIDRetrieverMiddleware(stack); err != nil { 131 return err 132 } 133 if err = addResponseErrorMiddleware(stack); err != nil { 134 return err 135 } 136 if err = addRequestResponseLogging(stack, options); err != nil { 137 return err 138 } 139 return nil 140} 141 142func newServiceMetadataMiddleware_opCreateQueue(region string) *awsmiddleware.RegisterServiceMetadata { 143 return &awsmiddleware.RegisterServiceMetadata{ 144 Region: region, 145 ServiceID: ServiceID, 146 SigningName: "mediaconvert", 147 OperationName: "CreateQueue", 148 } 149} 150