diff --git a/storage/.openapi-generator/FILES b/storage/.openapi-generator/FILES index c4dd2cf..1bf2e6a 100644 --- a/storage/.openapi-generator/FILES +++ b/storage/.openapi-generator/FILES @@ -1,31 +1,28 @@ .gitignore -.openapi-generator-ignore README.md api/openapi.yaml appveyor.yml docs/Bucket.md docs/BucketCreate.md -docs/BucketsApi.md +docs/BucketObject.md docs/EdgeAccessEnum.md +docs/ObjectResponseData.md docs/PaginatedBucketList.md -docs/PatchedBucket.md +docs/PaginatedBucketObjectList.md docs/ResponseBucket.md -docs/ResponseDeleteBucket.md -docs/ResponseDeleteBucketData.md docs/StateEnum.md +docs/StorageApi.md +docs/SuccessBucketOperation.md +docs/SuccessObjectOperation.md git_push.sh -src/storage.Test/Api/BucketsApiTests.cs -src/storage.Test/Model/BucketCreateTests.cs -src/storage.Test/Model/BucketTests.cs -src/storage.Test/Model/EdgeAccessEnumTests.cs -src/storage.Test/Model/PaginatedBucketListTests.cs -src/storage.Test/Model/PatchedBucketTests.cs -src/storage.Test/Model/ResponseBucketTests.cs -src/storage.Test/Model/ResponseDeleteBucketDataTests.cs -src/storage.Test/Model/ResponseDeleteBucketTests.cs -src/storage.Test/Model/StateEnumTests.cs +src/storage.Test/Api/StorageApiTests.cs +src/storage.Test/Model/BucketObjectTests.cs +src/storage.Test/Model/ObjectResponseDataTests.cs +src/storage.Test/Model/PaginatedBucketObjectListTests.cs +src/storage.Test/Model/SuccessBucketOperationTests.cs +src/storage.Test/Model/SuccessObjectOperationTests.cs src/storage.Test/storage.Test.csproj -src/storage/Api/BucketsApi.cs +src/storage/Api/StorageApi.cs src/storage/Client/ApiClient.cs src/storage/Client/ApiException.cs src/storage/Client/ApiResponse.cs @@ -45,12 +42,14 @@ src/storage/Client/RetryConfiguration.cs src/storage/Model/AbstractOpenAPISchema.cs src/storage/Model/Bucket.cs src/storage/Model/BucketCreate.cs +src/storage/Model/BucketObject.cs src/storage/Model/EdgeAccessEnum.cs +src/storage/Model/ObjectResponseData.cs src/storage/Model/PaginatedBucketList.cs -src/storage/Model/PatchedBucket.cs +src/storage/Model/PaginatedBucketObjectList.cs src/storage/Model/ResponseBucket.cs -src/storage/Model/ResponseDeleteBucket.cs -src/storage/Model/ResponseDeleteBucketData.cs src/storage/Model/StateEnum.cs +src/storage/Model/SuccessBucketOperation.cs +src/storage/Model/SuccessObjectOperation.cs src/storage/storage.csproj storage.sln diff --git a/storage/README.md b/storage/README.md index 237d946..9aa22b5 100644 --- a/storage/README.md +++ b/storage/README.md @@ -90,18 +90,18 @@ namespace Example // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // config.ApiKeyPrefix.Add("Authorization", "Bearer"); - var apiInstance = new BucketsApi(config); + var apiInstance = new StorageApi(config); var bucketCreate = new BucketCreate(); // BucketCreate | try { - // /v4/storage/buckets - ResponseBucket result = apiInstance.ApiV1StorageBucketsCreate(bucketCreate); + // Create a new bucket + ResponseBucket result = apiInstance.StorageApiBucketsCreate(bucketCreate); Debug.WriteLine(result); } catch (ApiException e) { - Debug.Print("Exception when calling BucketsApi.ApiV1StorageBucketsCreate: " + e.Message ); + Debug.Print("Exception when calling StorageApi.StorageApiBucketsCreate: " + e.Message ); Debug.Print("Status Code: "+ e.ErrorCode); Debug.Print(e.StackTrace); } @@ -118,10 +118,15 @@ All URIs are relative to *https://api.azion.com* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*BucketsApi* | [**ApiV1StorageBucketsCreate**](docs/BucketsApi.md#apiv1storagebucketscreate) | **POST** /v4/storage/buckets | /v4/storage/buckets -*BucketsApi* | [**ApiV1StorageBucketsDestroy**](docs/BucketsApi.md#apiv1storagebucketsdestroy) | **DELETE** /v4/storage/buckets/{name} | /v4/storage/buckets/:name -*BucketsApi* | [**ApiV1StorageBucketsList**](docs/BucketsApi.md#apiv1storagebucketslist) | **GET** /v4/storage/buckets | /v4/storage/buckets -*BucketsApi* | [**ApiV1StorageBucketsPartialUpdate**](docs/BucketsApi.md#apiv1storagebucketspartialupdate) | **PATCH** /v4/storage/buckets/{name} | /v4/storage/buckets/:name +*StorageApi* | [**StorageApiBucketsCreate**](docs/StorageApi.md#storageapibucketscreate) | **POST** /v4/storage/buckets | Create a new bucket +*StorageApi* | [**StorageApiBucketsDestroy**](docs/StorageApi.md#storageapibucketsdestroy) | **DELETE** /v4/storage/buckets/{name} | Delete a bucket +*StorageApi* | [**StorageApiBucketsList**](docs/StorageApi.md#storageapibucketslist) | **GET** /v4/storage/buckets | List buckets +*StorageApi* | [**StorageApiBucketsObjectsCreate**](docs/StorageApi.md#storageapibucketsobjectscreate) | **POST** /v4/storage/buckets/{bucket_name}/objects/{object_key} | Create new object key +*StorageApi* | [**StorageApiBucketsObjectsDestroy**](docs/StorageApi.md#storageapibucketsobjectsdestroy) | **DELETE** /v4/storage/buckets/{bucket_name}/objects/{object_key} | Delete object key +*StorageApi* | [**StorageApiBucketsObjectsList**](docs/StorageApi.md#storageapibucketsobjectslist) | **GET** /v4/storage/buckets/{bucket_name}/objects | List buckets objects +*StorageApi* | [**StorageApiBucketsObjectsRetrieve**](docs/StorageApi.md#storageapibucketsobjectsretrieve) | **GET** /v4/storage/buckets/{bucket_name}/objects/{object_key} | Download object +*StorageApi* | [**StorageApiBucketsObjectsUpdate**](docs/StorageApi.md#storageapibucketsobjectsupdate) | **PUT** /v4/storage/buckets/{bucket_name}/objects/{object_key} | Update the object key +*StorageApi* | [**StorageApiBucketsPartialUpdate**](docs/StorageApi.md#storageapibucketspartialupdate) | **PATCH** /v4/storage/buckets/{name} | Update bucket info @@ -129,13 +134,15 @@ Class | Method | HTTP request | Description - [Model.Bucket](docs/Bucket.md) - [Model.BucketCreate](docs/BucketCreate.md) + - [Model.BucketObject](docs/BucketObject.md) - [Model.EdgeAccessEnum](docs/EdgeAccessEnum.md) + - [Model.ObjectResponseData](docs/ObjectResponseData.md) - [Model.PaginatedBucketList](docs/PaginatedBucketList.md) - - [Model.PatchedBucket](docs/PatchedBucket.md) + - [Model.PaginatedBucketObjectList](docs/PaginatedBucketObjectList.md) - [Model.ResponseBucket](docs/ResponseBucket.md) - - [Model.ResponseDeleteBucket](docs/ResponseDeleteBucket.md) - - [Model.ResponseDeleteBucketData](docs/ResponseDeleteBucketData.md) - [Model.StateEnum](docs/StateEnum.md) + - [Model.SuccessBucketOperation](docs/SuccessBucketOperation.md) + - [Model.SuccessObjectOperation](docs/SuccessObjectOperation.md) diff --git a/storage/api/openapi.yaml b/storage/api/openapi.yaml index 49b6035..b50d997 100644 --- a/storage/api/openapi.yaml +++ b/storage/api/openapi.yaml @@ -13,7 +13,7 @@ paths: /v4/storage/buckets: get: description: "" - operationId: api_v1_storage_buckets_list + operationId: storage_api_buckets_list parameters: - description: A page number within the paginated result set. explode: true @@ -52,12 +52,12 @@ paths: description: Forbidden security: - tokenAuth: [] - summary: /v4/storage/buckets + summary: List buckets tags: - - buckets + - storage post: description: "" - operationId: api_v1_storage_buckets_create + operationId: storage_api_buckets_create requestBody: content: application/json: @@ -97,27 +97,43 @@ paths: description: "" security: - tokenAuth: [] - summary: /v4/storage/buckets + summary: Create a new bucket tags: - - buckets - /v4/storage/buckets/{name}: - delete: + - storage + /v4/storage/buckets/{bucket_name}/objects: + get: description: "" - operationId: api_v1_storage_buckets_destroy + operationId: storage_api_buckets_objects_list parameters: - explode: false in: path - name: name + name: bucket_name required: true schema: type: string style: simple + - description: A page number within the paginated result set. + explode: true + in: query + name: page + required: false + schema: + type: integer + style: form + - description: Number of results to return per page. + explode: true + in: query + name: page_size + required: false + schema: + type: integer + style: form responses: "200": content: application/json: schema: - $ref: '#/components/schemas/ResponseDeleteBucket' + $ref: '#/components/schemas/PaginatedBucketObjectList' description: "" "400": description: Bad Request @@ -131,39 +147,242 @@ paths: description: Unauthorized "403": description: Forbidden - "202": + security: + - tokenAuth: [] + summary: List buckets objects + tags: + - storage + /v4/storage/buckets/{bucket_name}/objects/{object_key}: + delete: + description: Delete an object key from bucket + operationId: storage_api_buckets_objects_destroy + parameters: + - explode: false + in: path + name: bucket_name + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: object_key + required: true + schema: + type: string + style: simple + responses: + "200": content: application/json: schema: - $ref: '#/components/schemas/ResponseBucket' + $ref: '#/components/schemas/SuccessObjectOperation' description: "" + "400": + description: Bad Request + "404": + description: Not Found + "406": + description: Not Acceptable + "429": + description: Too Many Requests + "401": + description: Unauthorized + "403": + description: Forbidden security: - tokenAuth: [] - summary: /v4/storage/buckets/:name + summary: Delete object key tags: - - buckets - patch: - description: "" - operationId: api_v1_storage_buckets_partial_update + - storage + get: + description: Download the object key from bucket. + operationId: storage_api_buckets_objects_retrieve parameters: - explode: false in: path - name: name + name: bucket_name + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: object_key + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/octet-stream: + schema: + format: binary + type: string + description: "" + "400": + description: Bad Request + "404": + description: Not Found + "406": + description: Not Acceptable + "429": + description: Too Many Requests + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - tokenAuth: [] + summary: Download object + tags: + - storage + post: + description: Create a new object key in the bucket. + operationId: storage_api_buckets_objects_create + parameters: + - explode: false + in: path + name: bucket_name + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: object_key required: true schema: type: string style: simple requestBody: content: - application/json: - schema: - $ref: '#/components/schemas/PatchedBucket' - application/x-www-form-urlencoded: + application/octet-stream: schema: - $ref: '#/components/schemas/PatchedBucket' - multipart/form-data: + additionalProperties: {} + description: Unspecified request body + type: object + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessObjectOperation' + description: "" + "400": + description: Bad Request + "404": + description: Not Found + "406": + description: Not Acceptable + "429": + description: Too Many Requests + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - tokenAuth: [] + summary: Create new object key + tags: + - storage + put: + description: Update the object key from bucket. + operationId: storage_api_buckets_objects_update + parameters: + - explode: false + in: path + name: bucket_name + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: object_key + required: true + schema: + type: string + style: simple + requestBody: + content: + application/octet-stream: schema: - $ref: '#/components/schemas/PatchedBucket' + additionalProperties: {} + description: Unspecified request body + type: object + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessObjectOperation' + description: "" + "400": + description: Bad Request + "404": + description: Not Found + "406": + description: Not Acceptable + "429": + description: Too Many Requests + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - tokenAuth: [] + summary: Update the object key + tags: + - storage + /v4/storage/buckets/{name}: + delete: + description: "" + operationId: storage_api_buckets_destroy + parameters: + - explode: false + in: path + name: name + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessBucketOperation' + description: "" + "400": + description: Bad Request + "404": + description: Not Found + "406": + description: Not Acceptable + "429": + description: Too Many Requests + "401": + description: Unauthorized + "403": + description: Forbidden + security: + - tokenAuth: [] + summary: Delete a bucket + tags: + - storage + patch: + description: "" + operationId: storage_api_buckets_partial_update + parameters: + - explode: false + in: path + name: name + required: true + schema: + type: string + style: simple responses: "200": content: @@ -191,9 +410,9 @@ paths: description: "" security: - tokenAuth: [] - summary: /v4/storage/buckets/:name + summary: Update bucket info tags: - - buckets + - storage components: schemas: Bucket: @@ -227,12 +446,47 @@ components: - edge_access - name type: object + BucketObject: + example: + size: 0 + etag: etag + last_modified: 2000-01-23T04:56:07.000+00:00 + key: key + properties: + key: + readOnly: true + type: string + last_modified: + format: date-time + readOnly: true + type: string + size: + readOnly: true + type: integer + etag: + readOnly: true + type: string + required: + - etag + - key + - last_modified + - size + type: object EdgeAccessEnum: enum: - read_only - read_write - restricted type: string + ObjectResponseData: + example: + object_key: object_key + properties: + object_key: + type: string + required: + - object_key + type: object PaginatedBucketList: example: next: http://api.example.org/accounts/?page=4 @@ -262,18 +516,38 @@ components: $ref: '#/components/schemas/Bucket' type: array type: object - PatchedBucket: + PaginatedBucketObjectList: example: - edge_access: null - name: name + next: http://api.example.org/accounts/?page=4 + previous: http://api.example.org/accounts/?page=2 + count: 123 + results: + - size: 0 + etag: etag + last_modified: 2000-01-23T04:56:07.000+00:00 + key: key + - size: 0 + etag: etag + last_modified: 2000-01-23T04:56:07.000+00:00 + key: key properties: - name: - maxLength: 63 - minLength: 6 - readOnly: true + count: + example: 123 + type: integer + next: + example: http://api.example.org/accounts/?page=4 + format: uri + nullable: true type: string - edge_access: - $ref: '#/components/schemas/EdgeAccessEnum' + previous: + example: http://api.example.org/accounts/?page=2 + format: uri + nullable: true + type: string + results: + items: + $ref: '#/components/schemas/BucketObject' + type: array type: object ResponseBucket: example: @@ -290,28 +564,43 @@ components: - data - state type: object - ResponseDeleteBucket: + StateEnum: + enum: + - pending + - executed + type: string + SuccessBucketOperation: example: - data: null - state: null + data: + edge_access: null + name: name + state: "" properties: state: - $ref: '#/components/schemas/StateEnum' + allOf: + - $ref: '#/components/schemas/StateEnum' + title: BucketStateEnum data: - $ref: '#/components/schemas/ResponseDeleteBucket_data' + $ref: '#/components/schemas/Bucket' required: - data - state type: object - StateEnum: - enum: - - pending - - executed - type: string - ResponseDeleteBucket_data: - allOf: - - $ref: '#/components/schemas/Bucket' - nullable: true + SuccessObjectOperation: + example: + data: + object_key: object_key + state: "" + properties: + state: + allOf: + - $ref: '#/components/schemas/StateEnum' + title: ObjectStateEnum + data: + $ref: '#/components/schemas/ObjectResponseData' + required: + - data + - state type: object securitySchemes: tokenAuth: diff --git a/storage/docs/BucketObject.md b/storage/docs/BucketObject.md new file mode 100644 index 0000000..61286e5 --- /dev/null +++ b/storage/docs/BucketObject.md @@ -0,0 +1,13 @@ +# storage.Model.BucketObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Key** | **string** | | [readonly] +**LastModified** | **DateTime** | | [readonly] +**Size** | **int** | | [readonly] +**Etag** | **string** | | [readonly] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/storage/docs/ObjectResponseData.md b/storage/docs/ObjectResponseData.md new file mode 100644 index 0000000..1b8ab50 --- /dev/null +++ b/storage/docs/ObjectResponseData.md @@ -0,0 +1,10 @@ +# storage.Model.ObjectResponseData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ObjectKey** | **string** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/storage/docs/PaginatedBucketObjectList.md b/storage/docs/PaginatedBucketObjectList.md new file mode 100644 index 0000000..90c5f17 --- /dev/null +++ b/storage/docs/PaginatedBucketObjectList.md @@ -0,0 +1,13 @@ +# storage.Model.PaginatedBucketObjectList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Count** | **int** | | [optional] +**Next** | **string** | | [optional] +**Previous** | **string** | | [optional] +**Results** | [**List<BucketObject>**](BucketObject.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/storage/docs/StorageApi.md b/storage/docs/StorageApi.md new file mode 100644 index 0000000..44b3f9f --- /dev/null +++ b/storage/docs/StorageApi.md @@ -0,0 +1,944 @@ +# storage.Api.StorageApi + +All URIs are relative to *https://api.azion.com* + +| Method | HTTP request | Description | +|--------|--------------|-------------| +| [**StorageApiBucketsCreate**](StorageApi.md#storageapibucketscreate) | **POST** /v4/storage/buckets | Create a new bucket | +| [**StorageApiBucketsDestroy**](StorageApi.md#storageapibucketsdestroy) | **DELETE** /v4/storage/buckets/{name} | Delete a bucket | +| [**StorageApiBucketsList**](StorageApi.md#storageapibucketslist) | **GET** /v4/storage/buckets | List buckets | +| [**StorageApiBucketsObjectsCreate**](StorageApi.md#storageapibucketsobjectscreate) | **POST** /v4/storage/buckets/{bucket_name}/objects/{object_key} | Create new object key | +| [**StorageApiBucketsObjectsDestroy**](StorageApi.md#storageapibucketsobjectsdestroy) | **DELETE** /v4/storage/buckets/{bucket_name}/objects/{object_key} | Delete object key | +| [**StorageApiBucketsObjectsList**](StorageApi.md#storageapibucketsobjectslist) | **GET** /v4/storage/buckets/{bucket_name}/objects | List buckets objects | +| [**StorageApiBucketsObjectsRetrieve**](StorageApi.md#storageapibucketsobjectsretrieve) | **GET** /v4/storage/buckets/{bucket_name}/objects/{object_key} | Download object | +| [**StorageApiBucketsObjectsUpdate**](StorageApi.md#storageapibucketsobjectsupdate) | **PUT** /v4/storage/buckets/{bucket_name}/objects/{object_key} | Update the object key | +| [**StorageApiBucketsPartialUpdate**](StorageApi.md#storageapibucketspartialupdate) | **PATCH** /v4/storage/buckets/{name} | Update bucket info | + + +# **StorageApiBucketsCreate** +> ResponseBucket StorageApiBucketsCreate (BucketCreate bucketCreate) + +Create a new bucket + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using storage.Api; +using storage.Client; +using storage.Model; + +namespace Example +{ + public class StorageApiBucketsCreateExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "https://api.azion.com"; + // Configure API key authorization: tokenAuth + config.AddApiKey("Authorization", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("Authorization", "Bearer"); + + var apiInstance = new StorageApi(config); + var bucketCreate = new BucketCreate(); // BucketCreate | + + try + { + // Create a new bucket + ResponseBucket result = apiInstance.StorageApiBucketsCreate(bucketCreate); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StorageApi.StorageApiBucketsCreate: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the StorageApiBucketsCreateWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Create a new bucket + ApiResponse response = apiInstance.StorageApiBucketsCreateWithHttpInfo(bucketCreate); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling StorageApi.StorageApiBucketsCreateWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **bucketCreate** | [**BucketCreate**](BucketCreate.md) | | | + +### Return type + +[**ResponseBucket**](ResponseBucket.md) + +### Authorization + +[tokenAuth](../README.md#tokenAuth) + +### HTTP request headers + + - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | | - | +| **400** | Bad Request | - | +| **404** | Not Found | - | +| **406** | Not Acceptable | - | +| **429** | Too Many Requests | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **202** | | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **StorageApiBucketsDestroy** +> SuccessBucketOperation StorageApiBucketsDestroy (string name) + +Delete a bucket + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using storage.Api; +using storage.Client; +using storage.Model; + +namespace Example +{ + public class StorageApiBucketsDestroyExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "https://api.azion.com"; + // Configure API key authorization: tokenAuth + config.AddApiKey("Authorization", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("Authorization", "Bearer"); + + var apiInstance = new StorageApi(config); + var name = "name_example"; // string | + + try + { + // Delete a bucket + SuccessBucketOperation result = apiInstance.StorageApiBucketsDestroy(name); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StorageApi.StorageApiBucketsDestroy: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the StorageApiBucketsDestroyWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Delete a bucket + ApiResponse response = apiInstance.StorageApiBucketsDestroyWithHttpInfo(name); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling StorageApi.StorageApiBucketsDestroyWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **name** | **string** | | | + +### Return type + +[**SuccessBucketOperation**](SuccessBucketOperation.md) + +### Authorization + +[tokenAuth](../README.md#tokenAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **400** | Bad Request | - | +| **404** | Not Found | - | +| **406** | Not Acceptable | - | +| **429** | Too Many Requests | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **StorageApiBucketsList** +> PaginatedBucketList StorageApiBucketsList (int? page = null, int? pageSize = null) + +List buckets + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using storage.Api; +using storage.Client; +using storage.Model; + +namespace Example +{ + public class StorageApiBucketsListExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "https://api.azion.com"; + // Configure API key authorization: tokenAuth + config.AddApiKey("Authorization", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("Authorization", "Bearer"); + + var apiInstance = new StorageApi(config); + var page = 56; // int? | A page number within the paginated result set. (optional) + var pageSize = 56; // int? | Number of results to return per page. (optional) + + try + { + // List buckets + PaginatedBucketList result = apiInstance.StorageApiBucketsList(page, pageSize); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StorageApi.StorageApiBucketsList: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the StorageApiBucketsListWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // List buckets + ApiResponse response = apiInstance.StorageApiBucketsListWithHttpInfo(page, pageSize); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling StorageApi.StorageApiBucketsListWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **page** | **int?** | A page number within the paginated result set. | [optional] | +| **pageSize** | **int?** | Number of results to return per page. | [optional] | + +### Return type + +[**PaginatedBucketList**](PaginatedBucketList.md) + +### Authorization + +[tokenAuth](../README.md#tokenAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **400** | Bad Request | - | +| **404** | Not Found | - | +| **406** | Not Acceptable | - | +| **429** | Too Many Requests | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **StorageApiBucketsObjectsCreate** +> SuccessObjectOperation StorageApiBucketsObjectsCreate (string bucketName, string objectKey, Dictionary? requestBody = null) + +Create new object key + +Create a new object key in the bucket. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using storage.Api; +using storage.Client; +using storage.Model; + +namespace Example +{ + public class StorageApiBucketsObjectsCreateExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "https://api.azion.com"; + // Configure API key authorization: tokenAuth + config.AddApiKey("Authorization", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("Authorization", "Bearer"); + + var apiInstance = new StorageApi(config); + var bucketName = "bucketName_example"; // string | + var objectKey = "objectKey_example"; // string | + var requestBody = new Dictionary?(); // Dictionary? | (optional) + + try + { + // Create new object key + SuccessObjectOperation result = apiInstance.StorageApiBucketsObjectsCreate(bucketName, objectKey, requestBody); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StorageApi.StorageApiBucketsObjectsCreate: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the StorageApiBucketsObjectsCreateWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Create new object key + ApiResponse response = apiInstance.StorageApiBucketsObjectsCreateWithHttpInfo(bucketName, objectKey, requestBody); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling StorageApi.StorageApiBucketsObjectsCreateWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **bucketName** | **string** | | | +| **objectKey** | **string** | | | +| **requestBody** | [**Dictionary<string, Object>?**](Object.md) | | [optional] | + +### Return type + +[**SuccessObjectOperation**](SuccessObjectOperation.md) + +### Authorization + +[tokenAuth](../README.md#tokenAuth) + +### HTTP request headers + + - **Content-Type**: application/octet-stream + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **400** | Bad Request | - | +| **404** | Not Found | - | +| **406** | Not Acceptable | - | +| **429** | Too Many Requests | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **StorageApiBucketsObjectsDestroy** +> SuccessObjectOperation StorageApiBucketsObjectsDestroy (string bucketName, string objectKey) + +Delete object key + +Delete an object key from bucket + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using storage.Api; +using storage.Client; +using storage.Model; + +namespace Example +{ + public class StorageApiBucketsObjectsDestroyExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "https://api.azion.com"; + // Configure API key authorization: tokenAuth + config.AddApiKey("Authorization", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("Authorization", "Bearer"); + + var apiInstance = new StorageApi(config); + var bucketName = "bucketName_example"; // string | + var objectKey = "objectKey_example"; // string | + + try + { + // Delete object key + SuccessObjectOperation result = apiInstance.StorageApiBucketsObjectsDestroy(bucketName, objectKey); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StorageApi.StorageApiBucketsObjectsDestroy: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the StorageApiBucketsObjectsDestroyWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Delete object key + ApiResponse response = apiInstance.StorageApiBucketsObjectsDestroyWithHttpInfo(bucketName, objectKey); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling StorageApi.StorageApiBucketsObjectsDestroyWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **bucketName** | **string** | | | +| **objectKey** | **string** | | | + +### Return type + +[**SuccessObjectOperation**](SuccessObjectOperation.md) + +### Authorization + +[tokenAuth](../README.md#tokenAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **400** | Bad Request | - | +| **404** | Not Found | - | +| **406** | Not Acceptable | - | +| **429** | Too Many Requests | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **StorageApiBucketsObjectsList** +> PaginatedBucketObjectList StorageApiBucketsObjectsList (string bucketName, int? page = null, int? pageSize = null) + +List buckets objects + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using storage.Api; +using storage.Client; +using storage.Model; + +namespace Example +{ + public class StorageApiBucketsObjectsListExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "https://api.azion.com"; + // Configure API key authorization: tokenAuth + config.AddApiKey("Authorization", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("Authorization", "Bearer"); + + var apiInstance = new StorageApi(config); + var bucketName = "bucketName_example"; // string | + var page = 56; // int? | A page number within the paginated result set. (optional) + var pageSize = 56; // int? | Number of results to return per page. (optional) + + try + { + // List buckets objects + PaginatedBucketObjectList result = apiInstance.StorageApiBucketsObjectsList(bucketName, page, pageSize); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StorageApi.StorageApiBucketsObjectsList: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the StorageApiBucketsObjectsListWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // List buckets objects + ApiResponse response = apiInstance.StorageApiBucketsObjectsListWithHttpInfo(bucketName, page, pageSize); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling StorageApi.StorageApiBucketsObjectsListWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **bucketName** | **string** | | | +| **page** | **int?** | A page number within the paginated result set. | [optional] | +| **pageSize** | **int?** | Number of results to return per page. | [optional] | + +### Return type + +[**PaginatedBucketObjectList**](PaginatedBucketObjectList.md) + +### Authorization + +[tokenAuth](../README.md#tokenAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **400** | Bad Request | - | +| **404** | Not Found | - | +| **406** | Not Acceptable | - | +| **429** | Too Many Requests | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **StorageApiBucketsObjectsRetrieve** +> System.IO.Stream StorageApiBucketsObjectsRetrieve (string bucketName, string objectKey) + +Download object + +Download the object key from bucket. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using storage.Api; +using storage.Client; +using storage.Model; + +namespace Example +{ + public class StorageApiBucketsObjectsRetrieveExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "https://api.azion.com"; + // Configure API key authorization: tokenAuth + config.AddApiKey("Authorization", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("Authorization", "Bearer"); + + var apiInstance = new StorageApi(config); + var bucketName = "bucketName_example"; // string | + var objectKey = "objectKey_example"; // string | + + try + { + // Download object + System.IO.Stream result = apiInstance.StorageApiBucketsObjectsRetrieve(bucketName, objectKey); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StorageApi.StorageApiBucketsObjectsRetrieve: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the StorageApiBucketsObjectsRetrieveWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Download object + ApiResponse response = apiInstance.StorageApiBucketsObjectsRetrieveWithHttpInfo(bucketName, objectKey); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling StorageApi.StorageApiBucketsObjectsRetrieveWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **bucketName** | **string** | | | +| **objectKey** | **string** | | | + +### Return type + +**System.IO.Stream** + +### Authorization + +[tokenAuth](../README.md#tokenAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/octet-stream + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **400** | Bad Request | - | +| **404** | Not Found | - | +| **406** | Not Acceptable | - | +| **429** | Too Many Requests | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **StorageApiBucketsObjectsUpdate** +> SuccessObjectOperation StorageApiBucketsObjectsUpdate (string bucketName, string objectKey, Dictionary? requestBody = null) + +Update the object key + +Update the object key from bucket. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using storage.Api; +using storage.Client; +using storage.Model; + +namespace Example +{ + public class StorageApiBucketsObjectsUpdateExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "https://api.azion.com"; + // Configure API key authorization: tokenAuth + config.AddApiKey("Authorization", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("Authorization", "Bearer"); + + var apiInstance = new StorageApi(config); + var bucketName = "bucketName_example"; // string | + var objectKey = "objectKey_example"; // string | + var requestBody = new Dictionary?(); // Dictionary? | (optional) + + try + { + // Update the object key + SuccessObjectOperation result = apiInstance.StorageApiBucketsObjectsUpdate(bucketName, objectKey, requestBody); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StorageApi.StorageApiBucketsObjectsUpdate: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the StorageApiBucketsObjectsUpdateWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Update the object key + ApiResponse response = apiInstance.StorageApiBucketsObjectsUpdateWithHttpInfo(bucketName, objectKey, requestBody); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling StorageApi.StorageApiBucketsObjectsUpdateWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **bucketName** | **string** | | | +| **objectKey** | **string** | | | +| **requestBody** | [**Dictionary<string, Object>?**](Object.md) | | [optional] | + +### Return type + +[**SuccessObjectOperation**](SuccessObjectOperation.md) + +### Authorization + +[tokenAuth](../README.md#tokenAuth) + +### HTTP request headers + + - **Content-Type**: application/octet-stream + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **400** | Bad Request | - | +| **404** | Not Found | - | +| **406** | Not Acceptable | - | +| **429** | Too Many Requests | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **StorageApiBucketsPartialUpdate** +> ResponseBucket StorageApiBucketsPartialUpdate (string name) + +Update bucket info + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using storage.Api; +using storage.Client; +using storage.Model; + +namespace Example +{ + public class StorageApiBucketsPartialUpdateExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "https://api.azion.com"; + // Configure API key authorization: tokenAuth + config.AddApiKey("Authorization", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("Authorization", "Bearer"); + + var apiInstance = new StorageApi(config); + var name = "name_example"; // string | + + try + { + // Update bucket info + ResponseBucket result = apiInstance.StorageApiBucketsPartialUpdate(name); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StorageApi.StorageApiBucketsPartialUpdate: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the StorageApiBucketsPartialUpdateWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Update bucket info + ApiResponse response = apiInstance.StorageApiBucketsPartialUpdateWithHttpInfo(name); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling StorageApi.StorageApiBucketsPartialUpdateWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **name** | **string** | | | + +### Return type + +[**ResponseBucket**](ResponseBucket.md) + +### Authorization + +[tokenAuth](../README.md#tokenAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | +| **400** | Bad Request | - | +| **404** | Not Found | - | +| **406** | Not Acceptable | - | +| **429** | Too Many Requests | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **202** | | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/storage/docs/SuccessBucketOperation.md b/storage/docs/SuccessBucketOperation.md new file mode 100644 index 0000000..2d198ce --- /dev/null +++ b/storage/docs/SuccessBucketOperation.md @@ -0,0 +1,11 @@ +# storage.Model.SuccessBucketOperation + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**State** | **StateEnum** | | +**Data** | [**Bucket**](Bucket.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/storage/docs/SuccessObjectOperation.md b/storage/docs/SuccessObjectOperation.md new file mode 100644 index 0000000..358d197 --- /dev/null +++ b/storage/docs/SuccessObjectOperation.md @@ -0,0 +1,11 @@ +# storage.Model.SuccessObjectOperation + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**State** | **StateEnum** | | +**Data** | [**ObjectResponseData**](ObjectResponseData.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/storage/src/storage.Test/Api/StorageApiTests.cs b/storage/src/storage.Test/Api/StorageApiTests.cs new file mode 100644 index 0000000..c9c1208 --- /dev/null +++ b/storage/src/storage.Test/Api/StorageApiTests.cs @@ -0,0 +1,174 @@ +/* + * Object Storage + * + * REST API OpenAPI documentation for the Object Storage + * + * The version of the OpenAPI document: 1.0.0 (v1) + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using RestSharp; +using Xunit; + +using storage.Client; +using storage.Api; +// uncomment below to import models +//using storage.Model; + +namespace storage.Test.Api +{ + /// + /// Class for testing StorageApi + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the API endpoint. + /// + public class StorageApiTests : IDisposable + { + private StorageApi instance; + + public StorageApiTests() + { + instance = new StorageApi(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of StorageApi + /// + [Fact] + public void InstanceTest() + { + // TODO uncomment below to test 'IsType' StorageApi + //Assert.IsType(instance); + } + + /// + /// Test StorageApiBucketsCreate + /// + [Fact] + public void StorageApiBucketsCreateTest() + { + // TODO uncomment below to test the method and replace null with proper value + //BucketCreate bucketCreate = null; + //var response = instance.StorageApiBucketsCreate(bucketCreate); + //Assert.IsType(response); + } + + /// + /// Test StorageApiBucketsDestroy + /// + [Fact] + public void StorageApiBucketsDestroyTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string name = null; + //var response = instance.StorageApiBucketsDestroy(name); + //Assert.IsType(response); + } + + /// + /// Test StorageApiBucketsList + /// + [Fact] + public void StorageApiBucketsListTest() + { + // TODO uncomment below to test the method and replace null with proper value + //int? page = null; + //int? pageSize = null; + //var response = instance.StorageApiBucketsList(page, pageSize); + //Assert.IsType(response); + } + + /// + /// Test StorageApiBucketsObjectsCreate + /// + [Fact] + public void StorageApiBucketsObjectsCreateTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string bucketName = null; + //string objectKey = null; + //Dictionary? requestBody = null; + //var response = instance.StorageApiBucketsObjectsCreate(bucketName, objectKey, requestBody); + //Assert.IsType(response); + } + + /// + /// Test StorageApiBucketsObjectsDestroy + /// + [Fact] + public void StorageApiBucketsObjectsDestroyTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string bucketName = null; + //string objectKey = null; + //var response = instance.StorageApiBucketsObjectsDestroy(bucketName, objectKey); + //Assert.IsType(response); + } + + /// + /// Test StorageApiBucketsObjectsList + /// + [Fact] + public void StorageApiBucketsObjectsListTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string bucketName = null; + //int? page = null; + //int? pageSize = null; + //var response = instance.StorageApiBucketsObjectsList(bucketName, page, pageSize); + //Assert.IsType(response); + } + + /// + /// Test StorageApiBucketsObjectsRetrieve + /// + [Fact] + public void StorageApiBucketsObjectsRetrieveTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string bucketName = null; + //string objectKey = null; + //var response = instance.StorageApiBucketsObjectsRetrieve(bucketName, objectKey); + //Assert.IsType(response); + } + + /// + /// Test StorageApiBucketsObjectsUpdate + /// + [Fact] + public void StorageApiBucketsObjectsUpdateTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string bucketName = null; + //string objectKey = null; + //Dictionary? requestBody = null; + //var response = instance.StorageApiBucketsObjectsUpdate(bucketName, objectKey, requestBody); + //Assert.IsType(response); + } + + /// + /// Test StorageApiBucketsPartialUpdate + /// + [Fact] + public void StorageApiBucketsPartialUpdateTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string name = null; + //var response = instance.StorageApiBucketsPartialUpdate(name); + //Assert.IsType(response); + } + } +} diff --git a/storage/src/storage.Test/Model/BucketObjectTests.cs b/storage/src/storage.Test/Model/BucketObjectTests.cs new file mode 100644 index 0000000..acfbfce --- /dev/null +++ b/storage/src/storage.Test/Model/BucketObjectTests.cs @@ -0,0 +1,93 @@ +/* + * Object Storage + * + * REST API OpenAPI documentation for the Object Storage + * + * The version of the OpenAPI document: 1.0.0 (v1) + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using storage.Model; +using storage.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace storage.Test.Model +{ + /// + /// Class for testing BucketObject + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BucketObjectTests : IDisposable + { + // TODO uncomment below to declare an instance variable for BucketObject + //private BucketObject instance; + + public BucketObjectTests() + { + // TODO uncomment below to create an instance of BucketObject + //instance = new BucketObject(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of BucketObject + /// + [Fact] + public void BucketObjectInstanceTest() + { + // TODO uncomment below to test "IsType" BucketObject + //Assert.IsType(instance); + } + + /// + /// Test the property 'Key' + /// + [Fact] + public void KeyTest() + { + // TODO unit test for the property 'Key' + } + + /// + /// Test the property 'LastModified' + /// + [Fact] + public void LastModifiedTest() + { + // TODO unit test for the property 'LastModified' + } + + /// + /// Test the property 'Size' + /// + [Fact] + public void SizeTest() + { + // TODO unit test for the property 'Size' + } + + /// + /// Test the property 'Etag' + /// + [Fact] + public void EtagTest() + { + // TODO unit test for the property 'Etag' + } + } +} diff --git a/storage/src/storage.Test/Model/ObjectResponseDataTests.cs b/storage/src/storage.Test/Model/ObjectResponseDataTests.cs new file mode 100644 index 0000000..0524b51 --- /dev/null +++ b/storage/src/storage.Test/Model/ObjectResponseDataTests.cs @@ -0,0 +1,66 @@ +/* + * Object Storage + * + * REST API OpenAPI documentation for the Object Storage + * + * The version of the OpenAPI document: 1.0.0 (v1) + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using storage.Model; +using storage.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace storage.Test.Model +{ + /// + /// Class for testing ObjectResponseData + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ObjectResponseDataTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ObjectResponseData + //private ObjectResponseData instance; + + public ObjectResponseDataTests() + { + // TODO uncomment below to create an instance of ObjectResponseData + //instance = new ObjectResponseData(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ObjectResponseData + /// + [Fact] + public void ObjectResponseDataInstanceTest() + { + // TODO uncomment below to test "IsType" ObjectResponseData + //Assert.IsType(instance); + } + + /// + /// Test the property 'ObjectKey' + /// + [Fact] + public void ObjectKeyTest() + { + // TODO unit test for the property 'ObjectKey' + } + } +} diff --git a/storage/src/storage.Test/Model/PaginatedBucketObjectListTests.cs b/storage/src/storage.Test/Model/PaginatedBucketObjectListTests.cs new file mode 100644 index 0000000..59a2088 --- /dev/null +++ b/storage/src/storage.Test/Model/PaginatedBucketObjectListTests.cs @@ -0,0 +1,93 @@ +/* + * Object Storage + * + * REST API OpenAPI documentation for the Object Storage + * + * The version of the OpenAPI document: 1.0.0 (v1) + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using storage.Model; +using storage.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace storage.Test.Model +{ + /// + /// Class for testing PaginatedBucketObjectList + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class PaginatedBucketObjectListTests : IDisposable + { + // TODO uncomment below to declare an instance variable for PaginatedBucketObjectList + //private PaginatedBucketObjectList instance; + + public PaginatedBucketObjectListTests() + { + // TODO uncomment below to create an instance of PaginatedBucketObjectList + //instance = new PaginatedBucketObjectList(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of PaginatedBucketObjectList + /// + [Fact] + public void PaginatedBucketObjectListInstanceTest() + { + // TODO uncomment below to test "IsType" PaginatedBucketObjectList + //Assert.IsType(instance); + } + + /// + /// Test the property 'Count' + /// + [Fact] + public void CountTest() + { + // TODO unit test for the property 'Count' + } + + /// + /// Test the property 'Next' + /// + [Fact] + public void NextTest() + { + // TODO unit test for the property 'Next' + } + + /// + /// Test the property 'Previous' + /// + [Fact] + public void PreviousTest() + { + // TODO unit test for the property 'Previous' + } + + /// + /// Test the property 'Results' + /// + [Fact] + public void ResultsTest() + { + // TODO unit test for the property 'Results' + } + } +} diff --git a/storage/src/storage.Test/Model/SuccessBucketOperationTests.cs b/storage/src/storage.Test/Model/SuccessBucketOperationTests.cs new file mode 100644 index 0000000..3d60611 --- /dev/null +++ b/storage/src/storage.Test/Model/SuccessBucketOperationTests.cs @@ -0,0 +1,75 @@ +/* + * Object Storage + * + * REST API OpenAPI documentation for the Object Storage + * + * The version of the OpenAPI document: 1.0.0 (v1) + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using storage.Model; +using storage.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace storage.Test.Model +{ + /// + /// Class for testing SuccessBucketOperation + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class SuccessBucketOperationTests : IDisposable + { + // TODO uncomment below to declare an instance variable for SuccessBucketOperation + //private SuccessBucketOperation instance; + + public SuccessBucketOperationTests() + { + // TODO uncomment below to create an instance of SuccessBucketOperation + //instance = new SuccessBucketOperation(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of SuccessBucketOperation + /// + [Fact] + public void SuccessBucketOperationInstanceTest() + { + // TODO uncomment below to test "IsType" SuccessBucketOperation + //Assert.IsType(instance); + } + + /// + /// Test the property 'State' + /// + [Fact] + public void StateTest() + { + // TODO unit test for the property 'State' + } + + /// + /// Test the property 'Data' + /// + [Fact] + public void DataTest() + { + // TODO unit test for the property 'Data' + } + } +} diff --git a/storage/src/storage.Test/Model/SuccessObjectOperationTests.cs b/storage/src/storage.Test/Model/SuccessObjectOperationTests.cs new file mode 100644 index 0000000..ce57bf9 --- /dev/null +++ b/storage/src/storage.Test/Model/SuccessObjectOperationTests.cs @@ -0,0 +1,75 @@ +/* + * Object Storage + * + * REST API OpenAPI documentation for the Object Storage + * + * The version of the OpenAPI document: 1.0.0 (v1) + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using storage.Model; +using storage.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace storage.Test.Model +{ + /// + /// Class for testing SuccessObjectOperation + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class SuccessObjectOperationTests : IDisposable + { + // TODO uncomment below to declare an instance variable for SuccessObjectOperation + //private SuccessObjectOperation instance; + + public SuccessObjectOperationTests() + { + // TODO uncomment below to create an instance of SuccessObjectOperation + //instance = new SuccessObjectOperation(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of SuccessObjectOperation + /// + [Fact] + public void SuccessObjectOperationInstanceTest() + { + // TODO uncomment below to test "IsType" SuccessObjectOperation + //Assert.IsType(instance); + } + + /// + /// Test the property 'State' + /// + [Fact] + public void StateTest() + { + // TODO unit test for the property 'State' + } + + /// + /// Test the property 'Data' + /// + [Fact] + public void DataTest() + { + // TODO unit test for the property 'Data' + } + } +} diff --git a/storage/src/storage/Api/StorageApi.cs b/storage/src/storage/Api/StorageApi.cs new file mode 100644 index 0000000..3c788ab --- /dev/null +++ b/storage/src/storage/Api/StorageApi.cs @@ -0,0 +1,2122 @@ +/* + * Object Storage + * + * REST API OpenAPI documentation for the Object Storage + * + * The version of the OpenAPI document: 1.0.0 (v1) + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Net; +using System.Net.Mime; +using storage.Client; +using storage.Model; + +namespace storage.Api +{ + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IStorageApiSync : IApiAccessor + { + #region Synchronous Operations + /// + /// Create a new bucket + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ResponseBucket + ResponseBucket StorageApiBucketsCreate(BucketCreate bucketCreate, int operationIndex = 0); + + /// + /// Create a new bucket + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of ResponseBucket + ApiResponse StorageApiBucketsCreateWithHttpInfo(BucketCreate bucketCreate, int operationIndex = 0); + /// + /// Delete a bucket + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// SuccessBucketOperation + SuccessBucketOperation StorageApiBucketsDestroy(string name, int operationIndex = 0); + + /// + /// Delete a bucket + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of SuccessBucketOperation + ApiResponse StorageApiBucketsDestroyWithHttpInfo(string name, int operationIndex = 0); + /// + /// List buckets + /// + /// Thrown when fails to make API call + /// A page number within the paginated result set. (optional) + /// Number of results to return per page. (optional) + /// Index associated with the operation. + /// PaginatedBucketList + PaginatedBucketList StorageApiBucketsList(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0); + + /// + /// List buckets + /// + /// + /// + /// + /// Thrown when fails to make API call + /// A page number within the paginated result set. (optional) + /// Number of results to return per page. (optional) + /// Index associated with the operation. + /// ApiResponse of PaginatedBucketList + ApiResponse StorageApiBucketsListWithHttpInfo(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0); + /// + /// Create new object key + /// + /// + /// Create a new object key in the bucket. + /// + /// Thrown when fails to make API call + /// + /// + /// (optional) + /// Index associated with the operation. + /// SuccessObjectOperation + SuccessObjectOperation StorageApiBucketsObjectsCreate(string bucketName, string objectKey, Dictionary? requestBody = default(Dictionary?), int operationIndex = 0); + + /// + /// Create new object key + /// + /// + /// Create a new object key in the bucket. + /// + /// Thrown when fails to make API call + /// + /// + /// (optional) + /// Index associated with the operation. + /// ApiResponse of SuccessObjectOperation + ApiResponse StorageApiBucketsObjectsCreateWithHttpInfo(string bucketName, string objectKey, Dictionary? requestBody = default(Dictionary?), int operationIndex = 0); + /// + /// Delete object key + /// + /// + /// Delete an object key from bucket + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// SuccessObjectOperation + SuccessObjectOperation StorageApiBucketsObjectsDestroy(string bucketName, string objectKey, int operationIndex = 0); + + /// + /// Delete object key + /// + /// + /// Delete an object key from bucket + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// ApiResponse of SuccessObjectOperation + ApiResponse StorageApiBucketsObjectsDestroyWithHttpInfo(string bucketName, string objectKey, int operationIndex = 0); + /// + /// List buckets objects + /// + /// Thrown when fails to make API call + /// + /// A page number within the paginated result set. (optional) + /// Number of results to return per page. (optional) + /// Index associated with the operation. + /// PaginatedBucketObjectList + PaginatedBucketObjectList StorageApiBucketsObjectsList(string bucketName, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0); + + /// + /// List buckets objects + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// A page number within the paginated result set. (optional) + /// Number of results to return per page. (optional) + /// Index associated with the operation. + /// ApiResponse of PaginatedBucketObjectList + ApiResponse StorageApiBucketsObjectsListWithHttpInfo(string bucketName, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0); + /// + /// Download object + /// + /// + /// Download the object key from bucket. + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// System.IO.Stream + System.IO.Stream StorageApiBucketsObjectsRetrieve(string bucketName, string objectKey, int operationIndex = 0); + + /// + /// Download object + /// + /// + /// Download the object key from bucket. + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// ApiResponse of System.IO.Stream + ApiResponse StorageApiBucketsObjectsRetrieveWithHttpInfo(string bucketName, string objectKey, int operationIndex = 0); + /// + /// Update the object key + /// + /// + /// Update the object key from bucket. + /// + /// Thrown when fails to make API call + /// + /// + /// (optional) + /// Index associated with the operation. + /// SuccessObjectOperation + SuccessObjectOperation StorageApiBucketsObjectsUpdate(string bucketName, string objectKey, Dictionary? requestBody = default(Dictionary?), int operationIndex = 0); + + /// + /// Update the object key + /// + /// + /// Update the object key from bucket. + /// + /// Thrown when fails to make API call + /// + /// + /// (optional) + /// Index associated with the operation. + /// ApiResponse of SuccessObjectOperation + ApiResponse StorageApiBucketsObjectsUpdateWithHttpInfo(string bucketName, string objectKey, Dictionary? requestBody = default(Dictionary?), int operationIndex = 0); + /// + /// Update bucket info + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ResponseBucket + ResponseBucket StorageApiBucketsPartialUpdate(string name, int operationIndex = 0); + + /// + /// Update bucket info + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of ResponseBucket + ApiResponse StorageApiBucketsPartialUpdateWithHttpInfo(string name, int operationIndex = 0); + #endregion Synchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IStorageApiAsync : IApiAccessor + { + #region Asynchronous Operations + /// + /// Create a new bucket + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ResponseBucket + System.Threading.Tasks.Task StorageApiBucketsCreateAsync(BucketCreate bucketCreate, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Create a new bucket + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (ResponseBucket) + System.Threading.Tasks.Task> StorageApiBucketsCreateWithHttpInfoAsync(BucketCreate bucketCreate, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Delete a bucket + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of SuccessBucketOperation + System.Threading.Tasks.Task StorageApiBucketsDestroyAsync(string name, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Delete a bucket + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (SuccessBucketOperation) + System.Threading.Tasks.Task> StorageApiBucketsDestroyWithHttpInfoAsync(string name, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// List buckets + /// + /// + /// + /// + /// Thrown when fails to make API call + /// A page number within the paginated result set. (optional) + /// Number of results to return per page. (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of PaginatedBucketList + System.Threading.Tasks.Task StorageApiBucketsListAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// List buckets + /// + /// + /// + /// + /// Thrown when fails to make API call + /// A page number within the paginated result set. (optional) + /// Number of results to return per page. (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (PaginatedBucketList) + System.Threading.Tasks.Task> StorageApiBucketsListWithHttpInfoAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Create new object key + /// + /// + /// Create a new object key in the bucket. + /// + /// Thrown when fails to make API call + /// + /// + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of SuccessObjectOperation + System.Threading.Tasks.Task StorageApiBucketsObjectsCreateAsync(string bucketName, string objectKey, Dictionary? requestBody = default(Dictionary?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Create new object key + /// + /// + /// Create a new object key in the bucket. + /// + /// Thrown when fails to make API call + /// + /// + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (SuccessObjectOperation) + System.Threading.Tasks.Task> StorageApiBucketsObjectsCreateWithHttpInfoAsync(string bucketName, string objectKey, Dictionary? requestBody = default(Dictionary?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Delete object key + /// + /// + /// Delete an object key from bucket + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of SuccessObjectOperation + System.Threading.Tasks.Task StorageApiBucketsObjectsDestroyAsync(string bucketName, string objectKey, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Delete object key + /// + /// + /// Delete an object key from bucket + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (SuccessObjectOperation) + System.Threading.Tasks.Task> StorageApiBucketsObjectsDestroyWithHttpInfoAsync(string bucketName, string objectKey, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// List buckets objects + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// A page number within the paginated result set. (optional) + /// Number of results to return per page. (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of PaginatedBucketObjectList + System.Threading.Tasks.Task StorageApiBucketsObjectsListAsync(string bucketName, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// List buckets objects + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// A page number within the paginated result set. (optional) + /// Number of results to return per page. (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (PaginatedBucketObjectList) + System.Threading.Tasks.Task> StorageApiBucketsObjectsListWithHttpInfoAsync(string bucketName, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Download object + /// + /// + /// Download the object key from bucket. + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of System.IO.Stream + System.Threading.Tasks.Task StorageApiBucketsObjectsRetrieveAsync(string bucketName, string objectKey, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Download object + /// + /// + /// Download the object key from bucket. + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (System.IO.Stream) + System.Threading.Tasks.Task> StorageApiBucketsObjectsRetrieveWithHttpInfoAsync(string bucketName, string objectKey, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Update the object key + /// + /// + /// Update the object key from bucket. + /// + /// Thrown when fails to make API call + /// + /// + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of SuccessObjectOperation + System.Threading.Tasks.Task StorageApiBucketsObjectsUpdateAsync(string bucketName, string objectKey, Dictionary? requestBody = default(Dictionary?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Update the object key + /// + /// + /// Update the object key from bucket. + /// + /// Thrown when fails to make API call + /// + /// + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (SuccessObjectOperation) + System.Threading.Tasks.Task> StorageApiBucketsObjectsUpdateWithHttpInfoAsync(string bucketName, string objectKey, Dictionary? requestBody = default(Dictionary?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Update bucket info + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ResponseBucket + System.Threading.Tasks.Task StorageApiBucketsPartialUpdateAsync(string name, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Update bucket info + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (ResponseBucket) + System.Threading.Tasks.Task> StorageApiBucketsPartialUpdateWithHttpInfoAsync(string name, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + #endregion Asynchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IStorageApi : IStorageApiSync, IStorageApiAsync + { + + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class StorageApi : IStorageApi + { + private storage.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public StorageApi() : this((string)null) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// + public StorageApi(string basePath) + { + this.Configuration = storage.Client.Configuration.MergeConfigurations( + storage.Client.GlobalConfiguration.Instance, + new storage.Client.Configuration { BasePath = basePath } + ); + this.Client = new storage.Client.ApiClient(this.Configuration.BasePath); + this.AsynchronousClient = new storage.Client.ApiClient(this.Configuration.BasePath); + this.ExceptionFactory = storage.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public StorageApi(storage.Client.Configuration configuration) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Configuration = storage.Client.Configuration.MergeConfigurations( + storage.Client.GlobalConfiguration.Instance, + configuration + ); + this.Client = new storage.Client.ApiClient(this.Configuration.BasePath); + this.AsynchronousClient = new storage.Client.ApiClient(this.Configuration.BasePath); + ExceptionFactory = storage.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using a Configuration object and client instance. + /// + /// The client interface for synchronous API access. + /// The client interface for asynchronous API access. + /// The configuration object. + public StorageApi(storage.Client.ISynchronousClient client, storage.Client.IAsynchronousClient asyncClient, storage.Client.IReadableConfiguration configuration) + { + if (client == null) throw new ArgumentNullException("client"); + if (asyncClient == null) throw new ArgumentNullException("asyncClient"); + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Client = client; + this.AsynchronousClient = asyncClient; + this.Configuration = configuration; + this.ExceptionFactory = storage.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// The client for accessing this underlying API asynchronously. + /// + public storage.Client.IAsynchronousClient AsynchronousClient { get; set; } + + /// + /// The client for accessing this underlying API synchronously. + /// + public storage.Client.ISynchronousClient Client { get; set; } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public string GetBasePath() + { + return this.Configuration.BasePath; + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public storage.Client.IReadableConfiguration Configuration { get; set; } + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public storage.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + /// + /// Create a new bucket + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ResponseBucket + public ResponseBucket StorageApiBucketsCreate(BucketCreate bucketCreate, int operationIndex = 0) + { + storage.Client.ApiResponse localVarResponse = StorageApiBucketsCreateWithHttpInfo(bucketCreate); + return localVarResponse.Data; + } + + /// + /// Create a new bucket + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of ResponseBucket + public storage.Client.ApiResponse StorageApiBucketsCreateWithHttpInfo(BucketCreate bucketCreate, int operationIndex = 0) + { + // verify the required parameter 'bucketCreate' is set + if (bucketCreate == null) + { + throw new storage.Client.ApiException(400, "Missing required parameter 'bucketCreate' when calling StorageApi->StorageApiBucketsCreate"); + } + + storage.Client.RequestOptions localVarRequestOptions = new storage.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json", + "application/x-www-form-urlencoded", + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = storage.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = storage.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = bucketCreate; + + localVarRequestOptions.Operation = "StorageApi.StorageApiBucketsCreate"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (tokenAuth) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/v4/storage/buckets", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("StorageApiBucketsCreate", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Create a new bucket + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ResponseBucket + public async System.Threading.Tasks.Task StorageApiBucketsCreateAsync(BucketCreate bucketCreate, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + storage.Client.ApiResponse localVarResponse = await StorageApiBucketsCreateWithHttpInfoAsync(bucketCreate, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Create a new bucket + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (ResponseBucket) + public async System.Threading.Tasks.Task> StorageApiBucketsCreateWithHttpInfoAsync(BucketCreate bucketCreate, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'bucketCreate' is set + if (bucketCreate == null) + { + throw new storage.Client.ApiException(400, "Missing required parameter 'bucketCreate' when calling StorageApi->StorageApiBucketsCreate"); + } + + + storage.Client.RequestOptions localVarRequestOptions = new storage.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json", + "application/x-www-form-urlencoded", + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = storage.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = storage.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = bucketCreate; + + localVarRequestOptions.Operation = "StorageApi.StorageApiBucketsCreate"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (tokenAuth) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/v4/storage/buckets", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("StorageApiBucketsCreate", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Delete a bucket + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// SuccessBucketOperation + public SuccessBucketOperation StorageApiBucketsDestroy(string name, int operationIndex = 0) + { + storage.Client.ApiResponse localVarResponse = StorageApiBucketsDestroyWithHttpInfo(name); + return localVarResponse.Data; + } + + /// + /// Delete a bucket + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of SuccessBucketOperation + public storage.Client.ApiResponse StorageApiBucketsDestroyWithHttpInfo(string name, int operationIndex = 0) + { + // verify the required parameter 'name' is set + if (name == null) + { + throw new storage.Client.ApiException(400, "Missing required parameter 'name' when calling StorageApi->StorageApiBucketsDestroy"); + } + + storage.Client.RequestOptions localVarRequestOptions = new storage.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = storage.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = storage.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("name", storage.Client.ClientUtils.ParameterToString(name)); // path parameter + + localVarRequestOptions.Operation = "StorageApi.StorageApiBucketsDestroy"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (tokenAuth) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Delete("/v4/storage/buckets/{name}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("StorageApiBucketsDestroy", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Delete a bucket + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of SuccessBucketOperation + public async System.Threading.Tasks.Task StorageApiBucketsDestroyAsync(string name, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + storage.Client.ApiResponse localVarResponse = await StorageApiBucketsDestroyWithHttpInfoAsync(name, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Delete a bucket + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (SuccessBucketOperation) + public async System.Threading.Tasks.Task> StorageApiBucketsDestroyWithHttpInfoAsync(string name, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'name' is set + if (name == null) + { + throw new storage.Client.ApiException(400, "Missing required parameter 'name' when calling StorageApi->StorageApiBucketsDestroy"); + } + + + storage.Client.RequestOptions localVarRequestOptions = new storage.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = storage.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = storage.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("name", storage.Client.ClientUtils.ParameterToString(name)); // path parameter + + localVarRequestOptions.Operation = "StorageApi.StorageApiBucketsDestroy"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (tokenAuth) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.DeleteAsync("/v4/storage/buckets/{name}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("StorageApiBucketsDestroy", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// List buckets + /// + /// Thrown when fails to make API call + /// A page number within the paginated result set. (optional) + /// Number of results to return per page. (optional) + /// Index associated with the operation. + /// PaginatedBucketList + public PaginatedBucketList StorageApiBucketsList(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0) + { + storage.Client.ApiResponse localVarResponse = StorageApiBucketsListWithHttpInfo(page, pageSize); + return localVarResponse.Data; + } + + /// + /// List buckets + /// + /// Thrown when fails to make API call + /// A page number within the paginated result set. (optional) + /// Number of results to return per page. (optional) + /// Index associated with the operation. + /// ApiResponse of PaginatedBucketList + public storage.Client.ApiResponse StorageApiBucketsListWithHttpInfo(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0) + { + storage.Client.RequestOptions localVarRequestOptions = new storage.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = storage.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = storage.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + if (page != null) + { + localVarRequestOptions.QueryParameters.Add(storage.Client.ClientUtils.ParameterToMultiMap("", "page", page)); + } + if (pageSize != null) + { + localVarRequestOptions.QueryParameters.Add(storage.Client.ClientUtils.ParameterToMultiMap("", "page_size", pageSize)); + } + + localVarRequestOptions.Operation = "StorageApi.StorageApiBucketsList"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (tokenAuth) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/v4/storage/buckets", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("StorageApiBucketsList", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// List buckets + /// + /// Thrown when fails to make API call + /// A page number within the paginated result set. (optional) + /// Number of results to return per page. (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of PaginatedBucketList + public async System.Threading.Tasks.Task StorageApiBucketsListAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + storage.Client.ApiResponse localVarResponse = await StorageApiBucketsListWithHttpInfoAsync(page, pageSize, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// List buckets + /// + /// Thrown when fails to make API call + /// A page number within the paginated result set. (optional) + /// Number of results to return per page. (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (PaginatedBucketList) + public async System.Threading.Tasks.Task> StorageApiBucketsListWithHttpInfoAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + storage.Client.RequestOptions localVarRequestOptions = new storage.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = storage.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = storage.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + if (page != null) + { + localVarRequestOptions.QueryParameters.Add(storage.Client.ClientUtils.ParameterToMultiMap("", "page", page)); + } + if (pageSize != null) + { + localVarRequestOptions.QueryParameters.Add(storage.Client.ClientUtils.ParameterToMultiMap("", "page_size", pageSize)); + } + + localVarRequestOptions.Operation = "StorageApi.StorageApiBucketsList"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (tokenAuth) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/v4/storage/buckets", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("StorageApiBucketsList", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Create new object key Create a new object key in the bucket. + /// + /// Thrown when fails to make API call + /// + /// + /// (optional) + /// Index associated with the operation. + /// SuccessObjectOperation + public SuccessObjectOperation StorageApiBucketsObjectsCreate(string bucketName, string objectKey, Dictionary? requestBody = default(Dictionary?), int operationIndex = 0) + { + storage.Client.ApiResponse localVarResponse = StorageApiBucketsObjectsCreateWithHttpInfo(bucketName, objectKey, requestBody); + return localVarResponse.Data; + } + + /// + /// Create new object key Create a new object key in the bucket. + /// + /// Thrown when fails to make API call + /// + /// + /// (optional) + /// Index associated with the operation. + /// ApiResponse of SuccessObjectOperation + public storage.Client.ApiResponse StorageApiBucketsObjectsCreateWithHttpInfo(string bucketName, string objectKey, Dictionary? requestBody = default(Dictionary?), int operationIndex = 0) + { + // verify the required parameter 'bucketName' is set + if (bucketName == null) + { + throw new storage.Client.ApiException(400, "Missing required parameter 'bucketName' when calling StorageApi->StorageApiBucketsObjectsCreate"); + } + + // verify the required parameter 'objectKey' is set + if (objectKey == null) + { + throw new storage.Client.ApiException(400, "Missing required parameter 'objectKey' when calling StorageApi->StorageApiBucketsObjectsCreate"); + } + + storage.Client.RequestOptions localVarRequestOptions = new storage.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/octet-stream" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = storage.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = storage.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("bucket_name", storage.Client.ClientUtils.ParameterToString(bucketName)); // path parameter + localVarRequestOptions.PathParameters.Add("object_key", storage.Client.ClientUtils.ParameterToString(objectKey)); // path parameter + localVarRequestOptions.Data = requestBody; + + localVarRequestOptions.Operation = "StorageApi.StorageApiBucketsObjectsCreate"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (tokenAuth) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/v4/storage/buckets/{bucket_name}/objects/{object_key}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("StorageApiBucketsObjectsCreate", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Create new object key Create a new object key in the bucket. + /// + /// Thrown when fails to make API call + /// + /// + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of SuccessObjectOperation + public async System.Threading.Tasks.Task StorageApiBucketsObjectsCreateAsync(string bucketName, string objectKey, Dictionary? requestBody = default(Dictionary?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + storage.Client.ApiResponse localVarResponse = await StorageApiBucketsObjectsCreateWithHttpInfoAsync(bucketName, objectKey, requestBody, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Create new object key Create a new object key in the bucket. + /// + /// Thrown when fails to make API call + /// + /// + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (SuccessObjectOperation) + public async System.Threading.Tasks.Task> StorageApiBucketsObjectsCreateWithHttpInfoAsync(string bucketName, string objectKey, Dictionary? requestBody = default(Dictionary?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'bucketName' is set + if (bucketName == null) + { + throw new storage.Client.ApiException(400, "Missing required parameter 'bucketName' when calling StorageApi->StorageApiBucketsObjectsCreate"); + } + + // verify the required parameter 'objectKey' is set + if (objectKey == null) + { + throw new storage.Client.ApiException(400, "Missing required parameter 'objectKey' when calling StorageApi->StorageApiBucketsObjectsCreate"); + } + + + storage.Client.RequestOptions localVarRequestOptions = new storage.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/octet-stream" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = storage.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = storage.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("bucket_name", storage.Client.ClientUtils.ParameterToString(bucketName)); // path parameter + localVarRequestOptions.PathParameters.Add("object_key", storage.Client.ClientUtils.ParameterToString(objectKey)); // path parameter + localVarRequestOptions.Data = requestBody; + + localVarRequestOptions.Operation = "StorageApi.StorageApiBucketsObjectsCreate"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (tokenAuth) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/v4/storage/buckets/{bucket_name}/objects/{object_key}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("StorageApiBucketsObjectsCreate", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Delete object key Delete an object key from bucket + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// SuccessObjectOperation + public SuccessObjectOperation StorageApiBucketsObjectsDestroy(string bucketName, string objectKey, int operationIndex = 0) + { + storage.Client.ApiResponse localVarResponse = StorageApiBucketsObjectsDestroyWithHttpInfo(bucketName, objectKey); + return localVarResponse.Data; + } + + /// + /// Delete object key Delete an object key from bucket + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// ApiResponse of SuccessObjectOperation + public storage.Client.ApiResponse StorageApiBucketsObjectsDestroyWithHttpInfo(string bucketName, string objectKey, int operationIndex = 0) + { + // verify the required parameter 'bucketName' is set + if (bucketName == null) + { + throw new storage.Client.ApiException(400, "Missing required parameter 'bucketName' when calling StorageApi->StorageApiBucketsObjectsDestroy"); + } + + // verify the required parameter 'objectKey' is set + if (objectKey == null) + { + throw new storage.Client.ApiException(400, "Missing required parameter 'objectKey' when calling StorageApi->StorageApiBucketsObjectsDestroy"); + } + + storage.Client.RequestOptions localVarRequestOptions = new storage.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = storage.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = storage.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("bucket_name", storage.Client.ClientUtils.ParameterToString(bucketName)); // path parameter + localVarRequestOptions.PathParameters.Add("object_key", storage.Client.ClientUtils.ParameterToString(objectKey)); // path parameter + + localVarRequestOptions.Operation = "StorageApi.StorageApiBucketsObjectsDestroy"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (tokenAuth) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Delete("/v4/storage/buckets/{bucket_name}/objects/{object_key}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("StorageApiBucketsObjectsDestroy", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Delete object key Delete an object key from bucket + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of SuccessObjectOperation + public async System.Threading.Tasks.Task StorageApiBucketsObjectsDestroyAsync(string bucketName, string objectKey, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + storage.Client.ApiResponse localVarResponse = await StorageApiBucketsObjectsDestroyWithHttpInfoAsync(bucketName, objectKey, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Delete object key Delete an object key from bucket + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (SuccessObjectOperation) + public async System.Threading.Tasks.Task> StorageApiBucketsObjectsDestroyWithHttpInfoAsync(string bucketName, string objectKey, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'bucketName' is set + if (bucketName == null) + { + throw new storage.Client.ApiException(400, "Missing required parameter 'bucketName' when calling StorageApi->StorageApiBucketsObjectsDestroy"); + } + + // verify the required parameter 'objectKey' is set + if (objectKey == null) + { + throw new storage.Client.ApiException(400, "Missing required parameter 'objectKey' when calling StorageApi->StorageApiBucketsObjectsDestroy"); + } + + + storage.Client.RequestOptions localVarRequestOptions = new storage.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = storage.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = storage.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("bucket_name", storage.Client.ClientUtils.ParameterToString(bucketName)); // path parameter + localVarRequestOptions.PathParameters.Add("object_key", storage.Client.ClientUtils.ParameterToString(objectKey)); // path parameter + + localVarRequestOptions.Operation = "StorageApi.StorageApiBucketsObjectsDestroy"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (tokenAuth) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.DeleteAsync("/v4/storage/buckets/{bucket_name}/objects/{object_key}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("StorageApiBucketsObjectsDestroy", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// List buckets objects + /// + /// Thrown when fails to make API call + /// + /// A page number within the paginated result set. (optional) + /// Number of results to return per page. (optional) + /// Index associated with the operation. + /// PaginatedBucketObjectList + public PaginatedBucketObjectList StorageApiBucketsObjectsList(string bucketName, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0) + { + storage.Client.ApiResponse localVarResponse = StorageApiBucketsObjectsListWithHttpInfo(bucketName, page, pageSize); + return localVarResponse.Data; + } + + /// + /// List buckets objects + /// + /// Thrown when fails to make API call + /// + /// A page number within the paginated result set. (optional) + /// Number of results to return per page. (optional) + /// Index associated with the operation. + /// ApiResponse of PaginatedBucketObjectList + public storage.Client.ApiResponse StorageApiBucketsObjectsListWithHttpInfo(string bucketName, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0) + { + // verify the required parameter 'bucketName' is set + if (bucketName == null) + { + throw new storage.Client.ApiException(400, "Missing required parameter 'bucketName' when calling StorageApi->StorageApiBucketsObjectsList"); + } + + storage.Client.RequestOptions localVarRequestOptions = new storage.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = storage.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = storage.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("bucket_name", storage.Client.ClientUtils.ParameterToString(bucketName)); // path parameter + if (page != null) + { + localVarRequestOptions.QueryParameters.Add(storage.Client.ClientUtils.ParameterToMultiMap("", "page", page)); + } + if (pageSize != null) + { + localVarRequestOptions.QueryParameters.Add(storage.Client.ClientUtils.ParameterToMultiMap("", "page_size", pageSize)); + } + + localVarRequestOptions.Operation = "StorageApi.StorageApiBucketsObjectsList"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (tokenAuth) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/v4/storage/buckets/{bucket_name}/objects", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("StorageApiBucketsObjectsList", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// List buckets objects + /// + /// Thrown when fails to make API call + /// + /// A page number within the paginated result set. (optional) + /// Number of results to return per page. (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of PaginatedBucketObjectList + public async System.Threading.Tasks.Task StorageApiBucketsObjectsListAsync(string bucketName, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + storage.Client.ApiResponse localVarResponse = await StorageApiBucketsObjectsListWithHttpInfoAsync(bucketName, page, pageSize, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// List buckets objects + /// + /// Thrown when fails to make API call + /// + /// A page number within the paginated result set. (optional) + /// Number of results to return per page. (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (PaginatedBucketObjectList) + public async System.Threading.Tasks.Task> StorageApiBucketsObjectsListWithHttpInfoAsync(string bucketName, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'bucketName' is set + if (bucketName == null) + { + throw new storage.Client.ApiException(400, "Missing required parameter 'bucketName' when calling StorageApi->StorageApiBucketsObjectsList"); + } + + + storage.Client.RequestOptions localVarRequestOptions = new storage.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = storage.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = storage.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("bucket_name", storage.Client.ClientUtils.ParameterToString(bucketName)); // path parameter + if (page != null) + { + localVarRequestOptions.QueryParameters.Add(storage.Client.ClientUtils.ParameterToMultiMap("", "page", page)); + } + if (pageSize != null) + { + localVarRequestOptions.QueryParameters.Add(storage.Client.ClientUtils.ParameterToMultiMap("", "page_size", pageSize)); + } + + localVarRequestOptions.Operation = "StorageApi.StorageApiBucketsObjectsList"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (tokenAuth) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/v4/storage/buckets/{bucket_name}/objects", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("StorageApiBucketsObjectsList", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Download object Download the object key from bucket. + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// System.IO.Stream + public System.IO.Stream StorageApiBucketsObjectsRetrieve(string bucketName, string objectKey, int operationIndex = 0) + { + storage.Client.ApiResponse localVarResponse = StorageApiBucketsObjectsRetrieveWithHttpInfo(bucketName, objectKey); + return localVarResponse.Data; + } + + /// + /// Download object Download the object key from bucket. + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// ApiResponse of System.IO.Stream + public storage.Client.ApiResponse StorageApiBucketsObjectsRetrieveWithHttpInfo(string bucketName, string objectKey, int operationIndex = 0) + { + // verify the required parameter 'bucketName' is set + if (bucketName == null) + { + throw new storage.Client.ApiException(400, "Missing required parameter 'bucketName' when calling StorageApi->StorageApiBucketsObjectsRetrieve"); + } + + // verify the required parameter 'objectKey' is set + if (objectKey == null) + { + throw new storage.Client.ApiException(400, "Missing required parameter 'objectKey' when calling StorageApi->StorageApiBucketsObjectsRetrieve"); + } + + storage.Client.RequestOptions localVarRequestOptions = new storage.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/octet-stream" + }; + + var localVarContentType = storage.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = storage.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("bucket_name", storage.Client.ClientUtils.ParameterToString(bucketName)); // path parameter + localVarRequestOptions.PathParameters.Add("object_key", storage.Client.ClientUtils.ParameterToString(objectKey)); // path parameter + + localVarRequestOptions.Operation = "StorageApi.StorageApiBucketsObjectsRetrieve"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (tokenAuth) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/v4/storage/buckets/{bucket_name}/objects/{object_key}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("StorageApiBucketsObjectsRetrieve", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Download object Download the object key from bucket. + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of System.IO.Stream + public async System.Threading.Tasks.Task StorageApiBucketsObjectsRetrieveAsync(string bucketName, string objectKey, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + storage.Client.ApiResponse localVarResponse = await StorageApiBucketsObjectsRetrieveWithHttpInfoAsync(bucketName, objectKey, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Download object Download the object key from bucket. + /// + /// Thrown when fails to make API call + /// + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (System.IO.Stream) + public async System.Threading.Tasks.Task> StorageApiBucketsObjectsRetrieveWithHttpInfoAsync(string bucketName, string objectKey, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'bucketName' is set + if (bucketName == null) + { + throw new storage.Client.ApiException(400, "Missing required parameter 'bucketName' when calling StorageApi->StorageApiBucketsObjectsRetrieve"); + } + + // verify the required parameter 'objectKey' is set + if (objectKey == null) + { + throw new storage.Client.ApiException(400, "Missing required parameter 'objectKey' when calling StorageApi->StorageApiBucketsObjectsRetrieve"); + } + + + storage.Client.RequestOptions localVarRequestOptions = new storage.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/octet-stream" + }; + + var localVarContentType = storage.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = storage.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("bucket_name", storage.Client.ClientUtils.ParameterToString(bucketName)); // path parameter + localVarRequestOptions.PathParameters.Add("object_key", storage.Client.ClientUtils.ParameterToString(objectKey)); // path parameter + + localVarRequestOptions.Operation = "StorageApi.StorageApiBucketsObjectsRetrieve"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (tokenAuth) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/v4/storage/buckets/{bucket_name}/objects/{object_key}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("StorageApiBucketsObjectsRetrieve", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Update the object key Update the object key from bucket. + /// + /// Thrown when fails to make API call + /// + /// + /// (optional) + /// Index associated with the operation. + /// SuccessObjectOperation + public SuccessObjectOperation StorageApiBucketsObjectsUpdate(string bucketName, string objectKey, Dictionary? requestBody = default(Dictionary?), int operationIndex = 0) + { + storage.Client.ApiResponse localVarResponse = StorageApiBucketsObjectsUpdateWithHttpInfo(bucketName, objectKey, requestBody); + return localVarResponse.Data; + } + + /// + /// Update the object key Update the object key from bucket. + /// + /// Thrown when fails to make API call + /// + /// + /// (optional) + /// Index associated with the operation. + /// ApiResponse of SuccessObjectOperation + public storage.Client.ApiResponse StorageApiBucketsObjectsUpdateWithHttpInfo(string bucketName, string objectKey, Dictionary? requestBody = default(Dictionary?), int operationIndex = 0) + { + // verify the required parameter 'bucketName' is set + if (bucketName == null) + { + throw new storage.Client.ApiException(400, "Missing required parameter 'bucketName' when calling StorageApi->StorageApiBucketsObjectsUpdate"); + } + + // verify the required parameter 'objectKey' is set + if (objectKey == null) + { + throw new storage.Client.ApiException(400, "Missing required parameter 'objectKey' when calling StorageApi->StorageApiBucketsObjectsUpdate"); + } + + storage.Client.RequestOptions localVarRequestOptions = new storage.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/octet-stream" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = storage.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = storage.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("bucket_name", storage.Client.ClientUtils.ParameterToString(bucketName)); // path parameter + localVarRequestOptions.PathParameters.Add("object_key", storage.Client.ClientUtils.ParameterToString(objectKey)); // path parameter + localVarRequestOptions.Data = requestBody; + + localVarRequestOptions.Operation = "StorageApi.StorageApiBucketsObjectsUpdate"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (tokenAuth) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Put("/v4/storage/buckets/{bucket_name}/objects/{object_key}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("StorageApiBucketsObjectsUpdate", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Update the object key Update the object key from bucket. + /// + /// Thrown when fails to make API call + /// + /// + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of SuccessObjectOperation + public async System.Threading.Tasks.Task StorageApiBucketsObjectsUpdateAsync(string bucketName, string objectKey, Dictionary? requestBody = default(Dictionary?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + storage.Client.ApiResponse localVarResponse = await StorageApiBucketsObjectsUpdateWithHttpInfoAsync(bucketName, objectKey, requestBody, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Update the object key Update the object key from bucket. + /// + /// Thrown when fails to make API call + /// + /// + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (SuccessObjectOperation) + public async System.Threading.Tasks.Task> StorageApiBucketsObjectsUpdateWithHttpInfoAsync(string bucketName, string objectKey, Dictionary? requestBody = default(Dictionary?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'bucketName' is set + if (bucketName == null) + { + throw new storage.Client.ApiException(400, "Missing required parameter 'bucketName' when calling StorageApi->StorageApiBucketsObjectsUpdate"); + } + + // verify the required parameter 'objectKey' is set + if (objectKey == null) + { + throw new storage.Client.ApiException(400, "Missing required parameter 'objectKey' when calling StorageApi->StorageApiBucketsObjectsUpdate"); + } + + + storage.Client.RequestOptions localVarRequestOptions = new storage.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/octet-stream" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = storage.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = storage.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("bucket_name", storage.Client.ClientUtils.ParameterToString(bucketName)); // path parameter + localVarRequestOptions.PathParameters.Add("object_key", storage.Client.ClientUtils.ParameterToString(objectKey)); // path parameter + localVarRequestOptions.Data = requestBody; + + localVarRequestOptions.Operation = "StorageApi.StorageApiBucketsObjectsUpdate"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (tokenAuth) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PutAsync("/v4/storage/buckets/{bucket_name}/objects/{object_key}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("StorageApiBucketsObjectsUpdate", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Update bucket info + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ResponseBucket + public ResponseBucket StorageApiBucketsPartialUpdate(string name, int operationIndex = 0) + { + storage.Client.ApiResponse localVarResponse = StorageApiBucketsPartialUpdateWithHttpInfo(name); + return localVarResponse.Data; + } + + /// + /// Update bucket info + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of ResponseBucket + public storage.Client.ApiResponse StorageApiBucketsPartialUpdateWithHttpInfo(string name, int operationIndex = 0) + { + // verify the required parameter 'name' is set + if (name == null) + { + throw new storage.Client.ApiException(400, "Missing required parameter 'name' when calling StorageApi->StorageApiBucketsPartialUpdate"); + } + + storage.Client.RequestOptions localVarRequestOptions = new storage.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = storage.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = storage.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("name", storage.Client.ClientUtils.ParameterToString(name)); // path parameter + + localVarRequestOptions.Operation = "StorageApi.StorageApiBucketsPartialUpdate"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (tokenAuth) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = this.Client.Patch("/v4/storage/buckets/{name}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("StorageApiBucketsPartialUpdate", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Update bucket info + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ResponseBucket + public async System.Threading.Tasks.Task StorageApiBucketsPartialUpdateAsync(string name, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + storage.Client.ApiResponse localVarResponse = await StorageApiBucketsPartialUpdateWithHttpInfoAsync(name, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Update bucket info + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (ResponseBucket) + public async System.Threading.Tasks.Task> StorageApiBucketsPartialUpdateWithHttpInfoAsync(string name, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'name' is set + if (name == null) + { + throw new storage.Client.ApiException(400, "Missing required parameter 'name' when calling StorageApi->StorageApiBucketsPartialUpdate"); + } + + + storage.Client.RequestOptions localVarRequestOptions = new storage.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = storage.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = storage.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("name", storage.Client.ClientUtils.ParameterToString(name)); // path parameter + + localVarRequestOptions.Operation = "StorageApi.StorageApiBucketsPartialUpdate"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (tokenAuth) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PatchAsync("/v4/storage/buckets/{name}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("StorageApiBucketsPartialUpdate", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + } +} diff --git a/storage/src/storage/Model/BucketObject.cs b/storage/src/storage/Model/BucketObject.cs new file mode 100644 index 0000000..02d98e2 --- /dev/null +++ b/storage/src/storage/Model/BucketObject.cs @@ -0,0 +1,203 @@ +/* + * Object Storage + * + * REST API OpenAPI documentation for the Object Storage + * + * The version of the OpenAPI document: 1.0.0 (v1) + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = storage.Client.OpenAPIDateConverter; + +namespace storage.Model +{ + /// + /// BucketObject + /// + [DataContract(Name = "BucketObject")] + public partial class BucketObject : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + public BucketObject() + { + } + + /// + /// Gets or Sets Key + /// + [DataMember(Name = "key", IsRequired = true, EmitDefaultValue = true)] + public string Key { get; private set; } + + /// + /// Returns false as Key should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeKey() + { + return false; + } + /// + /// Gets or Sets LastModified + /// + [DataMember(Name = "last_modified", IsRequired = true, EmitDefaultValue = true)] + public DateTime LastModified { get; private set; } + + /// + /// Returns false as LastModified should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeLastModified() + { + return false; + } + /// + /// Gets or Sets Size + /// + [DataMember(Name = "size", IsRequired = true, EmitDefaultValue = true)] + public int Size { get; private set; } + + /// + /// Returns false as Size should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeSize() + { + return false; + } + /// + /// Gets or Sets Etag + /// + [DataMember(Name = "etag", IsRequired = true, EmitDefaultValue = true)] + public string Etag { get; private set; } + + /// + /// Returns false as Etag should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeEtag() + { + return false; + } + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class BucketObject {\n"); + sb.Append(" Key: ").Append(Key).Append("\n"); + sb.Append(" LastModified: ").Append(LastModified).Append("\n"); + sb.Append(" Size: ").Append(Size).Append("\n"); + sb.Append(" Etag: ").Append(Etag).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as BucketObject); + } + + /// + /// Returns true if BucketObject instances are equal + /// + /// Instance of BucketObject to be compared + /// Boolean + public bool Equals(BucketObject input) + { + if (input == null) + { + return false; + } + return + ( + this.Key == input.Key || + (this.Key != null && + this.Key.Equals(input.Key)) + ) && + ( + this.LastModified == input.LastModified || + (this.LastModified != null && + this.LastModified.Equals(input.LastModified)) + ) && + ( + this.Size == input.Size || + this.Size.Equals(input.Size) + ) && + ( + this.Etag == input.Etag || + (this.Etag != null && + this.Etag.Equals(input.Etag)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Key != null) + { + hashCode = (hashCode * 59) + this.Key.GetHashCode(); + } + if (this.LastModified != null) + { + hashCode = (hashCode * 59) + this.LastModified.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Size.GetHashCode(); + if (this.Etag != null) + { + hashCode = (hashCode * 59) + this.Etag.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/storage/src/storage/Model/ObjectResponseData.cs b/storage/src/storage/Model/ObjectResponseData.cs new file mode 100644 index 0000000..31f3b46 --- /dev/null +++ b/storage/src/storage/Model/ObjectResponseData.cs @@ -0,0 +1,138 @@ +/* + * Object Storage + * + * REST API OpenAPI documentation for the Object Storage + * + * The version of the OpenAPI document: 1.0.0 (v1) + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = storage.Client.OpenAPIDateConverter; + +namespace storage.Model +{ + /// + /// ObjectResponseData + /// + [DataContract(Name = "ObjectResponseData")] + public partial class ObjectResponseData : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected ObjectResponseData() { } + /// + /// Initializes a new instance of the class. + /// + /// objectKey (required). + public ObjectResponseData(string objectKey = default(string)) + { + // to ensure "objectKey" is required (not null) + if (objectKey == null) + { + throw new ArgumentNullException("objectKey is a required property for ObjectResponseData and cannot be null"); + } + this.ObjectKey = objectKey; + } + + /// + /// Gets or Sets ObjectKey + /// + [DataMember(Name = "object_key", IsRequired = true, EmitDefaultValue = true)] + public string ObjectKey { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ObjectResponseData {\n"); + sb.Append(" ObjectKey: ").Append(ObjectKey).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as ObjectResponseData); + } + + /// + /// Returns true if ObjectResponseData instances are equal + /// + /// Instance of ObjectResponseData to be compared + /// Boolean + public bool Equals(ObjectResponseData input) + { + if (input == null) + { + return false; + } + return + ( + this.ObjectKey == input.ObjectKey || + (this.ObjectKey != null && + this.ObjectKey.Equals(input.ObjectKey)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ObjectKey != null) + { + hashCode = (hashCode * 59) + this.ObjectKey.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/storage/src/storage/Model/PaginatedBucketObjectList.cs b/storage/src/storage/Model/PaginatedBucketObjectList.cs new file mode 100644 index 0000000..739e1a8 --- /dev/null +++ b/storage/src/storage/Model/PaginatedBucketObjectList.cs @@ -0,0 +1,182 @@ +/* + * Object Storage + * + * REST API OpenAPI documentation for the Object Storage + * + * The version of the OpenAPI document: 1.0.0 (v1) + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = storage.Client.OpenAPIDateConverter; + +namespace storage.Model +{ + /// + /// PaginatedBucketObjectList + /// + [DataContract(Name = "PaginatedBucketObjectList")] + public partial class PaginatedBucketObjectList : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// count. + /// next. + /// previous. + /// results. + public PaginatedBucketObjectList(int count = default(int), string next = default(string), string previous = default(string), List results = default(List)) + { + this.Count = count; + this.Next = next; + this.Previous = previous; + this.Results = results; + } + + /// + /// Gets or Sets Count + /// + /// 123 + [DataMember(Name = "count", EmitDefaultValue = false)] + public int Count { get; set; } + + /// + /// Gets or Sets Next + /// + /// http://api.example.org/accounts/?page=4 + [DataMember(Name = "next", EmitDefaultValue = true)] + public string Next { get; set; } + + /// + /// Gets or Sets Previous + /// + /// http://api.example.org/accounts/?page=2 + [DataMember(Name = "previous", EmitDefaultValue = true)] + public string Previous { get; set; } + + /// + /// Gets or Sets Results + /// + [DataMember(Name = "results", EmitDefaultValue = false)] + public List Results { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class PaginatedBucketObjectList {\n"); + sb.Append(" Count: ").Append(Count).Append("\n"); + sb.Append(" Next: ").Append(Next).Append("\n"); + sb.Append(" Previous: ").Append(Previous).Append("\n"); + sb.Append(" Results: ").Append(Results).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as PaginatedBucketObjectList); + } + + /// + /// Returns true if PaginatedBucketObjectList instances are equal + /// + /// Instance of PaginatedBucketObjectList to be compared + /// Boolean + public bool Equals(PaginatedBucketObjectList input) + { + if (input == null) + { + return false; + } + return + ( + this.Count == input.Count || + this.Count.Equals(input.Count) + ) && + ( + this.Next == input.Next || + (this.Next != null && + this.Next.Equals(input.Next)) + ) && + ( + this.Previous == input.Previous || + (this.Previous != null && + this.Previous.Equals(input.Previous)) + ) && + ( + this.Results == input.Results || + this.Results != null && + input.Results != null && + this.Results.SequenceEqual(input.Results) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Count.GetHashCode(); + if (this.Next != null) + { + hashCode = (hashCode * 59) + this.Next.GetHashCode(); + } + if (this.Previous != null) + { + hashCode = (hashCode * 59) + this.Previous.GetHashCode(); + } + if (this.Results != null) + { + hashCode = (hashCode * 59) + this.Results.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/storage/src/storage/Model/SuccessBucketOperation.cs b/storage/src/storage/Model/SuccessBucketOperation.cs new file mode 100644 index 0000000..d89f726 --- /dev/null +++ b/storage/src/storage/Model/SuccessBucketOperation.cs @@ -0,0 +1,152 @@ +/* + * Object Storage + * + * REST API OpenAPI documentation for the Object Storage + * + * The version of the OpenAPI document: 1.0.0 (v1) + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = storage.Client.OpenAPIDateConverter; + +namespace storage.Model +{ + /// + /// SuccessBucketOperation + /// + [DataContract(Name = "SuccessBucketOperation")] + public partial class SuccessBucketOperation : IEquatable, IValidatableObject + { + + /// + /// Gets or Sets State + /// + [DataMember(Name = "state", IsRequired = true, EmitDefaultValue = true)] + public StateEnum State { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected SuccessBucketOperation() { } + /// + /// Initializes a new instance of the class. + /// + /// state (required). + /// data (required). + public SuccessBucketOperation(StateEnum state = default(StateEnum), Bucket data = default(Bucket)) + { + this.State = state; + // to ensure "data" is required (not null) + if (data == null) + { + throw new ArgumentNullException("data is a required property for SuccessBucketOperation and cannot be null"); + } + this.Data = data; + } + + /// + /// Gets or Sets Data + /// + [DataMember(Name = "data", IsRequired = true, EmitDefaultValue = true)] + public Bucket Data { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class SuccessBucketOperation {\n"); + sb.Append(" State: ").Append(State).Append("\n"); + sb.Append(" Data: ").Append(Data).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as SuccessBucketOperation); + } + + /// + /// Returns true if SuccessBucketOperation instances are equal + /// + /// Instance of SuccessBucketOperation to be compared + /// Boolean + public bool Equals(SuccessBucketOperation input) + { + if (input == null) + { + return false; + } + return + ( + this.State == input.State || + this.State.Equals(input.State) + ) && + ( + this.Data == input.Data || + (this.Data != null && + this.Data.Equals(input.Data)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.State.GetHashCode(); + if (this.Data != null) + { + hashCode = (hashCode * 59) + this.Data.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/storage/src/storage/Model/SuccessObjectOperation.cs b/storage/src/storage/Model/SuccessObjectOperation.cs new file mode 100644 index 0000000..1db21d4 --- /dev/null +++ b/storage/src/storage/Model/SuccessObjectOperation.cs @@ -0,0 +1,152 @@ +/* + * Object Storage + * + * REST API OpenAPI documentation for the Object Storage + * + * The version of the OpenAPI document: 1.0.0 (v1) + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = storage.Client.OpenAPIDateConverter; + +namespace storage.Model +{ + /// + /// SuccessObjectOperation + /// + [DataContract(Name = "SuccessObjectOperation")] + public partial class SuccessObjectOperation : IEquatable, IValidatableObject + { + + /// + /// Gets or Sets State + /// + [DataMember(Name = "state", IsRequired = true, EmitDefaultValue = true)] + public StateEnum State { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected SuccessObjectOperation() { } + /// + /// Initializes a new instance of the class. + /// + /// state (required). + /// data (required). + public SuccessObjectOperation(StateEnum state = default(StateEnum), ObjectResponseData data = default(ObjectResponseData)) + { + this.State = state; + // to ensure "data" is required (not null) + if (data == null) + { + throw new ArgumentNullException("data is a required property for SuccessObjectOperation and cannot be null"); + } + this.Data = data; + } + + /// + /// Gets or Sets Data + /// + [DataMember(Name = "data", IsRequired = true, EmitDefaultValue = true)] + public ObjectResponseData Data { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class SuccessObjectOperation {\n"); + sb.Append(" State: ").Append(State).Append("\n"); + sb.Append(" Data: ").Append(Data).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as SuccessObjectOperation); + } + + /// + /// Returns true if SuccessObjectOperation instances are equal + /// + /// Instance of SuccessObjectOperation to be compared + /// Boolean + public bool Equals(SuccessObjectOperation input) + { + if (input == null) + { + return false; + } + return + ( + this.State == input.State || + this.State.Equals(input.State) + ) && + ( + this.Data == input.Data || + (this.Data != null && + this.Data.Equals(input.Data)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.State.GetHashCode(); + if (this.Data != null) + { + hashCode = (hashCode * 59) + this.Data.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/storage/storage.sln b/storage/storage.sln index 1dd3f83..fa32bdd 100644 --- a/storage/storage.sln +++ b/storage/storage.sln @@ -2,7 +2,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 VisualStudioVersion = 12.0.0.0 MinimumVisualStudioVersion = 10.0.0.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "storage", "src\storage\storage.csproj", "{349FCC21-F151-4BD1-8DFD-0D4A62EE7FD6}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "storage", "src\storage\storage.csproj", "{6A1A3807-3EAF-4BE6-88B7-E8973D2C784D}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "storage.Test", "src\storage.Test\storage.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" EndProject @@ -12,10 +12,10 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {349FCC21-F151-4BD1-8DFD-0D4A62EE7FD6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {349FCC21-F151-4BD1-8DFD-0D4A62EE7FD6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {349FCC21-F151-4BD1-8DFD-0D4A62EE7FD6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {349FCC21-F151-4BD1-8DFD-0D4A62EE7FD6}.Release|Any CPU.Build.0 = Release|Any CPU + {6A1A3807-3EAF-4BE6-88B7-E8973D2C784D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6A1A3807-3EAF-4BE6-88B7-E8973D2C784D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6A1A3807-3EAF-4BE6-88B7-E8973D2C784D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6A1A3807-3EAF-4BE6-88B7-E8973D2C784D}.Release|Any CPU.Build.0 = Release|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU