// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) TypeSpec Code Generator.

package type.file;

import com.azure.core.annotation.Generated;
import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceClient;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.exception.ClientAuthenticationException;
import com.azure.core.exception.HttpResponseException;
import com.azure.core.exception.ResourceModifiedException;
import com.azure.core.exception.ResourceNotFoundException;
import com.azure.core.http.rest.RequestOptions;
import com.azure.core.http.rest.Response;
import com.azure.core.util.BinaryData;
import type.file.implementation.BodiesImpl;

/**
 * Initializes a new instance of the synchronous FileClient type.
 */
@ServiceClient(builder = FileClientBuilder.class)
public final class FileClient {
    @Generated
    private final BodiesImpl serviceClient;

    /**
     * Initializes an instance of FileClient class.
     * 
     * @param serviceClient the service client implementation.
     */
    @Generated
    FileClient(BodiesImpl serviceClient) {
        this.serviceClient = serviceClient;
    }

    /**
     * The uploadFileSpecificContentType operation.
     * <p><strong>Request Body Schema</strong></p>
     * 
     * <pre>
     * {@code
     * BinaryData
     * }
     * </pre>
     * 
     * @param file The file parameter.
     * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @return the {@link Response}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<Void> uploadFileSpecificContentTypeWithResponse(BinaryData file, RequestOptions requestOptions) {
        return this.serviceClient.uploadFileSpecificContentTypeWithResponse(file, requestOptions);
    }

    /**
     * The uploadFileJsonContentType operation.
     * <p><strong>Request Body Schema</strong></p>
     * 
     * <pre>
     * {@code
     * BinaryData
     * }
     * </pre>
     * 
     * @param file The file parameter.
     * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @return the {@link Response}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<Void> uploadFileJsonContentTypeWithResponse(BinaryData file, RequestOptions requestOptions) {
        return this.serviceClient.uploadFileJsonContentTypeWithResponse(file, requestOptions);
    }

    /**
     * The downloadFileJsonContentType operation.
     * <p><strong>Response Body Schema</strong></p>
     * 
     * <pre>
     * {@code
     * BinaryData
     * }
     * </pre>
     * 
     * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @return the response body along with {@link Response}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<BinaryData> downloadFileJsonContentTypeWithResponse(RequestOptions requestOptions) {
        return this.serviceClient.downloadFileJsonContentTypeWithResponse(requestOptions);
    }

    /**
     * The downloadFileSpecificContentType operation.
     * <p><strong>Response Body Schema</strong></p>
     * 
     * <pre>
     * {@code
     * BinaryData
     * }
     * </pre>
     * 
     * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @return the response body along with {@link Response}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<BinaryData> downloadFileSpecificContentTypeWithResponse(RequestOptions requestOptions) {
        return this.serviceClient.downloadFileSpecificContentTypeWithResponse(requestOptions);
    }

    /**
     * The uploadFileMultipleContentTypes operation.
     * <p><strong>Request Body Schema</strong></p>
     * 
     * <pre>
     * {@code
     * BinaryData
     * }
     * </pre>
     * 
     * @param contentType Body parameter's content type. Known values are image/png,image/jpeg. Allowed values:
     * "image/png", "image/jpeg".
     * @param file The file parameter.
     * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @return the {@link Response}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<Void> uploadFileMultipleContentTypesWithResponse(String contentType, BinaryData file,
        RequestOptions requestOptions) {
        // Operation 'uploadFileMultipleContentTypes' can be invoked with multiple content-type. It is difficult to form
        // a correct method signature for convenience API, and hence the convenience API is not generated.
        return this.serviceClient.uploadFileMultipleContentTypesWithResponse(contentType, file, requestOptions);
    }

    /**
     * The downloadFileMultipleContentTypes operation.
     * <p><strong>Response Body Schema</strong></p>
     * 
     * <pre>
     * {@code
     * BinaryData
     * }
     * </pre>
     * 
     * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @return the response body along with {@link Response}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<BinaryData> downloadFileMultipleContentTypesWithResponse(RequestOptions requestOptions) {
        return this.serviceClient.downloadFileMultipleContentTypesWithResponse(requestOptions);
    }

    /**
     * The uploadFileDefaultContentType operation.
     * <p><strong>Request Body Schema</strong></p>
     * 
     * <pre>
     * {@code
     * BinaryData
     * }
     * </pre>
     * 
     * @param file The file parameter.
     * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @return the {@link Response}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<Void> uploadFileDefaultContentTypeWithResponse(BinaryData file, RequestOptions requestOptions) {
        return this.serviceClient.uploadFileDefaultContentTypeWithResponse(file, requestOptions);
    }

    /**
     * The downloadFileDefaultContentType operation.
     * <p><strong>Response Body Schema</strong></p>
     * 
     * <pre>
     * {@code
     * BinaryData
     * }
     * </pre>
     * 
     * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @return the response body along with {@link Response}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<BinaryData> downloadFileDefaultContentTypeWithResponse(RequestOptions requestOptions) {
        return this.serviceClient.downloadFileDefaultContentTypeWithResponse(requestOptions);
    }

    /**
     * The uploadFileSpecificContentType operation.
     * 
     * @param file The file parameter.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public void uploadFileSpecificContentType(BinaryData file) {
        // Generated convenience method for uploadFileSpecificContentTypeWithResponse
        RequestOptions requestOptions = new RequestOptions();
        uploadFileSpecificContentTypeWithResponse(file, requestOptions).getValue();
    }

    /**
     * The uploadFileJsonContentType operation.
     * 
     * @param file The file parameter.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public void uploadFileJsonContentType(BinaryData file) {
        // Generated convenience method for uploadFileJsonContentTypeWithResponse
        RequestOptions requestOptions = new RequestOptions();
        uploadFileJsonContentTypeWithResponse(file, requestOptions).getValue();
    }

    /**
     * The downloadFileJsonContentType operation.
     * 
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public BinaryData downloadFileJsonContentType() {
        // Generated convenience method for downloadFileJsonContentTypeWithResponse
        RequestOptions requestOptions = new RequestOptions();
        return downloadFileJsonContentTypeWithResponse(requestOptions).getValue();
    }

    /**
     * The downloadFileSpecificContentType operation.
     * 
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public BinaryData downloadFileSpecificContentType() {
        // Generated convenience method for downloadFileSpecificContentTypeWithResponse
        RequestOptions requestOptions = new RequestOptions();
        return downloadFileSpecificContentTypeWithResponse(requestOptions).getValue();
    }

    /**
     * The downloadFileMultipleContentTypes operation.
     * 
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public BinaryData downloadFileMultipleContentTypes() {
        // Generated convenience method for downloadFileMultipleContentTypesWithResponse
        RequestOptions requestOptions = new RequestOptions();
        return downloadFileMultipleContentTypesWithResponse(requestOptions).getValue();
    }

    /**
     * The uploadFileDefaultContentType operation.
     * 
     * @param file The file parameter.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public void uploadFileDefaultContentType(BinaryData file) {
        // Generated convenience method for uploadFileDefaultContentTypeWithResponse
        RequestOptions requestOptions = new RequestOptions();
        uploadFileDefaultContentTypeWithResponse(file, requestOptions).getValue();
    }

    /**
     * The downloadFileDefaultContentType operation.
     * 
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public BinaryData downloadFileDefaultContentType() {
        // Generated convenience method for downloadFileDefaultContentTypeWithResponse
        RequestOptions requestOptions = new RequestOptions();
        return downloadFileDefaultContentTypeWithResponse(requestOptions).getValue();
    }
}
