Skip to content

Commit

Permalink
Update Greengrass V2 IPC models
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeDombo committed Jun 20, 2022
1 parent a39cab3 commit c30e30d
Show file tree
Hide file tree
Showing 9 changed files with 447 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
package software.amazon.awssdk.aws.greengrass;

import java.util.Optional;
import software.amazon.awssdk.aws.greengrass.model.AuthorizeClientDeviceActionRequest;
import software.amazon.awssdk.aws.greengrass.model.CertificateUpdateEvent;
import software.amazon.awssdk.aws.greengrass.model.ComponentUpdatePolicyEvents;
import software.amazon.awssdk.aws.greengrass.model.ConfigurationUpdateEvents;
import software.amazon.awssdk.aws.greengrass.model.CreateDebugPasswordRequest;
import software.amazon.awssdk.aws.greengrass.model.CreateLocalDeploymentRequest;
import software.amazon.awssdk.aws.greengrass.model.DeferComponentUpdateRequest;
import software.amazon.awssdk.aws.greengrass.model.DeleteThingShadowRequest;
import software.amazon.awssdk.aws.greengrass.model.GetClientDeviceAuthTokenRequest;
import software.amazon.awssdk.aws.greengrass.model.GetComponentDetailsRequest;
import software.amazon.awssdk.aws.greengrass.model.GetConfigurationRequest;
import software.amazon.awssdk.aws.greengrass.model.GetLocalDeploymentStatusRequest;
Expand All @@ -23,6 +26,7 @@
import software.amazon.awssdk.aws.greengrass.model.ResumeComponentRequest;
import software.amazon.awssdk.aws.greengrass.model.SendConfigurationValidityReportRequest;
import software.amazon.awssdk.aws.greengrass.model.StopComponentRequest;
import software.amazon.awssdk.aws.greengrass.model.SubscribeToCertificateUpdatesRequest;
import software.amazon.awssdk.aws.greengrass.model.SubscribeToComponentUpdatesRequest;
import software.amazon.awssdk.aws.greengrass.model.SubscribeToConfigurationUpdateRequest;
import software.amazon.awssdk.aws.greengrass.model.SubscribeToIoTCoreRequest;
Expand All @@ -34,10 +38,15 @@
import software.amazon.awssdk.aws.greengrass.model.UpdateThingShadowRequest;
import software.amazon.awssdk.aws.greengrass.model.ValidateAuthorizationTokenRequest;
import software.amazon.awssdk.aws.greengrass.model.ValidateConfigurationUpdateEvents;
import software.amazon.awssdk.aws.greengrass.model.VerifyClientDeviceIdentityRequest;
import software.amazon.awssdk.eventstreamrpc.StreamResponseHandler;
import software.amazon.awssdk.eventstreamrpc.model.EventStreamJsonMessage;

public interface GreengrassCoreIPC {
AuthorizeClientDeviceActionResponseHandler authorizeClientDeviceAction(
final AuthorizeClientDeviceActionRequest request,
final Optional<StreamResponseHandler<EventStreamJsonMessage>> streamResponseHandler);

CreateDebugPasswordResponseHandler createDebugPassword(final CreateDebugPasswordRequest request,
final Optional<StreamResponseHandler<EventStreamJsonMessage>> streamResponseHandler);

Expand All @@ -52,6 +61,10 @@ DeferComponentUpdateResponseHandler deferComponentUpdate(
DeleteThingShadowResponseHandler deleteThingShadow(final DeleteThingShadowRequest request,
final Optional<StreamResponseHandler<EventStreamJsonMessage>> streamResponseHandler);

GetClientDeviceAuthTokenResponseHandler getClientDeviceAuthToken(
final GetClientDeviceAuthTokenRequest request,
final Optional<StreamResponseHandler<EventStreamJsonMessage>> streamResponseHandler);

GetComponentDetailsResponseHandler getComponentDetails(final GetComponentDetailsRequest request,
final Optional<StreamResponseHandler<EventStreamJsonMessage>> streamResponseHandler);

Expand Down Expand Up @@ -101,6 +114,10 @@ SendConfigurationValidityReportResponseHandler sendConfigurationValidityReport(
StopComponentResponseHandler stopComponent(final StopComponentRequest request,
final Optional<StreamResponseHandler<EventStreamJsonMessage>> streamResponseHandler);

SubscribeToCertificateUpdatesResponseHandler subscribeToCertificateUpdates(
final SubscribeToCertificateUpdatesRequest request,
final Optional<StreamResponseHandler<CertificateUpdateEvent>> streamResponseHandler);

SubscribeToComponentUpdatesResponseHandler subscribeToComponentUpdates(
final SubscribeToComponentUpdatesRequest request,
final Optional<StreamResponseHandler<ComponentUpdatePolicyEvents>> streamResponseHandler);
Expand Down Expand Up @@ -131,4 +148,8 @@ UpdateThingShadowResponseHandler updateThingShadow(final UpdateThingShadowReques
ValidateAuthorizationTokenResponseHandler validateAuthorizationToken(
final ValidateAuthorizationTokenRequest request,
final Optional<StreamResponseHandler<EventStreamJsonMessage>> streamResponseHandler);

VerifyClientDeviceIdentityResponseHandler verifyClientDeviceIdentity(
final VerifyClientDeviceIdentityRequest request,
final Optional<StreamResponseHandler<EventStreamJsonMessage>> streamResponseHandler);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@

import java.lang.Override;
import java.util.Optional;
import software.amazon.awssdk.aws.greengrass.model.AuthorizeClientDeviceActionRequest;
import software.amazon.awssdk.aws.greengrass.model.CertificateUpdateEvent;
import software.amazon.awssdk.aws.greengrass.model.ComponentUpdatePolicyEvents;
import software.amazon.awssdk.aws.greengrass.model.ConfigurationUpdateEvents;
import software.amazon.awssdk.aws.greengrass.model.CreateDebugPasswordRequest;
import software.amazon.awssdk.aws.greengrass.model.CreateLocalDeploymentRequest;
import software.amazon.awssdk.aws.greengrass.model.DeferComponentUpdateRequest;
import software.amazon.awssdk.aws.greengrass.model.DeleteThingShadowRequest;
import software.amazon.awssdk.aws.greengrass.model.GetClientDeviceAuthTokenRequest;
import software.amazon.awssdk.aws.greengrass.model.GetComponentDetailsRequest;
import software.amazon.awssdk.aws.greengrass.model.GetConfigurationRequest;
import software.amazon.awssdk.aws.greengrass.model.GetLocalDeploymentStatusRequest;
Expand All @@ -24,6 +27,7 @@
import software.amazon.awssdk.aws.greengrass.model.ResumeComponentRequest;
import software.amazon.awssdk.aws.greengrass.model.SendConfigurationValidityReportRequest;
import software.amazon.awssdk.aws.greengrass.model.StopComponentRequest;
import software.amazon.awssdk.aws.greengrass.model.SubscribeToCertificateUpdatesRequest;
import software.amazon.awssdk.aws.greengrass.model.SubscribeToComponentUpdatesRequest;
import software.amazon.awssdk.aws.greengrass.model.SubscribeToConfigurationUpdateRequest;
import software.amazon.awssdk.aws.greengrass.model.SubscribeToIoTCoreRequest;
Expand All @@ -35,6 +39,7 @@
import software.amazon.awssdk.aws.greengrass.model.UpdateThingShadowRequest;
import software.amazon.awssdk.aws.greengrass.model.ValidateAuthorizationTokenRequest;
import software.amazon.awssdk.aws.greengrass.model.ValidateConfigurationUpdateEvents;
import software.amazon.awssdk.aws.greengrass.model.VerifyClientDeviceIdentityRequest;
import software.amazon.awssdk.eventstreamrpc.EventStreamRPCClient;
import software.amazon.awssdk.eventstreamrpc.EventStreamRPCConnection;
import software.amazon.awssdk.eventstreamrpc.StreamResponseHandler;
Expand All @@ -45,6 +50,14 @@ public GreengrassCoreIPCClient(final EventStreamRPCConnection connection) {
super(connection);
}

@Override
public AuthorizeClientDeviceActionResponseHandler authorizeClientDeviceAction(
final AuthorizeClientDeviceActionRequest request,
final Optional<StreamResponseHandler<EventStreamJsonMessage>> streamResponseHandler) {
final AuthorizeClientDeviceActionOperationContext operationContext = GreengrassCoreIPCServiceModel.getAuthorizeClientDeviceActionModelContext();
return new AuthorizeClientDeviceActionResponseHandler(doOperationInvoke(operationContext, request, streamResponseHandler));
}

@Override
public CreateDebugPasswordResponseHandler createDebugPassword(
final CreateDebugPasswordRequest request,
Expand Down Expand Up @@ -76,6 +89,14 @@ public DeleteThingShadowResponseHandler deleteThingShadow(final DeleteThingShado
return new DeleteThingShadowResponseHandler(doOperationInvoke(operationContext, request, streamResponseHandler));
}

@Override
public GetClientDeviceAuthTokenResponseHandler getClientDeviceAuthToken(
final GetClientDeviceAuthTokenRequest request,
final Optional<StreamResponseHandler<EventStreamJsonMessage>> streamResponseHandler) {
final GetClientDeviceAuthTokenOperationContext operationContext = GreengrassCoreIPCServiceModel.getGetClientDeviceAuthTokenModelContext();
return new GetClientDeviceAuthTokenResponseHandler(doOperationInvoke(operationContext, request, streamResponseHandler));
}

@Override
public GetComponentDetailsResponseHandler getComponentDetails(
final GetComponentDetailsRequest request,
Expand Down Expand Up @@ -186,6 +207,14 @@ public StopComponentResponseHandler stopComponent(final StopComponentRequest req
return new StopComponentResponseHandler(doOperationInvoke(operationContext, request, streamResponseHandler));
}

@Override
public SubscribeToCertificateUpdatesResponseHandler subscribeToCertificateUpdates(
final SubscribeToCertificateUpdatesRequest request,
final Optional<StreamResponseHandler<CertificateUpdateEvent>> streamResponseHandler) {
final SubscribeToCertificateUpdatesOperationContext operationContext = GreengrassCoreIPCServiceModel.getSubscribeToCertificateUpdatesModelContext();
return new SubscribeToCertificateUpdatesResponseHandler(doOperationInvoke(operationContext, request, streamResponseHandler));
}

@Override
public SubscribeToComponentUpdatesResponseHandler subscribeToComponentUpdates(
final SubscribeToComponentUpdatesRequest request,
Expand Down Expand Up @@ -254,4 +283,12 @@ public ValidateAuthorizationTokenResponseHandler validateAuthorizationToken(
final ValidateAuthorizationTokenOperationContext operationContext = GreengrassCoreIPCServiceModel.getValidateAuthorizationTokenModelContext();
return new ValidateAuthorizationTokenResponseHandler(doOperationInvoke(operationContext, request, streamResponseHandler));
}

@Override
public VerifyClientDeviceIdentityResponseHandler verifyClientDeviceIdentity(
final VerifyClientDeviceIdentityRequest request,
final Optional<StreamResponseHandler<EventStreamJsonMessage>> streamResponseHandler) {
final VerifyClientDeviceIdentityOperationContext operationContext = GreengrassCoreIPCServiceModel.getVerifyClientDeviceIdentityModelContext();
return new VerifyClientDeviceIdentityResponseHandler(doOperationInvoke(operationContext, request, streamResponseHandler));
}
}
Loading

0 comments on commit c30e30d

Please sign in to comment.