Search in sources :

Example 16 with Region

use of software.amazon.awssdk.regions.Region in project aws-doc-sdk-examples by awsdocs.

the class EnhancedBatchWriteItems method main.

public static void main(String[] args) {
    Region region = Region.US_EAST_1;
    DynamoDbClient ddb = DynamoDbClient.builder().region(region).build();
    DynamoDbEnhancedClient enhancedClient = DynamoDbEnhancedClient.builder().dynamoDbClient(ddb).build();
    putBatchRecords(enhancedClient);
    ddb.close();
}
Also used : DynamoDbClient(software.amazon.awssdk.services.dynamodb.DynamoDbClient) Region(software.amazon.awssdk.regions.Region) DynamoDbEnhancedClient(software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedClient)

Example 17 with Region

use of software.amazon.awssdk.regions.Region in project aws-doc-sdk-examples by awsdocs.

the class EnhancedQueryRecordsWithFilter method main.

// Query the Customer table using a filter.
public static void main(String[] args) {
    Region region = Region.US_EAST_1;
    DynamoDbClient ddb = DynamoDbClient.builder().region(region).build();
    DynamoDbEnhancedClient enhancedClient = DynamoDbEnhancedClient.builder().dynamoDbClient(ddb).build();
    queryTableFilter(enhancedClient);
    ddb.close();
}
Also used : DynamoDbClient(software.amazon.awssdk.services.dynamodb.DynamoDbClient) Region(software.amazon.awssdk.regions.Region) DynamoDbEnhancedClient(software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedClient)

Example 18 with Region

use of software.amazon.awssdk.regions.Region in project aws-doc-sdk-examples by awsdocs.

the class DetectKeyPhrases method main.

public static void main(String[] args) {
    String text = "Amazon.com, Inc. is located in Seattle, WA and was founded July 5th, 1994 by Jeff Bezos, allowing customers to buy everything from books to blenders. Seattle is north of Portland and south of Vancouver, BC. Other notable Seattle - based companies are Starbucks and Boeing.";
    Region region = Region.US_EAST_1;
    ComprehendClient comClient = ComprehendClient.builder().region(region).build();
    System.out.println("Calling DetectKeyPhrases");
    detectAllKeyPhrases(comClient, text);
    comClient.close();
}
Also used : ComprehendClient(software.amazon.awssdk.services.comprehend.ComprehendClient) Region(software.amazon.awssdk.regions.Region)

Example 19 with Region

use of software.amazon.awssdk.regions.Region in project aws-doc-sdk-examples by awsdocs.

the class DetectSentiment method main.

public static void main(String[] args) {
    String text = "Amazon.com, Inc. is located in Seattle, WA and was founded July 5th, 1994 by Jeff Bezos, allowing customers to buy everything from books to blenders. Seattle is north of Portland and south of Vancouver, BC. Other notable Seattle - based companies are Starbucks and Boeing.";
    Region region = Region.US_EAST_1;
    ComprehendClient comClient = ComprehendClient.builder().region(region).build();
    System.out.println("Calling DetectSentiment");
    detectSentiments(comClient, text);
    comClient.close();
}
Also used : ComprehendClient(software.amazon.awssdk.services.comprehend.ComprehendClient) Region(software.amazon.awssdk.regions.Region)

Example 20 with Region

use of software.amazon.awssdk.regions.Region in project aws-doc-sdk-examples by awsdocs.

the class DetectPHI method main.

public static void main(String[] args) {
    String text = "Pt is 87 yo woman, highschool teacher with past medical history that includes\n" + "   - status post cardiac catheterization in April 2019.\n" + "She presents today with palpitations and chest pressure.\n" + "HPI : Sleeping trouble on present dosage of Clonidine. Severe Rash  on face and leg, slightly itchy  \n" + "Meds : Vyvanse 50 mgs po at breakfast daily, \n" + "            Clonidine 0.2 mgs -- 1 and 1 / 2 tabs po qhs \n" + "HEENT : Boggy inferior turbinates, No oropharyngeal lesion \n" + "Lungs : clear \n" + "Heart : Regular rhythm \n" + "Skin :  Mild erythematous eruption to hairline \n" + "\n" + "Follow-up as scheduled";
    Region region = Region.US_EAST_1;
    ComprehendMedicalClient medClient = ComprehendMedicalClient.builder().region(region).build();
    System.out.println("Calling Detect Medical Entities");
    detectPHIValues(medClient, text);
    medClient.close();
}
Also used : ComprehendMedicalClient(software.amazon.awssdk.services.comprehendmedical.ComprehendMedicalClient) Region(software.amazon.awssdk.regions.Region)

Aggregations

Region (software.amazon.awssdk.regions.Region)534 S3Client (software.amazon.awssdk.services.s3.S3Client)43 RekognitionClient (software.amazon.awssdk.services.rekognition.RekognitionClient)32 DynamoDbClient (software.amazon.awssdk.services.dynamodb.DynamoDbClient)31 IamClient (software.amazon.awssdk.services.iam.IamClient)23 PersonalizeClient (software.amazon.awssdk.services.personalize.PersonalizeClient)22 Ec2Client (software.amazon.awssdk.services.ec2.Ec2Client)20 Test (org.junit.Test)17 AwsCredentialsProvider (software.amazon.awssdk.auth.credentials.AwsCredentialsProvider)15 KmsClient (software.amazon.awssdk.services.kms.KmsClient)15 URI (java.net.URI)13 CodeCommitClient (software.amazon.awssdk.services.codecommit.CodeCommitClient)13 GlueClient (software.amazon.awssdk.services.glue.GlueClient)12 Properties (java.util.Properties)11 DynamoDbEnhancedClient (software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedClient)11 SesClient (software.amazon.awssdk.services.ses.SesClient)11 SdkBytes (software.amazon.awssdk.core.SdkBytes)9 Route53Client (software.amazon.awssdk.services.route53.Route53Client)9 CloudTrailClient (software.amazon.awssdk.services.cloudtrail.CloudTrailClient)8 CloudWatchClient (software.amazon.awssdk.services.cloudwatch.CloudWatchClient)8