|
46 | 46 | import com.azure.storage.blob.implementation.models.ContainersSetAccessPolicyHeaders; |
47 | 47 | import com.azure.storage.blob.implementation.models.ContainersSetMetadataHeaders; |
48 | 48 | import com.azure.storage.blob.implementation.models.ContainersSubmitBatchHeaders; |
| 49 | +import com.azure.storage.blob.implementation.models.CreateSessionConfiguration; |
| 50 | +import com.azure.storage.blob.implementation.models.CreateSessionResponse; |
49 | 51 | import com.azure.storage.blob.implementation.models.FilterBlobSegment; |
50 | 52 | import com.azure.storage.blob.implementation.models.FilterBlobsIncludeItem; |
51 | 53 | import com.azure.storage.blob.implementation.models.ListBlobsFlatSegmentResponse; |
@@ -938,6 +940,24 @@ Response<Void> getAccountInfoNoCustomHeadersSync(@HostParam("url") String url, |
938 | 940 | @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, |
939 | 941 | @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, |
940 | 942 | @HeaderParam("Accept") String accept, Context context); |
| 943 | + |
| 944 | + @Post("/{containerName}") |
| 945 | + @ExpectedResponses({ 201 }) |
| 946 | + @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) |
| 947 | + Mono<Response<CreateSessionResponse>> createSession(@HostParam("url") String url, |
| 948 | + @PathParam("containerName") String containerName, @QueryParam("restype") String restype, |
| 949 | + @QueryParam("comp") String comp, |
| 950 | + @BodyParam("application/xml") CreateSessionConfiguration createSessionConfiguration, |
| 951 | + @HeaderParam("Accept") String accept, Context context); |
| 952 | + |
| 953 | + @Post("/{containerName}") |
| 954 | + @ExpectedResponses({ 201 }) |
| 955 | + @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) |
| 956 | + Response<CreateSessionResponse> createSessionSync(@HostParam("url") String url, |
| 957 | + @PathParam("containerName") String containerName, @QueryParam("restype") String restype, |
| 958 | + @QueryParam("comp") String comp, |
| 959 | + @BodyParam("application/xml") CreateSessionConfiguration createSessionConfiguration, |
| 960 | + @HeaderParam("Accept") String accept, Context context); |
941 | 961 | } |
942 | 962 |
|
943 | 963 | /** |
@@ -6707,4 +6727,127 @@ public Response<Void> getAccountInfoNoCustomHeadersWithResponse(String container |
6707 | 6727 | throw ModelHelper.mapToBlobStorageException(internalException); |
6708 | 6728 | } |
6709 | 6729 | } |
| 6730 | + |
| 6731 | + /** |
| 6732 | + * The Create Session operation enables users to create a session scoped to a container. |
| 6733 | + * |
| 6734 | + * @param containerName The container name. |
| 6735 | + * @param createSessionConfiguration The createSessionConfiguration parameter. |
| 6736 | + * @throws IllegalArgumentException thrown if parameters fail the validation. |
| 6737 | + * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. |
| 6738 | + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. |
| 6739 | + * @return the response body along with {@link Response} on successful completion of {@link Mono}. |
| 6740 | + */ |
| 6741 | + @ServiceMethod(returns = ReturnType.SINGLE) |
| 6742 | + public Mono<Response<CreateSessionResponse>> createSessionWithResponseAsync(String containerName, |
| 6743 | + CreateSessionConfiguration createSessionConfiguration) { |
| 6744 | + return FluxUtil |
| 6745 | + .withContext(context -> createSessionWithResponseAsync(containerName, createSessionConfiguration, context)) |
| 6746 | + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); |
| 6747 | + } |
| 6748 | + |
| 6749 | + /** |
| 6750 | + * The Create Session operation enables users to create a session scoped to a container. |
| 6751 | + * |
| 6752 | + * @param containerName The container name. |
| 6753 | + * @param createSessionConfiguration The createSessionConfiguration parameter. |
| 6754 | + * @param context The context to associate with this operation. |
| 6755 | + * @throws IllegalArgumentException thrown if parameters fail the validation. |
| 6756 | + * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. |
| 6757 | + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. |
| 6758 | + * @return the response body along with {@link Response} on successful completion of {@link Mono}. |
| 6759 | + */ |
| 6760 | + @ServiceMethod(returns = ReturnType.SINGLE) |
| 6761 | + public Mono<Response<CreateSessionResponse>> createSessionWithResponseAsync(String containerName, |
| 6762 | + CreateSessionConfiguration createSessionConfiguration, Context context) { |
| 6763 | + final String restype = "container"; |
| 6764 | + final String comp = "session"; |
| 6765 | + final String accept = "application/xml"; |
| 6766 | + return service |
| 6767 | + .createSession(this.client.getUrl(), containerName, restype, comp, createSessionConfiguration, accept, |
| 6768 | + context) |
| 6769 | + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); |
| 6770 | + } |
| 6771 | + |
| 6772 | + /** |
| 6773 | + * The Create Session operation enables users to create a session scoped to a container. |
| 6774 | + * |
| 6775 | + * @param containerName The container name. |
| 6776 | + * @param createSessionConfiguration The createSessionConfiguration parameter. |
| 6777 | + * @throws IllegalArgumentException thrown if parameters fail the validation. |
| 6778 | + * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. |
| 6779 | + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. |
| 6780 | + * @return the response body on successful completion of {@link Mono}. |
| 6781 | + */ |
| 6782 | + @ServiceMethod(returns = ReturnType.SINGLE) |
| 6783 | + public Mono<CreateSessionResponse> createSessionAsync(String containerName, |
| 6784 | + CreateSessionConfiguration createSessionConfiguration) { |
| 6785 | + return createSessionWithResponseAsync(containerName, createSessionConfiguration) |
| 6786 | + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) |
| 6787 | + .flatMap(res -> Mono.justOrEmpty(res.getValue())); |
| 6788 | + } |
| 6789 | + |
| 6790 | + /** |
| 6791 | + * The Create Session operation enables users to create a session scoped to a container. |
| 6792 | + * |
| 6793 | + * @param containerName The container name. |
| 6794 | + * @param createSessionConfiguration The createSessionConfiguration parameter. |
| 6795 | + * @param context The context to associate with this operation. |
| 6796 | + * @throws IllegalArgumentException thrown if parameters fail the validation. |
| 6797 | + * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. |
| 6798 | + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. |
| 6799 | + * @return the response body on successful completion of {@link Mono}. |
| 6800 | + */ |
| 6801 | + @ServiceMethod(returns = ReturnType.SINGLE) |
| 6802 | + public Mono<CreateSessionResponse> createSessionAsync(String containerName, |
| 6803 | + CreateSessionConfiguration createSessionConfiguration, Context context) { |
| 6804 | + return createSessionWithResponseAsync(containerName, createSessionConfiguration, context) |
| 6805 | + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) |
| 6806 | + .flatMap(res -> Mono.justOrEmpty(res.getValue())); |
| 6807 | + } |
| 6808 | + |
| 6809 | + /** |
| 6810 | + * The Create Session operation enables users to create a session scoped to a container. |
| 6811 | + * |
| 6812 | + * @param containerName The container name. |
| 6813 | + * @param createSessionConfiguration The createSessionConfiguration parameter. |
| 6814 | + * @param context The context to associate with this operation. |
| 6815 | + * @throws IllegalArgumentException thrown if parameters fail the validation. |
| 6816 | + * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. |
| 6817 | + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. |
| 6818 | + * @return the response body along with {@link Response}. |
| 6819 | + */ |
| 6820 | + @ServiceMethod(returns = ReturnType.SINGLE) |
| 6821 | + public Response<CreateSessionResponse> createSessionWithResponse(String containerName, |
| 6822 | + CreateSessionConfiguration createSessionConfiguration, Context context) { |
| 6823 | + try { |
| 6824 | + final String restype = "container"; |
| 6825 | + final String comp = "session"; |
| 6826 | + final String accept = "application/xml"; |
| 6827 | + return service.createSessionSync(this.client.getUrl(), containerName, restype, comp, |
| 6828 | + createSessionConfiguration, accept, context); |
| 6829 | + } catch (BlobStorageExceptionInternal internalException) { |
| 6830 | + throw ModelHelper.mapToBlobStorageException(internalException); |
| 6831 | + } |
| 6832 | + } |
| 6833 | + |
| 6834 | + /** |
| 6835 | + * The Create Session operation enables users to create a session scoped to a container. |
| 6836 | + * |
| 6837 | + * @param containerName The container name. |
| 6838 | + * @param createSessionConfiguration The createSessionConfiguration parameter. |
| 6839 | + * @throws IllegalArgumentException thrown if parameters fail the validation. |
| 6840 | + * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. |
| 6841 | + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. |
| 6842 | + * @return the response. |
| 6843 | + */ |
| 6844 | + @ServiceMethod(returns = ReturnType.SINGLE) |
| 6845 | + public CreateSessionResponse createSession(String containerName, |
| 6846 | + CreateSessionConfiguration createSessionConfiguration) { |
| 6847 | + try { |
| 6848 | + return createSessionWithResponse(containerName, createSessionConfiguration, Context.NONE).getValue(); |
| 6849 | + } catch (BlobStorageExceptionInternal internalException) { |
| 6850 | + throw ModelHelper.mapToBlobStorageException(internalException); |
| 6851 | + } |
| 6852 | + } |
6710 | 6853 | } |
0 commit comments