/* * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ package com.amazonaws.services.connect.model; import java.io.Serializable; /** *

* Contains information about a real-time metric. For a description of each * metric, see Real-time Metrics Definitions in the Amazon Connect Administrator * Guide. *

*/ public class CurrentMetric implements Serializable { /** *

* The name of the metric. *

*

* Constraints:
* Allowed Values: AGENTS_ONLINE, AGENTS_AVAILABLE, AGENTS_ON_CALL, * AGENTS_NON_PRODUCTIVE, AGENTS_AFTER_CONTACT_WORK, AGENTS_ERROR, * AGENTS_STAFFED, CONTACTS_IN_QUEUE, OLDEST_CONTACT_AGE, * CONTACTS_SCHEDULED, AGENTS_ON_CONTACT, SLOTS_ACTIVE, SLOTS_AVAILABLE */ private String name; /** *

* The unit for the metric. *

*

* Constraints:
* Allowed Values: SECONDS, COUNT, PERCENT */ private String unit; /** *

* The name of the metric. *

*

* Constraints:
* Allowed Values: AGENTS_ONLINE, AGENTS_AVAILABLE, AGENTS_ON_CALL, * AGENTS_NON_PRODUCTIVE, AGENTS_AFTER_CONTACT_WORK, AGENTS_ERROR, * AGENTS_STAFFED, CONTACTS_IN_QUEUE, OLDEST_CONTACT_AGE, * CONTACTS_SCHEDULED, AGENTS_ON_CONTACT, SLOTS_ACTIVE, SLOTS_AVAILABLE * * @return

* The name of the metric. *

* @see CurrentMetricName */ public String getName() { return name; } /** *

* The name of the metric. *

*

* Constraints:
* Allowed Values: AGENTS_ONLINE, AGENTS_AVAILABLE, AGENTS_ON_CALL, * AGENTS_NON_PRODUCTIVE, AGENTS_AFTER_CONTACT_WORK, AGENTS_ERROR, * AGENTS_STAFFED, CONTACTS_IN_QUEUE, OLDEST_CONTACT_AGE, * CONTACTS_SCHEDULED, AGENTS_ON_CONTACT, SLOTS_ACTIVE, SLOTS_AVAILABLE * * @param name

* The name of the metric. *

* @see CurrentMetricName */ public void setName(String name) { this.name = name; } /** *

* The name of the metric. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: AGENTS_ONLINE, AGENTS_AVAILABLE, AGENTS_ON_CALL, * AGENTS_NON_PRODUCTIVE, AGENTS_AFTER_CONTACT_WORK, AGENTS_ERROR, * AGENTS_STAFFED, CONTACTS_IN_QUEUE, OLDEST_CONTACT_AGE, * CONTACTS_SCHEDULED, AGENTS_ON_CONTACT, SLOTS_ACTIVE, SLOTS_AVAILABLE * * @param name

* The name of the metric. *

* @return A reference to this updated object so that method calls can be * chained together. * @see CurrentMetricName */ public CurrentMetric withName(String name) { this.name = name; return this; } /** *

* The name of the metric. *

*

* Constraints:
* Allowed Values: AGENTS_ONLINE, AGENTS_AVAILABLE, AGENTS_ON_CALL, * AGENTS_NON_PRODUCTIVE, AGENTS_AFTER_CONTACT_WORK, AGENTS_ERROR, * AGENTS_STAFFED, CONTACTS_IN_QUEUE, OLDEST_CONTACT_AGE, * CONTACTS_SCHEDULED, AGENTS_ON_CONTACT, SLOTS_ACTIVE, SLOTS_AVAILABLE * * @param name

* The name of the metric. *

* @see CurrentMetricName */ public void setName(CurrentMetricName name) { this.name = name.toString(); } /** *

* The name of the metric. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: AGENTS_ONLINE, AGENTS_AVAILABLE, AGENTS_ON_CALL, * AGENTS_NON_PRODUCTIVE, AGENTS_AFTER_CONTACT_WORK, AGENTS_ERROR, * AGENTS_STAFFED, CONTACTS_IN_QUEUE, OLDEST_CONTACT_AGE, * CONTACTS_SCHEDULED, AGENTS_ON_CONTACT, SLOTS_ACTIVE, SLOTS_AVAILABLE * * @param name

* The name of the metric. *

* @return A reference to this updated object so that method calls can be * chained together. * @see CurrentMetricName */ public CurrentMetric withName(CurrentMetricName name) { this.name = name.toString(); return this; } /** *

* The unit for the metric. *

*

* Constraints:
* Allowed Values: SECONDS, COUNT, PERCENT * * @return

* The unit for the metric. *

* @see Unit */ public String getUnit() { return unit; } /** *

* The unit for the metric. *

*

* Constraints:
* Allowed Values: SECONDS, COUNT, PERCENT * * @param unit

* The unit for the metric. *

* @see Unit */ public void setUnit(String unit) { this.unit = unit; } /** *

* The unit for the metric. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: SECONDS, COUNT, PERCENT * * @param unit

* The unit for the metric. *

* @return A reference to this updated object so that method calls can be * chained together. * @see Unit */ public CurrentMetric withUnit(String unit) { this.unit = unit; return this; } /** *

* The unit for the metric. *

*

* Constraints:
* Allowed Values: SECONDS, COUNT, PERCENT * * @param unit

* The unit for the metric. *

* @see Unit */ public void setUnit(Unit unit) { this.unit = unit.toString(); } /** *

* The unit for the metric. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: SECONDS, COUNT, PERCENT * * @param unit

* The unit for the metric. *

* @return A reference to this updated object so that method calls can be * chained together. * @see Unit */ public CurrentMetric withUnit(Unit unit) { this.unit = unit.toString(); return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getName() != null) sb.append("Name: " + getName() + ","); if (getUnit() != null) sb.append("Unit: " + getUnit()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getUnit() == null) ? 0 : getUnit().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CurrentMetric == false) return false; CurrentMetric other = (CurrentMetric) obj; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getUnit() == null ^ this.getUnit() == null) return false; if (other.getUnit() != null && other.getUnit().equals(this.getUnit()) == false) return false; return true; } }