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

package com.azure.resourcemanager.apimanagement.fluent.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;

/** Request Report data. */
@Fluent
public final class RequestReportRecordContractInner {
    /*
     * API identifier path. /apis/{apiId}
     */
    @JsonProperty(value = "apiId")
    private String apiId;

    /*
     * Operation identifier path. /apis/{apiId}/operations/{operationId}
     */
    @JsonProperty(value = "operationId")
    private String operationId;

    /*
     * Product identifier path. /products/{productId}
     */
    @JsonProperty(value = "productId", access = JsonProperty.Access.WRITE_ONLY)
    private String productId;

    /*
     * User identifier path. /users/{userId}
     */
    @JsonProperty(value = "userId", access = JsonProperty.Access.WRITE_ONLY)
    private String userId;

    /*
     * The HTTP method associated with this request..
     */
    @JsonProperty(value = "method")
    private String method;

    /*
     * The full URL associated with this request.
     */
    @JsonProperty(value = "url")
    private String url;

    /*
     * The client IP address associated with this request.
     */
    @JsonProperty(value = "ipAddress")
    private String ipAddress;

    /*
     * The HTTP status code received by the gateway as a result of forwarding
     * this request to the backend.
     */
    @JsonProperty(value = "backendResponseCode")
    private String backendResponseCode;

    /*
     * The HTTP status code returned by the gateway.
     */
    @JsonProperty(value = "responseCode")
    private Integer responseCode;

    /*
     * The size of the response returned by the gateway.
     */
    @JsonProperty(value = "responseSize")
    private Integer responseSize;

    /*
     * The date and time when this request was received by the gateway in ISO
     * 8601 format.
     */
    @JsonProperty(value = "timestamp")
    private OffsetDateTime timestamp;

    /*
     * Specifies if response cache was involved in generating the response. If
     * the value is none, the cache was not used. If the value is hit, cached
     * response was returned. If the value is miss, the cache was used but
     * lookup resulted in a miss and request was fulfilled by the backend.
     */
    @JsonProperty(value = "cache")
    private String cache;

    /*
     * The total time it took to process this request.
     */
    @JsonProperty(value = "apiTime")
    private Double apiTime;

    /*
     * he time it took to forward this request to the backend and get the
     * response back.
     */
    @JsonProperty(value = "serviceTime")
    private Double serviceTime;

    /*
     * Azure region where the gateway that processed this request is located.
     */
    @JsonProperty(value = "apiRegion")
    private String apiRegion;

    /*
     * Subscription identifier path. /subscriptions/{subscriptionId}
     */
    @JsonProperty(value = "subscriptionId")
    private String subscriptionId;

    /*
     * Request Identifier.
     */
    @JsonProperty(value = "requestId")
    private String requestId;

    /*
     * The size of this request..
     */
    @JsonProperty(value = "requestSize")
    private Integer requestSize;

    /**
     * Get the apiId property: API identifier path. /apis/{apiId}.
     *
     * @return the apiId value.
     */
    public String apiId() {
        return this.apiId;
    }

    /**
     * Set the apiId property: API identifier path. /apis/{apiId}.
     *
     * @param apiId the apiId value to set.
     * @return the RequestReportRecordContractInner object itself.
     */
    public RequestReportRecordContractInner withApiId(String apiId) {
        this.apiId = apiId;
        return this;
    }

    /**
     * Get the operationId property: Operation identifier path. /apis/{apiId}/operations/{operationId}.
     *
     * @return the operationId value.
     */
    public String operationId() {
        return this.operationId;
    }

    /**
     * Set the operationId property: Operation identifier path. /apis/{apiId}/operations/{operationId}.
     *
     * @param operationId the operationId value to set.
     * @return the RequestReportRecordContractInner object itself.
     */
    public RequestReportRecordContractInner withOperationId(String operationId) {
        this.operationId = operationId;
        return this;
    }

    /**
     * Get the productId property: Product identifier path. /products/{productId}.
     *
     * @return the productId value.
     */
    public String productId() {
        return this.productId;
    }

    /**
     * Get the userId property: User identifier path. /users/{userId}.
     *
     * @return the userId value.
     */
    public String userId() {
        return this.userId;
    }

    /**
     * Get the method property: The HTTP method associated with this request..
     *
     * @return the method value.
     */
    public String method() {
        return this.method;
    }

    /**
     * Set the method property: The HTTP method associated with this request..
     *
     * @param method the method value to set.
     * @return the RequestReportRecordContractInner object itself.
     */
    public RequestReportRecordContractInner withMethod(String method) {
        this.method = method;
        return this;
    }

    /**
     * Get the url property: The full URL associated with this request.
     *
     * @return the url value.
     */
    public String url() {
        return this.url;
    }

    /**
     * Set the url property: The full URL associated with this request.
     *
     * @param url the url value to set.
     * @return the RequestReportRecordContractInner object itself.
     */
    public RequestReportRecordContractInner withUrl(String url) {
        this.url = url;
        return this;
    }

    /**
     * Get the ipAddress property: The client IP address associated with this request.
     *
     * @return the ipAddress value.
     */
    public String ipAddress() {
        return this.ipAddress;
    }

    /**
     * Set the ipAddress property: The client IP address associated with this request.
     *
     * @param ipAddress the ipAddress value to set.
     * @return the RequestReportRecordContractInner object itself.
     */
    public RequestReportRecordContractInner withIpAddress(String ipAddress) {
        this.ipAddress = ipAddress;
        return this;
    }

    /**
     * Get the backendResponseCode property: The HTTP status code received by the gateway as a result of forwarding this
     * request to the backend.
     *
     * @return the backendResponseCode value.
     */
    public String backendResponseCode() {
        return this.backendResponseCode;
    }

    /**
     * Set the backendResponseCode property: The HTTP status code received by the gateway as a result of forwarding this
     * request to the backend.
     *
     * @param backendResponseCode the backendResponseCode value to set.
     * @return the RequestReportRecordContractInner object itself.
     */
    public RequestReportRecordContractInner withBackendResponseCode(String backendResponseCode) {
        this.backendResponseCode = backendResponseCode;
        return this;
    }

    /**
     * Get the responseCode property: The HTTP status code returned by the gateway.
     *
     * @return the responseCode value.
     */
    public Integer responseCode() {
        return this.responseCode;
    }

    /**
     * Set the responseCode property: The HTTP status code returned by the gateway.
     *
     * @param responseCode the responseCode value to set.
     * @return the RequestReportRecordContractInner object itself.
     */
    public RequestReportRecordContractInner withResponseCode(Integer responseCode) {
        this.responseCode = responseCode;
        return this;
    }

    /**
     * Get the responseSize property: The size of the response returned by the gateway.
     *
     * @return the responseSize value.
     */
    public Integer responseSize() {
        return this.responseSize;
    }

    /**
     * Set the responseSize property: The size of the response returned by the gateway.
     *
     * @param responseSize the responseSize value to set.
     * @return the RequestReportRecordContractInner object itself.
     */
    public RequestReportRecordContractInner withResponseSize(Integer responseSize) {
        this.responseSize = responseSize;
        return this;
    }

    /**
     * Get the timestamp property: The date and time when this request was received by the gateway in ISO 8601 format.
     *
     * @return the timestamp value.
     */
    public OffsetDateTime timestamp() {
        return this.timestamp;
    }

    /**
     * Set the timestamp property: The date and time when this request was received by the gateway in ISO 8601 format.
     *
     * @param timestamp the timestamp value to set.
     * @return the RequestReportRecordContractInner object itself.
     */
    public RequestReportRecordContractInner withTimestamp(OffsetDateTime timestamp) {
        this.timestamp = timestamp;
        return this;
    }

    /**
     * Get the cache property: Specifies if response cache was involved in generating the response. If the value is
     * none, the cache was not used. If the value is hit, cached response was returned. If the value is miss, the cache
     * was used but lookup resulted in a miss and request was fulfilled by the backend.
     *
     * @return the cache value.
     */
    public String cache() {
        return this.cache;
    }

    /**
     * Set the cache property: Specifies if response cache was involved in generating the response. If the value is
     * none, the cache was not used. If the value is hit, cached response was returned. If the value is miss, the cache
     * was used but lookup resulted in a miss and request was fulfilled by the backend.
     *
     * @param cache the cache value to set.
     * @return the RequestReportRecordContractInner object itself.
     */
    public RequestReportRecordContractInner withCache(String cache) {
        this.cache = cache;
        return this;
    }

    /**
     * Get the apiTime property: The total time it took to process this request.
     *
     * @return the apiTime value.
     */
    public Double apiTime() {
        return this.apiTime;
    }

    /**
     * Set the apiTime property: The total time it took to process this request.
     *
     * @param apiTime the apiTime value to set.
     * @return the RequestReportRecordContractInner object itself.
     */
    public RequestReportRecordContractInner withApiTime(Double apiTime) {
        this.apiTime = apiTime;
        return this;
    }

    /**
     * Get the serviceTime property: he time it took to forward this request to the backend and get the response back.
     *
     * @return the serviceTime value.
     */
    public Double serviceTime() {
        return this.serviceTime;
    }

    /**
     * Set the serviceTime property: he time it took to forward this request to the backend and get the response back.
     *
     * @param serviceTime the serviceTime value to set.
     * @return the RequestReportRecordContractInner object itself.
     */
    public RequestReportRecordContractInner withServiceTime(Double serviceTime) {
        this.serviceTime = serviceTime;
        return this;
    }

    /**
     * Get the apiRegion property: Azure region where the gateway that processed this request is located.
     *
     * @return the apiRegion value.
     */
    public String apiRegion() {
        return this.apiRegion;
    }

    /**
     * Set the apiRegion property: Azure region where the gateway that processed this request is located.
     *
     * @param apiRegion the apiRegion value to set.
     * @return the RequestReportRecordContractInner object itself.
     */
    public RequestReportRecordContractInner withApiRegion(String apiRegion) {
        this.apiRegion = apiRegion;
        return this;
    }

    /**
     * Get the subscriptionId property: Subscription identifier path. /subscriptions/{subscriptionId}.
     *
     * @return the subscriptionId value.
     */
    public String subscriptionId() {
        return this.subscriptionId;
    }

    /**
     * Set the subscriptionId property: Subscription identifier path. /subscriptions/{subscriptionId}.
     *
     * @param subscriptionId the subscriptionId value to set.
     * @return the RequestReportRecordContractInner object itself.
     */
    public RequestReportRecordContractInner withSubscriptionId(String subscriptionId) {
        this.subscriptionId = subscriptionId;
        return this;
    }

    /**
     * Get the requestId property: Request Identifier.
     *
     * @return the requestId value.
     */
    public String requestId() {
        return this.requestId;
    }

    /**
     * Set the requestId property: Request Identifier.
     *
     * @param requestId the requestId value to set.
     * @return the RequestReportRecordContractInner object itself.
     */
    public RequestReportRecordContractInner withRequestId(String requestId) {
        this.requestId = requestId;
        return this;
    }

    /**
     * Get the requestSize property: The size of this request..
     *
     * @return the requestSize value.
     */
    public Integer requestSize() {
        return this.requestSize;
    }

    /**
     * Set the requestSize property: The size of this request..
     *
     * @param requestSize the requestSize value to set.
     * @return the RequestReportRecordContractInner object itself.
     */
    public RequestReportRecordContractInner withRequestSize(Integer requestSize) {
        this.requestSize = requestSize;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
    }
}
