Skip to content

Commit

Permalink
feat(client-mediaconvert): This release adds the ability to search fo…
Browse files Browse the repository at this point in the history
…r historical job records within the management console using a search box and/or via the SDK/CLI with partial string matching search on input file name.
  • Loading branch information
awstools committed Jun 14, 2024
1 parent 2d57a05 commit 33a5089
Show file tree
Hide file tree
Showing 11 changed files with 1,892 additions and 2 deletions.
8 changes: 8 additions & 0 deletions clients/client-mediaconvert/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,14 @@ PutPolicy

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/mediaconvert/command/PutPolicyCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-mediaconvert/Interface/PutPolicyCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-mediaconvert/Interface/PutPolicyCommandOutput/)

</details>
<details>
<summary>
SearchJobs
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/mediaconvert/command/SearchJobsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-mediaconvert/Interface/SearchJobsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-mediaconvert/Interface/SearchJobsCommandOutput/)

</details>
<details>
<summary>
Expand Down
14 changes: 14 additions & 0 deletions clients/client-mediaconvert/src/MediaConvert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ import {
ListTagsForResourceCommandOutput,
} from "./commands/ListTagsForResourceCommand";
import { PutPolicyCommand, PutPolicyCommandInput, PutPolicyCommandOutput } from "./commands/PutPolicyCommand";
import { SearchJobsCommand, SearchJobsCommandInput, SearchJobsCommandOutput } from "./commands/SearchJobsCommand";
import { TagResourceCommand, TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
import {
UntagResourceCommand,
Expand Down Expand Up @@ -112,6 +113,7 @@ const commands = {
ListQueuesCommand,
ListTagsForResourceCommand,
PutPolicyCommand,
SearchJobsCommand,
TagResourceCommand,
UntagResourceCommand,
UpdateJobTemplateCommand,
Expand Down Expand Up @@ -425,6 +427,18 @@ export interface MediaConvert {
cb: (err: any, data?: PutPolicyCommandOutput) => void
): void;

/**
* @see {@link SearchJobsCommand}
*/
searchJobs(): Promise<SearchJobsCommandOutput>;
searchJobs(args: SearchJobsCommandInput, options?: __HttpHandlerOptions): Promise<SearchJobsCommandOutput>;
searchJobs(args: SearchJobsCommandInput, cb: (err: any, data?: SearchJobsCommandOutput) => void): void;
searchJobs(
args: SearchJobsCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: SearchJobsCommandOutput) => void
): void;

/**
* @see {@link TagResourceCommand}
*/
Expand Down
3 changes: 3 additions & 0 deletions clients/client-mediaconvert/src/MediaConvertClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ import {
ListTagsForResourceCommandOutput,
} from "./commands/ListTagsForResourceCommand";
import { PutPolicyCommandInput, PutPolicyCommandOutput } from "./commands/PutPolicyCommand";
import { SearchJobsCommandInput, SearchJobsCommandOutput } from "./commands/SearchJobsCommand";
import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand";
import { UpdateJobTemplateCommandInput, UpdateJobTemplateCommandOutput } from "./commands/UpdateJobTemplateCommand";
Expand Down Expand Up @@ -128,6 +129,7 @@ export type ServiceInputTypes =
| ListQueuesCommandInput
| ListTagsForResourceCommandInput
| PutPolicyCommandInput
| SearchJobsCommandInput
| TagResourceCommandInput
| UntagResourceCommandInput
| UpdateJobTemplateCommandInput
Expand Down Expand Up @@ -161,6 +163,7 @@ export type ServiceOutputTypes =
| ListQueuesCommandOutput
| ListTagsForResourceCommandOutput
| PutPolicyCommandOutput
| SearchJobsCommandOutput
| TagResourceCommandOutput
| UntagResourceCommandOutput
| UpdateJobTemplateCommandOutput
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export interface DescribeEndpointsCommandInput extends DescribeEndpointsRequest
export interface DescribeEndpointsCommandOutput extends DescribeEndpointsResponse, __MetadataBearer {}

/**
* Send an request with an empty body to the regional API endpoint to get your account API endpoint.
* Send a request with an empty body to the regional API endpoint to get your account API endpoint. Note that DescribeEndpoints is no longer required. We recommend that you send your requests directly to the regional endpoint instead.
*
* @deprecated DescribeEndpoints and account specific endpoints are no longer required. We recommend that you send your requests directly to the regional endpoint instead.
* @example
Expand Down
1,619 changes: 1,619 additions & 0 deletions clients/client-mediaconvert/src/commands/SearchJobsCommand.ts

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions clients/client-mediaconvert/src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export * from "./ListPresetsCommand";
export * from "./ListQueuesCommand";
export * from "./ListTagsForResourceCommand";
export * from "./PutPolicyCommand";
export * from "./SearchJobsCommand";
export * from "./TagResourceCommand";
export * from "./UntagResourceCommand";
export * from "./UpdateJobTemplateCommand";
Expand Down
58 changes: 58 additions & 0 deletions clients/client-mediaconvert/src/models/models_2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -946,6 +946,64 @@ export interface PutPolicyResponse {
Policy?: Policy;
}

/**
* @public
*/
export interface SearchJobsRequest {
/**
* Optional. Provide your input file URL or your partial input file name. The maximum length for an input file is 300 characters.
* @public
*/
InputFile?: string;

/**
* Optional. Number of jobs, up to twenty, that will be returned at one time.
* @public
*/
MaxResults?: number;

/**
* Optional. Use this string, provided with the response to a previous request, to request the next batch of jobs.
* @public
*/
NextToken?: string;

/**
* Optional. When you request lists of resources, you can specify whether they are sorted in ASCENDING or DESCENDING order. Default varies by resource.
* @public
*/
Order?: Order;

/**
* Optional. Provide a queue name, or a queue ARN, to return only jobs from that queue.
* @public
*/
Queue?: string;

/**
* Optional. A job's status can be SUBMITTED, PROGRESSING, COMPLETE, CANCELED, or ERROR.
* @public
*/
Status?: JobStatus;
}

/**
* @public
*/
export interface SearchJobsResponse {
/**
* List of jobs.
* @public
*/
Jobs?: Job[];

/**
* Use this string to request the next batch of jobs.
* @public
*/
NextToken?: string;
}

/**
* @public
*/
Expand Down
20 changes: 20 additions & 0 deletions clients/client-mediaconvert/src/pagination/SearchJobsPaginator.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// smithy-typescript generated code
import { createPaginator } from "@smithy/core";
import { Paginator } from "@smithy/types";

import { SearchJobsCommand, SearchJobsCommandInput, SearchJobsCommandOutput } from "../commands/SearchJobsCommand";
import { MediaConvertClient } from "../MediaConvertClient";
import { MediaConvertPaginationConfiguration } from "./Interfaces";

/**
* @public
*/
export const paginateSearchJobs: (
config: MediaConvertPaginationConfiguration,
input: SearchJobsCommandInput,
...rest: any[]
) => Paginator<SearchJobsCommandOutput> = createPaginator<
MediaConvertPaginationConfiguration,
SearchJobsCommandInput,
SearchJobsCommandOutput
>(MediaConvertClient, SearchJobsCommand, "NextToken", "NextToken", "MaxResults");
1 change: 1 addition & 0 deletions clients/client-mediaconvert/src/pagination/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ export * from "./ListJobTemplatesPaginator";
export * from "./ListJobsPaginator";
export * from "./ListPresetsPaginator";
export * from "./ListQueuesPaginator";
export * from "./SearchJobsPaginator";
48 changes: 48 additions & 0 deletions clients/client-mediaconvert/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ import {
ListTagsForResourceCommandOutput,
} from "../commands/ListTagsForResourceCommand";
import { PutPolicyCommandInput, PutPolicyCommandOutput } from "../commands/PutPolicyCommand";
import { SearchJobsCommandInput, SearchJobsCommandOutput } from "../commands/SearchJobsCommand";
import { TagResourceCommandInput, TagResourceCommandOutput } from "../commands/TagResourceCommand";
import { UntagResourceCommandInput, UntagResourceCommandOutput } from "../commands/UntagResourceCommand";
import { UpdateJobTemplateCommandInput, UpdateJobTemplateCommandOutput } from "../commands/UpdateJobTemplateCommand";
Expand Down Expand Up @@ -723,6 +724,29 @@ export const se_PutPolicyCommand = async (
return b.build();
};

/**
* serializeAws_restJson1SearchJobsCommand
*/
export const se_SearchJobsCommand = async (
input: SearchJobsCommandInput,
context: __SerdeContext
): Promise<__HttpRequest> => {
const b = rb(input, context);
const headers: any = {};
b.bp("/2017-08-29/search");
const query: any = map({
[_iF]: [, input[_IF]!],
[_mR]: [() => input.MaxResults !== void 0, () => input[_MR]!.toString()],
[_nT]: [, input[_NT]!],
[_o]: [, input[_O]!],
[_q]: [, input[_Q]!],
[_s]: [, input[_S]!],
});
let body: any;
b.m("GET").h(headers).q(query).b(body);
return b.build();
};

/**
* serializeAws_restJson1TagResourceCommand
*/
Expand Down Expand Up @@ -1309,6 +1333,28 @@ export const de_PutPolicyCommand = async (
return contents;
};

/**
* deserializeAws_restJson1SearchJobsCommand
*/
export const de_SearchJobsCommand = async (
output: __HttpResponse,
context: __SerdeContext
): Promise<SearchJobsCommandOutput> => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents: any = map({
$metadata: deserializeMetadata(output),
});
const data: Record<string, any> = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
const doc = take(data, {
Jobs: [, (_) => de___listOfJob(_, context), `jobs`],
NextToken: [, __expectString, `nextToken`],
});
Object.assign(contents, doc);
return contents;
};

/**
* deserializeAws_restJson1TagResourceCommand
*/
Expand Down Expand Up @@ -7597,13 +7643,15 @@ const isSerializableHeaderValue = (value: any): boolean =>
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);

const _C = "Category";
const _IF = "InputFile";
const _LB = "ListBy";
const _MR = "MaxResults";
const _NT = "NextToken";
const _O = "Order";
const _Q = "Queue";
const _S = "Status";
const _c = "category";
const _iF = "inputFile";
const _lB = "listBy";
const _mR = "maxResults";
const _nT = "nextToken";
Expand Down
Loading

0 comments on commit 33a5089

Please sign in to comment.