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

package com.azure.analytics.purview.catalog.implementation;

import com.azure.core.annotation.BodyParam;
import com.azure.core.annotation.Delete;
import com.azure.core.annotation.ExpectedResponses;
import com.azure.core.annotation.Get;
import com.azure.core.annotation.HeaderParam;
import com.azure.core.annotation.Host;
import com.azure.core.annotation.HostParam;
import com.azure.core.annotation.PathParam;
import com.azure.core.annotation.Post;
import com.azure.core.annotation.Put;
import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceInterface;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.annotation.UnexpectedResponseExceptionType;
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.http.rest.RestProxy;
import com.azure.core.util.BinaryData;
import com.azure.core.util.Context;
import com.azure.core.util.FluxUtil;
import reactor.core.publisher.Mono;

/** An instance of this class provides access to all the operations defined in Relationships. */
public final class RelationshipsImpl {
    /** The proxy service used to perform REST calls. */
    private final RelationshipsService service;

    /** The service client containing this operation class. */
    private final PurviewCatalogClientImpl client;

    /**
     * Initializes an instance of RelationshipsImpl.
     *
     * @param client the instance of the service client containing this operation class.
     */
    RelationshipsImpl(PurviewCatalogClientImpl client) {
        this.service =
                RestProxy.create(RelationshipsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
        this.client = client;
    }

    /**
     * The interface defining all the services for PurviewCatalogClientRelationships to be used by the proxy service to
     * perform REST calls.
     */
    @Host("{Endpoint}/catalog/api")
    @ServiceInterface(name = "PurviewCatalogClient")
    public interface RelationshipsService {
        @Post("/atlas/v2/relationship")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(
                value = ClientAuthenticationException.class,
                code = {401})
        @UnexpectedResponseExceptionType(
                value = ResourceNotFoundException.class,
                code = {404})
        @UnexpectedResponseExceptionType(
                value = ResourceModifiedException.class,
                code = {409})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<Response<BinaryData>> create(
                @HostParam("Endpoint") String endpoint,
                @BodyParam("application/json") BinaryData relationship,
                @HeaderParam("Accept") String accept,
                RequestOptions requestOptions,
                Context context);

        @Post("/atlas/v2/relationship")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(
                value = ClientAuthenticationException.class,
                code = {401})
        @UnexpectedResponseExceptionType(
                value = ResourceNotFoundException.class,
                code = {404})
        @UnexpectedResponseExceptionType(
                value = ResourceModifiedException.class,
                code = {409})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Response<BinaryData> createSync(
                @HostParam("Endpoint") String endpoint,
                @BodyParam("application/json") BinaryData relationship,
                @HeaderParam("Accept") String accept,
                RequestOptions requestOptions,
                Context context);

        @Put("/atlas/v2/relationship")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(
                value = ClientAuthenticationException.class,
                code = {401})
        @UnexpectedResponseExceptionType(
                value = ResourceNotFoundException.class,
                code = {404})
        @UnexpectedResponseExceptionType(
                value = ResourceModifiedException.class,
                code = {409})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<Response<BinaryData>> update(
                @HostParam("Endpoint") String endpoint,
                @BodyParam("application/json") BinaryData relationship,
                @HeaderParam("Accept") String accept,
                RequestOptions requestOptions,
                Context context);

        @Put("/atlas/v2/relationship")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(
                value = ClientAuthenticationException.class,
                code = {401})
        @UnexpectedResponseExceptionType(
                value = ResourceNotFoundException.class,
                code = {404})
        @UnexpectedResponseExceptionType(
                value = ResourceModifiedException.class,
                code = {409})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Response<BinaryData> updateSync(
                @HostParam("Endpoint") String endpoint,
                @BodyParam("application/json") BinaryData relationship,
                @HeaderParam("Accept") String accept,
                RequestOptions requestOptions,
                Context context);

        @Get("/atlas/v2/relationship/guid/{guid}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(
                value = ClientAuthenticationException.class,
                code = {401})
        @UnexpectedResponseExceptionType(
                value = ResourceNotFoundException.class,
                code = {404})
        @UnexpectedResponseExceptionType(
                value = ResourceModifiedException.class,
                code = {409})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<Response<BinaryData>> get(
                @HostParam("Endpoint") String endpoint,
                @PathParam("guid") String guid,
                @HeaderParam("Accept") String accept,
                RequestOptions requestOptions,
                Context context);

        @Get("/atlas/v2/relationship/guid/{guid}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(
                value = ClientAuthenticationException.class,
                code = {401})
        @UnexpectedResponseExceptionType(
                value = ResourceNotFoundException.class,
                code = {404})
        @UnexpectedResponseExceptionType(
                value = ResourceModifiedException.class,
                code = {409})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Response<BinaryData> getSync(
                @HostParam("Endpoint") String endpoint,
                @PathParam("guid") String guid,
                @HeaderParam("Accept") String accept,
                RequestOptions requestOptions,
                Context context);

        @Delete("/atlas/v2/relationship/guid/{guid}")
        @ExpectedResponses({204})
        @UnexpectedResponseExceptionType(
                value = ClientAuthenticationException.class,
                code = {401})
        @UnexpectedResponseExceptionType(
                value = ResourceNotFoundException.class,
                code = {404})
        @UnexpectedResponseExceptionType(
                value = ResourceModifiedException.class,
                code = {409})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<Response<Void>> delete(
                @HostParam("Endpoint") String endpoint,
                @PathParam("guid") String guid,
                @HeaderParam("Accept") String accept,
                RequestOptions requestOptions,
                Context context);

        @Delete("/atlas/v2/relationship/guid/{guid}")
        @ExpectedResponses({204})
        @UnexpectedResponseExceptionType(
                value = ClientAuthenticationException.class,
                code = {401})
        @UnexpectedResponseExceptionType(
                value = ResourceNotFoundException.class,
                code = {404})
        @UnexpectedResponseExceptionType(
                value = ResourceModifiedException.class,
                code = {409})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Response<Void> deleteSync(
                @HostParam("Endpoint") String endpoint,
                @PathParam("guid") String guid,
                @HeaderParam("Accept") String accept,
                RequestOptions requestOptions,
                Context context);
    }

    /**
     * Create a new relationship between entities.
     *
     * <p><strong>Request Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     attributes (Optional): {
     *         String: Object (Optional)
     *     }
     *     typeName: String (Optional)
     *     lastModifiedTS: String (Optional)
     *     createTime: Float (Optional)
     *     createdBy: String (Optional)
     *     end1 (Optional): {
     *         guid: String (Optional)
     *         typeName: String (Optional)
     *         uniqueAttributes (Optional): {
     *             String: Object (Optional)
     *         }
     *     }
     *     end2 (Optional): (recursive schema, see end2 above)
     *     guid: String (Optional)
     *     homeId: String (Optional)
     *     label: String (Optional)
     *     provenanceType: Float (Optional)
     *     status: String(ACTIVE/DELETED) (Optional)
     *     updateTime: Float (Optional)
     *     updatedBy: String (Optional)
     *     version: Float (Optional)
     * }
     * }</pre>
     *
     * <p><strong>Response Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     attributes (Optional): {
     *         String: Object (Optional)
     *     }
     *     typeName: String (Optional)
     *     lastModifiedTS: String (Optional)
     *     createTime: Float (Optional)
     *     createdBy: String (Optional)
     *     end1 (Optional): {
     *         guid: String (Optional)
     *         typeName: String (Optional)
     *         uniqueAttributes (Optional): {
     *             String: Object (Optional)
     *         }
     *     }
     *     end2 (Optional): (recursive schema, see end2 above)
     *     guid: String (Optional)
     *     homeId: String (Optional)
     *     label: String (Optional)
     *     provenanceType: Float (Optional)
     *     status: String(ACTIVE/DELETED) (Optional)
     *     updateTime: Float (Optional)
     *     updatedBy: String (Optional)
     *     version: Float (Optional)
     * }
     * }</pre>
     *
     * @param relationship The AtlasRelationship object containing the information for the relationship to be created.
     * @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 atlasRelationship along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<BinaryData>> createWithResponseAsync(BinaryData relationship, RequestOptions requestOptions) {
        final String accept = "application/json";
        return FluxUtil.withContext(
                context -> service.create(this.client.getEndpoint(), relationship, accept, requestOptions, context));
    }

    /**
     * Create a new relationship between entities.
     *
     * <p><strong>Request Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     attributes (Optional): {
     *         String: Object (Optional)
     *     }
     *     typeName: String (Optional)
     *     lastModifiedTS: String (Optional)
     *     createTime: Float (Optional)
     *     createdBy: String (Optional)
     *     end1 (Optional): {
     *         guid: String (Optional)
     *         typeName: String (Optional)
     *         uniqueAttributes (Optional): {
     *             String: Object (Optional)
     *         }
     *     }
     *     end2 (Optional): (recursive schema, see end2 above)
     *     guid: String (Optional)
     *     homeId: String (Optional)
     *     label: String (Optional)
     *     provenanceType: Float (Optional)
     *     status: String(ACTIVE/DELETED) (Optional)
     *     updateTime: Float (Optional)
     *     updatedBy: String (Optional)
     *     version: Float (Optional)
     * }
     * }</pre>
     *
     * <p><strong>Response Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     attributes (Optional): {
     *         String: Object (Optional)
     *     }
     *     typeName: String (Optional)
     *     lastModifiedTS: String (Optional)
     *     createTime: Float (Optional)
     *     createdBy: String (Optional)
     *     end1 (Optional): {
     *         guid: String (Optional)
     *         typeName: String (Optional)
     *         uniqueAttributes (Optional): {
     *             String: Object (Optional)
     *         }
     *     }
     *     end2 (Optional): (recursive schema, see end2 above)
     *     guid: String (Optional)
     *     homeId: String (Optional)
     *     label: String (Optional)
     *     provenanceType: Float (Optional)
     *     status: String(ACTIVE/DELETED) (Optional)
     *     updateTime: Float (Optional)
     *     updatedBy: String (Optional)
     *     version: Float (Optional)
     * }
     * }</pre>
     *
     * @param relationship The AtlasRelationship object containing the information for the relationship to be created.
     * @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 atlasRelationship along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<BinaryData> createWithResponse(BinaryData relationship, RequestOptions requestOptions) {
        final String accept = "application/json";
        return service.createSync(this.client.getEndpoint(), relationship, accept, requestOptions, Context.NONE);
    }

    /**
     * Update an existing relationship between entities.
     *
     * <p><strong>Request Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     attributes (Optional): {
     *         String: Object (Optional)
     *     }
     *     typeName: String (Optional)
     *     lastModifiedTS: String (Optional)
     *     createTime: Float (Optional)
     *     createdBy: String (Optional)
     *     end1 (Optional): {
     *         guid: String (Optional)
     *         typeName: String (Optional)
     *         uniqueAttributes (Optional): {
     *             String: Object (Optional)
     *         }
     *     }
     *     end2 (Optional): (recursive schema, see end2 above)
     *     guid: String (Optional)
     *     homeId: String (Optional)
     *     label: String (Optional)
     *     provenanceType: Float (Optional)
     *     status: String(ACTIVE/DELETED) (Optional)
     *     updateTime: Float (Optional)
     *     updatedBy: String (Optional)
     *     version: Float (Optional)
     * }
     * }</pre>
     *
     * <p><strong>Response Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     attributes (Optional): {
     *         String: Object (Optional)
     *     }
     *     typeName: String (Optional)
     *     lastModifiedTS: String (Optional)
     *     createTime: Float (Optional)
     *     createdBy: String (Optional)
     *     end1 (Optional): {
     *         guid: String (Optional)
     *         typeName: String (Optional)
     *         uniqueAttributes (Optional): {
     *             String: Object (Optional)
     *         }
     *     }
     *     end2 (Optional): (recursive schema, see end2 above)
     *     guid: String (Optional)
     *     homeId: String (Optional)
     *     label: String (Optional)
     *     provenanceType: Float (Optional)
     *     status: String(ACTIVE/DELETED) (Optional)
     *     updateTime: Float (Optional)
     *     updatedBy: String (Optional)
     *     version: Float (Optional)
     * }
     * }</pre>
     *
     * @param relationship The AtlasRelationship object containing the information for the relationship to be created.
     * @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 atlasRelationship along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<BinaryData>> updateWithResponseAsync(BinaryData relationship, RequestOptions requestOptions) {
        final String accept = "application/json";
        return FluxUtil.withContext(
                context -> service.update(this.client.getEndpoint(), relationship, accept, requestOptions, context));
    }

    /**
     * Update an existing relationship between entities.
     *
     * <p><strong>Request Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     attributes (Optional): {
     *         String: Object (Optional)
     *     }
     *     typeName: String (Optional)
     *     lastModifiedTS: String (Optional)
     *     createTime: Float (Optional)
     *     createdBy: String (Optional)
     *     end1 (Optional): {
     *         guid: String (Optional)
     *         typeName: String (Optional)
     *         uniqueAttributes (Optional): {
     *             String: Object (Optional)
     *         }
     *     }
     *     end2 (Optional): (recursive schema, see end2 above)
     *     guid: String (Optional)
     *     homeId: String (Optional)
     *     label: String (Optional)
     *     provenanceType: Float (Optional)
     *     status: String(ACTIVE/DELETED) (Optional)
     *     updateTime: Float (Optional)
     *     updatedBy: String (Optional)
     *     version: Float (Optional)
     * }
     * }</pre>
     *
     * <p><strong>Response Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     attributes (Optional): {
     *         String: Object (Optional)
     *     }
     *     typeName: String (Optional)
     *     lastModifiedTS: String (Optional)
     *     createTime: Float (Optional)
     *     createdBy: String (Optional)
     *     end1 (Optional): {
     *         guid: String (Optional)
     *         typeName: String (Optional)
     *         uniqueAttributes (Optional): {
     *             String: Object (Optional)
     *         }
     *     }
     *     end2 (Optional): (recursive schema, see end2 above)
     *     guid: String (Optional)
     *     homeId: String (Optional)
     *     label: String (Optional)
     *     provenanceType: Float (Optional)
     *     status: String(ACTIVE/DELETED) (Optional)
     *     updateTime: Float (Optional)
     *     updatedBy: String (Optional)
     *     version: Float (Optional)
     * }
     * }</pre>
     *
     * @param relationship The AtlasRelationship object containing the information for the relationship to be created.
     * @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 atlasRelationship along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<BinaryData> updateWithResponse(BinaryData relationship, RequestOptions requestOptions) {
        final String accept = "application/json";
        return service.updateSync(this.client.getEndpoint(), relationship, accept, requestOptions, Context.NONE);
    }

    /**
     * Get relationship information between entities by its GUID.
     *
     * <p><strong>Query Parameters</strong>
     *
     * <table border="1">
     *     <caption>Query Parameters</caption>
     *     <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
     *     <tr><td>extendedInfo</td><td>Boolean</td><td>No</td><td>Limits whether includes extended information.</td></tr>
     * </table>
     *
     * You can add these to a request with {@link RequestOptions#addQueryParam}
     *
     * <p><strong>Response Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     referredEntities (Optional): {
     *         String (Optional): {
     *             attributes (Optional): {
     *                 String: Object (Optional)
     *             }
     *             typeName: String (Optional)
     *             lastModifiedTS: String (Optional)
     *             classificationNames (Optional): [
     *                 String (Optional)
     *             ]
     *             classifications (Optional): [
     *                  (Optional){
     *                     attributes (Optional): {
     *                         String: Object (Optional)
     *                     }
     *                     typeName: String (Optional)
     *                     lastModifiedTS: String (Optional)
     *                     entityGuid: String (Optional)
     *                     entityStatus: String(ACTIVE/DELETED) (Optional)
     *                     removePropagationsOnEntityDelete: Boolean (Optional)
     *                     validityPeriods (Optional): [
     *                          (Optional){
     *                             endTime: String (Optional)
     *                             startTime: String (Optional)
     *                             timeZone: String (Optional)
     *                         }
     *                     ]
     *                     source: String (Optional)
     *                     sourceDetails (Optional): {
     *                         String: Object (Optional)
     *                     }
     *                 }
     *             ]
     *             displayText: String (Optional)
     *             guid: String (Optional)
     *             isIncomplete: Boolean (Optional)
     *             labels (Optional): [
     *                 String (Optional)
     *             ]
     *             meaningNames (Optional): [
     *                 String (Optional)
     *             ]
     *             meanings (Optional): [
     *                  (Optional){
     *                     confidence: Integer (Optional)
     *                     createdBy: String (Optional)
     *                     description: String (Optional)
     *                     displayText: String (Optional)
     *                     expression: String (Optional)
     *                     relationGuid: String (Optional)
     *                     source: String (Optional)
     *                     status: String(DISCOVERED/PROPOSED/IMPORTED/VALIDATED/DEPRECATED/OBSOLETE/OTHER) (Optional)
     *                     steward: String (Optional)
     *                     termGuid: String (Optional)
     *                 }
     *             ]
     *             status: String(ACTIVE/DELETED) (Optional)
     *         }
     *     }
     *     relationship (Optional): {
     *         attributes (Optional): {
     *             String: Object (Optional)
     *         }
     *         typeName: String (Optional)
     *         lastModifiedTS: String (Optional)
     *         createTime: Float (Optional)
     *         createdBy: String (Optional)
     *         end1 (Optional): {
     *             guid: String (Optional)
     *             typeName: String (Optional)
     *             uniqueAttributes (Optional): {
     *                 String: Object (Optional)
     *             }
     *         }
     *         end2 (Optional): (recursive schema, see end2 above)
     *         guid: String (Optional)
     *         homeId: String (Optional)
     *         label: String (Optional)
     *         provenanceType: Float (Optional)
     *         status: String(ACTIVE/DELETED) (Optional)
     *         updateTime: Float (Optional)
     *         updatedBy: String (Optional)
     *         version: Float (Optional)
     *     }
     * }
     * }</pre>
     *
     * @param guid The globally unique identifier of the relationship.
     * @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 relationship information between entities by its GUID along with {@link Response} on successful
     *     completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<BinaryData>> getWithResponseAsync(String guid, RequestOptions requestOptions) {
        final String accept = "application/json";
        return FluxUtil.withContext(
                context -> service.get(this.client.getEndpoint(), guid, accept, requestOptions, context));
    }

    /**
     * Get relationship information between entities by its GUID.
     *
     * <p><strong>Query Parameters</strong>
     *
     * <table border="1">
     *     <caption>Query Parameters</caption>
     *     <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
     *     <tr><td>extendedInfo</td><td>Boolean</td><td>No</td><td>Limits whether includes extended information.</td></tr>
     * </table>
     *
     * You can add these to a request with {@link RequestOptions#addQueryParam}
     *
     * <p><strong>Response Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     referredEntities (Optional): {
     *         String (Optional): {
     *             attributes (Optional): {
     *                 String: Object (Optional)
     *             }
     *             typeName: String (Optional)
     *             lastModifiedTS: String (Optional)
     *             classificationNames (Optional): [
     *                 String (Optional)
     *             ]
     *             classifications (Optional): [
     *                  (Optional){
     *                     attributes (Optional): {
     *                         String: Object (Optional)
     *                     }
     *                     typeName: String (Optional)
     *                     lastModifiedTS: String (Optional)
     *                     entityGuid: String (Optional)
     *                     entityStatus: String(ACTIVE/DELETED) (Optional)
     *                     removePropagationsOnEntityDelete: Boolean (Optional)
     *                     validityPeriods (Optional): [
     *                          (Optional){
     *                             endTime: String (Optional)
     *                             startTime: String (Optional)
     *                             timeZone: String (Optional)
     *                         }
     *                     ]
     *                     source: String (Optional)
     *                     sourceDetails (Optional): {
     *                         String: Object (Optional)
     *                     }
     *                 }
     *             ]
     *             displayText: String (Optional)
     *             guid: String (Optional)
     *             isIncomplete: Boolean (Optional)
     *             labels (Optional): [
     *                 String (Optional)
     *             ]
     *             meaningNames (Optional): [
     *                 String (Optional)
     *             ]
     *             meanings (Optional): [
     *                  (Optional){
     *                     confidence: Integer (Optional)
     *                     createdBy: String (Optional)
     *                     description: String (Optional)
     *                     displayText: String (Optional)
     *                     expression: String (Optional)
     *                     relationGuid: String (Optional)
     *                     source: String (Optional)
     *                     status: String(DISCOVERED/PROPOSED/IMPORTED/VALIDATED/DEPRECATED/OBSOLETE/OTHER) (Optional)
     *                     steward: String (Optional)
     *                     termGuid: String (Optional)
     *                 }
     *             ]
     *             status: String(ACTIVE/DELETED) (Optional)
     *         }
     *     }
     *     relationship (Optional): {
     *         attributes (Optional): {
     *             String: Object (Optional)
     *         }
     *         typeName: String (Optional)
     *         lastModifiedTS: String (Optional)
     *         createTime: Float (Optional)
     *         createdBy: String (Optional)
     *         end1 (Optional): {
     *             guid: String (Optional)
     *             typeName: String (Optional)
     *             uniqueAttributes (Optional): {
     *                 String: Object (Optional)
     *             }
     *         }
     *         end2 (Optional): (recursive schema, see end2 above)
     *         guid: String (Optional)
     *         homeId: String (Optional)
     *         label: String (Optional)
     *         provenanceType: Float (Optional)
     *         status: String(ACTIVE/DELETED) (Optional)
     *         updateTime: Float (Optional)
     *         updatedBy: String (Optional)
     *         version: Float (Optional)
     *     }
     * }
     * }</pre>
     *
     * @param guid The globally unique identifier of the relationship.
     * @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 relationship information between entities by its GUID along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<BinaryData> getWithResponse(String guid, RequestOptions requestOptions) {
        final String accept = "application/json";
        return service.getSync(this.client.getEndpoint(), guid, accept, requestOptions, Context.NONE);
    }

    /**
     * Delete a relationship between entities by its GUID.
     *
     * @param guid The globally unique identifier of the relationship.
     * @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} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<Void>> deleteWithResponseAsync(String guid, RequestOptions requestOptions) {
        final String accept = "application/json";
        return FluxUtil.withContext(
                context -> service.delete(this.client.getEndpoint(), guid, accept, requestOptions, context));
    }

    /**
     * Delete a relationship between entities by its GUID.
     *
     * @param guid The globally unique identifier of the relationship.
     * @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}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<Void> deleteWithResponse(String guid, RequestOptions requestOptions) {
        final String accept = "application/json";
        return service.deleteSync(this.client.getEndpoint(), guid, accept, requestOptions, Context.NONE);
    }
}
