Skip to content

Commit

Permalink
Merge pull request #27 from autodesk-platform-services/DAS-209
Browse files Browse the repository at this point in the history
[DAS 209] - Added Regions enum, Removed Inline models and Accumlated Docs team changes
  • Loading branch information
sajith-subramanian authored May 14, 2024
2 parents 504fe75 + 09814f6 commit 87f4a26
Show file tree
Hide file tree
Showing 75 changed files with 3,003 additions and 4,147 deletions.
3 changes: 2 additions & 1 deletion oss/source/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
/* eslint-disable */


export * from './api/ossapi';
export * from "./api/buckets-api"
export * from "./api/objects-api"

422 changes: 422 additions & 0 deletions oss/source/api/buckets-api.ts

Large diffs are not rendered by default.

2,127 changes: 2,127 additions & 0 deletions oss/source/api/objects-api.ts

Large diffs are not rendered by default.

2,629 changes: 0 additions & 2,629 deletions oss/source/api/ossapi.ts

This file was deleted.

17 changes: 9 additions & 8 deletions oss/source/custom-code/OSSFileTransfer.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { IAuthClient, SdkManager, ApiResponse, ApsServiceRequestConfig } from "@aps_sdk/autodesk-sdkmanager";
import { IFileTransferConfigurations } from './FileTransferConfigurations';
import { OSSApi } from "../api";
import { Completes3uploadBody, ObjectStatusEnum, Signeds3downloadResponse, Signeds3uploadResponse } from "../model";
import { ObjectsApi } from "../api";
import { Completes3uploadBody, DownloadStatus, Signeds3downloadResponse, Signeds3uploadResponse } from "../model";
import { OssApiError, RequestArgs } from "../base";
import { createRequestFunctionOss } from "../common";
import { WriteStream, createWriteStream } from "fs";
Expand All @@ -17,7 +17,7 @@ class Constants {
export class OSSFileTransfer implements IOSSFileTransfer {

public configuration: IFileTransferConfigurations;
public ossApi: OSSApi;
public objectApi: ObjectsApi;
public authentication: IAuthClient;

private maxRetryOnTokenExpiry: number;
Expand All @@ -36,7 +36,8 @@ export class OSSFileTransfer implements IOSSFileTransfer {

this.sdkManager = sdkmanager;
this.configuration = configuration;
this.ossApi = new OSSApi(this.sdkManager);
this.objectApi = new ObjectsApi(this.sdkManager);

this.maxChunkCountAllowed = this.configuration.getMaxChunkCountAllowed();
this.maxRetryOnUrlExpiry = this.configuration.getMaxRetryOnUrlExpiry();
this.maxRetryOnTokenExpiry = this.configuration.getMaxRetryOnTokenExpiry();
Expand Down Expand Up @@ -108,7 +109,7 @@ export class OSSFileTransfer implements IOSSFileTransfer {
onProgress?.(percentCompleted);
this.logger.logInfo(`${requestId} Number of chunks uploaded : ${chunksUploaded}`);
}
var completeResponse = await this.ossApi.completeSignedS3Upload(
var completeResponse = await this.objectApi.completeSignedS3Upload(
accessToken,
bucketKey,
objectKey,
Expand Down Expand Up @@ -201,7 +202,7 @@ export class OSSFileTransfer implements IOSSFileTransfer {
this.logger.logInfo(`${requestId} Refreshing URL attempt:${attemptcount}.`);
try {

var response = await this.ossApi.signedS3Upload(accessToken, bucketKey, objectKey, projectScope, parts, firstPart, uploadKey);
var response = await this.objectApi.signedS3Upload(accessToken, bucketKey, objectKey, projectScope, parts, firstPart, uploadKey);
return ([response.content, accessToken]);

} catch (e) {
Expand Down Expand Up @@ -252,8 +253,8 @@ export class OSSFileTransfer implements IOSSFileTransfer {
this.logger.logInfo(`${requestId} Get signed URL to download directly from S3 attempt: ${attemptCount}`);

try {
var objectStatusEnumString: string = ObjectStatusEnum.Complete;
var response = await this.ossApi.signedS3Download(accessToken, bucketKey, objectKey, requestId);
var objectStatusEnumString: string = DownloadStatus.Complete;
var response = await this.objectApi.signedS3Download(accessToken, bucketKey, objectKey, requestId);
if (response.content.status != objectStatusEnumString) {
this.logger.logError(`${requestId} File not available for download yet.`);
throw new OssApiError(`${requestId} File not available for download yet.`);
Expand Down
80 changes: 42 additions & 38 deletions oss/source/custom-code/OssClient.ts

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions oss/source/model/access.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/* tslint:disable */
/* eslint-disable */


/**
* Access for signed resource Acceptable values: read, write, readwrite Default value: read
* @export
* @enum {string}
*/

export const Access = {
Read: 'Read',
Write: 'Write',
ReadWrite: 'ReadWrite'
} as const;

export type Access = typeof Access[keyof typeof Access];



39 changes: 39 additions & 0 deletions oss/source/model/batch-completed-results-parts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/* tslint:disable */
/* eslint-disable */

import { Status } from './status';

/**
*
* @export
* @interface BatchCompletedResultsParts
*/
export interface BatchCompletedResultsParts {
/**
* The index of the first part in the multipart upload.
* @type {number}
* @memberof BatchCompletedResultsParts
*/
'firstPart'?: number;
/**
*
* @type {Status}
* @memberof BatchCompletedResultsParts
*/
'status'?: Status;
/**
* The size of the corresponding part detected in S3.
* @type {number}
* @memberof BatchCompletedResultsParts
*/
'size'?: number;
/**
* The eTag of the detected part in S3.
* @type {string}
* @memberof BatchCompletedResultsParts
*/
'eTag'?: string;
}



79 changes: 79 additions & 0 deletions oss/source/model/batch-completed-results.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/* tslint:disable */
/* eslint-disable */

import { BatchCompletedResultsParts } from './batch-completed-results-parts';

/**
*
* @export
* @interface BatchCompletedResults
*/
export interface BatchCompletedResults {
/**
* If this attribute is not returned, completion has succeeded. If the value of this attribute is \"error\", completion failed.\'
* @type {string}
* @memberof BatchCompletedResults
*/
'status'?: string;
/**
* The bucket key of the bucket the object was uploaded to.
* @type {string}
* @memberof BatchCompletedResults
*/
'bucketKey'?: string;
/**
* The URL-encoded human friendly name of the object.
* @type {string}
* @memberof BatchCompletedResults
*/
'objectKey'?: string;
/**
* An identifier (URN) that uniquely and persistently identifies the object.
* @type {string}
* @memberof BatchCompletedResults
*/
'objectId'?: string;
/**
* The total amount of storage space occupied by the object, in bytes.
* @type {number}
* @memberof BatchCompletedResults
*/
'size'?: number;
/**
* The format of the data stored within the object, expressed as a MIME type. This attribute is returned only if it was specified when the object was uploaded.
* @type {string}
* @memberof BatchCompletedResults
*/
'contentType'?: string;
/**
* The Content-Disposition value for the uploaded object as recorded within OSS. This attribute is returned only if it was specified when the object was uploaded.
* @type {string}
* @memberof BatchCompletedResults
*/
'contentDisposition'?: string;
/**
* The Content-Encoding value for the uploaded object as recorded within OSS. This attribute is returned only if it was specified when the object was uploaded.
* @type {string}
* @memberof BatchCompletedResults
*/
'contentEncoding'?: string;
/**
* The Cache-Control value for the uploaded object as recorded within OSS. This attribute is returned only if it was specified when the object was uploaded.
* @type {string}
* @memberof BatchCompletedResults
*/
'cacheControl'?: string;
/**
* An array containing the status of each part, indicating any issues with eTag or size mismatch issues.
* @type {Array<BatchCompletedResultsParts>}
* @memberof BatchCompletedResults
*/
'parts'?: Array<BatchCompletedResultsParts>;
/**
* The reason for the failure, if the status is ``error``.
* @type {string}
* @memberof BatchCompletedResults
*/
'reason'?: string;
}

24 changes: 0 additions & 24 deletions oss/source/model/batch-copy-objects.ts

This file was deleted.

19 changes: 0 additions & 19 deletions oss/source/model/batch-copy.ts

This file was deleted.

63 changes: 0 additions & 63 deletions oss/source/model/batch-delete-details.ts

This file was deleted.

57 changes: 0 additions & 57 deletions oss/source/model/batch-delete-list-processes.ts

This file was deleted.

19 changes: 0 additions & 19 deletions oss/source/model/batch-delete-list.ts

This file was deleted.

Loading

0 comments on commit 87f4a26

Please sign in to comment.