Skip to content

Commit

Permalink
feat(client-m2): Add returnCode, batchJobIdentifier in GetBatchJobExe…
Browse files Browse the repository at this point in the history
…cution response, for user to view the batch job execution result & unique identifier from engine. Also removed unused headers from REST APIs
  • Loading branch information
awstools committed Jan 25, 2023
1 parent 40714b5 commit 717df3e
Show file tree
Hide file tree
Showing 4 changed files with 322 additions and 588 deletions.
2 changes: 1 addition & 1 deletion clients/client-m2/src/endpoint/ruleset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ m={[q]:"booleanEquals",[r]:[true,{[q]:"getAttr",[r]:[{[s]:d},"supportsFIPS"]}]},
n={[q]:"booleanEquals",[r]:[true,{[q]:"getAttr",[r]:[{[s]:d},"supportsDualStack"]}]},
o=[j],
p=[k];
const _data={version:"1.0",parameters:{Region:{required:a,type:c},UseDualStack:h,UseFIPS:h,Endpoint:{required:b,type:c}},rules:[{conditions:[{[q]:"aws.partition",[r]:[{[s]:"Region"}],assign:d}],type:e,rules:[{conditions:[{[q]:"isSet",[r]:[i]}],type:e,rules:[{conditions:o,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:f},{type:e,rules:[{conditions:p,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:f},{endpoint:{url:i,properties:l,headers:l},type:g}]}]},{conditions:[j,k],type:e,rules:[{conditions:[m,n],type:e,rules:[{endpoint:{url:"https://m2-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:l,headers:l},type:g}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:f}]},{conditions:o,type:e,rules:[{conditions:[m],type:e,rules:[{type:e,rules:[{endpoint:{url:"https://m2-fips.{Region}.{PartitionResult#dnsSuffix}",properties:l,headers:l},type:g}]}]},{error:"FIPS is enabled but this partition does not support FIPS",type:f}]},{conditions:p,type:e,rules:[{conditions:[n],type:e,rules:[{endpoint:{url:"https://m2.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:l,headers:l},type:g}]},{error:"DualStack is enabled but this partition does not support DualStack",type:f}]},{endpoint:{url:"https://m2.{Region}.{PartitionResult#dnsSuffix}",properties:l,headers:l},type:g}]}]};
const _data={version:"1.0",parameters:{Region:{required:a,type:c},UseDualStack:h,UseFIPS:h,Endpoint:{required:b,type:c}},rules:[{conditions:[{[q]:"aws.partition",[r]:[{[s]:"Region"}],assign:d}],type:e,rules:[{conditions:[{[q]:"isSet",[r]:[i]}],type:e,rules:[{conditions:o,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:f},{type:e,rules:[{conditions:p,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:f},{endpoint:{url:i,properties:l,headers:l},type:g}]}]},{conditions:[j,k],type:e,rules:[{conditions:[m,n],type:e,rules:[{type:e,rules:[{endpoint:{url:"https://m2-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:l,headers:l},type:g}]}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:f}]},{conditions:o,type:e,rules:[{conditions:[m],type:e,rules:[{type:e,rules:[{endpoint:{url:"https://m2-fips.{Region}.{PartitionResult#dnsSuffix}",properties:l,headers:l},type:g}]}]},{error:"FIPS is enabled but this partition does not support FIPS",type:f}]},{conditions:p,type:e,rules:[{conditions:[n],type:e,rules:[{type:e,rules:[{endpoint:{url:"https://m2.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:l,headers:l},type:g}]}]},{error:"DualStack is enabled but this partition does not support DualStack",type:f}]},{type:e,rules:[{endpoint:{url:"https://m2.{Region}.{PartitionResult#dnsSuffix}",properties:l,headers:l},type:g}]}]}]};
export const ruleSet: RuleSetObject = _data;
223 changes: 124 additions & 99 deletions clients/client-m2/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1001,6 +1001,80 @@ export interface GetBatchJobExecutionRequest {
executionId: string | undefined;
}

/**
* <p>A batch job identifier in which the batch job to run is identified by the file name and
* the relative path to the file name.</p>
*/
export interface FileBatchJobIdentifier {
/**
* <p>The file name for the batch job identifier.</p>
*/
fileName: string | undefined;

/**
* <p>The relative path to the file name for the batch job identifier.</p>
*/
folderPath?: string;
}

/**
* <p>A batch job identifier in which the batch job to run is identified by the script
* name.</p>
*/
export interface ScriptBatchJobIdentifier {
/**
* <p>The name of the script containing the batch job definition.</p>
*/
scriptName: string | undefined;
}

/**
* <p>Identifies a specific batch job.</p>
*/
export type BatchJobIdentifier =
| BatchJobIdentifier.FileBatchJobIdentifierMember
| BatchJobIdentifier.ScriptBatchJobIdentifierMember
| BatchJobIdentifier.$UnknownMember;

export namespace BatchJobIdentifier {
/**
* <p>Specifies a file associated with a specific batch job.</p>
*/
export interface FileBatchJobIdentifierMember {
fileBatchJobIdentifier: FileBatchJobIdentifier;
scriptBatchJobIdentifier?: never;
$unknown?: never;
}

/**
* <p>A batch job identifier in which the batch job to run is identified by the script name.</p>
*/
export interface ScriptBatchJobIdentifierMember {
fileBatchJobIdentifier?: never;
scriptBatchJobIdentifier: ScriptBatchJobIdentifier;
$unknown?: never;
}

export interface $UnknownMember {
fileBatchJobIdentifier?: never;
scriptBatchJobIdentifier?: never;
$unknown: [string, any];
}

export interface Visitor<T> {
fileBatchJobIdentifier: (value: FileBatchJobIdentifier) => T;
scriptBatchJobIdentifier: (value: ScriptBatchJobIdentifier) => T;
_: (name: string, value: any) => T;
}

export const visit = <T>(value: BatchJobIdentifier, visitor: Visitor<T>): T => {
if (value.fileBatchJobIdentifier !== undefined) return visitor.fileBatchJobIdentifier(value.fileBatchJobIdentifier);
if (value.scriptBatchJobIdentifier !== undefined)
return visitor.scriptBatchJobIdentifier(value.scriptBatchJobIdentifier);
return visitor._(value.$unknown[0], value.$unknown[1]);
};
}

export enum BatchJobType {
JES2 = "JES2",
JES3 = "JES3",
Expand Down Expand Up @@ -1069,6 +1143,16 @@ export interface GetBatchJobExecutionResponse {
* <p>The reason for the reported status.</p>
*/
statusReason?: string;

/**
* <p/>
*/
returnCode?: string;

/**
* <p>Identifies a specific batch job.</p>
*/
batchJobIdentifier?: BatchJobIdentifier;
}

export interface GetDataSetDetailsRequest {
Expand Down Expand Up @@ -1681,6 +1765,16 @@ export interface BatchJobExecutionSummary {
* <p>The timestamp when this batch job execution ended.</p>
*/
endTime?: Date;

/**
* <p/>
*/
returnCode?: string;

/**
* <p>Identifies a specific batch job.</p>
*/
batchJobIdentifier?: BatchJobIdentifier;
}

export interface ListBatchJobExecutionsResponse {
Expand Down Expand Up @@ -1905,80 +1999,6 @@ export interface StartApplicationRequest {

export interface StartApplicationResponse {}

/**
* <p>A batch job identifier in which the batch job to run is identified by the file name and
* the relative path to the file name.</p>
*/
export interface FileBatchJobIdentifier {
/**
* <p>The file name for the batch job identifier.</p>
*/
fileName: string | undefined;

/**
* <p>The relative path to the file name for the batch job identifier.</p>
*/
folderPath?: string;
}

/**
* <p>A batch job identifier in which the batch job to run is identified by the script
* name.</p>
*/
export interface ScriptBatchJobIdentifier {
/**
* <p>The name of the script containing the batch job definition.</p>
*/
scriptName: string | undefined;
}

/**
* <p>Identifies a specific batch job.</p>
*/
export type BatchJobIdentifier =
| BatchJobIdentifier.FileBatchJobIdentifierMember
| BatchJobIdentifier.ScriptBatchJobIdentifierMember
| BatchJobIdentifier.$UnknownMember;

export namespace BatchJobIdentifier {
/**
* <p>Specifies a file associated with a specific batch job.</p>
*/
export interface FileBatchJobIdentifierMember {
fileBatchJobIdentifier: FileBatchJobIdentifier;
scriptBatchJobIdentifier?: never;
$unknown?: never;
}

/**
* <p>A batch job identifier in which the batch job to run is identified by the script name.</p>
*/
export interface ScriptBatchJobIdentifierMember {
fileBatchJobIdentifier?: never;
scriptBatchJobIdentifier: ScriptBatchJobIdentifier;
$unknown?: never;
}

export interface $UnknownMember {
fileBatchJobIdentifier?: never;
scriptBatchJobIdentifier?: never;
$unknown: [string, any];
}

export interface Visitor<T> {
fileBatchJobIdentifier: (value: FileBatchJobIdentifier) => T;
scriptBatchJobIdentifier: (value: ScriptBatchJobIdentifier) => T;
_: (name: string, value: any) => T;
}

export const visit = <T>(value: BatchJobIdentifier, visitor: Visitor<T>): T => {
if (value.fileBatchJobIdentifier !== undefined) return visitor.fileBatchJobIdentifier(value.fileBatchJobIdentifier);
if (value.scriptBatchJobIdentifier !== undefined)
return visitor.scriptBatchJobIdentifier(value.scriptBatchJobIdentifier);
return visitor._(value.$unknown[0], value.$unknown[1]);
};
}

export interface StartBatchJobRequest {
/**
* <p>The unique identifier of the application associated with this batch job.</p>
Expand Down Expand Up @@ -2848,11 +2868,37 @@ export const GetBatchJobExecutionRequestFilterSensitiveLog = (obj: GetBatchJobEx
...obj,
});

/**
* @internal
*/
export const FileBatchJobIdentifierFilterSensitiveLog = (obj: FileBatchJobIdentifier): any => ({
...obj,
});

/**
* @internal
*/
export const ScriptBatchJobIdentifierFilterSensitiveLog = (obj: ScriptBatchJobIdentifier): any => ({
...obj,
});

/**
* @internal
*/
export const BatchJobIdentifierFilterSensitiveLog = (obj: BatchJobIdentifier): any => {
if (obj.fileBatchJobIdentifier !== undefined)
return { fileBatchJobIdentifier: FileBatchJobIdentifierFilterSensitiveLog(obj.fileBatchJobIdentifier) };
if (obj.scriptBatchJobIdentifier !== undefined)
return { scriptBatchJobIdentifier: ScriptBatchJobIdentifierFilterSensitiveLog(obj.scriptBatchJobIdentifier) };
if (obj.$unknown !== undefined) return { [obj.$unknown[0]]: "UNKNOWN" };
};

/**
* @internal
*/
export const GetBatchJobExecutionResponseFilterSensitiveLog = (obj: GetBatchJobExecutionResponse): any => ({
...obj,
...(obj.batchJobIdentifier && { batchJobIdentifier: BatchJobIdentifierFilterSensitiveLog(obj.batchJobIdentifier) }),
});

/**
Expand Down Expand Up @@ -3017,13 +3063,17 @@ export const ListBatchJobExecutionsRequestFilterSensitiveLog = (obj: ListBatchJo
*/
export const BatchJobExecutionSummaryFilterSensitiveLog = (obj: BatchJobExecutionSummary): any => ({
...obj,
...(obj.batchJobIdentifier && { batchJobIdentifier: BatchJobIdentifierFilterSensitiveLog(obj.batchJobIdentifier) }),
});

/**
* @internal
*/
export const ListBatchJobExecutionsResponseFilterSensitiveLog = (obj: ListBatchJobExecutionsResponse): any => ({
...obj,
...(obj.batchJobExecutions && {
batchJobExecutions: obj.batchJobExecutions.map((item) => BatchJobExecutionSummaryFilterSensitiveLog(item)),
}),
});

/**
Expand Down Expand Up @@ -3103,31 +3153,6 @@ export const StartApplicationResponseFilterSensitiveLog = (obj: StartApplication
...obj,
});

/**
* @internal
*/
export const FileBatchJobIdentifierFilterSensitiveLog = (obj: FileBatchJobIdentifier): any => ({
...obj,
});

/**
* @internal
*/
export const ScriptBatchJobIdentifierFilterSensitiveLog = (obj: ScriptBatchJobIdentifier): any => ({
...obj,
});

/**
* @internal
*/
export const BatchJobIdentifierFilterSensitiveLog = (obj: BatchJobIdentifier): any => {
if (obj.fileBatchJobIdentifier !== undefined)
return { fileBatchJobIdentifier: FileBatchJobIdentifierFilterSensitiveLog(obj.fileBatchJobIdentifier) };
if (obj.scriptBatchJobIdentifier !== undefined)
return { scriptBatchJobIdentifier: ScriptBatchJobIdentifierFilterSensitiveLog(obj.scriptBatchJobIdentifier) };
if (obj.$unknown !== undefined) return { [obj.$unknown[0]]: "UNKNOWN" };
};

/**
* @internal
*/
Expand Down
50 changes: 50 additions & 0 deletions clients/client-m2/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1798,6 +1798,12 @@ export const deserializeAws_restJson1GetBatchJobExecutionCommand = async (
if (data.applicationId != null) {
contents.applicationId = __expectString(data.applicationId);
}
if (data.batchJobIdentifier != null) {
contents.batchJobIdentifier = deserializeAws_restJson1BatchJobIdentifier(
__expectUnion(data.batchJobIdentifier),
context
);
}
if (data.endTime != null) {
contents.endTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.endTime)));
}
Expand All @@ -1816,6 +1822,9 @@ export const deserializeAws_restJson1GetBatchJobExecutionCommand = async (
if (data.jobUser != null) {
contents.jobUser = __expectString(data.jobUser);
}
if (data.returnCode != null) {
contents.returnCode = __expectString(data.returnCode);
}
if (data.startTime != null) {
contents.startTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.startTime)));
}
Expand Down Expand Up @@ -3630,12 +3639,17 @@ const deserializeAws_restJson1BatchJobExecutionSummary = (
): BatchJobExecutionSummary => {
return {
applicationId: __expectString(output.applicationId),
batchJobIdentifier:
output.batchJobIdentifier != null
? deserializeAws_restJson1BatchJobIdentifier(__expectUnion(output.batchJobIdentifier), context)
: undefined,
endTime:
output.endTime != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.endTime))) : undefined,
executionId: __expectString(output.executionId),
jobId: __expectString(output.jobId),
jobName: __expectString(output.jobName),
jobType: __expectString(output.jobType),
returnCode: __expectString(output.returnCode),
startTime:
output.startTime != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.startTime))) : undefined,
status: __expectString(output.status),
Expand All @@ -3657,6 +3671,23 @@ const deserializeAws_restJson1BatchJobExecutionSummaryList = (
return retVal;
};

const deserializeAws_restJson1BatchJobIdentifier = (output: any, context: __SerdeContext): BatchJobIdentifier => {
if (output.fileBatchJobIdentifier != null) {
return {
fileBatchJobIdentifier: deserializeAws_restJson1FileBatchJobIdentifier(output.fileBatchJobIdentifier, context),
};
}
if (output.scriptBatchJobIdentifier != null) {
return {
scriptBatchJobIdentifier: deserializeAws_restJson1ScriptBatchJobIdentifier(
output.scriptBatchJobIdentifier,
context
),
};
}
return { $unknown: Object.entries(output)[0] };
};

const deserializeAws_restJson1DatasetDetailOrgAttributes = (
output: any,
context: __SerdeContext
Expand Down Expand Up @@ -3844,6 +3875,16 @@ const deserializeAws_restJson1FileBatchJobDefinition = (
} as any;
};

const deserializeAws_restJson1FileBatchJobIdentifier = (
output: any,
context: __SerdeContext
): FileBatchJobIdentifier => {
return {
fileName: __expectString(output.fileName),
folderPath: __expectString(output.folderPath),
} as any;
};

const deserializeAws_restJson1FsxStorageConfiguration = (
output: any,
context: __SerdeContext
Expand Down Expand Up @@ -3935,6 +3976,15 @@ const deserializeAws_restJson1ScriptBatchJobDefinition = (
} as any;
};

const deserializeAws_restJson1ScriptBatchJobIdentifier = (
output: any,
context: __SerdeContext
): ScriptBatchJobIdentifier => {
return {
scriptName: __expectString(output.scriptName),
} as any;
};

const deserializeAws_restJson1StorageConfiguration = (output: any, context: __SerdeContext): StorageConfiguration => {
if (output.efs != null) {
return {
Expand Down
Loading

0 comments on commit 717df3e

Please sign in to comment.