@@ -0,0 +1,2800 @@
+package com.example.eventbridge;%0A%0Aimport software.amazon.awssdk.services.eventbridge.EventBridgeClient;%0Aimport software.amazon.awssdk.services.eventbridge.model.EventBridgeException;%0Aimport software.amazon.awssdk.services.eventbridge.model.PutEventsRequest;%0Aimport software.amazon.awssdk.services.eventbridge.model.PutEventsRequestEntry;%0Aimport software.amazon.awssdk.services.eventbridge.model.PutEventsResponse;%0Aimport software.amazon.awssdk.services.eventbridge.model.PutEventsResultEntry;%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0Apublic class PutEvents %7B%0A%0A    public static void main(String%5B%5D args) %7B%0A%0A        final String USAGE =%0A                %22To run this example, supply a resource arn%5Cn%22 +%0A                        %22Ex: PutEvents %3Cresource-arn%3E%5Cn%22;%0A%0A        if (args.length != 2) %7B%0A            System.out.println(USAGE);%0A            System.exit(1);%0A        %7D%0A%0A        EventBridgeClient eventBrClient =%0A                EventBridgeClient.builder().build();%0A%0A%0A        String resourceArn = args%5B0%5D;%0A        String resourceArn2 = args%5B1%5D;%0A%0A        putEBEvents(eventBrClient, resourceArn, resourceArn2);%0A    %7D%0A%0A    public static void putEBEvents(EventBridgeClient eventBrClient, String resourceArn, String resourceArn2 ) %7B%0A%0A        try %7B%0A%0A            // Populate a List with the resource ARN values%0A            List%3CString%3E resources = new ArrayList%3CString%3E();%0A            resources.add(resourceArn);%0A            resources.add(resourceArn2);%0A%0A            // Create a PutEventsRequestEntry object%0A            PutEventsRequestEntry reqEntry = PutEventsRequestEntry.builder()%0A                    .resources(resources)%0A                    .source(%22com.mycompany.myapp%22)%0A                    .detailType(%22myDetailType%22)%0A                    .detail(%22%7B %5C%22key1%5C%22: %5C%22value1%5C%22, %5C%22key2%5C%22: %5C%22value2%5C%22 %7D%22)%0A                    .build();%0A%0A            // Add the PutEventsRequestEntry to a list%0A            List%3CPutEventsRequestEntry%3E list = new ArrayList%3CPutEventsRequestEntry%3E();%0A            list.add(reqEntry);%0A%0A            PutEventsRequest eventsRequest = PutEventsRequest.builder()%0A                    .entries(reqEntry)%0A                    .build();%0A%0A            // Invoke the PutEvents method%0A            PutEventsResponse result = eventBrClient.putEvents(eventsRequest);%0A%0A            for (PutEventsResultEntry resultEntry : result.entries()) %7B%0A                if (resultEntry.eventId() != null) %7B%0A                    System.out.println(%22Event Id: %22 + resultEntry.eventId());%0A                %7D else %7B%0A                    System.out.println(%22Injection failed with Error Code: %22 + resultEntry.errorCode());%0A                %7D%0A            %7D%0A%0A        %7D catch (EventBridgeException e) %7B%0A%0A            System.err.println(e.awsErrorDetails().errorMessage());%0A            System.exit(1);%0A        %7D%0A    %7D%0A%7D%0A

Create PutEvents.java