/* 
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */

package dev.plexapi.sdk.models.operations;


import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Integer;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;


public class GetBandwidthStatisticsDevice {

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("id")
    private Optional<Integer> id;

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("name")
    private Optional<String> name;

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("platform")
    private Optional<String> platform;

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("clientIdentifier")
    private Optional<String> clientIdentifier;

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("createdAt")
    private Optional<Integer> createdAt;

    @JsonCreator
    public GetBandwidthStatisticsDevice(
            @JsonProperty("id") Optional<Integer> id,
            @JsonProperty("name") Optional<String> name,
            @JsonProperty("platform") Optional<String> platform,
            @JsonProperty("clientIdentifier") Optional<String> clientIdentifier,
            @JsonProperty("createdAt") Optional<Integer> createdAt) {
        Utils.checkNotNull(id, "id");
        Utils.checkNotNull(name, "name");
        Utils.checkNotNull(platform, "platform");
        Utils.checkNotNull(clientIdentifier, "clientIdentifier");
        Utils.checkNotNull(createdAt, "createdAt");
        this.id = id;
        this.name = name;
        this.platform = platform;
        this.clientIdentifier = clientIdentifier;
        this.createdAt = createdAt;
    }
    
    public GetBandwidthStatisticsDevice() {
        this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty());
    }

    @JsonIgnore
    public Optional<Integer> id() {
        return id;
    }

    @JsonIgnore
    public Optional<String> name() {
        return name;
    }

    @JsonIgnore
    public Optional<String> platform() {
        return platform;
    }

    @JsonIgnore
    public Optional<String> clientIdentifier() {
        return clientIdentifier;
    }

    @JsonIgnore
    public Optional<Integer> createdAt() {
        return createdAt;
    }

    public final static Builder builder() {
        return new Builder();
    }

    public GetBandwidthStatisticsDevice withId(int id) {
        Utils.checkNotNull(id, "id");
        this.id = Optional.ofNullable(id);
        return this;
    }

    public GetBandwidthStatisticsDevice withId(Optional<Integer> id) {
        Utils.checkNotNull(id, "id");
        this.id = id;
        return this;
    }

    public GetBandwidthStatisticsDevice withName(String name) {
        Utils.checkNotNull(name, "name");
        this.name = Optional.ofNullable(name);
        return this;
    }

    public GetBandwidthStatisticsDevice withName(Optional<String> name) {
        Utils.checkNotNull(name, "name");
        this.name = name;
        return this;
    }

    public GetBandwidthStatisticsDevice withPlatform(String platform) {
        Utils.checkNotNull(platform, "platform");
        this.platform = Optional.ofNullable(platform);
        return this;
    }

    public GetBandwidthStatisticsDevice withPlatform(Optional<String> platform) {
        Utils.checkNotNull(platform, "platform");
        this.platform = platform;
        return this;
    }

    public GetBandwidthStatisticsDevice withClientIdentifier(String clientIdentifier) {
        Utils.checkNotNull(clientIdentifier, "clientIdentifier");
        this.clientIdentifier = Optional.ofNullable(clientIdentifier);
        return this;
    }

    public GetBandwidthStatisticsDevice withClientIdentifier(Optional<String> clientIdentifier) {
        Utils.checkNotNull(clientIdentifier, "clientIdentifier");
        this.clientIdentifier = clientIdentifier;
        return this;
    }

    public GetBandwidthStatisticsDevice withCreatedAt(int createdAt) {
        Utils.checkNotNull(createdAt, "createdAt");
        this.createdAt = Optional.ofNullable(createdAt);
        return this;
    }

    public GetBandwidthStatisticsDevice withCreatedAt(Optional<Integer> createdAt) {
        Utils.checkNotNull(createdAt, "createdAt");
        this.createdAt = createdAt;
        return this;
    }
    
    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        GetBandwidthStatisticsDevice other = (GetBandwidthStatisticsDevice) o;
        return 
            Objects.deepEquals(this.id, other.id) &&
            Objects.deepEquals(this.name, other.name) &&
            Objects.deepEquals(this.platform, other.platform) &&
            Objects.deepEquals(this.clientIdentifier, other.clientIdentifier) &&
            Objects.deepEquals(this.createdAt, other.createdAt);
    }
    
    @Override
    public int hashCode() {
        return Objects.hash(
            id,
            name,
            platform,
            clientIdentifier,
            createdAt);
    }
    
    @Override
    public String toString() {
        return Utils.toString(GetBandwidthStatisticsDevice.class,
                "id", id,
                "name", name,
                "platform", platform,
                "clientIdentifier", clientIdentifier,
                "createdAt", createdAt);
    }
    
    public final static class Builder {
 
        private Optional<Integer> id = Optional.empty();
 
        private Optional<String> name = Optional.empty();
 
        private Optional<String> platform = Optional.empty();
 
        private Optional<String> clientIdentifier = Optional.empty();
 
        private Optional<Integer> createdAt = Optional.empty();  
        
        private Builder() {
          // force use of static builder() method
        }

        public Builder id(int id) {
            Utils.checkNotNull(id, "id");
            this.id = Optional.ofNullable(id);
            return this;
        }

        public Builder id(Optional<Integer> id) {
            Utils.checkNotNull(id, "id");
            this.id = id;
            return this;
        }

        public Builder name(String name) {
            Utils.checkNotNull(name, "name");
            this.name = Optional.ofNullable(name);
            return this;
        }

        public Builder name(Optional<String> name) {
            Utils.checkNotNull(name, "name");
            this.name = name;
            return this;
        }

        public Builder platform(String platform) {
            Utils.checkNotNull(platform, "platform");
            this.platform = Optional.ofNullable(platform);
            return this;
        }

        public Builder platform(Optional<String> platform) {
            Utils.checkNotNull(platform, "platform");
            this.platform = platform;
            return this;
        }

        public Builder clientIdentifier(String clientIdentifier) {
            Utils.checkNotNull(clientIdentifier, "clientIdentifier");
            this.clientIdentifier = Optional.ofNullable(clientIdentifier);
            return this;
        }

        public Builder clientIdentifier(Optional<String> clientIdentifier) {
            Utils.checkNotNull(clientIdentifier, "clientIdentifier");
            this.clientIdentifier = clientIdentifier;
            return this;
        }

        public Builder createdAt(int createdAt) {
            Utils.checkNotNull(createdAt, "createdAt");
            this.createdAt = Optional.ofNullable(createdAt);
            return this;
        }

        public Builder createdAt(Optional<Integer> createdAt) {
            Utils.checkNotNull(createdAt, "createdAt");
            this.createdAt = createdAt;
            return this;
        }
        
        public GetBandwidthStatisticsDevice build() {
            return new GetBandwidthStatisticsDevice(
                id,
                name,
                platform,
                clientIdentifier,
                createdAt);
        }
    }
}

