1// Code generated by smithy-go-codegen DO NOT EDIT. 2 3package databrew 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/databrew/types" 10 "github.com/aws/smithy-go/middleware" 11 smithyhttp "github.com/aws/smithy-go/transport/http" 12) 13 14// Creates a new job to profile an AWS Glue DataBrew dataset that exists in the 15// current AWS account. 16func (c *Client) CreateProfileJob(ctx context.Context, params *CreateProfileJobInput, optFns ...func(*Options)) (*CreateProfileJobOutput, error) { 17 if params == nil { 18 params = &CreateProfileJobInput{} 19 } 20 21 result, metadata, err := c.invokeOperation(ctx, "CreateProfileJob", params, optFns, addOperationCreateProfileJobMiddlewares) 22 if err != nil { 23 return nil, err 24 } 25 26 out := result.(*CreateProfileJobOutput) 27 out.ResultMetadata = metadata 28 return out, nil 29} 30 31type CreateProfileJobInput struct { 32 33 // The name of the dataset that this job is to act upon. 34 // 35 // This member is required. 36 DatasetName *string 37 38 // The name of the job to be created. 39 // 40 // This member is required. 41 Name *string 42 43 // An Amazon S3 location (bucket name an object key) where DataBrew can read input 44 // data, or write output from a job. 45 // 46 // This member is required. 47 OutputLocation *types.S3Location 48 49 // The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) 50 // role to be assumed for this request. 51 // 52 // This member is required. 53 RoleArn *string 54 55 // The Amazon Resource Name (ARN) of an encryption key that is used to protect the 56 // job. 57 EncryptionKeyArn *string 58 59 // The encryption mode for the job, which can be one of the following: 60 // 61 // * SSE-KMS - 62 // para>SSE-KMS - server-side encryption with AWS KMS-managed keys. 63 // 64 // * SSE-S3 - 65 // Server-side encryption with keys managed by Amazon S3. 66 EncryptionMode types.EncryptionMode 67 68 // A value that enables or disables Amazon CloudWatch logging for the current AWS 69 // account. If logging is enabled, CloudWatch writes one log stream for each job 70 // run. 71 LogSubscription types.LogSubscription 72 73 // The maximum number of nodes that DataBrew can use when the job processes data. 74 MaxCapacity int32 75 76 // The maximum number of times to retry the job after a job run fails. 77 MaxRetries int32 78 79 // Metadata tags to apply to this job. 80 Tags map[string]string 81 82 // The job's timeout in minutes. A job that attempts to run longer than this 83 // timeout period ends with a status of TIMEOUT. 84 Timeout int32 85} 86 87type CreateProfileJobOutput struct { 88 89 // The name of the job that was created. 90 // 91 // This member is required. 92 Name *string 93 94 // Metadata pertaining to the operation's result. 95 ResultMetadata middleware.Metadata 96} 97 98func addOperationCreateProfileJobMiddlewares(stack *middleware.Stack, options Options) (err error) { 99 err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateProfileJob{}, middleware.After) 100 if err != nil { 101 return err 102 } 103 err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateProfileJob{}, middleware.After) 104 if err != nil { 105 return err 106 } 107 if err = addSetLoggerMiddleware(stack, options); err != nil { 108 return err 109 } 110 if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { 111 return err 112 } 113 if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { 114 return err 115 } 116 if err = addResolveEndpointMiddleware(stack, options); err != nil { 117 return err 118 } 119 if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { 120 return err 121 } 122 if err = addRetryMiddlewares(stack, options); err != nil { 123 return err 124 } 125 if err = addHTTPSignerV4Middleware(stack, options); err != nil { 126 return err 127 } 128 if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { 129 return err 130 } 131 if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { 132 return err 133 } 134 if err = addClientUserAgent(stack); err != nil { 135 return err 136 } 137 if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { 138 return err 139 } 140 if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { 141 return err 142 } 143 if err = addOpCreateProfileJobValidationMiddleware(stack); err != nil { 144 return err 145 } 146 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateProfileJob(options.Region), middleware.Before); err != nil { 147 return err 148 } 149 if err = addRequestIDRetrieverMiddleware(stack); err != nil { 150 return err 151 } 152 if err = addResponseErrorMiddleware(stack); err != nil { 153 return err 154 } 155 if err = addRequestResponseLogging(stack, options); err != nil { 156 return err 157 } 158 return nil 159} 160 161func newServiceMetadataMiddleware_opCreateProfileJob(region string) *awsmiddleware.RegisterServiceMetadata { 162 return &awsmiddleware.RegisterServiceMetadata{ 163 Region: region, 164 ServiceID: ServiceID, 165 SigningName: "databrew", 166 OperationName: "CreateProfileJob", 167 } 168} 169