diff --git a/sdk/greengrass/greengrass-client/src/event-stream-rpc-java/client/software/amazon/awssdk/aws/greengrass/GreengrassCoreIPC.java b/sdk/greengrass/greengrass-client/src/event-stream-rpc-java/client/software/amazon/awssdk/aws/greengrass/GreengrassCoreIPC.java index ff9714fcd..de8eaec80 100644 --- a/sdk/greengrass/greengrass-client/src/event-stream-rpc-java/client/software/amazon/awssdk/aws/greengrass/GreengrassCoreIPC.java +++ b/sdk/greengrass/greengrass-client/src/event-stream-rpc-java/client/software/amazon/awssdk/aws/greengrass/GreengrassCoreIPC.java @@ -22,6 +22,7 @@ import software.amazon.awssdk.aws.greengrass.model.PauseComponentRequest; import software.amazon.awssdk.aws.greengrass.model.PublishToIoTCoreRequest; import software.amazon.awssdk.aws.greengrass.model.PublishToTopicRequest; +import software.amazon.awssdk.aws.greengrass.model.PutComponentMetricRequest; import software.amazon.awssdk.aws.greengrass.model.RestartComponentRequest; import software.amazon.awssdk.aws.greengrass.model.ResumeComponentRequest; import software.amazon.awssdk.aws.greengrass.model.SendConfigurationValidityReportRequest; @@ -101,6 +102,9 @@ PublishToIoTCoreResponseHandler publishToIoTCore(final PublishToIoTCoreRequest r PublishToTopicResponseHandler publishToTopic(final PublishToTopicRequest request, final Optional> streamResponseHandler); + PutComponentMetricResponseHandler putComponentMetric(final PutComponentMetricRequest request, + final Optional> streamResponseHandler); + RestartComponentResponseHandler restartComponent(final RestartComponentRequest request, final Optional> streamResponseHandler); diff --git a/sdk/greengrass/greengrass-client/src/event-stream-rpc-java/client/software/amazon/awssdk/aws/greengrass/GreengrassCoreIPCClient.java b/sdk/greengrass/greengrass-client/src/event-stream-rpc-java/client/software/amazon/awssdk/aws/greengrass/GreengrassCoreIPCClient.java index cb7da0d69..8aa6170d4 100644 --- a/sdk/greengrass/greengrass-client/src/event-stream-rpc-java/client/software/amazon/awssdk/aws/greengrass/GreengrassCoreIPCClient.java +++ b/sdk/greengrass/greengrass-client/src/event-stream-rpc-java/client/software/amazon/awssdk/aws/greengrass/GreengrassCoreIPCClient.java @@ -23,6 +23,7 @@ import software.amazon.awssdk.aws.greengrass.model.PauseComponentRequest; import software.amazon.awssdk.aws.greengrass.model.PublishToIoTCoreRequest; import software.amazon.awssdk.aws.greengrass.model.PublishToTopicRequest; +import software.amazon.awssdk.aws.greengrass.model.PutComponentMetricRequest; import software.amazon.awssdk.aws.greengrass.model.RestartComponentRequest; import software.amazon.awssdk.aws.greengrass.model.ResumeComponentRequest; import software.amazon.awssdk.aws.greengrass.model.SendConfigurationValidityReportRequest; @@ -178,6 +179,14 @@ public PublishToTopicResponseHandler publishToTopic(final PublishToTopicRequest return new PublishToTopicResponseHandler(doOperationInvoke(operationContext, request, streamResponseHandler)); } + @Override + public PutComponentMetricResponseHandler putComponentMetric( + final PutComponentMetricRequest request, + final Optional> streamResponseHandler) { + final PutComponentMetricOperationContext operationContext = GreengrassCoreIPCServiceModel.getPutComponentMetricModelContext(); + return new PutComponentMetricResponseHandler(doOperationInvoke(operationContext, request, streamResponseHandler)); + } + @Override public RestartComponentResponseHandler restartComponent(final RestartComponentRequest request, final Optional> streamResponseHandler) { diff --git a/sdk/greengrass/greengrass-client/src/event-stream-rpc-java/client/software/amazon/awssdk/aws/greengrass/GreengrassCoreIPCClientV2.java b/sdk/greengrass/greengrass-client/src/event-stream-rpc-java/client/software/amazon/awssdk/aws/greengrass/GreengrassCoreIPCClientV2.java index 70cbc2869..3c83c7b76 100644 --- a/sdk/greengrass/greengrass-client/src/event-stream-rpc-java/client/software/amazon/awssdk/aws/greengrass/GreengrassCoreIPCClientV2.java +++ b/sdk/greengrass/greengrass-client/src/event-stream-rpc-java/client/software/amazon/awssdk/aws/greengrass/GreengrassCoreIPCClientV2.java @@ -57,6 +57,8 @@ import software.amazon.awssdk.aws.greengrass.model.PublishToIoTCoreResponse; import software.amazon.awssdk.aws.greengrass.model.PublishToTopicRequest; import software.amazon.awssdk.aws.greengrass.model.PublishToTopicResponse; +import software.amazon.awssdk.aws.greengrass.model.PutComponentMetricRequest; +import software.amazon.awssdk.aws.greengrass.model.PutComponentMetricResponse; import software.amazon.awssdk.aws.greengrass.model.RestartComponentRequest; import software.amazon.awssdk.aws.greengrass.model.RestartComponentResponse; import software.amazon.awssdk.aws.greengrass.model.ResumeComponentRequest; @@ -558,6 +560,31 @@ public CompletableFuture publishToTopicAsync( return client.publishToTopic(request, Optional.empty()).getResponse(); } + /** + * Perform the putComponentMetric operation synchronously. + * + * @throws InterruptedException if thread is interrupted while waiting for the response + * @return the response + * + * @param request request object + */ + public PutComponentMetricResponse putComponentMetric(final PutComponentMetricRequest request) + throws InterruptedException { + return getResponse(this.putComponentMetricAsync(request)); + } + + /** + * Perform the putComponentMetric operation asynchronously. + * + * @return a future which resolves to the response + * + * @param request request object + */ + public CompletableFuture putComponentMetricAsync( + final PutComponentMetricRequest request) { + return client.putComponentMetric(request, Optional.empty()).getResponse(); + } + /** * Perform the restartComponent operation synchronously. * diff --git a/sdk/greengrass/greengrass-client/src/event-stream-rpc-java/client/software/amazon/awssdk/aws/greengrass/PutComponentMetricResponseHandler.java b/sdk/greengrass/greengrass-client/src/event-stream-rpc-java/client/software/amazon/awssdk/aws/greengrass/PutComponentMetricResponseHandler.java new file mode 100644 index 000000000..5065b27cd --- /dev/null +++ b/sdk/greengrass/greengrass-client/src/event-stream-rpc-java/client/software/amazon/awssdk/aws/greengrass/PutComponentMetricResponseHandler.java @@ -0,0 +1,43 @@ +package software.amazon.awssdk.aws.greengrass; + +import java.lang.Override; +import java.lang.Void; +import java.util.concurrent.CompletableFuture; +import software.amazon.awssdk.aws.greengrass.model.PutComponentMetricResponse; +import software.amazon.awssdk.eventstreamrpc.OperationResponse; +import software.amazon.awssdk.eventstreamrpc.StreamResponse; +import software.amazon.awssdk.eventstreamrpc.model.EventStreamJsonMessage; + +public final class PutComponentMetricResponseHandler implements StreamResponse { + private final OperationResponse operationResponse; + + public PutComponentMetricResponseHandler( + final OperationResponse operationResponse) { + this.operationResponse = operationResponse; + } + + @Override + public CompletableFuture getRequestFlushFuture() { + return operationResponse.getRequestFlushFuture(); + } + + @Override + public CompletableFuture getResponse() { + return operationResponse.getResponse(); + } + + @Override + public CompletableFuture sendStreamEvent(final EventStreamJsonMessage event) { + return operationResponse.sendStreamEvent(event); + } + + @Override + public CompletableFuture closeStream() { + return operationResponse.closeStream(); + } + + @Override + public boolean isClosed() { + return operationResponse.isClosed(); + } +} diff --git a/sdk/greengrass/greengrass-client/src/event-stream-rpc-java/model/software/amazon/awssdk/aws/greengrass/GreengrassCoreIPCServiceModel.java b/sdk/greengrass/greengrass-client/src/event-stream-rpc-java/model/software/amazon/awssdk/aws/greengrass/GreengrassCoreIPCServiceModel.java index 05d06901a..1f6e642b2 100644 --- a/sdk/greengrass/greengrass-client/src/event-stream-rpc-java/model/software/amazon/awssdk/aws/greengrass/GreengrassCoreIPCServiceModel.java +++ b/sdk/greengrass/greengrass-client/src/event-stream-rpc-java/model/software/amazon/awssdk/aws/greengrass/GreengrassCoreIPCServiceModel.java @@ -67,6 +67,8 @@ import software.amazon.awssdk.aws.greengrass.model.MQTTCredential; import software.amazon.awssdk.aws.greengrass.model.MQTTMessage; import software.amazon.awssdk.aws.greengrass.model.MessageContext; +import software.amazon.awssdk.aws.greengrass.model.Metric; +import software.amazon.awssdk.aws.greengrass.model.MetricUnitType; import software.amazon.awssdk.aws.greengrass.model.PauseComponentRequest; import software.amazon.awssdk.aws.greengrass.model.PauseComponentResponse; import software.amazon.awssdk.aws.greengrass.model.PostComponentUpdateEvent; @@ -76,6 +78,8 @@ import software.amazon.awssdk.aws.greengrass.model.PublishToIoTCoreResponse; import software.amazon.awssdk.aws.greengrass.model.PublishToTopicRequest; import software.amazon.awssdk.aws.greengrass.model.PublishToTopicResponse; +import software.amazon.awssdk.aws.greengrass.model.PutComponentMetricRequest; +import software.amazon.awssdk.aws.greengrass.model.PutComponentMetricResponse; import software.amazon.awssdk.aws.greengrass.model.QOS; import software.amazon.awssdk.aws.greengrass.model.ReceiveMode; import software.amazon.awssdk.aws.greengrass.model.ReportedLifecycleState; @@ -204,6 +208,10 @@ public class GreengrassCoreIPCServiceModel extends EventStreamRPCServiceModel { private static final PublishToTopicOperationContext _PUBLISH_TO_TOPIC_OPERATION_CONTEXT = new PublishToTopicOperationContext(); + public static final String PUT_COMPONENT_METRIC = SERVICE_NAMESPACE + "#" + "PutComponentMetric"; + + private static final PutComponentMetricOperationContext _PUT_COMPONENT_METRIC_OPERATION_CONTEXT = new PutComponentMetricOperationContext(); + public static final String RESTART_COMPONENT = SERVICE_NAMESPACE + "#" + "RestartComponent"; private static final RestartComponentOperationContext _RESTART_COMPONENT_OPERATION_CONTEXT = new RestartComponentOperationContext(); @@ -299,6 +307,8 @@ public class GreengrassCoreIPCServiceModel extends EventStreamRPCServiceModel { SERVICE_OPERATION_SET.add(PUBLISH_TO_IOT_CORE); SERVICE_OPERATION_MODEL_MAP.put(PUBLISH_TO_TOPIC, _PUBLISH_TO_TOPIC_OPERATION_CONTEXT); SERVICE_OPERATION_SET.add(PUBLISH_TO_TOPIC); + SERVICE_OPERATION_MODEL_MAP.put(PUT_COMPONENT_METRIC, _PUT_COMPONENT_METRIC_OPERATION_CONTEXT); + SERVICE_OPERATION_SET.add(PUT_COMPONENT_METRIC); SERVICE_OPERATION_MODEL_MAP.put(RESTART_COMPONENT, _RESTART_COMPONENT_OPERATION_CONTEXT); SERVICE_OPERATION_SET.add(RESTART_COMPONENT); SERVICE_OPERATION_MODEL_MAP.put(RESUME_COMPONENT, _RESUME_COMPONENT_OPERATION_CONTEXT); @@ -387,6 +397,8 @@ public class GreengrassCoreIPCServiceModel extends EventStreamRPCServiceModel { SERVICE_OBJECT_MODEL_MAP.put(MQTTCredential.APPLICATION_MODEL_TYPE, MQTTCredential.class); SERVICE_OBJECT_MODEL_MAP.put(MQTTMessage.APPLICATION_MODEL_TYPE, MQTTMessage.class); SERVICE_OBJECT_MODEL_MAP.put(MessageContext.APPLICATION_MODEL_TYPE, MessageContext.class); + SERVICE_OBJECT_MODEL_MAP.put(Metric.APPLICATION_MODEL_TYPE, Metric.class); + SERVICE_OBJECT_MODEL_MAP.put(MetricUnitType.APPLICATION_MODEL_TYPE, MetricUnitType.class); SERVICE_OBJECT_MODEL_MAP.put(PauseComponentRequest.APPLICATION_MODEL_TYPE, PauseComponentRequest.class); SERVICE_OBJECT_MODEL_MAP.put(PauseComponentResponse.APPLICATION_MODEL_TYPE, PauseComponentResponse.class); SERVICE_OBJECT_MODEL_MAP.put(PostComponentUpdateEvent.APPLICATION_MODEL_TYPE, PostComponentUpdateEvent.class); @@ -396,6 +408,8 @@ public class GreengrassCoreIPCServiceModel extends EventStreamRPCServiceModel { SERVICE_OBJECT_MODEL_MAP.put(PublishToIoTCoreResponse.APPLICATION_MODEL_TYPE, PublishToIoTCoreResponse.class); SERVICE_OBJECT_MODEL_MAP.put(PublishToTopicRequest.APPLICATION_MODEL_TYPE, PublishToTopicRequest.class); SERVICE_OBJECT_MODEL_MAP.put(PublishToTopicResponse.APPLICATION_MODEL_TYPE, PublishToTopicResponse.class); + SERVICE_OBJECT_MODEL_MAP.put(PutComponentMetricRequest.APPLICATION_MODEL_TYPE, PutComponentMetricRequest.class); + SERVICE_OBJECT_MODEL_MAP.put(PutComponentMetricResponse.APPLICATION_MODEL_TYPE, PutComponentMetricResponse.class); SERVICE_OBJECT_MODEL_MAP.put(QOS.APPLICATION_MODEL_TYPE, QOS.class); SERVICE_OBJECT_MODEL_MAP.put(ReceiveMode.APPLICATION_MODEL_TYPE, ReceiveMode.class); SERVICE_OBJECT_MODEL_MAP.put(ReportedLifecycleState.APPLICATION_MODEL_TYPE, ReportedLifecycleState.class); @@ -522,6 +536,10 @@ public static PublishToTopicOperationContext getPublishToTopicModelContext() { return _PUBLISH_TO_TOPIC_OPERATION_CONTEXT; } + public static PutComponentMetricOperationContext getPutComponentMetricModelContext() { + return _PUT_COMPONENT_METRIC_OPERATION_CONTEXT; + } + public static RestartComponentOperationContext getRestartComponentModelContext() { return _RESTART_COMPONENT_OPERATION_CONTEXT; } diff --git a/sdk/greengrass/greengrass-client/src/event-stream-rpc-java/model/software/amazon/awssdk/aws/greengrass/PutComponentMetricOperationContext.java b/sdk/greengrass/greengrass-client/src/event-stream-rpc-java/model/software/amazon/awssdk/aws/greengrass/PutComponentMetricOperationContext.java new file mode 100644 index 000000000..4e1a562e8 --- /dev/null +++ b/sdk/greengrass/greengrass-client/src/event-stream-rpc-java/model/software/amazon/awssdk/aws/greengrass/PutComponentMetricOperationContext.java @@ -0,0 +1,62 @@ +package software.amazon.awssdk.aws.greengrass; + +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.Optional; +import software.amazon.awssdk.aws.greengrass.model.PutComponentMetricRequest; +import software.amazon.awssdk.aws.greengrass.model.PutComponentMetricResponse; +import software.amazon.awssdk.eventstreamrpc.EventStreamRPCServiceModel; +import software.amazon.awssdk.eventstreamrpc.OperationModelContext; +import software.amazon.awssdk.eventstreamrpc.model.EventStreamJsonMessage; + +public class PutComponentMetricOperationContext implements OperationModelContext { + @Override + public EventStreamRPCServiceModel getServiceModel() { + return GreengrassCoreIPCServiceModel.getInstance(); + } + + @Override + public String getOperationName() { + return GreengrassCoreIPCServiceModel.PUT_COMPONENT_METRIC; + } + + @Override + public Class getRequestTypeClass() { + return PutComponentMetricRequest.class; + } + + @Override + public Class getResponseTypeClass() { + return PutComponentMetricResponse.class; + } + + @Override + public String getRequestApplicationModelType() { + return PutComponentMetricRequest.APPLICATION_MODEL_TYPE; + } + + @Override + public String getResponseApplicationModelType() { + return PutComponentMetricResponse.APPLICATION_MODEL_TYPE; + } + + @Override + public Optional> getStreamingRequestTypeClass() { + return Optional.empty(); + } + + @Override + public Optional> getStreamingResponseTypeClass() { + return Optional.empty(); + } + + public Optional getStreamingRequestApplicationModelType() { + return Optional.empty(); + } + + @Override + public Optional getStreamingResponseApplicationModelType() { + return Optional.empty(); + } +} diff --git a/sdk/greengrass/greengrass-client/src/event-stream-rpc-java/model/software/amazon/awssdk/aws/greengrass/model/Metric.java b/sdk/greengrass/greengrass-client/src/event-stream-rpc-java/model/software/amazon/awssdk/aws/greengrass/model/Metric.java new file mode 100644 index 000000000..5002a22b4 --- /dev/null +++ b/sdk/greengrass/greengrass-client/src/event-stream-rpc-java/model/software/amazon/awssdk/aws/greengrass/model/Metric.java @@ -0,0 +1,136 @@ +package software.amazon.awssdk.aws.greengrass.model; + +import com.google.gson.annotations.Expose; +import java.lang.Double; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import java.util.Optional; +import software.amazon.awssdk.eventstreamrpc.model.EventStreamJsonMessage; + +public class Metric implements EventStreamJsonMessage { + public static final String APPLICATION_MODEL_TYPE = "aws.greengrass#Metric"; + + public static final Metric VOID; + + static { + VOID = new Metric() { + @Override + public boolean isVoid() { + return true; + } + }; + } + + @Expose( + serialize = true, + deserialize = true + ) + private Optional name; + + @Expose( + serialize = true, + deserialize = true + ) + private Optional unit; + + @Expose( + serialize = true, + deserialize = true + ) + private Optional value; + + public Metric() { + this.name = Optional.empty(); + this.unit = Optional.empty(); + this.value = Optional.empty(); + } + + public String getName() { + if (name.isPresent()) { + return name.get(); + } + return null; + } + + public void setName(final String name) { + this.name = Optional.ofNullable(name); + } + + public Metric withName(final String name) { + setName(name); + return this; + } + + public MetricUnitType getUnit() { + if (unit.isPresent()) { + return MetricUnitType.get(unit.get()); + } + return null; + } + + public String getUnitAsString() { + if (unit.isPresent()) { + return unit.get(); + } + return null; + } + + public void setUnit(final String unit) { + this.unit = Optional.ofNullable(unit); + } + + public Metric withUnit(final String unit) { + setUnit(unit); + return this; + } + + public void setUnit(final MetricUnitType unit) { + this.unit = Optional.ofNullable(unit.getValue()); + } + + public Metric withUnit(final MetricUnitType unit) { + setUnit(unit); + return this; + } + + public Double getValue() { + if (value.isPresent()) { + return value.get(); + } + return null; + } + + public void setValue(final Double value) { + this.value = Optional.ofNullable(value); + } + + public Metric withValue(final Double value) { + setValue(value); + return this; + } + + @Override + public String getApplicationModelType() { + return APPLICATION_MODEL_TYPE; + } + + @Override + public boolean equals(Object rhs) { + if (rhs == null) return false; + if (!(rhs instanceof Metric)) return false; + if (this == rhs) return true; + final Metric other = (Metric)rhs; + boolean isEquals = true; + isEquals = isEquals && this.name.equals(other.name); + isEquals = isEquals && this.unit.equals(other.unit); + isEquals = isEquals && this.value.equals(other.value); + return isEquals; + } + + @Override + public int hashCode() { + return Objects.hash(name, unit, value); + } +} diff --git a/sdk/greengrass/greengrass-client/src/event-stream-rpc-java/model/software/amazon/awssdk/aws/greengrass/model/MetricUnitType.java b/sdk/greengrass/greengrass-client/src/event-stream-rpc-java/model/software/amazon/awssdk/aws/greengrass/model/MetricUnitType.java new file mode 100644 index 000000000..07072701c --- /dev/null +++ b/sdk/greengrass/greengrass-client/src/event-stream-rpc-java/model/software/amazon/awssdk/aws/greengrass/model/MetricUnitType.java @@ -0,0 +1,57 @@ +package software.amazon.awssdk.aws.greengrass.model; + +import com.google.gson.annotations.SerializedName; +import java.lang.Override; +import java.lang.String; +import java.util.HashMap; +import java.util.Map; +import software.amazon.awssdk.eventstreamrpc.model.EventStreamJsonMessage; + +public enum MetricUnitType implements EventStreamJsonMessage { + @SerializedName("BYTES") + BYTES("BYTES"), + + @SerializedName("BYTES_PER_SECOND") + BYTES_PER_SECOND("BYTES_PER_SECOND"), + + @SerializedName("COUNT") + COUNT("COUNT"), + + @SerializedName("COUNT_PER_SECOND") + COUNT_PER_SECOND("COUNT_PER_SECOND"), + + @SerializedName("MEGABYTES") + MEGABYTES("MEGABYTES"), + + @SerializedName("SECONDS") + SECONDS("SECONDS"); + + public static final String APPLICATION_MODEL_TYPE = "aws.greengrass#MetricUnitType"; + + private static final Map lookup = new HashMap(); + + static { + for (MetricUnitType value:MetricUnitType.values()) { + lookup.put(value.getValue(), value); + } + } + + String value; + + MetricUnitType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String getApplicationModelType() { + return APPLICATION_MODEL_TYPE; + } + + public static MetricUnitType get(String value) { + return lookup.get(value); + } +} diff --git a/sdk/greengrass/greengrass-client/src/event-stream-rpc-java/model/software/amazon/awssdk/aws/greengrass/model/PutComponentMetricRequest.java b/sdk/greengrass/greengrass-client/src/event-stream-rpc-java/model/software/amazon/awssdk/aws/greengrass/model/PutComponentMetricRequest.java new file mode 100644 index 000000000..e6a9af005 --- /dev/null +++ b/sdk/greengrass/greengrass-client/src/event-stream-rpc-java/model/software/amazon/awssdk/aws/greengrass/model/PutComponentMetricRequest.java @@ -0,0 +1,72 @@ +package software.amazon.awssdk.aws.greengrass.model; + +import com.google.gson.annotations.Expose; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import software.amazon.awssdk.eventstreamrpc.model.EventStreamJsonMessage; + +public class PutComponentMetricRequest implements EventStreamJsonMessage { + public static final String APPLICATION_MODEL_TYPE = "aws.greengrass#PutComponentMetricRequest"; + + public static final PutComponentMetricRequest VOID; + + static { + VOID = new PutComponentMetricRequest() { + @Override + public boolean isVoid() { + return true; + } + }; + } + + @Expose( + serialize = true, + deserialize = true + ) + private Optional> metrics; + + public PutComponentMetricRequest() { + this.metrics = Optional.empty(); + } + + public List getMetrics() { + if (metrics.isPresent()) { + return metrics.get(); + } + return null; + } + + public void setMetrics(final List metrics) { + this.metrics = Optional.ofNullable(metrics); + } + + public PutComponentMetricRequest withMetrics(final List metrics) { + setMetrics(metrics); + return this; + } + + @Override + public String getApplicationModelType() { + return APPLICATION_MODEL_TYPE; + } + + @Override + public boolean equals(Object rhs) { + if (rhs == null) return false; + if (!(rhs instanceof PutComponentMetricRequest)) return false; + if (this == rhs) return true; + final PutComponentMetricRequest other = (PutComponentMetricRequest)rhs; + boolean isEquals = true; + isEquals = isEquals && this.metrics.equals(other.metrics); + return isEquals; + } + + @Override + public int hashCode() { + return Objects.hash(metrics); + } +} diff --git a/sdk/greengrass/greengrass-client/src/event-stream-rpc-java/model/software/amazon/awssdk/aws/greengrass/model/PutComponentMetricResponse.java b/sdk/greengrass/greengrass-client/src/event-stream-rpc-java/model/software/amazon/awssdk/aws/greengrass/model/PutComponentMetricResponse.java new file mode 100644 index 000000000..15f37f2c8 --- /dev/null +++ b/sdk/greengrass/greengrass-client/src/event-stream-rpc-java/model/software/amazon/awssdk/aws/greengrass/model/PutComponentMetricResponse.java @@ -0,0 +1,45 @@ +package software.amazon.awssdk.aws.greengrass.model; + +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import software.amazon.awssdk.eventstreamrpc.model.EventStreamJsonMessage; + +public class PutComponentMetricResponse implements EventStreamJsonMessage { + public static final String APPLICATION_MODEL_TYPE = "aws.greengrass#PutComponentMetricResponse"; + + public static final PutComponentMetricResponse VOID; + + static { + VOID = new PutComponentMetricResponse() { + @Override + public boolean isVoid() { + return true; + } + }; + } + + public PutComponentMetricResponse() { + } + + @Override + public String getApplicationModelType() { + return APPLICATION_MODEL_TYPE; + } + + @Override + public boolean equals(Object rhs) { + if (rhs == null) return false; + if (!(rhs instanceof PutComponentMetricResponse)) return false; + if (this == rhs) return true; + final PutComponentMetricResponse other = (PutComponentMetricResponse)rhs; + boolean isEquals = true; + return isEquals; + } + + @Override + public int hashCode() { + return Objects.hash(); + } +} diff --git a/sdk/greengrass/greengrass-client/src/test/java/GreengrassV2ClientTest.java b/sdk/greengrass/greengrass-client/src/test/java/GreengrassV2ClientTest.java index 8d534592d..bc74e8d48 100644 --- a/sdk/greengrass/greengrass-client/src/test/java/GreengrassV2ClientTest.java +++ b/sdk/greengrass/greengrass-client/src/test/java/GreengrassV2ClientTest.java @@ -137,7 +137,7 @@ public void testV2Client() throws InterruptedException, ExecutionException, Time assertEquals("message", receivedMessage.get()); subResp.getHandler().closeStream().get(); - subscriptionClosed.get(1, TimeUnit.SECONDS); + subscriptionClosed.get(5, TimeUnit.SECONDS); subscriptionClosed = new CompletableFuture<>(); receivedMessage = new CompletableFuture<>(); @@ -165,7 +165,7 @@ public void onStreamClosed() { assertEquals("message", receivedMessage.get()); subResp.getHandler().closeStream().get(); - subscriptionClosed.get(1, TimeUnit.SECONDS); + subscriptionClosed.get(5, TimeUnit.SECONDS); subscriptionClosed = new CompletableFuture<>(); receivedMessage = new CompletableFuture<>(); @@ -194,7 +194,7 @@ public void onStreamClosed() { assertEquals("message", receivedMessage.get()); subRespAsync.getHandler().closeStream().get(); - subscriptionClosed.get(1, TimeUnit.SECONDS); + subscriptionClosed.get(5, TimeUnit.SECONDS); subscriptionClosed = new CompletableFuture<>(); receivedMessage = new CompletableFuture<>(); @@ -209,6 +209,6 @@ public void onStreamClosed() { assertEquals("message", receivedMessage.get()); subRespAsync.getHandler().closeStream().get(); - subscriptionClosed.get(1, TimeUnit.SECONDS); + subscriptionClosed.get(5, TimeUnit.SECONDS); } }